From 923680d490044a4d8049619c811bff54c9d55899 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sven=20P=C3=BCschel?= Date: Mon, 17 Mar 2025 11:36:26 +0100 Subject: [PATCH] use the GIO target instead of lib/include variables Use the GIO target instead of the lib/include variables, as it matches the modern CMake approach. Furthermore it also makes it clear to CMake that we're linking against an external target, so CMake doesn't try to add the include/library paths to the gernerated MaliitGLibTargets.cmake file. --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d4d1f26..89ced293 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -267,8 +267,7 @@ if(enable-glib) gdbus_add_code(GLIB_SOURCES dbus_interfaces/minputmethodserver1interface.xml) add_library(maliit-glib SHARED ${GLIB_SOURCES} ${GLIB_HEADER}) - target_include_directories(maliit-glib PUBLIC ${GIO_INCLUDE_DIRS}) - target_link_libraries(maliit-glib ${GIO_LIBRARIES}) + target_link_libraries(maliit-glib GLib2::GIO) set_target_properties(maliit-glib PROPERTIES SOVERSION ${PROJECT_VERSION_MAJOR} VERSION ${PROJECT_VERSION} EXPORT_NAME Maliit::GLib)