This repository has been archived by the owner on Feb 19, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 81
/
CMakeLists.txt
182 lines (128 loc) · 6.44 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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
#
# Copyright (c) 2010-2019, Gilles Caulier, <caulier dot gilles at gmail dot com>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
project(digikam-software-collection)
message(STATUS "----------------------------------------------------------------------------------")
message(STATUS "Starting CMake configuration for: ${PROJECT_NAME}")
set(CMAKE_MIN_VERSION "3.0.0")
set(ECM_MIN_VERSION "1.5.0")
cmake_minimum_required(VERSION ${CMAKE_MIN_VERSION})
############## ECM setup #################################################################################################################
find_package(ECM ${ECM_MIN_VERSION} CONFIG REQUIRED)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
include(ECMSetupVersion)
include(ECMMarkNonGuiExecutable)
include(ECMOptionalAddSubdirectory)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDEFrameworkCompilerSettings)
include(CMakePackageConfigHelpers)
include(GenerateExportHeader)
include(FeatureSummary)
# COMPILATION OPTIONS MANAGEMENT ###########################################################################################################
# doc and translations options
option(DIGIKAMSC_CHECKOUT_PO "Checkout application translations files from git repositories (default=OFF)" OFF)
option(DIGIKAMSC_CHECKOUT_DOC "Checkout documentation translations files from git repositories (default=OFF)" OFF)
option(DIGIKAMSC_COMPILE_PO "Build translations files (default=ON)" ON)
option(DIGIKAMSC_COMPILE_DOC "Build handbook files (default=ON)" ON)
option(DIGIKAMSC_COMPILE_DIGIKAM "Build digiKam core (default=ON)" ON)
###########################################################################################################################################
if(DIGIKAMSC_CHECKOUT_PO OR DIGIKAMSC_CHECKOUT_DOC)
find_package(Ruby)
find_package(Subversion)
if(RUBY_EXECUTABLE AND Subversion_FOUND)
if(DIGIKAMSC_CHECKOUT_PO)
message(STATUS "Extract application translation files from git repositories. Please wait, it can take a while...")
execute_process(COMMAND ${RUBY_EXECUTABLE} "${CMAKE_SOURCE_DIR}/project/release/fetch_l10n_po.rb"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
message(STATUS "Application translation files extraction done.")
endif()
if(DIGIKAMSC_CHECKOUT_DOC)
message(STATUS "Extract documentation translation files from git repositories. Please wait, it can take a while...")
message(STATUS "NOTE: (u) want mean uncomplete translations files, which will be removed from compilation.")
execute_process(COMMAND ${RUBY_EXECUTABLE} "${CMAKE_SOURCE_DIR}/project/release/fetch_l10n_doc.rb"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
message(STATUS "Documentation translation files extraction done.")
endif()
else()
message(STATUS "Could not find Ruby or Subversion to extract translation files")
endif()
endif()
if(DIGIKAMSC_COMPILE_PO AND NOT EXISTS ${CMAKE_SOURCE_DIR}/po/)
message(STATUS "Application translations directory is missing. Compilation of application translations is disabled...")
if(NOT DIGIKAMSC_CHECKOUT_PO)
message(STATUS "You can use DIGIKAMSC_CHECKOUT_PO option to extract GUI i18n files from git repositories.")
endif()
set(DIGIKAMSC_COMPILE_PO OFF)
endif()
if(DIGIKAMSC_COMPILE_DOC AND NOT EXISTS ${CMAKE_SOURCE_DIR}/doc/)
message(STATUS "Main one documentation directory is missing. Compilation of documentation is disabled...")
set(DIGIKAMSC_COMPILE_DOC OFF)
endif()
if(NOT EXISTS ${CMAKE_SOURCE_DIR}/doc-translated/)
message(STATUS "Documentation translations directory is missing.")
message(STATUS "You can use DIGIKAMSC_CHECKOUT_DOC option to extract doc i18n files from git repositories.")
endif()
if(DIGIKAMSC_COMPILE_PO OR DIGIKAMSC_COMPILE_DOC)
set_property(GLOBAL PROPERTY ALLOW_DUPLICATE_CUSTOM_TARGETS 1)
endif()
if(BUILD_TESTING)
include(CTest)
endif()
############################################################################################################################################
message(STATUS "----------------------------------------------------------------------------------")
message(STATUS "Compilation configuration for: ${PROJECT_NAME}")
if(DIGIKAMSC_COMPILE_DIGIKAM)
if(NOT EXISTS ${CMAKE_SOURCE_DIR}/core)
message(STATUS "digiKam core will be compiled.................. NO (source code not available)")
set (DIGIKAMSC_COMPILE_DIGIKAM OFF)
else()
message(STATUS "digiKam core will be compiled.................. YES")
endif()
else()
message(STATUS "digiKam core will be compiled.................. NO")
endif()
if(DIGIKAMSC_CHECKOUT_PO)
message(STATUS "Extract application translations files......... YES")
else()
message(STATUS "Extract application translations files......... NO")
endif()
if(DIGIKAMSC_CHECKOUT_DOC)
message(STATUS "Extract documentation translations files....... YES")
else()
message(STATUS "Extract documentation translations files....... NO")
endif()
if(DIGIKAMSC_COMPILE_PO)
message(STATUS "Translations will be compiled.................. YES")
else()
message(STATUS "Translations will be compiled.................. NO")
endif()
if(DIGIKAMSC_COMPILE_DOC)
message(STATUS "Handbooks will be compiled..................... YES")
else()
message(STATUS "Handbooks will be compiled..................... NO")
endif()
if(BUILD_TESTING)
message(STATUS "Tests code will be compiled.................... YES")
else()
message(STATUS "Tests code will be compiled.................... NO")
endif()
#############################################################################################
if(DIGIKAMSC_COMPILE_DIGIKAM)
add_subdirectory(core)
endif()
if(DIGIKAMSC_COMPILE_PO OR DIGIKAMSC_COMPILE_DOC)
find_package(Gettext REQUIRED)
endif()
if(DIGIKAMSC_COMPILE_PO)
add_subdirectory(po)
endif()
if(DIGIKAMSC_COMPILE_DOC)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS DocTools)
ECM_OPTIONAL_ADD_SUBDIRECTORY(doc)
ECM_OPTIONAL_ADD_SUBDIRECTORY(doc-translated)
endif()