Commit 7f13eea3 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Use imported targets for X11 libs

They are more robust and nicer than variables
parent d291b2c9
cmake_minimum_required(VERSION 3.6)
cmake_minimum_required(VERSION 3.14)
project(plasma-workspace)
set(PROJECT_VERSION "5.21.80")
......
......@@ -21,7 +21,6 @@ target_link_libraries(appmenu
KF5::DBusAddons
KF5::KIOCore
KF5::WindowSystem
${X11_LIBRARIES}
dbusmenuqt
)
......
......@@ -14,11 +14,11 @@ target_link_libraries(plasma_engine_mouse
Qt::X11Extras
KF5::Plasma
KF5::WindowSystem
${X11_LIBRARIES}
X11::X11
)
if (X11_Xfixes_FOUND)
target_link_libraries(plasma_engine_mouse ${X11_Xfixes_LIB})
target_link_libraries(plasma_engine_mouse X11::Xfixes)
endif ()
kcoreaddons_desktop_to_json(plasma_engine_mouse plasma-dataengine-mouse.desktop)
......
......@@ -36,7 +36,7 @@ target_link_libraries(kcm_colors
)
if(X11_FOUND)
target_link_libraries(kcm_colors ${X11_LIBRARIES} Qt::X11Extras)
target_link_libraries(kcm_colors X11::X11 Qt::X11Extras)
endif()
kcoreaddons_desktop_to_json(kcm_colors "kcm_colors.desktop")
......
......@@ -44,16 +44,16 @@ target_link_libraries(kcm_cursortheme
KF5::KDELibs4Support
KF5::NewStuffCore
KF5::QuickAddons
${X11_LIBRARIES}
X11::X11
XCB::XCB
PW::KWorkspace
)
if (X11_Xcursor_FOUND)
target_link_libraries(kcm_cursortheme ${X11_Xcursor_LIB})
target_link_libraries(kcm_cursortheme X11::Xcursor)
endif ()
if (X11_Xfixes_FOUND)
target_link_libraries(kcm_cursortheme ${X11_Xfixes_LIB})
target_link_libraries(kcm_cursortheme X11::Xfixes)
endif ()
install(TARGETS kcm_cursortheme DESTINATION ${KDE_INSTALL_PLUGINDIR}/kcms )
......
......@@ -44,7 +44,7 @@ if(X11_FOUND)
target_link_libraries(kcm_fonts ${FONTCONFIG_LIBRARIES})
endif()
target_link_libraries(kcm_fonts ${X11_LIBRARIES} ${X11_Xft_LIB})
target_link_libraries(kcm_fonts X11::X11 X11::Xft)
endif()
kcoreaddons_desktop_to_json(kcm_fonts "kcm_fonts.desktop")
......
......@@ -19,13 +19,12 @@ target_link_libraries(kfontinst_bin
KF5::KIOCore
KF5::KIOWidgets
KF5::XmlGui
${X11_X11_LIB}
X11::X11
kfontinst
)
target_link_libraries(kfontprint_bin
Qt::PrintSupport
KF5::IconThemes
${X11_X11_LIB}
${FREETYPE_LIBRARIES}
kfontinstui
kfontinst
......
......@@ -15,7 +15,7 @@ target_link_libraries(kcm_fontinst
KF5::NewStuff
kfontinstui
kfontinst
${X11_LIBRARIES}
X11::X11
)
install(TARGETS kcm_fontinst DESTINATION ${KDE_INSTALL_PLUGINDIR} )
......
......@@ -18,6 +18,6 @@ target_link_libraries(kfontinst
set_target_properties(kfontinst PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR} )
add_library(kfontinstui SHARED ${kfontinstui_LIB_SRCS})
target_link_libraries(kfontinstui Qt::X11Extras KF5::KIOCore KF5::KIOWidgets ${FREETYPE_LIBRARIES} ${FONTCONFIG_LIBRARIES} ${X11_X11_LIB} ${X11_Xft_LIB} kfontinst )
target_link_libraries(kfontinstui Qt::X11Extras KF5::KIOCore KF5::KIOWidgets ${FREETYPE_LIBRARIES} ${FONTCONFIG_LIBRARIES} X11::X11 X11::Xft kfontinst )
set_target_properties(kfontinstui PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR} )
install(TARGETS kfontinst kfontinstui ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} )
......@@ -59,17 +59,17 @@ target_link_libraries(kcm_lookandfeel
Qt::DBus
Qt::Widgets
Qt::QuickWidgets
${X11_LIBRARIES}
X11::X11
)
if(X11_FOUND)
target_link_libraries(kcm_lookandfeel Qt::X11Extras)
endif()
if (X11_Xcursor_FOUND)
target_link_libraries(kcm_lookandfeel ${X11_Xcursor_LIB})
target_link_libraries(kcm_lookandfeel X11::Xcursor)
endif ()
if (X11_Xfixes_FOUND)
target_link_libraries(kcm_lookandfeel ${X11_Xfixes_LIB})
target_link_libraries(kcm_lookandfeel X11::Xfixes)
endif ()
kcoreaddons_desktop_to_json(kcm_lookandfeel "kcm_lookandfeel.desktop" SERVICE_TYPES kcmodule.desktop)
......@@ -126,17 +126,16 @@ target_link_libraries(lookandfeeltool
Qt::DBus
Qt::Widgets
Qt::QuickWidgets
${X11_LIBRARIES}
)
if(X11_FOUND)
target_link_libraries(lookandfeeltool Qt::X11Extras)
target_link_libraries(lookandfeeltool X11::X11 Qt::X11Extras)
endif()
if (X11_Xcursor_FOUND)
target_link_libraries(lookandfeeltool ${X11_Xcursor_LIB})
target_link_libraries(lookandfeeltool X11::Xcursor)
endif ()
if (X11_Xfixes_FOUND)
target_link_libraries(lookandfeeltool ${X11_Xfixes_LIB})
target_link_libraries(lookandfeeltool X11::Xfixes)
endif ()
install( TARGETS lookandfeeltool ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} )
......
......@@ -40,17 +40,17 @@ target_link_libraries(kcmTest
Qt::DBus
Qt::Widgets
Qt::QuickWidgets
${X11_LIBRARIES}
X11::X11
)
if(X11_FOUND)
target_link_libraries(kcmTest Qt::X11Extras)
endif()
if (X11_Xcursor_FOUND)
target_link_libraries(kcmTest ${X11_Xcursor_LIB})
target_link_libraries(kcmTest X11::Xcursor)
endif ()
if (X11_Xfixes_FOUND)
target_link_libraries(kcmTest ${X11_Xfixes_LIB})
target_link_libraries(kcmTest X11::Xfixes)
endif ()
add_test(NAME lookandfeel-kcmTest COMMAND kcmTest)
......
......@@ -38,7 +38,7 @@ target_link_libraries(kcm_style
KF5::I18n
KF5::Notifications
KF5::Plasma
${X11_LIBRARIES}
X11::X11
KF5::KDELibs4Support
KF5::GuiAddons
KF5::QuickAddons
......
......@@ -49,8 +49,6 @@ target_link_libraries(ksmserver
KF5::I18n
KF5::KIOCore
KF5::KIOGui
${X11_LIBRARIES}
${X11_Xrender_LIB}
Qt::X11Extras
KF5::Solid
Qt::Quick
......@@ -60,6 +58,10 @@ target_link_libraries(ksmserver
KF5::Package
KF5::WindowSystem
Qt::Concurrent
X11::X11
X11::SM
X11::ICE
X11::Xrender
)
install(TARGETS ksmserver ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
......
......@@ -66,7 +66,7 @@ if(X11_FOUND)
if(NOT X11_Xau_FOUND)
message(FATAL_ERROR "Found X11, but not libXau which is required for building kworkspace")
endif()
target_link_libraries(kworkspace PRIVATE Qt::X11Extras ${X11_LIBRARIES} ${X11_Xau_LIB})
target_link_libraries(kworkspace PRIVATE Qt::X11Extras X11::Xau)
endif()
write_basic_config_version_file(${CMAKE_CURRENT_BINARY_DIR}/LibKWorkspaceConfigVersion.cmake VERSION
......
......@@ -21,7 +21,7 @@ target_link_libraries(ksmserver-logout-greeter
KF5::QuickAddons
KF5::WaylandClient
KF5::WindowSystem
${X11_LIBRARIES}
X11::X11
)
install(TARGETS ksmserver-logout-greeter DESTINATION ${KDE_INSTALL_LIBEXECDIR})
kdbusaddons_generate_dbus_service_file(ksmserver-logout-greeter org.kde.LogoutPrompt ${KDE_INSTALL_FULL_LIBEXECDIR})
......
......@@ -89,7 +89,7 @@ target_include_directories(plasmashell PRIVATE "${CMAKE_BINARY_DIR}")
target_compile_definitions(plasmashell PRIVATE -DPROJECT_VERSION="${PROJECT_VERSION}")
if(HAVE_X11)
target_link_libraries(plasmashell ${X11_LIBRARIES} ${XCB_LIBRARIES} )
target_link_libraries(plasmashell XCB::XCB XCB::RANDR)
target_link_libraries(plasmashell Qt::X11Extras)
endif()
......
......@@ -12,7 +12,7 @@ MACRO(PLASMASHELL_UNIT_TESTS)
KF5::WindowSystem
)
if(HAVE_X11)
target_link_libraries(${_testname} ${X11_LIBRARIES} ${XCB_LIBRARIES} )
target_link_libraries(${_testname} XCB::XCB XCB::RANDR)
target_link_libraries(${_testname} Qt::X11Extras)
endif()
if(QT_QTOPENGL_FOUND)
......
......@@ -24,9 +24,8 @@ add_executable(startplasma-x11 ${START_PLASMA_COMMON_SRCS} startplasma-x11.cpp k
add_executable(startplasma-wayland ${START_PLASMA_COMMON_SRCS} startplasma-wayland.cpp ${startplasma_SRCS})
add_executable(startplasma-waylandsession ${START_PLASMA_COMMON_SRCS} startplasma-waylandsession.cpp ${startplasma_SRCS})
target_include_directories(startplasma-x11 PRIVATE ${X11_X11_INCLUDE_PATH})
target_link_libraries(startplasma-x11 PRIVATE Qt::Core Qt::DBus KF5::ConfigCore PW::KWorkspace
${X11_X11_LIB} # for kcheckrunning
X11::X11 # for kcheckrunning
)
target_link_libraries(startplasma-wayland PRIVATE Qt::Core Qt::DBus KF5::ConfigCore PW::KWorkspace)
......
......@@ -58,7 +58,7 @@ target_link_libraries(xembedsniproxy
Qt::DBus
KF5::WindowSystem
${XCB_LIBS}
${X11_XTest_LIB}
X11::Xtst
)
install(TARGETS xembedsniproxy ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
......
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