From f6eee463bab70920971d5c49228af5206e1f40f9 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Mon, 10 Jan 2022 13:15:54 +0100 Subject: [PATCH] Make lcms2 a hard dependency When we do more color management stuff we'll need it in more places, making it a hard requirement reduces the amount of needed ifdefs and should make adding color management features a little simpler. --- CMakeLists.txt | 5 ++--- autotests/integration/CMakeLists.txt | 5 +---- src/CMakeLists.txt | 11 +++-------- src/config-kwin.h.cmake | 1 - src/main.cpp | 6 ------ src/plugins/CMakeLists.txt | 8 ++------ 6 files changed, 8 insertions(+), 28 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3bff3e3c54..c19ff6eeaa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -237,9 +237,9 @@ find_package(lcms2) set_package_properties(lcms2 PROPERTIES DESCRIPTION "Small-footprint color management engine" URL "http://www.littlecms.com" - TYPE OPTIONAL + TYPE REQUIRED + PURPOSE "Required for the color management system" ) -add_feature_info("lcms2" lcms2_FOUND "Required for the color management system") # All the required XCB components find_package(XCB 1.10 REQUIRED COMPONENTS @@ -345,7 +345,6 @@ option(KWIN_BUILD_SCREENLOCKER "Enable building of KWin lockscreen functionality option(KWIN_BUILD_TABBOX "Enable building of KWin Tabbox functionality" ON) cmake_dependent_option(KWIN_BUILD_ACTIVITIES "Enable building of KWin with kactivities support" ON "KF5Activities_FOUND" OFF) cmake_dependent_option(KWIN_BUILD_RUNNERS "Enable building of KWin with krunner support" ON "KF5Runner_FOUND" OFF) -cmake_dependent_option(KWIN_BUILD_CMS "Enable building of KWin with CMS" ON "lcms2_FOUND" OFF) # Binary name of KWin set(KWIN_NAME "kwin") diff --git a/autotests/integration/CMakeLists.txt b/autotests/integration/CMakeLists.txt index 691fcd3408..a7e0db0678 100644 --- a/autotests/integration/CMakeLists.txt +++ b/autotests/integration/CMakeLists.txt @@ -141,10 +141,7 @@ integrationTest(WAYLAND_ONLY NAME testOutputChanges SRCS outputchanges_test.cpp) qt_add_dbus_interfaces(DBUS_SRCS ${CMAKE_BINARY_DIR}/src/org.kde.kwin.VirtualKeyboard.xml) integrationTest(WAYLAND_ONLY NAME testVirtualKeyboardDBus SRCS test_virtualkeyboard_dbus.cpp ${DBUS_SRCS}) - -if (KWIN_BUILD_CMS) - integrationTest(WAYLAND_ONLY NAME testNightColor SRCS nightcolor_test.cpp LIBS KWinNightColorPlugin) -endif() +integrationTest(WAYLAND_ONLY NAME testNightColor SRCS nightcolor_test.cpp LIBS KWinNightColorPlugin) if (XCB_ICCCM_FOUND) integrationTest(NAME testMoveResize SRCS move_resize_window_test.cpp LIBS XCB::ICCCM) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 41afcfb811..503676f0a3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -32,6 +32,8 @@ target_sources(kwin PRIVATE appmenu.cpp atoms.cpp client_machine.cpp + colordevice.cpp + colormanager.cpp composite.cpp cursor.cpp cursordelegate_opengl.cpp @@ -201,6 +203,7 @@ target_link_libraries(kwin epoxy::epoxy Threads::Threads + lcms2::lcms2 ) if (QT_MAJOR_VERSION EQUAL "5") target_link_libraries(kwin Qt5::XkbCommonSupportPrivate) @@ -245,14 +248,6 @@ add_subdirectory(backends) add_subdirectory(scenes) add_subdirectory(utils) -if (KWIN_BUILD_CMS) - target_sources(kwin PRIVATE - colordevice.cpp - colormanager.cpp - ) - target_link_libraries(kwin lcms2::lcms2) -endif() - if (KWIN_BUILD_ACTIVITIES) target_sources(kwin PRIVATE activities.cpp) target_link_libraries(kwin KF5::Activities) diff --git a/src/config-kwin.h.cmake b/src/config-kwin.h.cmake index 8e691d3ae4..05a85a9556 100644 --- a/src/config-kwin.h.cmake +++ b/src/config-kwin.h.cmake @@ -5,7 +5,6 @@ #cmakedefine01 KWIN_BUILD_SCREENLOCKER #cmakedefine01 KWIN_BUILD_TABBOX #cmakedefine01 KWIN_BUILD_ACTIVITIES -#cmakedefine01 KWIN_BUILD_CMS #define KWIN_NAME "${KWIN_NAME}" #define KWIN_INTERNAL_NAME_X11 "${KWIN_INTERNAL_NAME_X11}" #define KWIN_CONFIG "${KWIN_NAME}rc" diff --git a/src/main.cpp b/src/main.cpp index cb02761d89..41971658f2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -13,9 +13,7 @@ #include "atoms.h" #include "platform.h" -#if KWIN_BUILD_CMS #include "colormanager.h" -#endif #include "composite.h" #include "cursor.h" #include "input.h" @@ -311,9 +309,7 @@ void Application::createPlugins() void Application::createColorManager() { -#if KWIN_BUILD_CMS ColorManager::create(this); -#endif } void Application::createInputMethod() @@ -353,9 +349,7 @@ void Application::destroyPlugins() void Application::destroyColorManager() { -#if KWIN_BUILD_CMS delete ColorManager::self(); -#endif } void Application::destroyInputMethod() diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index 09ae4d443f..675ebc16a1 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -3,18 +3,14 @@ add_subdirectory(qpa) add_subdirectory(idletime) add_subdirectory(windowsystem) add_subdirectory(kpackage) -if (KWIN_BUILD_CMS) - add_subdirectory(nightcolor) -endif() +add_subdirectory(nightcolor) +add_subdirectory(colord-integration) if (KWIN_BUILD_DECORATIONS) add_subdirectory(kdecorations) endif() if (PipeWire_FOUND) add_subdirectory(screencast) endif() -if (KWIN_BUILD_CMS) - add_subdirectory(colord-integration) -endif() if (KWIN_BUILD_RUNNERS) add_subdirectory(krunner-integration) endif()