Commit 685fc49f authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Use versionless Qt cmake target

This makes it easier to build against both Qt5 and Qt6

GIT_SILENT
parent 486f413a
add_executable(kbroadcastnotification main.cpp)
target_compile_definitions(kbroadcastnotification PRIVATE -DPROJECT_VERSION="${PROJECT_VERSION}")
target_link_libraries(kbroadcastnotification Qt5::DBus KF5::CoreAddons KF5::I18n)
target_link_libraries(kbroadcastnotification Qt::DBus KF5::CoreAddons KF5::I18n)
install(TARGETS kbroadcastnotification ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
......@@ -6,7 +6,7 @@ target_compile_definitions(kcmshell5 PRIVATE -DPROJECT_VERSION="${PROJECT_VERSIO
ecm_mark_nongui_executable(kcmshell5)
target_link_libraries(kcmshell5
Qt5::DBus
Qt::DBus
KF5::KCMUtils
KF5::I18n
KF5::WindowSystem
......
add_executable(kde-inhibit main.cpp)
target_link_libraries(kde-inhibit Qt5::Core Qt5::DBus KF5::I18n KF5::CoreAddons)
target_link_libraries(kde-inhibit Qt::Core Qt::DBus KF5::I18n KF5::CoreAddons)
install(TARGETS kde-inhibit ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
......@@ -25,7 +25,7 @@ target_link_libraries(kcm_filetypes
KF5::IconThemes
KF5::I18n
KF5::KIOWidgets # KOpenWithDialog, KBuildSycocaProgressDialog
Qt5::DBus
Qt::DBus
)
install(TARGETS kcm_filetypes DESTINATION ${KDE_INSTALL_PLUGINDIR} )
......@@ -43,7 +43,7 @@ target_link_libraries(keditfiletype5
KF5::KIOWidgets # KOpenWithDialog, KBuildSycocaProgressDialog
KF5::WindowSystem
KF5::I18n
Qt5::DBus
Qt::DBus
)
if (Q_WS_X11)
target_link_libraries(keditfiletype5 ${X11_X11_LIB})
......
......@@ -11,7 +11,7 @@ ecm_mark_as_test(filetypestest)
add_test(NAME filetypestest COMMAND filetypestest)
target_link_libraries(filetypestest
KF5::KIOCore
Qt5::Core
Qt5::Gui
Qt5::Test
Qt::Core
Qt::Gui
Qt::Test
)
......@@ -12,7 +12,7 @@ function(add_kioclient_interface TARGET_NAME)
string(TOUPPER "${TARGET_NAME}" UPPER_TARGET_NAME)
target_compile_definitions(${TARGET_NAME} PRIVATE "-DKIOCLIENT_AS_${UPPER_TARGET_NAME}")
target_compile_definitions(${TARGET_NAME} PRIVATE -DPROJECT_VERSION="${PROJECT_VERSION}")
target_link_libraries(${TARGET_NAME} Qt5::DBus Qt5::Widgets KF5::CoreAddons ${kio_libs} KF5::I18n)
target_link_libraries(${TARGET_NAME} Qt::DBus Qt::Widgets KF5::CoreAddons ${kio_libs} KF5::I18n)
install(TARGETS ${TARGET_NAME} ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
endfunction()
......@@ -29,6 +29,6 @@ if (NOT KIOCORE_ONLY)
add_executable(kde-open5 kioclient.cpp)
target_compile_definitions(kde-open5 PRIVATE "-DKIOCLIENT_AS_KDEOPEN")
target_compile_definitions(kde-open5 PRIVATE -DPROJECT_VERSION="${PROJECT_VERSION}")
target_link_libraries(kde-open5 Qt5::DBus KF5::CoreAddons KF5::KIOWidgets KF5::I18n)
target_link_libraries(kde-open5 Qt::DBus KF5::CoreAddons KF5::KIOWidgets KF5::I18n)
install(TARGETS kde-open5 ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
endif()
......@@ -5,7 +5,7 @@ ecm_mark_nongui_executable(kmimetypefinder5)
target_link_libraries(kmimetypefinder5
KF5::CoreAddons # KAboutData
KF5::I18n # i18n
Qt5::Core
Qt::Core
)
install(TARGETS kmimetypefinder5 ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} )
......@@ -7,8 +7,8 @@ set_package_properties(X11 PROPERTIES DESCRIPTION "X11 libraries"
add_executable(kstart5 kstart.cpp)
target_compile_definitions(kstart5 PRIVATE -DPROJECT_VERSION="${PROJECT_VERSION}")
target_link_libraries(kstart5
Qt5::Widgets
Qt5::X11Extras
Qt::Widgets
Qt::X11Extras
KF5::I18n
KF5::KIOGui
KF5::Service
......
add_executable(ksvgtopng5 ksvgtopng.cpp)
ecm_mark_nongui_executable(ksvgtopng5)
target_link_libraries(ksvgtopng5 Qt5::Svg)
target_link_libraries(ksvgtopng5 Qt::Svg)
install(TARGETS ksvgtopng5 ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
......@@ -6,7 +6,7 @@ target_link_libraries(ktraderclient5
KF5::Service # KService, traders...
KF5::CoreAddons # KAboutData
KF5::I18n # i18n
Qt5::Core
Qt::Core
)
install(TARGETS ktraderclient5 ${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