-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
122 lines (94 loc) · 3.61 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
cmake_minimum_required(VERSION 3.0)
project(knoda5)
set(PACKAGE_VERSION 0.12.1r1)
set(LIB_MODULE_NAME hk_kde5classes)
set(QT_MIN_VERSION "5.3.0")
set(KF5_MIN_VERSION "5.2.0")
find_package(LibXml2 REQUIRED)
find_package(ECM 1.0.0 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
# qmake-qt5 is a must for KDEInstallDirs to set up directories correctly
find_program(QMAKEQT5 qmake-qt5)
if(QMAKEQT5)
message(STATUS "Found qmake-qt5: " ${QMAKEQT5})
else()
message(FATAL_ERROR "Not found qmake-qt5")
endif()
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(FeatureSummary)
include(ECMInstallIcons)
include(ECMAddAppIcon)
# Find Qt modules
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
Core # QCommandLineParser, QStringLiteral
Widgets # QApplication
)
# Find KDE modules
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
CoreAddons # KAboutData
I18n # KLocalizedString
WidgetsAddons # KMessageBox
KDELibs4Support # Porting from KDE4
DocTools # Handbook
ConfigWidgets # Help invokation
TextEditor # Text Editor part
Parts # KParts
)
# execute the command "qmake -query QT_INSTALL_PLUGINS" to get the path of plugins dir.
execute_process(COMMAND ${QMAKEQT5} -query QT_INSTALL_PLUGINS OUTPUT_VARIABLE QT_PLUGINS_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
if(QT_PLUGINS_DIR)
message(STATUS "Qt5 plugin directory:" "${QT_PLUGINS_DIR}")
else()
message(FATAL_ERROR "Qt5 plugin directory cannot be detected.")
endif()
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
# STL needed for hk_string and assignments to/from QString
remove_definitions(-DQT_NO_STL)
add_definitions(-DHAVE_CONFIG_H)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()
if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
add_definitions(-D_DEBUG_ )
endif()
# defines update_xdg_mimetypes macro to update mimetypes after install
include(FindSharedMimeInfo)
include_directories(${LIBXML2_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/hk_kdeclasses
${CMAKE_CURRENT_BINARY_DIR})
find_path(HK_CLASSES_INCLUDE "hk_class.h" PATHS "/usr/include/hk_classes" )
if(HK_CLASSES_INCLUDE)
message(STATUS "Found hk_classes include directory: " ${HK_CLASSES_INCLUDE})
include_directories(${HK_CLASSES_INCLUDE})
else()
message(FATAL_ERROR "hk_classes include path not found !")
endif()
find_library(HK_CLASSES_LIB NAMES hk_classes libhk_classes PATHS "/usr/lib/hk_classes" "/usr/lib64/hk_classes" )
if(HK_CLASSES_LIB)
message(STATUS "Found hk_classes library: " ${HK_CLASSES_LIB})
else()
message(FATAL_ERROR "hk_classes library not found !")
endif()
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/lib64)
else()
set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/lib)
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
add_subdirectory(admin)
add_subdirectory(hk_kdeclasses)
add_subdirectory(hk_kdedbdesigner)
add_subdirectory(hk_kdeformpart)
add_subdirectory(hk_kdegridpart)
add_subdirectory(hk_kdemodulepart)
add_subdirectory(hk_kdeqbepart)
add_subdirectory(hk_kdequerypart)
add_subdirectory(hk_kdereportpart)
add_subdirectory(hk_kdetablepart)
add_subdirectory(knoda)
message( STATUS "Configuration is " ${CMAKE_BUILD_TYPE} )
message( STATUS "Install prefix is " ${CMAKE_INSTALL_PREFIX} )
message( STATUS "Architecture is " ${CMAKE_SYSTEM_PROCESSOR})