Skip to content

Commit

Permalink
Merge pull request #24 from matwey/fix/cmake_check
Browse files Browse the repository at this point in the history
Prefer Check::checkShared over Check::check
  • Loading branch information
matwey authored Oct 4, 2020
2 parents e1ee188 + ab21c6d commit aa7e661
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ find_package(LibUSB1 REQUIRED)
find_package(LibFTDI1 REQUIRED)
find_package(LibZip 1.0 REQUIRED)
find_package(Check CONFIG NAMES Check check)
if (NOT TARGET Check::check)
if (NOT TARGET Check::checkShared)
find_package(PkgConfig REQUIRED)

pkg_search_module(CHECK REQUIRED Check check)

add_library(Check::check INTERFACE IMPORTED)
set_target_properties(Check::check PROPERTIES
add_library(Check::checkShared INTERFACE IMPORTED)
set_target_properties(Check::checkShared PROPERTIES
INTERFACE_LINK_LIBRARIES "${CHECK_LDFLAGS}"
INTERFACE_COMPILE_OPTIONS "${CHECK_CFLAGS}")
endif()
Expand Down Expand Up @@ -131,7 +131,7 @@ foreach(test_source IN ITEMS ${TESTS})
string(REPLACE / _ test_name ${test_name})
string(REPLACE .c "" test_name ${test_name})
add_executable(${test_name} ${test_source})
target_link_libraries(${test_name} Check::check openvizsla_static)
target_link_libraries(${test_name} Check::checkShared openvizsla_static)
target_compile_definitions(${test_name} PRIVATE PROJECT_ROOT="${PROJECT_SOURCE_DIR}")
add_test(${test_name} ${test_name})
endforeach(test_source)
Expand Down

0 comments on commit aa7e661

Please sign in to comment.