From e0c510a95ffee47aaf020a8f9a71486bc66391d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Fri, 20 May 2016 21:59:44 +0200 Subject: [PATCH] Added Google Test as a submodule to avoid potential linking issues. --- .gitmodules | 3 +++ tests/CMakeLists.txt | 10 ++++++---- tests/googletest | 1 + 3 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 .gitmodules create mode 160000 tests/googletest diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..e23a605 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "tests/googletest"] + path = tests/googletest + url = git@github.com:google/googletest.git diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index a2c2ea7..91d4840 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -2,17 +2,19 @@ set(target tests) file(GLOB core_sources "*.cpp") -find_package(GTest REQUIRED) +add_subdirectory(googletest) include_directories( - ${GTEST_INCLUDE_DIRS} + ${gtest_SOURCE_DIR}/include + ${gtest_SOURCE_DIR} ${Boost_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR}/include ) set(libraries + gtest_main + gtest ${Boost_LIBRARIES} - ${GTEST_BOTH_LIBRARIES} plasp ) @@ -20,7 +22,7 @@ file(COPY data DESTINATION ${CMAKE_BINARY_DIR}) add_executable(${target} ${core_sources}) target_link_libraries(${target} ${libraries}) -GTEST_ADD_TESTS(tests "" ${core_sources}) +add_test(tests ${core_sources}) add_custom_target(run-tests COMMAND ${CMAKE_BINARY_DIR}/bin/tests diff --git a/tests/googletest b/tests/googletest new file mode 160000 index 0000000..0a43962 --- /dev/null +++ b/tests/googletest @@ -0,0 +1 @@ +Subproject commit 0a439623f75c029912728d80cb7f1b8b48739ca4