aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Heiko Becker <heirecka@exherbo.org> 2018-11-20 22:09:03 +0100
committerAvatar Heiko Becker <heirecka@exherbo.org> 2018-12-22 17:15:00 +0100
commit1606b0eecc9eb8e0c60fe34ff8d3671563a9ad35 (patch)
treedbca8de78aa256e25efcea2dff43dc6125ec37b1
parente5882cddca2fc293fc4f74b15fa591b45ed682ad (diff)
downloadpaludis-1606b0eecc9eb8e0c60fe34ff8d3671563a9ad35.tar.gz
paludis-1606b0eecc9eb8e0c60fe34ff8d3671563a9ad35.tar.xz
build: Use imported targets for GTest
Raises the cmake requirement to 3.5.0 (released in March 2016) but we don't need to manually mess with INCLUDE_DIRS and linking to a thread library anymore.
-rw-r--r--CMakeLists.txt2
-rw-r--r--cmake/modules/PaludisAddTest.cmake7
2 files changed, 3 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 286eb79..66018f0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,6 @@
# vim: set et fdm=marker fmr={{{,}}} sw=2 sts=2 ts=8:
-cmake_minimum_required(VERSION 3.3.0)
+cmake_minimum_required(VERSION 3.5.0)
cmake_policy(SET CMP0048 NEW)
cmake_policy(SET CMP0051 NEW)
cmake_policy(SET CMP0057 NEW)
diff --git a/cmake/modules/PaludisAddTest.cmake b/cmake/modules/PaludisAddTest.cmake
index 38362e4..684da49 100644
--- a/cmake/modules/PaludisAddTest.cmake
+++ b/cmake/modules/PaludisAddTest.cmake
@@ -22,15 +22,12 @@ function(paludis_add_test test_name)
"${CMAKE_CURRENT_SOURCE_DIR}/${test_name}.cc")
endif()
if(PAT_GTEST)
- target_include_directories(${test_name}
- PRIVATE
- ${GTEST_INCLUDE_DIRS})
target_link_libraries(${test_name}
PRIVATE
libpaludis
libpaludisutil
- ${GTEST_BOTH_LIBRARIES}
- Threads::Threads
+ GTest::GTest
+ GTest::Main
${PAT_LINK_LIBRARIES})
endif()