summaryrefslogtreecommitdiffstats
path: root/googlemock/CMakeLists.txt
diff options
context:
space:
mode:
authorGennadiy Civil <gennadiycivil@users.noreply.github.com>2018-08-17 15:48:56 (GMT)
committerGitHub <noreply@github.com>2018-08-17 15:48:56 (GMT)
commita9bd428e72a11a3a36bb7a8755cf2d58b1ce8e9d (patch)
tree32d0dac55ff598f9732ff57581044eabd24fa807 /googlemock/CMakeLists.txt
parent421e7b4f29fc761c66d2773a1fc318a738a6d3da (diff)
parent02a8ca87735601466d8c564344f9be493da84708 (diff)
downloadgoogletest-a9bd428e72a11a3a36bb7a8755cf2d58b1ce8e9d.zip
googletest-a9bd428e72a11a3a36bb7a8755cf2d58b1ce8e9d.tar.gz
googletest-a9bd428e72a11a3a36bb7a8755cf2d58b1ce8e9d.tar.bz2
Merge branch 'master' into fix-msvc-d9025-warningrefs/pull/1612/head
Diffstat (limited to 'googlemock/CMakeLists.txt')
-rw-r--r--googlemock/CMakeLists.txt24
1 files changed, 17 insertions, 7 deletions
diff --git a/googlemock/CMakeLists.txt b/googlemock/CMakeLists.txt
index bac2e3b..07b6ad2 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.
@@ -128,13 +138,13 @@ if(INSTALL_GMOCK)
# configure and install pkgconfig files
configure_file(
cmake/gmock.pc.in
- "${CMAKE_BINARY_DIR}/gmock.pc"
+ "${gmock_BINARY_DIR}/gmock.pc"
@ONLY)
configure_file(
cmake/gmock_main.pc.in
- "${CMAKE_BINARY_DIR}/gmock_main.pc"
+ "${gmock_BINARY_DIR}/gmock_main.pc"
@ONLY)
- install(FILES "${CMAKE_BINARY_DIR}/gmock.pc" "${CMAKE_BINARY_DIR}/gmock_main.pc"
+ install(FILES "${gmock_BINARY_DIR}/gmock.pc" "${gmock_BINARY_DIR}/gmock_main.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
endif()