Iterate over the cmake scripts

Prefer using imported targets rather than cmake variables.
This commit is contained in:
Aleix Pol 2013-11-15 16:46:59 +01:00
parent e9d7e823ef
commit 0fa21b4af5
11 changed files with 34 additions and 56 deletions

View File

@ -7,8 +7,8 @@ set(runnermodel_SRCS
add_library(runnermodelplugin SHARED ${runnermodel_SRCS})
target_link_libraries(runnermodelplugin
${Qt5Quick_LIBRARIES}
${Qt5Qml_LIBRARIES}
Qt5::Quick
Qt5::Qml
KF5::KI18n
Plasma
)

View File

@ -17,9 +17,8 @@ set(localebindings_SRCS
add_library(localebindingsplugin SHARED ${localebindings_SRCS})
target_link_libraries(localebindingsplugin
Qt5::Core
${Qt5Quick_LIBRARIES}
${Qt5Qml_LIBRARIES}
${KCore_LIBRARIES}
Qt5::Quick
Qt5::Qml
KF5::KDE4Support
KF5::KI18n
)

View File

@ -17,8 +17,8 @@ set(plasmacomponents_SRCS
add_library(plasmacomponentsplugin SHARED ${plasmacomponents_SRCS})
target_link_libraries(plasmacomponentsplugin
Qt5::Core
${Qt5Quick_LIBRARIES}
${Qt5Qml_LIBRARIES}
Qt5::Quick
Qt5::Qml
Qt5::Gui
KF5::KDeclarative
Plasma)

View File

@ -17,8 +17,8 @@ set(plasmaextracomponents_SRCS
add_library(plasmaextracomponentsplugin SHARED ${plasmaextracomponents_SRCS})
target_link_libraries(plasmaextracomponentsplugin
${Qt5Quick_LIBRARIES}
${Qt5Qml_LIBRARIES}
Qt5::Quick
Qt5::Qml
${KACTIVITIES_LIBRARY}
Plasma)

View File

@ -15,8 +15,8 @@ add_library(qtextracomponentsplugin SHARED ${qtextracomponents_SRCS})
target_link_libraries(qtextracomponentsplugin
Qt5::Core
${Qt5Quick_LIBRARIES}
${Qt5Qml_LIBRARIES}
Qt5::Quick
Qt5::Qml
Qt5::Gui
KF5::KDeclarative
KF5::KIconThemes

View File

@ -1,7 +1,5 @@
if(QCA2_FOUND)
include_directories(
${QCA2_INCLUDE_DIR}
)
include_directories( ${QCA2_INCLUDE_DIR} )
endif()
# This option should be removed, or moved down as far as possible.
@ -129,7 +127,8 @@ kconfig_add_kcfg_files(Plasma_LIB_SRCS data/kconfigxt/libplasma-theme-global.kcf
#)
add_library(Plasma SHARED ${Plasma_LIB_SRCS})
add_library(Plasma ${Plasma_LIB_SRCS})
add_library(KF5::Plasma ALIAS Plasma)
target_link_libraries(Plasma
Qt5::Network

View File

@ -1,18 +1,12 @@
project(plasma-containmentactions-test)
project(plasma_testengine_dataengine)
find_package(KDE4 REQUIRED)
include(KDE4Defaults)
set(test_SRCS
test.cpp
)
qt5_wrap_ui(test_SRCS config.ui)
add_library(plasma_containmentactions_test MODULE ${test_SRCS})
target_link_libraries(plasma_containmentactions_test ${Plasma_LIBRARIES} KF5::KIOCore KF5::KIOWidgets)
target_link_libraries(plasma_containmentactions_test KF5::Plasma KF5::KIOWidgets)
install(TARGETS plasma_containmentactions_test DESTINATION ${PLUGIN_INSTALL_DIR})
install(FILES plasma-containmentactions-test.desktop DESTINATION ${SERVICES_INSTALL_DIR})

View File

@ -1,18 +1,9 @@
project(plasma_testengine_dataengine)
find_package(KDE4 REQUIRED)
include(KDE4Defaults)
set(testengine_engine_SRCS
testengine.cpp)
add_library(plasma_engine_testengine MODULE
${testengine_engine_SRCS})
add_library(plasma_engine_testengine MODULE testengine.cpp)
target_link_libraries(plasma_engine_testengine
KF5::KIOCore KF5::KIOWidgets
${Plasma_LIBRARIES})
KF5::KIOWidgets KF5::Plasma)
install(TARGETS plasma_engine_testengine DESTINATION ${PLUGIN_INSTALL_DIR})
install(FILES plasma-dataengine-testengine.desktop DESTINATION ${SERVICES_INSTALL_DIR} )

View File

@ -52,12 +52,9 @@ include_directories(${PHONON_INCLUDES})
add_library(plasma_appletscript_simple_javascript MODULE ${simple_javascript_engine_SRCS})
target_link_libraries(plasma_appletscript_simple_javascript
${KCore_LIBRARIES}
KF5::KIOCore KF5::KIOWidgets
${Plasma_LIBRARIES}
KF5::Plasma
Qt5::Declarative
${QT_QTSCRIPT_LIBRARY}
${QT_QTUITOOLS_LIBRARY}
Qt5::Xml
)
@ -78,10 +75,10 @@ set(javascript_runner_engine_SRCS
add_library(plasma_runnerscript_javascript MODULE ${javascript_runner_engine_SRCS})
target_link_libraries(plasma_runnerscript_javascript
${KCore_LIBRARIES}
KF5::KIOCore KF5::KIOWidgets
${Plasma_LIBRARIES}
${QT_QTSCRIPT_LIBRARY})
KF5::KCoreAddons
KF5::KIOWidgets
KF5::Plasma
Qt5::Script)
install(TARGETS plasma_runnerscript_javascript DESTINATION ${PLUGIN_INSTALL_DIR})
install(FILES data/plasma-scriptengine-runner-javascript.desktop DESTINATION ${SERVICES_INSTALL_DIR})
@ -103,10 +100,10 @@ set(javascript_dataengine_engine_SRCS
add_library(plasma_dataenginescript_javascript MODULE ${javascript_dataengine_engine_SRCS})
target_link_libraries(plasma_dataenginescript_javascript
${KCore_LIBRARIES}
KF5::KIOCore KF5::KIOWidgets
${Plasma_LIBRARIES}
${QT_QTSCRIPT_LIBRARY})
KF5::KCoreAddons
KF5::KIOWidgets
KF5::Plasma
Qt5::Script)
install(TARGETS plasma_dataenginescript_javascript DESTINATION ${PLUGIN_INSTALL_DIR})
install(FILES data/plasma-scriptengine-dataengine-javascript.desktop DESTINATION ${SERVICES_INSTALL_DIR})
@ -119,7 +116,7 @@ set(javascript_addon_packagestructure_SRCS
)
add_library(plasma_packagestructure_javascriptaddon MODULE ${javascript_addon_packagestructure_SRCS})
target_link_libraries(plasma_packagestructure_javascriptaddon ${Plasma_LIBRARIES})
target_link_libraries(plasma_packagestructure_javascriptaddon KF5::Plasma)
install(TARGETS plasma_packagestructure_javascriptaddon DESTINATION ${PLUGIN_INSTALL_DIR})
install(FILES data/plasma-packagestructure-javascript-addon.desktop DESTINATION ${SERVICES_INSTALL_DIR})

View File

@ -7,10 +7,7 @@ set(CMAKE_AUTOMOC ON)
# to always look for includes there:
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
find_path(KDE_MODULES_DIR NAMES KDE4Macros.cmake PATH_SUFFIXES share/cmake/modules)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
add_definitions(-DHAVE_X11=${HAVE_X11})
@ -61,16 +58,15 @@ add_executable(plasma-shell
# The Qt5Widgets_LIBRARIES variable also includes QtGui and QtCore
target_link_libraries(plasma-shell
#${Qt5Widgets_LIBRARIES}
${Qt5Quick_LIBRARIES}
${Qt5Qml_LIBRARIES}
${KCore_LIBRARIES}
#Qt5::Widgets
Qt5::Quick
Qt5::Qml
KF5::KIOCore
${KWindowSystem_LIBRARIES}
KF5::KWindowSystem
KF5::KCoreAddons
Plasma
PlasmaQuick
${Qt5Script_LIBRARIES}
Qt5::Script
KF5::KDE4Support
KF5::Solid
KF5::KDeclarative

View File

@ -44,6 +44,7 @@ for FS in `find $PWD -type f -name 'CMakeLists.txt'`; do
perl -p -i -e 's/\$\{KIconThemes_LIBRARIES\}/KF5\:\:KIconThemes/g' $FS
perl -p -i -e 's/\$\{KWindowSystem_LIBRARIES\}/KF5\:\:KWindowSystem/g' $FS
perl -p -i -e 's/\$\{KConfigWidgets_LIBRARIES\}/KF5\:\:KConfigWidgets/g' $FS
perl -p -i -e 's/\$\{KCMUTILS_LIBS\}/KF5\:\:KCMUtils/g' $FS
perl -p -i -e 's/\$\{QT_QTXML_LIBRARY\}/Qt5\:\:Xml/g' $FS
perl -p -i -e 's/\$\{QT_QTGUI_LIBRARY\}/Qt5\:\:Gui/g' $FS
@ -59,5 +60,6 @@ for FS in `find $PWD -type f -name 'CMakeLists.txt'`; do
perl -p -i -e 's/\$\{Qt5Quick_LIBRARIES\}/Qt5\:\:Quick/g' $FS
perl -p -i -e 's/\$\{Qt5Qml_LIBRARIES\}/Qt5\:\:Qml/g' $FS
perl -p -i -e 's/\$\{Qt5Widgets_LIBRARIES\}/Qt5\:\:Widgets/g' $FS
perl -p -i -e 's/\$\{Qt5Script_LIBRARIES\}/Qt5\:\:Script/g' $FS
done