CMakeLists.txt 7.34 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1

Laurent Montel's avatar
Laurent Montel committed
2
cmake_minimum_required(VERSION 3.5)
3

4
# KDE Application Version, managed by release script
5
set(RELEASE_SERVICE_VERSION_MAJOR "20")
6
set(RELEASE_SERVICE_VERSION_MINOR "11")
7
8
set(RELEASE_SERVICE_VERSION_MICRO "70")
set(RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
9

10
project(kig VERSION ${RELEASE_SERVICE_VERSION})
11

David Narváez's avatar
David Narváez committed
12
find_package(Qt5Svg REQUIRED)
13
find_package(Qt5PrintSupport REQUIRED)
14
find_package(Qt5XmlPatterns 5.5.1)
15

16
find_package(ECM 1.7 REQUIRED NO_MODULE)
17
18
19
20
21
find_package(KF5Parts REQUIRED)
find_package(KF5DocTools REQUIRED)
find_package(KF5I18n REQUIRED)
find_package(KF5TextEditor REQUIRED)
find_package(KF5IconThemes REQUIRED)
22
find_package(KF5ConfigWidgets REQUIRED)
David Narváez's avatar
David Narváez committed
23
find_package(KF5Archive REQUIRED)
24
find_package(KF5XmlGui 5.1 REQUIRED)
25
find_package(KF5Crash 5.15 REQUIRED)
26
find_package(KF5CoreAddons REQUIRED)
27

28
set(CMAKE_MODULE_PATH ${kig_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH})
29

Jeremy Whiting's avatar
Jeremy Whiting committed
30
set (KDE5_ICON_DIR  ${CMAKE_INSTALL_PREFIX}/share/icons)
31

32
include(ECMAddAppIcon)
33
34
35
include(ECMInstallIcons)
include(ECMAddTests)
include(KDEInstallDirs)
36
include(KDECompilerSettings NO_POLICY_SCOPE)
37
38
include(KDECMakeSettings)
include(FeatureSummary)
39
include(GenerateExportHeader)
40
41
include(ECMSetupVersion)

42
ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX KIG VERSION_HEADER kig_version.h)
43

