Mercurial > hg > orthanc
changeset 2159:cfaf2bea096e
fix Google Test includes on Debian
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sun, 20 Nov 2016 21:45:24 +0100 |
parents | 5d8e6fab98dd |
children | 2f2de941dff7 |
files | Resources/CMake/GoogleTestConfiguration.cmake |
diffstat | 1 files changed, 21 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/Resources/CMake/GoogleTestConfiguration.cmake Wed Nov 16 12:34:15 2016 +0100 +++ b/Resources/CMake/GoogleTestConfiguration.cmake Sun Nov 20 21:45:24 2016 +0100 @@ -1,9 +1,26 @@ if (USE_GTEST_DEBIAN_SOURCE_PACKAGE) - set(GTEST_SOURCES /usr/src/gtest/src/gtest-all.cc) - include_directories(/usr/src/gtest) + find_path(GTEST_DEBIAN_SOURCES_DIR + NAMES src/gtest-all.cc + PATHS + /usr/src/gtest + /usr/src/googletest/googletest + PATH_SUFFIXES src + ) - if (NOT EXISTS /usr/include/gtest/gtest.h OR - NOT EXISTS ${GTEST_SOURCES}) + find_path(GTEST_DEBIAN_INCLUDE_DIR + NAMES gtest.h + PATHS + /usr/include/gtest + ) + + message("Path to the Debian Google Test sources: ${GTEST_DEBIAN_SOURCES_DIR}") + message("Path to the Debian Google Test includes: ${GTEST_DEBIAN_INCLUDE_DIR}") + + set(GTEST_SOURCES ${GTEST_DEBIAN_SOURCES_DIR}/src/gtest-all.cc) + include_directories(${GTEST_DEBIAN_SOURCES_DIR}) + + if (NOT EXISTS ${GTEST_SOURCES} OR + NOT EXISTS ${GTEST_DEBIAN_INCLUDE_DIR}/gtest.h) message(FATAL_ERROR "Please install the libgtest-dev package") endif()