summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <[email protected]>2017-10-09 19:29:36 +0200
committerFriedrich W. H. Kossebau <[email protected]>2017-10-09 19:29:36 +0200
commit00dde6f27efc3d1394c0057f0e1777b92a1617bd (patch)
tree4ab8f0e03714fa70646079b4518408ecffb009e4
parent7328bc1ab55f102af42a13379b16df648d3fdb6e (diff)
Clean-up CMakeLists.txt files
-rw-r--r--CMakeLists.txt63
-rw-r--r--doc/CMakeLists.txt5
-rw-r--r--interfaces/CMakeLists.txt11
-rw-r--r--komparenavtreepart/CMakeLists.txt16
-rw-r--r--komparepart/CMakeLists.txt70
-rw-r--r--libdialogpages/CMakeLists.txt14
-rw-r--r--pics/CMakeLists.txt17
7 files changed, 58 insertions, 138 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 66495f6..6783e32 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,13 +1,12 @@
cmake_minimum_required(VERSION 2.8.12)
-project(kompare)
-# search packages used by KDE
-include(FeatureSummary)
-find_package(Qt5 REQUIRED COMPONENTS Core PrintSupport Widgets)
+project(kompare)
-find_package(ECM 0.0.9 NO_MODULE REQUIRED)
+set(ECM_MIN_VERSION "5.25.0")
+find_package(ECM ${ECM_MIN_VERSION} NO_MODULE REQUIRED)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
+include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)
@@ -15,7 +14,15 @@ include(ECMInstallIcons)
include(GenerateExportHeader)
include(ECMAddAppIcon)
-find_package(KF5 REQUIRED COMPONENTS
+set(QT_MIN_VERSION "5.5.0")
+find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS
+ Core
+ PrintSupport
+ Widgets
+)
+
+set(KF5_MIN_VERSION "5.25.0")
+find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
CoreAddons
Codecs
DocTools
@@ -27,8 +34,11 @@ find_package(KF5 REQUIRED COMPONENTS
WidgetsAddons
)
-find_package(LibKompareDiff2 5.1 REQUIRED)
-include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
+find_package(LibKompareDiff2 5.1 CONFIG)
+set_package_properties(LibKompareDiff2 PROPERTIES
+ TYPE REQUIRED
+)
+
set(KOMPARE_LIB_VERSION 5)
set(KOMPARE_LIB_SOVERSION 5)
@@ -40,23 +50,19 @@ add_subdirectory( komparenavtreepart )
add_subdirectory( komparepart )
add_subdirectory( pics )
-include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/komparepart
- ${CMAKE_CURRENT_SOURCE_DIR}/libdialogpages
- ${CMAKE_CURRENT_SOURCE_DIR}/interfaces
- ${CMAKE_CURRENT_SOURCE_DIR}/komparenavtreepart
- ${CMAKE_CURRENT_SOURCE_DIR}/komparepart)
-
-
-########### next target ###############
-
set(kompare_SRCS
-main.cpp
-kompare_shell.cpp
-kompareurldialog.cpp
+ main.cpp
+ kompare_shell.cpp
+ kompareurldialog.cpp
)
-file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/pics/*-apps-kompare.png")
-ecm_add_app_icon(kompare_SRCS ICONS ${ICONS_SRCS})
+ecm_add_app_icon(kompare_SRCS ICONS
+ pics/16-apps-kompare.png
+ pics/22-apps-kompare.png
+ pics/32-apps-kompare.png
+ pics/48-apps-kompare.png
+ pics/128-apps-kompare.png
+)
add_executable(kompare ${kompare_SRCS})
@@ -69,14 +75,11 @@ target_link_libraries(kompare
Qt5::Widgets
)
-install(TARGETS kompare ${INSTALL_TARGETS_DEFAULT_ARGS} )
-
+install(TARGETS kompare ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
-########### install files ###############
+install(PROGRAMS org.kde.kompare.desktop DESTINATION ${KDE_INSTALL_APPDIR})
+install(FILES org.kde.kompare.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
+install(FILES kompareui.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/kompare)
+install(FILES komparenavigationpart.desktop kompareviewpart.desktop DESTINATION ${KDE_INSTALL_KSERVICETYPES5DIR})
-install( PROGRAMS org.kde.kompare.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
-install( FILES kompareui.rc DESTINATION ${KXMLGUI_INSTALL_DIR}/kompare )
-install( FILES komparenavigationpart.desktop kompareviewpart.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR} )
-install( FILES org.kde.kompare.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR} )
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
-
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index e0bd26c..83f1b08 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -1,4 +1 @@
-########### install files ###############
-#
-#
-kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR kompare)
+kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${KDE_INSTALL_DOCBUNDLEDIR}/en SUBDIR kompare)
diff --git a/interfaces/CMakeLists.txt b/interfaces/CMakeLists.txt
index 7da386a..40a56f0 100644
--- a/interfaces/CMakeLists.txt
+++ b/interfaces/CMakeLists.txt
@@ -1,21 +1,18 @@
add_definitions(-DTRANSLATION_DOMAIN=\"kompare\")
-
-########### next target ###############
-
set(kompareinterface_LIB_SRCS kompareinterface.cpp )
-
add_library(kompareinterface SHARED ${kompareinterface_LIB_SRCS})
generate_export_header(kompareinterface BASE_NAME KOMPAREINTERFACE)
target_link_libraries(kompareinterface
- Qt5::Core
+ PUBLIC
+ Qt5::Core
)
set_target_properties(kompareinterface PROPERTIES VERSION ${KOMPARE_LIB_VERSION} SOVERSION ${KOMPARE_LIB_SOVERSION} )
-install(TARGETS kompareinterface ${INSTALL_TARGETS_DEFAULT_ARGS} )
-install(FILES kompareinterface.h DESTINATION ${INCLUDE_INSTALL_DIR}/kompare COMPONENT Devel )
+install(TARGETS kompareinterface ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
+install(FILES kompareinterface.h DESTINATION ${KDE_INSTALL_INCLUDEDIR}/kompare COMPONENT Devel)
diff --git a/komparenavtreepart/CMakeLists.txt b/komparenavtreepart/CMakeLists.txt
index a8296ca..179ea4a 100644
--- a/komparenavtreepart/CMakeLists.txt
+++ b/komparenavtreepart/CMakeLists.txt
@@ -1,17 +1,9 @@
add_definitions(-DTRANSLATION_DOMAIN=\"kompare\")
-include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../komparepart)
-
-
-########### next target ###############
-
set(komparenavtreepart_PART_SRCS komparenavtreepart.cpp )
-
add_library(komparenavtreepart MODULE ${komparenavtreepart_PART_SRCS})
-
-
target_link_libraries(komparenavtreepart
Qt5::Widgets
KF5::Parts
@@ -19,10 +11,6 @@ target_link_libraries(komparenavtreepart
KompareDiff2
)
-install(TARGETS komparenavtreepart DESTINATION ${PLUGIN_INSTALL_DIR} )
-
-
-########### install files ###############
-
-install( FILES komparenavtreepart.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+install(TARGETS komparenavtreepart DESTINATION ${KDE_INSTALL_PLUGINDIR})
+install(FILES komparenavtreepart.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
diff --git a/komparepart/CMakeLists.txt b/komparepart/CMakeLists.txt
index 46acb76..498bcec 100644
--- a/komparepart/CMakeLists.txt
+++ b/komparepart/CMakeLists.txt
@@ -1,10 +1,5 @@
add_definitions(-DTRANSLATION_DOMAIN=\"kompare\")
-include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../libdialogpages ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces )
-
-
-########### next target ###############
-
set( komparepart_PART_SRCS
kompare_part.cpp
kompareconnectwidget.cpp
@@ -15,13 +10,10 @@ set( komparepart_PART_SRCS
komparesaveoptionswidget.cpp
kompareview.cpp )
-
ki18n_wrap_ui(komparepart_PART_SRCS komparesaveoptionsbase.ui )
add_library(komparepart MODULE ${komparepart_PART_SRCS})
-
-
target_link_libraries(komparepart
komparedialogpages
kompareinterface
@@ -32,63 +24,7 @@ target_link_libraries(komparepart
Qt5::PrintSupport
)
-install(TARGETS komparepart DESTINATION ${PLUGIN_INSTALL_DIR} )
-
-
-########### install files ###############
-
-install( FILES komparepart.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
-install( FILES komparepartui.rc DESTINATION ${KXMLGUI_INSTALL_DIR}/komparepart )
-
-
-
-
-#original Makefile.am contents follow:
+install(TARGETS komparepart DESTINATION ${KDE_INSTALL_PLUGINDIR})
-##########################################################################
-## KPART SECTION
-##########################################################################
-#
-#INCLUDES = \
-# -I$(top_srcdir)/kompare/libdialogpages \
-# -I$(top_srcdir)/kompare/interfaces \
-# $(all_includes)
-#
-#noinst_HEADERS = \
-# kompare_part.h \
-# komparesplitter.h \
-# kompareprefdlg.h \
-# komparelistview.h \
-# kompareconnectwidget.h \
-# komparesaveoptionsbase.h \
-# komparesaveoptionswidget.h \
-# kompare_qsplitter.h
-#
-## let automoc handle all of the meta source files (moc)
-#METASOURCES = AUTO
-#
-#kde_module_LTLIBRARIES = libkomparepart.la
-#
-## the Part's source, library search path, and link libraries
-#libkomparepart_la_SOURCES = \
-# kompare_part.cpp \
-# kompareconnectwidget.cpp \
-# komparesplitter.cpp \
-# komparelistview.cpp \
-# kompareprefdlg.cpp \
-# komparesaveoptionsbase.ui \
-# komparesaveoptionswidget.cpp
-#
-#libkomparepart_la_LDFLAGS = $(KDE_PLUGIN) $(all_libraries)
-#libkomparepart_la_LIBADD = $(LIB_KPARTS) $(LIB_KFILE) \
-# ../libdialogpages/libdialogpages.la \
-# ../interfaces/libkompareinterface.la
-#
-## this is where the desktop file will go
-#partdesktopdir = $(kde_servicesdir)
-#partdesktop_DATA = komparepart.desktop
-#
-## this is where the part's XML-GUI resource file goes
-#partrcdir = $(kde_datadir)/kompare
-#partrc_DATA = komparepartui.rc
-#
+install(FILES komparepart.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
+install(FILES komparepartui.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/komparepart)
diff --git a/libdialogpages/CMakeLists.txt b/libdialogpages/CMakeLists.txt
index f986aa1..15910a1 100644
--- a/libdialogpages/CMakeLists.txt
+++ b/libdialogpages/CMakeLists.txt
@@ -1,7 +1,5 @@
add_definitions(-DTRANSLATION_DOMAIN=\"kompare\")
-########### next target ###############
-
set(dialogpages_PART_SRCS
filessettings.cpp
viewsettings.cpp
@@ -9,20 +7,20 @@ set(dialogpages_PART_SRCS
filespage.cpp
viewpage.cpp )
-
add_library(komparedialogpages SHARED ${dialogpages_PART_SRCS})
generate_export_header(komparedialogpages BASE_NAME DIALOGPAGES)
target_link_libraries(komparedialogpages
- KompareDiff2
- KF5::Codecs
- KF5::Parts
- KF5::WidgetsAddons
+ PUBLIC
+ KompareDiff2
+ KF5::Codecs
+ KF5::Parts
+ KF5::WidgetsAddons
)
set_target_properties(komparedialogpages PROPERTIES VERSION ${KOMPARE_LIB_VERSION}
SOVERSION ${KOMPARE_LIB_SOVERSION} )
-install(TARGETS komparedialogpages ${INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)
+install(TARGETS komparedialogpages ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)
diff --git a/pics/CMakeLists.txt b/pics/CMakeLists.txt
index 8eb989d..4ef9bc1 100644
--- a/pics/CMakeLists.txt
+++ b/pics/CMakeLists.txt
@@ -1,11 +1,12 @@
-ecm_install_icons(ICONS
- 16-apps-kompare.png
- 22-apps-kompare.png
- 32-apps-kompare.png
- 48-apps-kompare.png
- 128-apps-kompare.png
- sc-apps-kompare.svgz
- DESTINATION ${ICON_INSTALL_DIR}
+ecm_install_icons(
+ ICONS
+ 16-apps-kompare.png
+ 22-apps-kompare.png
+ 32-apps-kompare.png
+ 48-apps-kompare.png
+ 128-apps-kompare.png
+ sc-apps-kompare.svgz
+ DESTINATION ${KDE_INSTALL_ICONDIR}
THEME hicolor
)