2018-03-29 17:34:21 +02:00
|
|
|
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
|
|
|
|
|
|
|
|
project(cppzmq-test CXX)
|
|
|
|
|
|
|
|
# place binaries and libraries according to GNU standards
|
|
|
|
|
2018-04-02 13:21:11 +02:00
|
|
|
include(GNUInstallDirs)
|
|
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
|
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
|
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR})
|
2018-03-29 17:34:21 +02:00
|
|
|
|
2019-01-22 23:58:49 +01:00
|
|
|
include(CTest)
|
2018-09-23 18:14:25 +02:00
|
|
|
include(cmake/catch.cmake)
|
2019-01-22 23:58:49 +01:00
|
|
|
include(${CATCH_MODULE_PATH}/Catch.cmake)
|
|
|
|
|
2019-01-22 21:55:06 +01:00
|
|
|
find_package(Threads)
|
2018-03-29 17:34:21 +02:00
|
|
|
|
|
|
|
add_executable(
|
|
|
|
unit_tests
|
2019-04-22 23:15:51 +02:00
|
|
|
buffer.cpp
|
2018-04-14 13:03:44 +02:00
|
|
|
message.cpp
|
2018-04-03 12:02:08 +02:00
|
|
|
context.cpp
|
|
|
|
socket.cpp
|
2019-04-07 23:10:04 +02:00
|
|
|
socket_ref.cpp
|
2018-05-11 11:43:41 +02:00
|
|
|
poller.cpp
|
2018-05-11 10:56:41 +02:00
|
|
|
active_poller.cpp
|
2018-05-11 11:01:04 +02:00
|
|
|
multipart.cpp
|
2019-10-26 20:29:22 +02:00
|
|
|
recv_multipart.cpp
|
|
|
|
send_multipart.cpp
|
2020-03-20 10:59:15 +01:00
|
|
|
codec_multipart.cpp
|
2019-05-31 14:09:20 +02:00
|
|
|
monitor.cpp
|
|
|
|
utilities.cpp
|
2018-09-23 18:14:25 +02:00
|
|
|
)
|
2018-03-29 17:34:21 +02:00
|
|
|
|
2018-09-23 18:14:25 +02:00
|
|
|
add_dependencies(unit_tests catch)
|
|
|
|
|
2019-01-22 23:58:49 +01:00
|
|
|
target_include_directories(unit_tests PUBLIC ${CATCH_MODULE_PATH})
|
2018-03-29 17:34:21 +02:00
|
|
|
target_link_libraries(
|
|
|
|
unit_tests
|
2018-06-02 18:25:37 +02:00
|
|
|
PRIVATE cppzmq
|
2019-01-22 21:55:06 +01:00
|
|
|
PRIVATE ${CMAKE_THREAD_LIBS_INIT}
|
2018-09-23 18:14:25 +02:00
|
|
|
)
|
2018-03-29 17:34:21 +02:00
|
|
|
|
2018-06-02 18:25:37 +02:00
|
|
|
OPTION (COVERAGE "Enable gcda file generation needed by lcov" OFF)
|
|
|
|
|
|
|
|
if (COVERAGE)
|
|
|
|
target_compile_options(unit_tests PRIVATE --coverage)
|
|
|
|
target_link_libraries(unit_tests PRIVATE --coverage)
|
|
|
|
endif()
|
|
|
|
|
2019-01-22 23:58:49 +01:00
|
|
|
catch_discover_tests(unit_tests)
|