Skip to content

Commit

Permalink
traditionally link if imported target CHECK::CHECK is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Koeppe committed Apr 18, 2019
1 parent 6504f24 commit 91b1b14
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ add_custom_target(test_verbose
# Adds a test by name
macro(_t NAME)
add_executable(test_${NAME} test_${NAME}.c)
target_link_libraries(test_${NAME} lib_ettercap CHECK::CHECK)
if (TARGET CHECK::CHECK)
target_link_libraries(test_${NAME} lib_ettercap CHECK::CHECK)
else()
include_directories(. ../include ${LIBCHECK_INCLUDE_DIRS})
target_link_libraries(test_${NAME} lib_ettercap ${LIBCHECK_LIBRARIES})
endif()
add_test(test_${NAME} ${CMAKE_CURRENT_BINARY_DIR}/test_${NAME})
endmacro()

Expand Down

0 comments on commit 91b1b14

Please sign in to comment.