diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 3cbfb0b2..d6532f90 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -88,7 +88,7 @@ int np2_server_test_stop(void);") int np2_${TEST}(int argc, char *argv[]);") endforeach() - add_library(netopeer2_lib_test OBJECT "${TEST_SRC_DIR}/${TEST_SRC}") + add_library(netopeer2_lib_test OBJECT ${TEST_SRC}) target_compile_definitions(netopeer2_lib_test PRIVATE NETOPEER2_LIB) include_directories(${TEST_BIN_DIR}) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 75c186c2..0146cc39 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -37,8 +37,8 @@ include_directories(SYSTEM ${CMOCKA_INCLUDE_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR}) -# base test source -set(TEST_SRC "np2_test.c" "np2_other_client.c") +# base test source (absolute path, used by the lib as well) +set(TEST_SRC "${CMAKE_CURRENT_SOURCE_DIR}/np2_test.c" "${CMAKE_CURRENT_SOURCE_DIR}/np2_other_client.c") # list of all the tests set(TESTS test_rpc test_edit test_filter test_subscribe_filter test_subscribe_param test_parallel_sessions