Clean-up CMakeLists.txt files

parent 7328bc1a
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)
########### 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)
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)
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})
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)
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)
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
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment