mirror of
https://github.com/wjwwood/serial.git
synced 2026-01-22 03:34:53 +08:00
Depend on GTest via its imported targets
- Find and use GTest as imported target GTest::GTest
- Note:
- GTest::GTest is available from CMake 3.5 and depricated in 3.20 but
still available in latest version.
- GTest::gtest added in CMake 3.20
Signed-off-by: Alex Moriarty <alex.moriarty@picknik.ai>
This commit is contained in:
parent
2528dcf50c
commit
f60d49d91b
@ -1,9 +1,8 @@
|
||||
if(UNIX)
|
||||
find_package(GTest REQUIRED)
|
||||
include_directories(${GTEST_INCLUDE_DIRS})
|
||||
|
||||
add_executable(${PROJECT_NAME}-test unix_serial_tests.cc)
|
||||
target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME} ${GTEST_LIBRARIES})
|
||||
target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME} GTest::GTest)
|
||||
if(NOT APPLE)
|
||||
target_link_libraries(${PROJECT_NAME}-test util)
|
||||
endif()
|
||||
@ -11,7 +10,7 @@ if(UNIX)
|
||||
|
||||
if(NOT APPLE) # these tests are unreliable on macOS
|
||||
add_executable(${PROJECT_NAME}-test-timer unit/unix_timer_tests.cc)
|
||||
target_link_libraries(${PROJECT_NAME}-test-timer ${PROJECT_NAME} ${GTEST_LIBRARIES})
|
||||
target_link_libraries(${PROJECT_NAME}-test-timer ${PROJECT_NAME} GTest::GTest)
|
||||
add_test("${PROJECT_NAME}-test-timer-gtest" ${PROJECT_NAME}-test-timer)
|
||||
endif()
|
||||
# Boost is only required for tests/proof_of_concepts which are not enabled by default
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user