summaryrefslogtreecommitdiffstats
path: root/googletest
diff options
context:
space:
mode:
authorGennadiy Civil <gennadiycivil@users.noreply.github.com>2018-08-17 14:27:13 (GMT)
committerGitHub <noreply@github.com>2018-08-17 14:27:13 (GMT)
commit02a8ca87735601466d8c564344f9be493da84708 (patch)
tree2b33ed7be724055867f69c51f2042b1c96a96404 /googletest
parentf87798a3f7c73e069becf5792d0443d5cba42434 (diff)
parenta65a993a3c00d8f93a19eb38f7e31277f547514f (diff)
downloadgoogletest-02a8ca87735601466d8c564344f9be493da84708.zip
googletest-02a8ca87735601466d8c564344f9be493da84708.tar.gz
googletest-02a8ca87735601466d8c564344f9be493da84708.tar.bz2
Merge pull request #1546 from henryiii/cleanup-cmake
Clean up cache non-advanced variable for subproject
Diffstat (limited to 'googletest')
-rw-r--r--googletest/CMakeLists.txt23
1 files changed, 19 insertions, 4 deletions
diff --git a/googletest/CMakeLists.txt b/googletest/CMakeLists.txt
index 6a917bb..2c735f6 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)