55 lines
2.5 KiB
Diff
55 lines
2.5 KiB
Diff
--- CMakeLists.txt (Revision 912562)
|
|
+++ CMakeLists.txt (Revision 912562)
|
|
@@ -4,9 +4,17 @@
|
|
find_package(GMP REQUIRED)
|
|
find_package(QCA2 REQUIRED)
|
|
find_package(Strigi REQUIRED)
|
|
-macro_optional_find_package(Plasma)
|
|
-macro_log_feature(PLASMA_FOUND "Plasma" "Plasma libraries and header files" "http://plasma.kde.org/" FALSE "" "Plasma is needed for KTorrent Plasmoid")
|
|
|
|
+# backward compatibility to <= KDE 4.1
|
|
+MACRO_ENSURE_VERSION( "4.1.83" ${KDE_VERSION} KDE_VERSION_OK)
|
|
+if(NOT KDE_VERSION_OK)
|
|
+ macro_optional_find_package(Plasma)
|
|
+ macro_log_feature(PLASMA_FOUND "Plasma" "Plasma libraries and header files" "http://plasma.kde.org/" FALSE "" "Plasma is needed for KTorrent Plasmoid")
|
|
+else(NOT KDE_VERSION_OK)
|
|
+ set(PLASMA_FOUND true)
|
|
+ set(PLASMA_LIBS ${KDE4_PLASMA_LIBS})
|
|
+endif(NOT KDE_VERSION_OK)
|
|
+
|
|
# set some default settings
|
|
include(KDE4Defaults)
|
|
|
|
--- plasma/applet/CMakeLists.txt (Revision 912562)
|
|
+++ plasma/applet/CMakeLists.txt (Revision 912562)
|
|
@@ -1,10 +1,20 @@
|
|
-set(ktapplet_SRCS applet.cpp chunkbar.cpp)
|
|
-
|
|
-
|
|
-kde4_add_ui_files(ktapplet_SRCS appletconfig.ui)
|
|
+set(TASKMANAGER_FOUND FALSE)
|
|
+FIND_PATH(TASKMANAGER_INCLUDE_DIR NAMES taskmanager.h PATHS ${KDE4_INCLUDE_DIR}/taskmanager ${INCLUDE_INSTALL_DIR}/taskmanager.h)
|
|
+FIND_LIBRARY(TASKMANAGER_LIBRARY NAMES taskmanager PATHS ${KDE4_LIB_DIR} ${LIB_INSTALL_DIR})
|
|
|
|
-kde4_add_plugin(plasma_applet_ktorrent ${ktapplet_SRCS})
|
|
-target_link_libraries(plasma_applet_ktorrent ${PLASMA_LIBS} ${KDE4_KIO_LIBS} taskmanager btcore ktcore)
|
|
+if(TASKMANAGER_INCLUDE_DIR AND TASKMANAGER_LIBRARY)
|
|
+ set(TASKMANAGER_FOUND TRUE)
|
|
+ message(STATUS "Found libtaskmanager: ${TASKMANAGER_LIBRARY} ")
|
|
+ include_directories(${TASKMANAGER_INCLUDE_DIR})
|
|
+ set(ktapplet_SRCS applet.cpp chunkbar.cpp)
|
|
+
|
|
+ kde4_add_ui_files(ktapplet_SRCS appletconfig.ui)
|
|
+
|
|
+ kde4_add_plugin(plasma_applet_ktorrent ${ktapplet_SRCS})
|
|
+ target_link_libraries(plasma_applet_ktorrent ${PLASMA_LIBS} ${KDE4_KIO_LIBS} ${TASKMANAGER_LIBRARY} btcore ktcore)
|
|
+
|
|
+ install(TARGETS plasma_applet_ktorrent DESTINATION ${PLUGIN_INSTALL_DIR})
|
|
+ install(FILES plasma-applet-ktorrent.desktop DESTINATION ${SERVICES_INSTALL_DIR})
|
|
+endif(TASKMANAGER_INCLUDE_DIR AND TASKMANAGER_LIBRARY)
|
|
|
|
-install(TARGETS plasma_applet_ktorrent DESTINATION ${PLUGIN_INSTALL_DIR})
|
|
-install(FILES plasma-applet-ktorrent.desktop DESTINATION ${SERVICES_INSTALL_DIR})
|
|
+macro_log_feature(TASKMANAGER_FOUND "libtaskmanager" "libtaskmanager library and header files" "http://www.kde.org/" FALSE "" "libtaskmanager is needed for KTorrent Plasmoid")
|
|
\ No newline at end of file
|