aboutsummaryrefslogtreecommitdiffstats
path: root/googlemock/CMakeLists.txt
diff options
context:
space:
mode:
authorHenry Fredrick Schreiner <henry.fredrick.schreiner@cern.ch>2018-04-05 13:38:33 +0200
committerHenry Fredrick Schreiner <henry.fredrick.schreiner@cern.ch>2018-04-05 13:40:26 +0200
commitb22e8dec408935a7f76420026a738eeb61f8af38 (patch)
tree543c1832744fdc09c1654b4d5ff320f73e9f8ce9 /googlemock/CMakeLists.txt
parent2cf2a1f8ce9e25a2c0d053a51a3e67b3621f025b (diff)
downloadgoogletest-b22e8dec408935a7f76420026a738eeb61f8af38.tar.gz
googletest-b22e8dec408935a7f76420026a738eeb61f8af38.tar.bz2
googletest-b22e8dec408935a7f76420026a738eeb61f8af38.zip
Clean up cache non-advanced variable for subproject
Diffstat (limited to 'googlemock/CMakeLists.txt')
-rw-r--r--googlemock/CMakeLists.txt18
1 files changed, 14 insertions, 4 deletions
diff --git a/googlemock/CMakeLists.txt b/googlemock/CMakeLists.txt
index bac2e3bf..7d66eb28 100644
--- a/googlemock/CMakeLists.txt
+++ b/googlemock/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)
-
option(gmock_build_tests "Build all of Google Mock's own tests." OFF)
# A directory to find Google Test sources.
@@ -55,6 +51,20 @@ endif()
# if they are the same (the default).
add_subdirectory("${gtest_dir}" "${gmock_BINARY_DIR}/gtest")
+
+# These commands only run if this is the main project
+if(CMAKE_PROJECT_NAME STREQUAL "gmock" 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(gmock_build_tests)
+
+endif()
+
# Although Google Test's CMakeLists.txt calls this function, the
# changes there don't affect the current scope. Therefore we have to
# call it again here.