diff options
author | Henry Fredrick Schreiner <henry.fredrick.schreiner@cern.ch> | 2018-04-05 11:38:33 (GMT) |
---|---|---|
committer | Henry Fredrick Schreiner <henry.fredrick.schreiner@cern.ch> | 2018-04-05 11:40:26 (GMT) |
commit | b22e8dec408935a7f76420026a738eeb61f8af38 (patch) | |
tree | 543c1832744fdc09c1654b4d5ff320f73e9f8ce9 /googletest/CMakeLists.txt | |
parent | 2cf2a1f8ce9e25a2c0d053a51a3e67b3621f025b (diff) | |
download | googletest-b22e8dec408935a7f76420026a738eeb61f8af38.zip googletest-b22e8dec408935a7f76420026a738eeb61f8af38.tar.gz googletest-b22e8dec408935a7f76420026a738eeb61f8af38.tar.bz2 |
Clean up cache non-advanced variable for subproject
Diffstat (limited to 'googletest/CMakeLists.txt')
-rw-r--r-- | googletest/CMakeLists.txt | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/googletest/CMakeLists.txt b/googletest/CMakeLists.txt index b09c46e..2a9b989 100644 --- a/googletest/CMakeLists.txt +++ b/googletest/CMakeLists.txt @@ -5,10 +5,6 @@ # ctest. You can select which tests to run using 'ctest -R regex'. # For more options, run 'ctest --help'. -# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to -# make it prominent in the GUI. -option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF) - # When other libraries are using a shared version of runtime libraries, # Google Test also has to use one. option( @@ -60,6 +56,25 @@ if (COMMAND set_up_hermetic_build) set_up_hermetic_build() endif() +# These commands only run if this is the main project +if(CMAKE_PROJECT_NAME STREQUAL "gtest" OR CMAKE_PROJECT_NAME STREQUAL "googletest-distribution") + + # BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to + # make it prominent in the GUI. + option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF) + +else() + + mark_as_advanced( + gtest_force_shared_crt + gtest_build_tests + gtest_build_samples + gtest_disable_pthreads + gtest_hide_internal_symbols) + +endif() + + if (gtest_hide_internal_symbols) set(CMAKE_CXX_VISIBILITY_PRESET hidden) set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) @@ -86,7 +101,7 @@ include_directories( if (MSVC AND MSVC_VERSION EQUAL 1700) add_definitions(/D _VARIADIC_MAX=10) endif() - + ######################################################################## # # Defines the gtest & gtest_main libraries. User tests should link |