-fix build, find ThreadWeaver via KF5

I thin using the variables is safer, this way you are somewhat guarded against changes
in the names of targets, and a typo leads to an empty variable, instead to
"ld: cannot find -lkcoreaddons" which looks very much like a missing normal library

Alex
This commit is contained in:
Alex Neundorf 2013-02-27 21:45:35 +01:00
parent eaed999665
commit f07a425546
4 changed files with 7 additions and 8 deletions

View File

@ -58,7 +58,7 @@ find_package(kdeqt5staging REQUIRED NO_MODULE)
# Load CMake, Compiler and InstallDirs settings from KF5 and the following are already somewhat "done" tier1/tier2 libs from kdelibs: # Load CMake, Compiler and InstallDirs settings from KF5 and the following are already somewhat "done" tier1/tier2 libs from kdelibs:
find_package(KF5 MODULE REQUIRED COMPONENTS CMake Compiler InstallDirs find_package(KF5 MODULE REQUIRED COMPONENTS CMake Compiler InstallDirs
KIdleTime ItemModels KWidgetsAddons KWindowSystem KCodecs KArchive KCoreAddons Solid KIdleTime ItemModels KWidgetsAddons KWindowSystem KCodecs KArchive KCoreAddons Solid ThreadWeaver
KConfig KAuth kjs) KConfig KAuth kjs)
#find_package(KF5Transitional REQUIRED) #find_package(KF5Transitional REQUIRED)

View File

@ -30,7 +30,6 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}
${KDE4_INCLUDE_DIR}/KDE ${KDE4_INCLUDE_DIR}/KDE
${ki18n_SOURCE_DIR}/src ${ki18n_SOURCE_DIR}/src
${ki18n_BINARY_DIR}/src ${ki18n_BINARY_DIR}/src
${KDE4_INCLUDE_DIR}/threadweaver
${KDE4_INCLUDE_DIR}/kio ${KDE4_INCLUDE_DIR}/kio
#FIXME: this will go into Qt upstream #FIXME: this will go into Qt upstream
${CMAKE_INSTALL_PREFIX}/include/kdeqt5staging/ ${CMAKE_INSTALL_PREFIX}/include/kdeqt5staging/
@ -44,7 +43,7 @@ if(NOT PLASMA_NO_KIO)
endif(NOT PLASMA_NO_KIO) endif(NOT PLASMA_NO_KIO)
if(NOT PLASMA_NO_SOLID) if(NOT PLASMA_NO_SOLID)
set(PLASMA_EXTRA_LIBS ${PLASMA_EXTRA_LIBS} ${solid_LIBRARIES}) set(PLASMA_EXTRA_LIBS ${PLASMA_EXTRA_LIBS} ${Solid_LIBRARIES})
endif(NOT PLASMA_NO_SOLID) endif(NOT PLASMA_NO_SOLID)
if(NOT PLASMA_NO_PACKAGEKIT) if(NOT PLASMA_NO_PACKAGEKIT)
@ -134,9 +133,9 @@ kde4_add_library(plasma SHARED ${plasma_LIB_SRCS})
target_link_libraries(plasma ${QT_QTUITOOLS_LIBRARY} target_link_libraries(plasma ${QT_QTUITOOLS_LIBRARY}
${QT_QTNETWORK_LIBRARY} ${QT_QTSQL_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTSQL_LIBRARY}
${KDE4_KDEUI_LIBS} KF5::threadweaver kauth KF5::kwindowsystem ${PLASMA_EXTRA_LIBS} ki18n) ${KDE4_KDEUI_LIBS} ${ThreadWeaver_LIBRARIES} ${KAuth_LIBRARIES} ${KWindowSystem_LIBRARIES} ${PLASMA_EXTRA_LIBS} ki18n)
#FIXME gpgme++ is in kdepimlibs, neeeds to be elsewhere #FIXME gpgme++ is in kdepimlibs, neeeds to be elsewhere
target_link_libraries(plasma kdeclarative KF5::karchive) target_link_libraries(plasma kdeclarative ${KArchive_LIBRARIES})
if(X11_FOUND) if(X11_FOUND)
target_link_libraries(plasma ${X11_LIBRARIES}) target_link_libraries(plasma ${X11_LIBRARIES})

View File

@ -8,7 +8,7 @@ MACRO(PLASMA_UNIT_TESTS)
FOREACH(_testname ${ARGN}) FOREACH(_testname ${ARGN})
kde4_add_unit_test(${_testname} TESTNAME plasma-${_testname} ${_testname}.cpp) kde4_add_unit_test(${_testname} TESTNAME plasma-${_testname} ${_testname}.cpp)
target_link_libraries(${_testname} ${QT_QTTEST_LIBRARY} ${QT_QTDECLARATIVE_LIBRARY} target_link_libraries(${_testname} ${QT_QTTEST_LIBRARY} ${QT_QTDECLARATIVE_LIBRARY}
${KDE4_KIO_LIBS} ${KDE4_KDEUI_LIBS} plasma KF5::karchive) ${KDE4_KIO_LIBS} ${KDE4_KDEUI_LIBS} plasma ${KArchive_LIBRARIES} )
if(QT_QTOPENGL_FOUND) if(QT_QTOPENGL_FOUND)
target_link_libraries(${_testname} ${QT_QTOPENGL_LIBRARY}) target_link_libraries(${_testname} ${QT_QTOPENGL_LIBRARY})
endif(QT_QTOPENGL_FOUND) endif(QT_QTOPENGL_FOUND)
@ -23,7 +23,7 @@ PLASMA_UNIT_TESTS(
) )
kde4_add_unit_test(storagetest TESTNAME plasma-storage storagetest.cpp ../private/storage.cpp ../private/storagethread.cpp) kde4_add_unit_test(storagetest TESTNAME plasma-storage storagetest.cpp ../private/storage.cpp ../private/storagethread.cpp)
target_link_libraries(storagetest ${QT_QTTEST_LIBRARY} ${QT_QTDECLARATIVE_LIBRARY} ${QT_QTSQL_LIBRARY} ${KDE4_KIO_LIBS} plasma kcoreaddons) target_link_libraries(storagetest ${QT_QTTEST_LIBRARY} ${QT_QTDECLARATIVE_LIBRARY} ${QT_QTSQL_LIBRARY} ${KDE4_KIO_LIBS} plasma ${KCoreAddons_LIBRARIES} )
if(QT_QTOPENGL_FOUND) if(QT_QTOPENGL_FOUND)
target_link_libraries(storagetest ${QT_QTOPENGL_LIBRARY}) target_link_libraries(storagetest ${QT_QTOPENGL_LIBRARY})
endif(QT_QTOPENGL_FOUND) endif(QT_QTOPENGL_FOUND)

View File

@ -45,7 +45,7 @@ target_link_libraries(testplasma2
${Qt5Quick_LIBRARIES} ${Qt5Quick_LIBRARIES}
${Qt5Qml_LIBRARIES} ${Qt5Qml_LIBRARIES}
${KDE4_KDECORE_LIBS} ${KDE4_KDECORE_LIBS}
KF5::kwindowsystem ${KWindowSystem_LIBRARIES}
plasma plasma
) )