summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHrvoje Senjan <[email protected]>2014-10-27 11:45:18 +0100
committerHrvoje Senjan <[email protected]>2014-10-27 11:45:18 +0100
commit010ca9359c20606e98d6c507f0b135cf4fc6c88e (patch)
treedc1bc13960b70bea074f77e6d1489e206c96ecbf
parent19adf93398ed5028638fe733fd4b93c7866b40be (diff)
Initial port to Frameworks
KDcraw still needs some fixing to be usable to the outside world
-rw-r--r--CMakeLists.txt48
-rw-r--r--ps/CMakeLists.txt4
-rw-r--r--ps/gscreator.cpp3
-rw-r--r--raw/CMakeLists.txt8
-rw-r--r--raw/rawcreator.cpp6
5 files changed, 42 insertions, 27 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 47bd2fb..c65fb3a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,23 +1,43 @@
project(kdegraphics-thumbnailers)
-find_package(KDE4 REQUIRED)
-include(KDE4Defaults)
-include(MacroLibrary)
-include(MacroOptionalAddSubdirectory)
+cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
+set(QT_MIN_VERSION "5.2.0")
-add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS} -DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
-include_directories(${KDE4_INCLUDES})
+find_package(ECM 1.0.0 REQUIRED NO_MODULE)
+set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
-macro_optional_find_package(Kexiv2)
-macro_optional_find_package(Kdcraw)
+include(ECMOptionalAddSubdirectory)
+include(KDEInstallDirs)
+include(KDECMakeSettings)
+include(KDECompilerSettings)
+include(FeatureSummary)
-macro_log_feature(KEXIV2_FOUND "libkexiv2" "A library for reading and writing image metadata" "www.kde.org" FALSE "" "Required to build the RAW thumbnailer")
-macro_log_feature(KDCRAW_FOUND "libkdcraw" "A library for accessing raw files" "www.kde.org" FALSE "" "Required to build the RAW thumbnailer")
+find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Gui)
+find_package(KF5 REQUIRED COMPONENTS KIO)
-macro_optional_add_subdirectory(ps)
+add_definitions(${QT_DEFINITIONS} -DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
-if(KEXIV2_FOUND AND KDCRAW_FOUND)
-macro_optional_add_subdirectory(raw)
+find_package(KF5KExiv2)
+set_package_properties("KF5KExiv2" PROPERTIES
+ DESCRIPTION "A library for reading and writing image metadata"
+ URL "www.kde.org"
+ TYPE OPTIONAL
+ PURPOSE "Required to build the RAW thumbnailer"
+)
+
+find_package(KF5KDcraw)
+set_package_properties("KF5KDcraw" PROPERTIES
+ DESCRIPTION "A library for accessing raw files"
+ URL "www.kde.org"
+ TYPE OPTIONAL
+ PURPOSE "Required to build the RAW thumbnailer"
+)
+
+
+ecm_optional_add_subdirectory(ps)
+
+if(KF5KExiv2_FOUND AND KF5KDcraw_FOUND)
+ecm_optional_add_subdirectory(raw)
endif()
-macro_display_feature_log()
+feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
diff --git a/ps/CMakeLists.txt b/ps/CMakeLists.txt
index b6643a3..92ea9c2 100644
--- a/ps/CMakeLists.txt
+++ b/ps/CMakeLists.txt
@@ -3,10 +3,10 @@
set(gsthumbnail_PART_SRCS gscreator.cpp dscparse.cpp dscparse_adapter.cpp)
-kde4_add_plugin(gsthumbnail ${gsthumbnail_PART_SRCS})
+add_library(gsthumbnail MODULE ${gsthumbnail_PART_SRCS})
-target_link_libraries(gsthumbnail ${KDE4_KDECORE_LIBS} ${KDE4_KIO_LIBS} ${QT_QTGUI_LIBRARY} )
+target_link_libraries(gsthumbnail Qt5::Gui KF5::KIOWidgets )
install(TARGETS gsthumbnail DESTINATION ${PLUGIN_INSTALL_DIR} )
diff --git a/ps/gscreator.cpp b/ps/gscreator.cpp
index 2650e30..df2de70 100644
--- a/ps/gscreator.cpp
+++ b/ps/gscreator.cpp
@@ -67,7 +67,6 @@
#include <sys/wait.h>
#include <fcntl.h>
#include <errno.h>
-#include <kdemacros.h>
#include <qcolor.h>
#include <qfile.h>
@@ -82,7 +81,7 @@
extern "C"
{
- KDE_EXPORT ThumbCreator *new_creator()
+ Q_DECL_EXPORT ThumbCreator *new_creator()
{
return new GSCreator;
}
diff --git a/raw/CMakeLists.txt b/raw/CMakeLists.txt
index adce793..f5d18f5 100644
--- a/raw/CMakeLists.txt
+++ b/raw/CMakeLists.txt
@@ -1,16 +1,12 @@
project(rawthumbnail)
-## includes and linking
-include_directories(${KEXIV2_INCLUDE_DIR} ${KDCRAW_INCLUDE_DIR})
-
-
#sources
set(rawthumbnail_SRCS rawcreator.cpp)
-kde4_add_plugin(rawthumbnail ${rawthumbnail_SRCS})
+add_library(rawthumbnail MODULE ${rawthumbnail_SRCS})
## includes and linking
-target_link_libraries(rawthumbnail ${KDE4_KIO_LIBS} ${KDCRAW_LIBRARIES} ${KEXIV2_LIBRARIES} ${QT_QTGUI_LIBRARY} ${KDE4_KDECORE_LIBS})
+target_link_libraries(rawthumbnail Qt5::Gui KF5::KIOWidgets KF5::Kdcraw KF5::Kexiv2)
## install the plugin
install(TARGETS rawthumbnail DESTINATION ${PLUGIN_INSTALL_DIR})
diff --git a/raw/rawcreator.cpp b/raw/rawcreator.cpp
index 48d2749..e3c9ed4 100644
--- a/raw/rawcreator.cpp
+++ b/raw/rawcreator.cpp
@@ -21,12 +21,12 @@
#include <QImage>
-#include <libkdcraw/kdcraw.h>
-#include <libkexiv2/kexiv2.h>
+#include <kdcraw/kdcraw.h>
+#include <kexiv2/kexiv2.h>
extern "C"
{
- KDE_EXPORT ThumbCreator *new_creator()
+ Q_DECL_EXPORT ThumbCreator *new_creator()
{
return new RAWCreator;
}