# HG changeset patch # User Sebastien Jodogne # Date 1351253129 -7200 # Node ID a63fb54819d7a40864878e41c92d8a23f4bd2a6f # Parent a660e18b2360cdc7301ca2f575b70877a7b42f8a gtest on debian sid diff -r a660e18b2360 -r a63fb54819d7 CMakeLists.txt --- a/CMakeLists.txt Tue Oct 23 16:01:39 2012 +0200 +++ b/CMakeLists.txt Fri Oct 26 14:05:29 2012 +0200 @@ -19,7 +19,7 @@ SET(USE_DYNAMIC_GOOGLE_TEST ON CACHE BOOL "Use the dynamic version of Google Test (not for Debian sid)") SET(USE_DYNAMIC_SQLITE ON CACHE BOOL "Use the dynamic version of SQLite") SET(DEBIAN_FORCE_HARDENING OFF CACHE BOOL "Force the injection of Debian hardening flags (unrecommended)") -SET(DEBIAN_USE_STATIC_GOOGLE_TEST OFF CACHE BOOL "Use the sources of Google Test shipped with libgtest-dev (only for Debian sid)") +SET(DEBIAN_USE_GTEST_SOURCE_PACKAGE OFF CACHE BOOL "Use the sources of Google Test shipped with libgtest-dev (only for Debian sid)") mark_as_advanced(USE_DYNAMIC_JSONCPP) mark_as_advanced(USE_DYNAMIC_GOOGLE_LOG) diff -r a660e18b2360 -r a63fb54819d7 Resources/CMake/GoogleTestConfiguration.cmake --- a/Resources/CMake/GoogleTestConfiguration.cmake Tue Oct 23 16:01:39 2012 +0200 +++ b/Resources/CMake/GoogleTestConfiguration.cmake Fri Oct 26 14:05:29 2012 +0200 @@ -1,5 +1,11 @@ -if (DEBIAN_USE_STATIC_GOOGLE_TEST) - message(FATAL_ERROR "todo") +if (DEBIAN_USE_GTEST_SOURCE_PACKAGE) + set(GTEST_SOURCES /usr/src/gtest/src/gtest-all.cc) + include_directories(/usr/src/gtest) + + if (NOT EXISTS /usr/include/gtest/gtest.h OR + NOT EXISTS ${GTEST_SOURCES}) + message(FATAL_ERROR "Please install the libgtest-dev package") + endif() elseif (STATIC_BUILD OR NOT USE_DYNAMIC_GOOGLE_TEST) SET(GTEST_SOURCES_DIR ${CMAKE_BINARY_DIR}/gtest-1.6.0) @@ -16,6 +22,10 @@ else() include(FindGTest) + if (NOT GTEST_FOUND) + message(FATAL_ERROR "Unable to find GoogleTest") + endif() + include_directories(${GTEST_INCLUDE_DIRS}) link_libraries(${GTEST_LIBRARIES}) endif()