forked from KDE/krusader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
163 lines (121 loc) · 4.31 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
cmake_minimum_required(VERSION 3.16)
project(krusader)
set(VERSION "2.9.0-dev")
set(RELEASE_NAME "Bleeding Edge")
set(MIN_QT_VERSION 5.12)
set(MIN_KF_VERSION 5.68)
# ===== Packages =====
find_package(ECM ${MIN_KF_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
set(KDE_COMPILERSETTINGS_LEVEL "5.68")
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(ECMInstallIcons)
include(ECMAddAppIcon)
include(FeatureSummary)
include(CheckIncludeFiles)
find_package(Qt5 ${MIN_QT_VERSION} CONFIG REQUIRED
Concurrent
Core
Gui
DBus
Widgets
PrintSupport
Xml
)
find_package(KF5 ${MIN_KF_VERSION} REQUIRED COMPONENTS
Archive
Bookmarks
Codecs
Completion
CoreAddons
Config
DocTools
I18n
IconThemes
ItemViews
KIO
Notifications
Parts
Solid
TextWidgets
Wallet
WidgetsAddons
WindowSystem
XmlGui
GuiAddons
)
# ===== Get GIT revision =====
execute_process(COMMAND git log --pretty=format:%h -n 1
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_REVISION
ERROR_QUIET)
# ===== Definitions =====
# Synchronizer is enabled by default, unless disabled from the command line (-DENABLE_SYNCHRONIZER=OFF)
option(ENABLE_SYNCHRONIZER "Enable Synchronizer" ON)
# If an old setting is being used, use the setting that complies with the structure of other Krusader settings.
if(ENABLE_SYNCHRONIZER)
set(SYNCHRONIZER_ENABLED TRUE)
add_definitions(-DSYNCHRONIZER_ENABLED)
else()
set(SYNCHRONIZER_ENABLED FALSE)
endif()
# For security reasons, absolute kdesu path is set at build time and is not configurable.
if(NOT KDESU_PATH)
if(EXISTS "${KDE_INSTALL_FULL_LIBDIR}/kf5/kdesu")
# Used by Arch distribution
set(KDESU_PATH "${KDE_INSTALL_FULL_LIBDIR}/kf5/kdesu")
else()
set(KDESU_PATH "${KDE_INSTALL_FULL_LIBEXECDIR_KF5}/kdesu")
endif()
endif()
add_definitions(-DKDESU_PATH="${KDESU_PATH}")
message(STATUS "kdesu path has been hard-coded: ${KDESU_PATH}")
add_definitions(${QT_DEFINITIONS} ${KF5_DEFINITIONS})
add_definitions(-DKRARC_ENABLED)
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
# Enable Krarc query, since MIN_KF_VERSION >= 5.23
add_definitions(-DKRARC_QUERY_ENABLED)
# ===== Additional checks =====
if (NOT CMAKE_INSTALL_PREFIX MATCHES "^/usr(/local)?/?$" AND NOT DEFINED KDE_INSTALL_QTPLUGINDIR
AND NOT DEFINED KDE_INSTALL_USE_QT_SYS_PATHS)
message(WARNING "CMAKE_INSTALL_PREFIX is not set to a standard location (/usr or /usr/local), \
krarc:/ protocol may not work. To force installing plugins into standard location \
use -DKDE_INSTALL_USE_QT_SYS_PATHS=true")
endif()
# ===== ACL support =====
check_include_files(attr/libattr.h HAVE_ATTR_LIBATTR_H)
check_include_files(sys/xattr.h HAVE_SYS_XATTR_H)
check_include_files(sys/acl.h HAVE_SYS_ACL_H)
check_include_files(acl/libacl.h HAVE_ACL_LIBACL_H)
if (HAVE_ATTR_LIBATTR_H AND HAVE_SYS_XATTR_H AND HAVE_SYS_ACL_H AND HAVE_ACL_LIBACL_H)
set(ACL_HEADERS_FOUND TRUE)
endif(HAVE_ATTR_LIBATTR_H AND HAVE_SYS_XATTR_H AND HAVE_SYS_ACL_H AND HAVE_ACL_LIBACL_H)
if (ACL_HEADERS_FOUND)
find_library(ACL_LIBS NAMES acl)
find_library(ATTR_LIBS NAMES attr)
endif(ACL_HEADERS_FOUND)
if (ACL_HEADERS_FOUND AND ACL_LIBS AND ATTR_LIBS)
set(ACL_FOUND TRUE)
set(ACL_LIBS ${ACL_LIBS} ${ATTR_LIBS})
message(STATUS "Found ACL support: ${ACL_LIBS}")
add_definitions(-DHAVE_POSIX_ACL)
endif(ACL_HEADERS_FOUND AND ACL_LIBS AND ATTR_LIBS)
# ===== Compile options =====
if (CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -fno-common -ansi -Wpedantic -Wconversion -Wpointer-arith \
-Wcast-qual -Wcast-align -Wwrite-strings -Wsuggest-override -Wfloat-equal \
-Woverloaded-virtual -Wundef -Wlogical-op -Wuninitialized -Wredundant-decls -Wnoexcept \
-Wnon-virtual-dtor -Wctor-dtor-privacy -Wzero-as-null-pointer-constant" CACHE STRING "" FORCE)
endif()
# ===== Subdirectories =====
add_subdirectory(app)
add_subdirectory(doc/handbook)
add_subdirectory(plugins/iso)
add_subdirectory(plugins/krarc)
# ===== Translations =====
ki18n_install(po)
kdoctools_install(po)
# ===== Output configuration =====
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)