Laurent Montel's avatar
Laurent Montel committed
44
add_definitions (-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
45
include_directories (${Qt5Gui_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE5_INCLUDES})
46

47

David Narváez's avatar
David Narváez committed
48
49
50
51
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif()

52
include(KigConfigureChecks.cmake)
53

54
55
find_package(BoostPython)

56
add_subdirectory( doc )
57
58
59
60
61
62
add_subdirectory( icons )
add_subdirectory( kig )
add_subdirectory( mimetypes )
add_subdirectory( macros )
add_subdirectory( data )
add_subdirectory( pykig )
63

64
if(BoostPython_FOUND)
65
  add_subdirectory( scripting )
66
  add_definitions(-DKIG_ENABLE_PYTHON_SCRIPTING)
67
endif(BoostPython_FOUND)
68

69
set_package_properties(
70
71
   BoostPython PROPERTIES
   DESCRIPTION "Python scripting support in Boost"
72
   URL "https://www.boost.org/"
73
74
   TYPE OPTIONAL
   PURPOSE "Kig can optionally use Boost.Python for Python scripting"
75
76
)

77
78
79
set_package_properties(
   Qt5XmlPatterns PROPERTIES
   DESCRIPTION "Qt5 XmlPatterns Module"
80
   URL "https://qt.io/"
81
82
   TYPE OPTIONAL
   PURPOSE "Kig uses the XML Patterns module in Qt to support Geogebra files"
83
84
)

85
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
86

Laurent Montel's avatar
Laurent Montel committed
87
include_directories( ${CMAKE_SOURCE_DIR}/modes )
88
89
90
if(BoostPython_FOUND)
  include_directories(${BoostPython_INCLUDE_DIRS})
endif(BoostPython_FOUND)
Laurent Montel's avatar
Laurent Montel committed
91

92
# kigpart
Laurent Montel's avatar
Laurent Montel committed
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
set(kigpart_PART_SRCS
   objects/angle_type.cc
   objects/arc_type.cc
   objects/base_type.cc
   objects/bogus_imp.cc
   objects/centerofcurvature_type.cc
   objects/circle_imp.cc
   objects/circle_type.cc
   objects/common.cc
   objects/conic_imp.cc
   objects/conic_types.cc
   objects/cubic_imp.cc
   objects/cubic_type.cc
   objects/curve_imp.cc
   objects/intersection_types.cc
   objects/inversion_type.cc
   objects/line_imp.cc
   objects/line_type.cc
   objects/locus_imp.cc
   objects/object_calcer.cc
   objects/object_drawer.cc
   objects/object_factory.cc
   objects/object_holder.cc
   objects/object_imp.cc
   objects/object_imp_factory.cc
   objects/object_type.cc
   objects/object_type_factory.cc
   objects/other_imp.cc
   objects/other_type.cc
   objects/point_imp.cc
   objects/point_type.cc
   objects/polygon_imp.cc
   objects/polygon_type.cc
127
128
   objects/bezier_imp.cc
   objects/bezier_type.cc
129
130
131
132
133
134
135
   objects/special_imptypes.cc
   objects/tangent_type.cc
   objects/tests_type.cc
   objects/text_imp.cc
   objects/text_type.cc
   objects/transform_types.cc
   objects/vector_type.cc
Pino Toscano's avatar
Pino Toscano committed
136
137
138
139
140
141
142
143
   misc/argsparser.cpp
   misc/builtin_stuff.cc
   misc/calcpaths.cc
   misc/common.cpp
   misc/conic-common.cpp
   misc/coordinate.cpp
   misc/coordinate_system.cpp
   misc/cubic-common.cc
144
   misc/equationstring.cc
Pino Toscano's avatar
Pino Toscano committed
145
146
   misc/goniometry.cc
   misc/guiaction.cc
147
   misc/kigcoordinateprecisiondialog.cpp
Pino Toscano's avatar
Pino Toscano committed
148
149
150
151
152
153
154
155
156
157
158
159
   misc/kigfiledialog.cc
   misc/kiginputdialog.cc
   misc/kignumerics.cpp
   misc/kigpainter.cpp
   misc/kigtransform.cpp
   misc/lists.cc
   misc/object_constructor.cc
   misc/object_hierarchy.cc
   misc/rect.cc
   misc/screeninfo.cc
   misc/special_constructors.cc
   misc/unit.cc
160
161
162
163
164
165
166
167
168
169
170
171
   modes/base_mode.cc
   modes/construct_mode.cc
   modes/dragrectmode.cc
   modes/edittype.cc
   modes/historydialog.cc
   modes/label.cc
   modes/linkslabel.cpp
   modes/macro.cc
   modes/macrowizard.cc
   modes/mode.cc
   modes/moving.cc
   modes/normal.cc
172
173
   modes/popup/popup.cc
   modes/popup/objectchooserpopup.cc
174
175
176
177
178
179
180
   modes/popup/propertiesactionsprovider.cc
   modes/popup/objectchooserpopup.cc
   modes/popup/objecttypeactionsprovider.cc
   modes/popup/nameobjectactionsprovider.cc
   modes/popup/objectconstructoractionsprovider.cc
   modes/popup/builtindocumentactionsprovider.cc
   modes/popup/builtinobjectactionsprovider.cc
181
182
   modes/textlabelwizard.cc
   modes/typesdialog.cpp
183
184
185
   filters/asyexporter.cc
   filters/asyexporteroptions.cc
   filters/asyexporterimpvisitor.cc
Pino Toscano's avatar
Pino Toscano committed
186
187
188
189
190
191
192
193
194
195
196
197
   filters/cabri-filter.cc
   filters/cabri-utils.cc
   filters/drgeo-filter.cc
   filters/exporter.cc
   filters/filter.cc
   filters/filters-common.cc
   filters/imageexporteroptions.cc
   filters/kgeo-filter.cc
   filters/kseg-filter.cc
   filters/latexexporter.cc
   filters/latexexporteroptions.cc
   filters/native-filter.cc
198
   filters/pgfexporterimpvisitor.cc
Pino Toscano's avatar
Pino Toscano committed
199
200
   filters/svgexporter.cc
   filters/svgexporteroptions.cc
201
   filters/xfigexporter.cc
202
203
204
205
   kig/kig_commands.cpp
   kig/kig_document.cc
   kig/kig_part.cpp
   kig/kig_view.cpp
206
)
207

208
if (Qt5XmlPatterns_FOUND)
Aniket Anvit's avatar
Aniket Anvit committed
209
210
211
212
  set(kigpart_PART_SRCS ${kigpart_PART_SRCS}
  geogebra/geogebratransformer.cpp
  geogebra/geogebrasection.cpp
  filters/geogebra-filter.cpp)
213
214
215
  qt5_add_resources(kigpart_PART_SRCS ${CMAKE_SOURCE_DIR}/geogebra/geogebra.qrc)
  add_definitions(-DWITH_GEOGEBRA=1)
endif(Qt5XmlPatterns_FOUND)
216

Laurent Montel's avatar
Laurent Montel committed
217
ki18n_wrap_ui(kigpart_PART_SRCS
218
219
220
   modes/typeswidget.ui
   modes/edittypewidget.ui
   modes/historywidget.ui
221
   filters/asyexporteroptionswidget.ui
Pino Toscano's avatar
Pino Toscano committed
222
223
224
   filters/imageexporteroptionswidget.ui
   filters/latexexporteroptionswidget.ui
   filters/svgexporteroptionswidget.ui
225
   misc/kigcoordinateprecisiondialog.ui
Laurent Montel's avatar
Laurent Montel committed
226
227
)

228
if(BoostPython_FOUND)
229
  set(kigpart_PART_SRCS ${kigpart_PART_SRCS}
230
     modes/popup/scriptactionsprovider.cc
Pino Toscano's avatar
Pino Toscano committed
231
232
233
234
235
     scripting/newscriptwizard.cc
     scripting/python_scripter.cc
     scripting/python_type.cc
     scripting/script-common.cc
     scripting/script_mode.cc
236
237
  )

238
  kde_source_files_enable_exceptions(scripting/python_scripter.cc)
239
endif(BoostPython_FOUND)
240

Laurent Montel's avatar
Laurent Montel committed
241

242
add_library(kigpart MODULE ${kigpart_PART_SRCS})
243
generate_export_header(kigpart)
Laurent Montel's avatar
Laurent Montel committed
244

David Narváez's avatar
David Narváez committed
245
246
247
target_link_libraries(kigpart
  Qt5::Gui
  Qt5::Svg
248
  Qt5::PrintSupport
249
  KF5::Crash
David Narváez's avatar
David Narváez committed
250
251
252
253
  KF5::Parts
  KF5::I18n
  KF5::TextEditor
  KF5::IconThemes
254
  KF5::ConfigWidgets
David Narváez's avatar
David Narváez committed
255
  KF5::Archive
David Narváez's avatar
David Narváez committed
256
257
  ${KDE5_KUTILS_LIBS}
)
258

259
if(BoostPython_FOUND)
260
  target_link_libraries(kigpart ${BoostPython_LIBRARIES} ${KDE5_KTEXTEDITOR_LIBS})
261
endif(BoostPython_FOUND)
Laurent Montel's avatar
Laurent Montel committed
262

263
264
265
if (Qt5XmlPatterns_FOUND)
  target_link_libraries(kigpart Qt5::XmlPatterns)
endif(Qt5XmlPatterns_FOUND)
266

Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
267
ki18n_install(po)
268
install(TARGETS kigpart DESTINATION ${PLUGIN_INSTALL_DIR})
269
install(FILES org.kde.kig.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
Laurent Montel's avatar
Laurent Montel committed
270

271
# unit tests
272
273
274
if (BUILD_TESTING)
  add_subdirectory(tests)
endif ()