+# package: find external packages
+include(FindPkgConfig)
+
# package: required boost libraries
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
# compiler: include directories where the source code is located
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
-# compiler: source code files
+# compiler: source code from test cases
+set(TESTS_SOURCES
+ test_messagepayload.cpp
+)
+
+# compiler: source code to be tested
set(SOURCES
- test_messagepayload.cpp
- ../src/host/messagepayload.cpp
+ ${CMAKE_SOURCE_DIR}/src/host/messagepayload.cpp
)
# compiler: creates the binary
-add_executable(test_${TARGET} ${SOURCES})
+add_executable(test_${TARGET} ${SOURCES} ${TESTS_SOURCES})
# cmake: add a custom "make check" target which automatically builds the binary
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} DEPENDS test_${TARGET})