Commit 63136854 authored by François Grisez's avatar François Grisez

Only build bctoolbox-tester if CUnit has been found

parent c307e230
......@@ -20,20 +20,21 @@
#
############################################################################
set(TESTER_SOURCES
bctoolbox_tester.c
bctoolbox_tester.h
containers.cc
)
string(REPLACE ";" " " LINK_FLAGS_STR "${LINK_FLAGS}")
add_executable(bctoolbox_tester ${TESTER_SOURCES})
if(NOT "${LINK_FLAGS_STR}" STREQUAL "")
set_target_properties(bctoolbox_tester PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
if(CUNIT_FOUND)
set(TESTER_SOURCES
bctoolbox_tester.c
bctoolbox_tester.h
containers.cc
)
string(REPLACE ";" " " LINK_FLAGS_STR "${LINK_FLAGS}")
add_executable(bctoolbox_tester ${TESTER_SOURCES})
if(NOT "${LINK_FLAGS_STR}" STREQUAL "")
set_target_properties(bctoolbox_tester PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
endif()
target_include_directories(bctoolbox_tester PUBLIC ${BCTOOLBOX_TESTER_INCLUDE_DIRS})
target_link_libraries(bctoolbox_tester ${BCTOOLBOX_TESTER_LIBRARIES} bctoolbox bctoolbox-tester)
set_target_properties(bctoolbox_tester PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
add_test(NAME bctoolbox_tester COMMAND bctoolbox_tester --verbose)
endif()
target_include_directories(bctoolbox_tester PUBLIC ${BCTOOLBOX_TESTER_INCLUDE_DIRS})
target_link_libraries(bctoolbox_tester ${BCTOOLBOX_TESTER_LIBRARIES} bctoolbox bctoolbox-tester)
set_target_properties(bctoolbox_tester PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
add_test(NAME bctoolbox_tester COMMAND bctoolbox_tester --verbose)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment