From 9ac94d01358808f9a90e472e44e8a0f6588bdec7 Mon Sep 17 00:00:00 2001 From: Michael Maltese Date: Wed, 3 May 2017 15:26:55 -0700 Subject: [PATCH 1/2] CMake: don't look for shared Google Test Google Test recommends not using a pre-compiled system copy[1] and Debian and Ubuntu no longer distribute compiled packages. This removes an unhelpful line from the CMake log: "Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)." [1]: https://github.com/google/googletest/blob/master/googletest/docs/FAQ.md#why-is-it-not-recommended-to-install-a-pre-compiled-copy-of-google-test-for-example-into-usrlocal --- CMakeLists.txt | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f4e2c302be..0a911aba2c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,6 @@ project(dolphin-emu) option(USE_EGL "Enables EGL OpenGL Interface" OFF) option(TRY_X11 "Enables X11 Support" ON) option(USE_SHARED_ENET "Use shared libenet if found rather than Dolphin's soon-to-compatibly-diverge version" OFF) -option(USE_SHARED_GTEST "Use shared gtest library if found" OFF) option(USE_UPNP "Enables UPnP port mapping support" ON) option(DISABLE_WX "Disable wxWidgets (use Qt or CLI interface)" OFF) option(ENABLE_QT2 "Enable Qt2 (use the other experimental Qt interface)" OFF) @@ -835,15 +834,9 @@ include_directories("${PROJECT_BINARY_DIR}/Source/Core") ######################################## # Unit testing. # -find_package(GTest) -if(GTEST_FOUND AND USE_SHARED_GTEST) - message(STATUS "Using shared gtest") - include_directories(${GTEST_INCLUDE_DIRS}) -else() - message(STATUS "Using static gtest from Externals") - include_directories(Externals/gtest/include) - add_subdirectory(Externals/gtest EXCLUDE_FROM_ALL) -endif() +message(STATUS "Using static gtest from Externals") +include_directories(Externals/gtest/include) +add_subdirectory(Externals/gtest EXCLUDE_FROM_ALL) enable_testing() add_custom_target(unittests) From cd7af32e0b6a8850b983c9c9957c04664d0ce83f Mon Sep 17 00:00:00 2001 From: Michael Maltese Date: Wed, 3 May 2017 16:22:14 -0700 Subject: [PATCH 2/2] CMake: gtest already propagates include directories --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a911aba2c..6e3e24d686 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -835,7 +835,6 @@ include_directories("${PROJECT_BINARY_DIR}/Source/Core") # Unit testing. # message(STATUS "Using static gtest from Externals") -include_directories(Externals/gtest/include) add_subdirectory(Externals/gtest EXCLUDE_FROM_ALL) enable_testing()