From 19461f441342d3ae444dca94f988f203dc146375 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Fri, 15 Jan 2021 23:11:38 +0200 Subject: [PATCH] cmake: Don't list linked libraries in variables If a non-existing variable is used, no warning will be printed. --- CMakeLists.txt | 55 ++++++++++++++++++-------------------------------- 1 file changed, 20 insertions(+), 35 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c299347a56..cff2d28746 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -599,20 +599,27 @@ ki18n_wrap_ui(kwin_SRCS ########### target link libraries ############### -set(kwin_OWN_LIBS - kwineffects - kwin4_effect_builtins +add_library(kwin SHARED ${kwin_SRCS}) +if (Libinput_VERSION_STRING VERSION_GREATER 1.14) + set_source_files_properties(libinput/connection.cpp PROPERTIES COMPILE_DEFINITIONS LIBINPUT_HAS_TOTEM) +endif () + +set_target_properties(kwin PROPERTIES + VERSION ${PROJECT_VERSION} + SOVERSION ${PROJECT_VERSION_MAJOR} ) -set(kwin_QT_LIBS +target_link_libraries(kwin + kwin4_effect_builtins + kwineffects + kwinglutils + Qt5::Concurrent Qt5::DBus Qt5::Quick Qt5::Script Qt5::Sensors -) -set(kwin_KDE_LIBS KF5::ConfigCore KF5::ConfigWidgets KF5::CoreAddons @@ -623,15 +630,15 @@ set(kwin_KDE_LIBS KF5::Package KF5::Plasma KF5::QuickAddons + KF5::WaylandClient KF5::WindowSystem KDecoration2::KDecoration KDecoration2::KDecoration2Private PW::KScreenLocker -) + Plasma::KWaylandServer -set(kwin_XCB_LIBS XCB::COMPOSITE XCB::DAMAGE XCB::GLX @@ -644,37 +651,15 @@ set(kwin_XCB_LIBS XCB::SYNC XCB::XCB XCB::XFIXES -) -set(kwin_WAYLAND_LIBS - KF5::WaylandClient - Plasma::KWaylandServer + Libinput::Libinput + UDev::UDev XKB::XKB + epoxy::epoxy + ${CMAKE_THREAD_LIBS_INIT} ) -set(kwinLibs - ${kwin_OWN_LIBS} - ${kwin_QT_LIBS} - ${kwin_KDE_LIBS} - ${kwin_XCB_LIBS} - ${kwin_WAYLAND_LIBS} - UDev::UDev - Libinput::Libinput -) - -add_library(kwin SHARED ${kwin_SRCS}) -if (Libinput_VERSION_STRING VERSION_GREATER 1.14) - set_source_files_properties(libinput/connection.cpp PROPERTIES COMPILE_DEFINITIONS LIBINPUT_HAS_TOTEM) -endif () - -set_target_properties(kwin PROPERTIES - VERSION ${PROJECT_VERSION} - SOVERSION ${PROJECT_VERSION_MAJOR} -) - -target_link_libraries(kwin ${kwinLibs} kwinglutils epoxy::epoxy) - if (KWIN_BUILD_CMS) target_sources(kwin PRIVATE colordevice.cpp @@ -708,7 +693,7 @@ generate_export_header(kwin EXPORT_FILE_NAME kwin_export.h) if(CMAKE_SYSTEM MATCHES "FreeBSD") # epoll is required, includes live under ${LOCALBASE}, separate library target_include_directories(kwin PUBLIC ${epoll_INCLUDE_DIRS}) - target_link_libraries(kwin ${kwinLibs} ${epoll_LIBRARIES}) + target_link_libraries(kwin ${epoll_LIBRARIES}) endif() add_executable(kwin_x11 main_x11.cpp)