CMakeLists.txt 3.58 KB
Newer Older
1
project(KHelpCenter)
2
set(PROJECT_VERSION "5.7.3")
3
4

cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
Eike Hein's avatar
Eike Hein committed
5
set(QT_MIN_VERSION "5.4.0")
6

7
8
set(KF5_MIN_VERSION "5.20.0")
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
9
10
11
12
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})

include(KDEInstallDirs)
include(KDECMakeSettings)
13
include(KDECompilerSettings NO_POLICY_SCOPE)
14
15
16
include(ECMInstallIcons)
include(ECMMarkAsTest)
include(ECMMarkNonGuiExecutable)
17
include(ECMOptionalAddSubdirectory)
18
19
20
21
22
include(FeatureSummary)
include(CheckIncludeFiles)

find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
    DBus
23
24
    Widgets
    Xml
25
26
)

27
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
28
    Archive
Pino Toscano's avatar
Pino Toscano committed
29
    Bookmarks
30
    Config
31
32
    CoreAddons
    DBusAddons
33
    DocTools
34
    I18n
35
    Init
36
37
    KHtml
    Service
38
    WindowSystem
39
40
)

41
42
43
44
45
46
find_package(Grantlee5 REQUIRED)
set_package_properties(Grantlee5 PROPERTIES
    DESCRIPTION "Support for HTML templates"
    URL "http://grantlee.org/"
    TYPE REQUIRED)

47
48
49
50
51
52
53
54
55
56
57
58
find_package(Xapian REQUIRED)
set_package_properties(Xapian PROPERTIES
    DESCRIPTION "Support for text indexing and searching"
    URL "https://xapian.org/"
    TYPE REQUIRED)

find_package(LibXml2 REQUIRED)
set_package_properties(LibXml2 PROPERTIES
    DESCRIPTION "Support for extracting text from HTML documents"
    URL "http://www.xmlsoft.org/"
    TYPE REQUIRED)

59
60
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)

61
62
63
add_subdirectory( plugins )
add_subdirectory( searchhandlers )
add_subdirectory( tests )
64
add_subdirectory( doc )
65
add_subdirectory( templates )
66

67
68
########### next target ###############

Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
69
set(khelpcenter_KDEINIT_SRCS
70
   khc_debug.cpp
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
71
72
   navigator.cpp
   navigatoritem.cpp
73
   navigatorappitem.cpp
74
   navigatorappgroupitem.cpp
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
75
76
77
78
79
   view.cpp
   searchwidget.cpp
   searchengine.cpp
   docmetainfo.cpp
   docentrytraverser.cpp
80
   grantleeformatter.cpp
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
81
82
83
84
85
86
87
88
89
90
91
   glossary.cpp
   toc.cpp
   mainwindow.cpp
   docentry.cpp
   history.cpp
   application.cpp
   treebuilder.cpp
   infotree.cpp
   fontdialog.cpp
   plugintraverser.cpp
   scrollkeepertreebuilder.cpp
Pino Toscano's avatar
Pino Toscano committed
92
   bookmarkowner.cpp
93
94
   searchhandler.cpp )

95
96
kconfig_add_kcfg_files(khelpcenter_KDEINIT_SRCS prefs.kcfgc )
# kf5_add_app_icon(khelpcenter_KDEINIT_SRCS "${KDE4_INSTALL_DIR}/share/icons/oxygen/*/apps/help-browser.png")
97

98
kf5_add_kdeinit_executable( khelpcenter ${khelpcenter_KDEINIT_SRCS})
99
target_compile_definitions(kdeinit_khelpcenter PRIVATE -DPROJECT_VERSION="${PROJECT_VERSION}")
Pino Toscano's avatar
Pino Toscano committed
100
target_link_libraries(kdeinit_khelpcenter KF5::KHtml KF5::Service KF5::DBusAddons KF5::ConfigGui KF5::WindowSystem KF5::Bookmarks Qt5::Xml Grantlee5::Templates)
101
102
if (${KF5_VERSION} VERSION_GREATER 5.35.0)
    # practically means >=5.36
103
104
    target_link_libraries(kdeinit_khelpcenter KF5::DocTools)
endif()
Ralf Habacker's avatar
Ralf Habacker committed
105
106
install(TARGETS kdeinit_khelpcenter  ${INSTALL_TARGETS_DEFAULT_ARGS} )
install(TARGETS khelpcenter ${INSTALL_TARGETS_DEFAULT_ARGS})
107
108
109

########### install files ###############

110
install( PROGRAMS org.kde.Help.desktop  DESTINATION  ${XDG_APPS_INSTALL_DIR} )
111
112
install( FILES khelpcenter.kcfg  DESTINATION  ${KCFG_INSTALL_DIR} )
install( FILES khelpcenter.desktop  DESTINATION  ${SERVICES_INSTALL_DIR} )
113
install( FILES khelpcenter.desktop  DESTINATION  ${SHARE_INSTALL_PREFIX}/kde4/services )
114
install( FILES table-of-contents.xslt glossary.xslt DESTINATION ${DATA_INSTALL_DIR}/khelpcenter )
115
install( FILES khelpcenterui.rc DESTINATION ${KXMLGUI_INSTALL_DIR}/khelpcenter )
116
install( FILES khelpcenter.categories DESTINATION ${KDE_INSTALL_CONFDIR} )
117
install( FILES org.kde.Help.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR} )
118
119

feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)