From 376c4605b6488ceba112761005d0bdb71eeee80d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= Date: Tue, 26 Jul 2016 15:46:01 +0200 Subject: [PATCH] cmake: fix tests' linking with libraries outside of a default path Just use a similar approach as server/CMakeLists.txt is already doing rather than a hardcoded list of libraries. --- server/tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/tests/CMakeLists.txt b/server/tests/CMakeLists.txt index 91db23bba..afa80bef2 100644 --- a/server/tests/CMakeLists.txt +++ b/server/tests/CMakeLists.txt @@ -32,7 +32,7 @@ endforeach() foreach(test_name IN LISTS tests) add_executable(${test_name} ${test_name}.c ../netconf_monitoring.c ../operations.c ../op_get_config.c ../op_editconfig.c ../op_copyconfig.c ../op_deleteconfig.c ../op_candidate.c ../op_validate.c ../op_un_lock.c ../op_generic.c ../log.c) - target_link_libraries(${test_name} ${CMOCKA_LIBRARIES} pthread yang netconf2 sysrepo) + target_link_libraries(${test_name} ${CMOCKA_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${LIBYANG_LIBRARIES} ${LIBNETCONF2_LIBRARIES} ${SYSREPO_LIBRARIES}) set_target_properties(${test_name} PROPERTIES LINK_FLAGS "${${test_name}_wrap_link_flags}") add_test(NAME ${test_name} COMMAND $) endforeach(test_name)