Commit ed53ae3c authored by Simon Morlat's avatar Simon Morlat

Fix enablement of TESTS and TEST_COMPONENTS.

parent 3eef7b37
Pipeline #114 passed with stage
in 0 seconds
......@@ -120,7 +120,7 @@ endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/bctoolbox.pc.in ${CMAKE_CURRENT_BINARY_DIR}/bctoolbox.pc)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/bctoolbox.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
if(ENABLE_TESTS_COMPONENT AND BCUNIT_FOUND)
if(ENABLE_TESTS_COMPONENT)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/bctoolbox-tester.pc.in ${CMAKE_CURRENT_BINARY_DIR}/bctoolbox-tester.pc)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/bctoolbox-tester.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
endif()
......@@ -160,7 +160,7 @@ check_include_file("execinfo.h" HAVE_EXECINFO)
add_subdirectory(include)
add_subdirectory(src)
if(ENABLE_TESTS AND ENABLE_TESTS_COMPONENT AND BCUNIT_FOUND)
if(ENABLE_TESTS AND ENABLE_TESTS_COMPONENT)
add_subdirectory(tester)
endif()
......
......@@ -66,7 +66,7 @@ if(POLARSSL_FOUND)
list(APPEND BCTOOLBOX_C_SOURCE_FILES crypto/polarssl1.2.c)
endif()
endif()
if(BCUNIT_FOUND)
if(ENABLE_TESTS_COMPONENT)
set(BCTOOLBOX_C_TESTER_SOURCE_FILES tester.c)
endif()
......@@ -98,7 +98,7 @@ if(ENABLE_STATIC)
if(HAVE_LIBDL)
target_link_libraries(bctoolbox-static INTERFACE dl)
endif()
if(BCUNIT_FOUND)
if(ENABLE_TESTS_COMPONENT)
add_library(bctoolbox-tester-static STATIC ${BCTOOLBOX_TESTER_SOURCE_FILES})
set_target_properties(bctoolbox-tester-static PROPERTIES OUTPUT_NAME bctoolbox-tester)
target_link_libraries(bctoolbox-tester-static INTERFACE bctoolbox-static)
......@@ -153,7 +153,7 @@ if(ENABLE_SHARED)
if(HAVE_LIBDL)
target_link_libraries(bctoolbox PRIVATE dl)
endif()
if(BCUNIT_FOUND)
if(ENABLE_TESTS_COMPONENT)
add_library(bctoolbox-tester SHARED ${BCTOOLBOX_TESTER_SOURCE_FILES})
set_target_properties(bctoolbox-tester PROPERTIES LINKER_LANGUAGE "CXX")
target_link_libraries(bctoolbox-tester PRIVATE bctoolbox)
......@@ -209,7 +209,7 @@ if(DECAF_FOUND)
endif()
endif()
if(BCUNIT_FOUND)
if(ENABLE_TESTS_COMPONENT)
if(ENABLE_STATIC)
target_include_directories(bctoolbox-tester-static PUBLIC ${BCUNIT_INCLUDE_DIRS})
target_link_libraries(bctoolbox-tester-static INTERFACE bctoolbox-static ${BCUNIT_LIBRARIES})
......@@ -234,7 +234,7 @@ if(ENABLE_STATIC)
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
COMPONENT core
)
if(BCUNIT_FOUND)
if(ENABLE_TESTS_COMPONENT)
install(TARGETS bctoolbox-tester-static EXPORT ${EXPORT_TARGETS_NAME}Targets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
......@@ -251,7 +251,7 @@ if(ENABLE_SHARED)
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
COMPONENT core
)
if(BCUNIT_FOUND)
if(ENABLE_TESTS_COMPONENT)
install(TARGETS bctoolbox-tester EXPORT ${EXPORT_TARGETS_NAME}Targets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
......@@ -271,7 +271,7 @@ if(MSVC)
if(ENABLE_STATIC)
target_compile_options(bctoolbox-static PRIVATE "/wd4996")
endif()
if(BCUNIT_FOUND)
if(ENABLE_TESTS_COMPONENT)
target_compile_options(bctoolbox-tester PRIVATE "/wd4996")
endif()
endif()
......@@ -26,7 +26,7 @@ else()
set(PROJECT_LIBS bctoolbox-static bctoolbox-tester-static)
endif()
if(BCUNIT_FOUND AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
if(ENABLE_TESTS AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
set(TESTER_SOURCES
bctoolbox_tester.c
bctoolbox_tester.h
......
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