From 9f0824b0a61b50fd40e47da2387cd9b3f872ce47 Mon Sep 17 00:00:00 2001 From: "zhanyong.wan" Date: Mon, 22 Mar 2010 21:23:51 +0000 Subject: Adds missing gtest DLL exports. --- CMakeLists.txt | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 74c5e962..c9805a3e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -124,15 +124,12 @@ target_link_libraries(gtest_main gtest) option(build_gtest_samples "Build gtest's sample programs." OFF) -# cxx_executable(name dir lib srcs...) +# cxx_executable_with_flags(name cxx_flags lib srcs...) # -# creates a named target that depends on the given lib and is built -# from the given source files. dir/name.cc is implicitly included in -# the source file list. -function(cxx_executable_with_flags name dir cxx_flags lib) - add_executable(${name} - ${dir}/${name}.cc - ${ARGN}) +# creates a named C++ executable that depends on the given library and +# is built from the given source files with the given compiler flags. +function(cxx_executable_with_flags name cxx_flags lib) + add_executable(${name} ${ARGN}) if (cxx_flags) set_target_properties(${name} PROPERTIES @@ -141,8 +138,14 @@ function(cxx_executable_with_flags name dir cxx_flags lib) target_link_libraries(${name} ${lib}) endfunction() +# cxx_executable(name dir lib srcs...) +# +# creates a named target that depends on the given lib and is built +# from the given source files. dir/name.cc is implicitly included in +# the source file list. function(cxx_executable name dir lib) - cxx_executable_with_flags(${name} ${dir} "${cxx_default}" ${lib} ${ARGN}) + cxx_executable_with_flags( + ${name} "${cxx_default}" ${lib} "${dir}/${name}.cc" ${ARGN}) endfunction() if (build_gtest_samples) @@ -273,8 +276,8 @@ if (build_all_gtest_tests) # TODO(vladl): This and the next tests may not run in the hermetic # environment on Windows. Re-evaluate and possibly make them # platform-conditional after implementing hermetic builds. - cxx_executable_with_flags(gtest_dll_test_ test "${cxx_use_shared_gtest}" - gtest_dll) + cxx_executable_with_flags(gtest_dll_test_ "${cxx_use_shared_gtest}" + gtest_dll test/gtest_all_test.cc) if (NOT(MSVC AND (MSVC_VERSION EQUAL 1600))) # The C++ Standard specifies tuple_element. -- cgit v1.2.3