aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Märkl <info@florianmaerkl.de>2025-05-09 18:24:14 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2026-06-09 15:40:23 +0200
commit80c8c7c5d9872727dbaa4c987f520240555eb4ba (patch)
tree02884795544f11ff121bdd9c1b48ccedd4c6e30d
parent6be6bfff40db6450d11a151812c8b27a65cbe1ed (diff)
downloadlibayatana-indicator-80c8c7c5d9872727dbaa4c987f520240555eb4ba.tar.gz
libayatana-indicator-80c8c7c5d9872727dbaa4c987f520240555eb4ba.tar.bz2
libayatana-indicator-80c8c7c5d9872727dbaa4c987f520240555eb4ba.zip
Fix linking against libs in non-standard paths
pkg_check_modules does not include absolute paths to the libraries in <prefix>_LIBRARIES, causing linker errors if they are not located in a standard path. <prefix>_LINK_LIBRARIES is the equivalent that does contain absolute paths.
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--tests/CMakeLists.txt6
-rw-r--r--tools/CMakeLists.txt2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 400f91a..b638165 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -142,6 +142,6 @@ target_include_directories("${ayatana_indicator_gtkver}" PUBLIC ${CMAKE_CURRENT_
if(NOT APPLE)
target_link_options("${ayatana_indicator_gtkver}" PRIVATE "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/indicator.symbols")
endif()
-target_link_libraries("${ayatana_indicator_gtkver}" ${PROJECT_DEPS_LIBRARIES} ${EXTRA_LIBS})
+target_link_libraries("${ayatana_indicator_gtkver}" ${PROJECT_DEPS_LINK_LIBRARIES} ${EXTRA_LIBS})
add_dependencies("${ayatana_indicator_gtkver}" "src-generated")
install(TARGETS "${ayatana_indicator_gtkver}" LIBRARY DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}")
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"
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
index 14ce777..18bf429 100644
--- a/tools/CMakeLists.txt
+++ b/tools/CMakeLists.txt
@@ -4,7 +4,7 @@ if (FLAVOUR_GTK3 AND ENABLE_IDO)
add_executable("ayatana-indicator-loader3" indicator-loader.c)
target_include_directories("ayatana-indicator-loader3" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS})
target_include_directories("ayatana-indicator-loader3" PUBLIC "${CMAKE_SOURCE_DIR}/src")
- target_link_libraries("ayatana-indicator-loader3" ${PROJECT_DEPS_LIBRARIES} "-L${CMAKE_BINARY_DIR}/src" -layatana-indicator3)
+ target_link_libraries("ayatana-indicator-loader3" ${PROJECT_DEPS_LINK_LIBRARIES} "-L${CMAKE_BINARY_DIR}/src" -layatana-indicator3)
add_dependencies("ayatana-indicator-loader3" "ayatana-indicator3")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ayatana-indicator-loader3" DESTINATION "${CMAKE_INSTALL_FULL_LIBEXECDIR}/${PROJECT_NAME}")