Commit aa601b6a authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Misc cmake cleanup

Define minimum versions for Qt and KF5 according to Plasma standard

Remove/simplify unneeded calls

Use imported targets instead of setting include dirs

Use C++17
parent 42105953
......@@ -2,15 +2,17 @@ project(kde-gtk-config)
set(PROJECT_VERSION "5.21.80")
cmake_minimum_required(VERSION 3.16)
find_package(ECM REQUIRED NO_MODULE)
set(QT_MIN_VERSION "5.15.0")
set(KF5_MIN_VERSION "5.78")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" ${ECM_MODULE_PATH})
find_package(Qt5 REQUIRED NO_MODULE COMPONENTS DBus Svg)
find_package(KF5CoreAddons REQUIRED)
find_package(KF5Config REQUIRED)
find_package(KF5ConfigWidgets REQUIRED)
find_package(KF5GuiAddons REQUIRED)
find_package(KF5DBusAddons REQUIRED)
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS DBus Svg)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS CoreAddons Config ConfigWidgets GuiAddons DBusAddons)
find_package(PkgConfig REQUIRED)
find_package(KDecoration2 REQUIRED)
find_package(GSettingSchemas REQUIRED)
......
......@@ -3,10 +3,6 @@ find_package(X11)
add_executable(gtk3_preview preview3.c)
if(X11_FOUND)
target_include_directories(gtk3_preview PRIVATE ${X11_X11_INCLUDE_PATH})
endif()
target_compile_definitions(gtk3_preview PRIVATE "-DDATA_DIR=\"${KDE_INSTALL_FULL_DATADIR}/kcm-gtk-module/\"")
target_link_libraries(gtk3_preview PkgConfig::GTK+3 PkgConfig::GLib2 PkgConfig::GObject)
target_link_libraries(gtk3_preview PkgConfig::GTK+3 PkgConfig::GLib2 PkgConfig::GObject X11::X11)
install(TARGETS gtk3_preview RUNTIME DESTINATION "${KDE_INSTALL_LIBEXECDIR}")
add_executable(gtk_theme gtktheme.cpp)
target_sources(gtk_theme
PRIVATE
../kded/configeditor.cpp
)
add_executable(gtk_theme gtktheme.cpp ../kded/configeditor.cpp)
target_link_libraries(gtk_theme
PRIVATE
......
......@@ -15,12 +15,6 @@ target_compile_definitions(gtkconfig
-DQT_NO_SIGNALS_SLOTS_KEYWORDS
)
target_include_directories(gtkconfig
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
${GTK3_INCLUDE_DIRS}
)
target_link_libraries(gtkconfig
PRIVATE
KWinBridge
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment