comparison Resources/CMake/GoogleTestConfiguration.cmake @ 157:a63fb54819d7

gtest on debian sid
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 26 Oct 2012 14:05:29 +0200
parents a2dbb5024fdf
children b45bc565d82a 61ab5fa36754
comparison
equal deleted inserted replaced
156:a660e18b2360 157:a63fb54819d7
1 if (DEBIAN_USE_STATIC_GOOGLE_TEST) 1 if (DEBIAN_USE_GTEST_SOURCE_PACKAGE)
2 message(FATAL_ERROR "todo") 2 set(GTEST_SOURCES /usr/src/gtest/src/gtest-all.cc)
3 include_directories(/usr/src/gtest)
4
5 if (NOT EXISTS /usr/include/gtest/gtest.h OR
6 NOT EXISTS ${GTEST_SOURCES})
7 message(FATAL_ERROR "Please install the libgtest-dev package")
8 endif()
3 9
4 elseif (STATIC_BUILD OR NOT USE_DYNAMIC_GOOGLE_TEST) 10 elseif (STATIC_BUILD OR NOT USE_DYNAMIC_GOOGLE_TEST)
5 SET(GTEST_SOURCES_DIR ${CMAKE_BINARY_DIR}/gtest-1.6.0) 11 SET(GTEST_SOURCES_DIR ${CMAKE_BINARY_DIR}/gtest-1.6.0)
6 DownloadPackage("http://googletest.googlecode.com/files/gtest-1.6.0.zip" "${GTEST_SOURCES_DIR}" "" "") 12 DownloadPackage("http://googletest.googlecode.com/files/gtest-1.6.0.zip" "${GTEST_SOURCES_DIR}" "" "")
7 13
14 ${GTEST_SOURCES_DIR}/src/gtest-all.cc 20 ${GTEST_SOURCES_DIR}/src/gtest-all.cc
15 ) 21 )
16 22
17 else() 23 else()
18 include(FindGTest) 24 include(FindGTest)
25 if (NOT GTEST_FOUND)
26 message(FATAL_ERROR "Unable to find GoogleTest")
27 endif()
28
19 include_directories(${GTEST_INCLUDE_DIRS}) 29 include_directories(${GTEST_INCLUDE_DIRS})
20 link_libraries(${GTEST_LIBRARIES}) 30 link_libraries(${GTEST_LIBRARIES})
21 endif() 31 endif()