]> git.saurik.com Git - apt.git/blame - test/libapt/CMakeLists.txt
Make directory paths configurable
[apt.git] / test / libapt / CMakeLists.txt
CommitLineData
06c2b40b
JAK
1include(ExternalProject)
2
3set(GTEST_ROOT "/usr/src/gtest" CACHE FILEPATH "Path to GTest CMake project")
4
5message(STATUS "Found GTest at ${GTEST_ROOT}")
6
7if (EXISTS ${GTEST_ROOT})
8
9ExternalProject_Add(gtest PREFIX ./gtest
10 SOURCE_DIR ${GTEST_ROOT}
11 INSTALL_COMMAND true)
12
13link_directories(${CMAKE_CURRENT_BINARY_DIR}/gtest/src/gtest-build)
14FILE(GLOB files gtest_runner.cc *-helpers.cc *_test.cc)
15add_executable(libapt_test ${files})
16target_link_libraries(libapt_test -lgtest ${CMAKE_THREAD_LIBS_INIT} apt-private apt-inst)
17add_dependencies(libapt_test gtest)
18add_test(NAME AptTests
19 COMMAND libapt_test
20 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
21
22endif()