From 80c8c7c5d9872727dbaa4c987f520240555eb4ba Mon Sep 17 00:00:00 2001 From: Florian Märkl Date: Fri, 9 May 2025 18:24:14 +0200 Subject: Fix linking against libs in non-standard paths pkg_check_modules does not include absolute paths to the libraries in _LIBRARIES, causing linker errors if they are not located in a standard path. _LINK_LIBRARIES is the equivalent that does contain absolute paths. --- tests/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 3f0ef94..b2a3ab4 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -13,7 +13,7 @@ function(add_test_library_by_name name) add_library("${TEST_LIBRARY_NAME}" SHARED ${TEST_LIBRARY_NAME}.c) target_include_directories("${TEST_LIBRARY_NAME}" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) target_include_directories("${TEST_LIBRARY_NAME}" PUBLIC "${CMAKE_SOURCE_DIR}/src") - target_link_libraries("${TEST_LIBRARY_NAME}" ${PROJECT_DEPS_LIBRARIES} -l${ayatana_indicator_gtkver}) + target_link_libraries("${TEST_LIBRARY_NAME}" ${PROJECT_DEPS_LINK_LIBRARIES} -l${ayatana_indicator_gtkver}) target_link_directories("${TEST_LIBRARY_NAME}" PUBLIC "${CMAKE_BINARY_DIR}/src") add_dependencies("${TEST_LIBRARY_NAME}" "${ayatana_indicator_gtkver}") endfunction() @@ -25,7 +25,7 @@ function(add_test_executable_by_name name) target_compile_definitions("${TEST_EXECUTABLE_NAME}" PUBLIC SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories("${TEST_EXECUTABLE_NAME}" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) target_include_directories("${TEST_EXECUTABLE_NAME}" PUBLIC "${CMAKE_SOURCE_DIR}/src") - target_link_libraries("${TEST_EXECUTABLE_NAME}" ${PROJECT_DEPS_LIBRARIES} -l${ayatana_indicator_gtkver}) + target_link_libraries("${TEST_EXECUTABLE_NAME}" ${PROJECT_DEPS_LINK_LIBRARIES} -l${ayatana_indicator_gtkver}) target_link_directories("${TEST_EXECUTABLE_NAME}" PUBLIC "${CMAKE_BINARY_DIR}/src") add_dependencies("${TEST_EXECUTABLE_NAME}" "${ayatana_indicator_gtkver}") endfunction() @@ -277,7 +277,7 @@ add_test("loader-tester" "loader-tester") # indicator-test-service add_executable("indicator-test-service" indicator-test-service.c) target_include_directories("indicator-test-service" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) -target_link_libraries("indicator-test-service" ${PROJECT_DEPS_LIBRARIES}) +target_link_libraries("indicator-test-service" ${PROJECT_DEPS_LINK_LIBRARIES}) set (ALL_TESTERS "service-manager-connect-tester" -- cgit v1.2.3