cmake: Remove support for building static binaries
[quassel.git] / CMakeLists.txt
1 # Main CMake file for building Quassel IRC
2 #
3 # See INSTALL for possible CMake options (or read the code, Luke)
4 #####################################################################
5
6 # General setup
7 #####################################################################
8
9 cmake_minimum_required(VERSION 3.5)
10
11 # Versions
12 set(QUASSEL_MAJOR  0)
13 set(QUASSEL_MINOR 13)
14 set(QUASSEL_PATCH 50)
15 set(QUASSEL_VERSION_STRING "0.14-pre")
16
17 # Build type
18 if (CMAKE_CONFIGURATION_TYPES)
19     set(CMAKE_CONFIGURATION_TYPES Release RelWithDebInfo Debug Debugfull Profile)
20     set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "These are the configuration types we support" FORCE)
21 endif()
22
23 if(NOT CMAKE_BUILD_TYPE)
24     set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build, options are: Release RelWithDebInfo Debug Debugfull Profile None" FORCE)
25 endif()
26
27 # Output CMake and Quassel versions as well as build type for debug reasons
28 message(STATUS "Building Quassel ${QUASSEL_VERSION_STRING}...")
29 message(STATUS "Using CMake ${CMAKE_VERSION}")
30 message(STATUS "CMake build type: ${CMAKE_BUILD_TYPE}")
31
32 # Support ccache if found
33 # This should happen before calling project(), so compiler settings are validated.
34 option(USE_CCACHE "Enable support for ccache if available" ON)
35 if (USE_CCACHE)
36     message(STATUS "Checking for ccache")
37     find_program(CCACHE_PROGRAM ccache)
38     if (CCACHE_PROGRAM)
39         set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
40         message(STATUS "Checking for ccache - enabled")
41     else()
42         message(STATUS "Checking for ccache - not found")
43     endif()
44 endif()
45
46 # Set up project
47 project(Quassel CXX)
48
49 # General conveniences
50 set(CMAKE_AUTOMOC ON)
51 set(CMAKE_INCLUDE_CURRENT_DIR ON)
52
53 # Include various CMake modules
54 include(CMakePushCheckState)
55 include(CheckFunctionExists)
56 include(CheckIncludeFileCXX)
57 include(CheckCXXSourceCompiles)
58 include(CMakeDependentOption)
59 include(FeatureSummary)
60
61 # Tell CMake about or own modules
62 set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
63 include(QuasselCompileSettings)
64 include(QuasselMacros)
65
66
67 # Options and variables that can be set on the command line
68 #####################################################################
69
70 # Select the binaries to build
71 option(WANT_CORE     "Build the core (server) binary"           ON)
72 option(WANT_QTCLIENT "Build the client-only binary"             ON)
73 option(WANT_MONO     "Build the monolithic (all-in-one) binary" ON)
74 add_feature_info(WANT_CORE WANT_CORE "Build the core (server) binary")
75 add_feature_info(WANT_QTCLIENT WANT_QTCLIENT "Build the client-only binary (requires a core to connect to)")
76 add_feature_info(WANT_MONO WANT_MONO "Build the monolithic (all-in-one) binary")
77
78 # Whether to enable integration with higher-tier KDE frameworks that require runtime support.
79 # We still optionally make use of certain Tier 1 frameworks even if WITH_KDE is disabled.
80 option(WITH_KDE "Integration with the KDE Frameworks runtime environment")
81 add_feature_info(WITH_KDE WITH_KDE "Integrate with the KDE Frameworks runtime environment")
82
83 # Icon theme support. By default, install the Breeze icon theme (may be disabled if a system installation is present)
84 option(WITH_BUNDLED_ICONS "Install required icons from the Breeze icon theme" ON)
85 add_feature_info(WITH_BUNDLED_ICONS WITH_BUNDLED_ICONS "Install required icons from the Breeze icon theme")
86
87 option(WITH_OXYGEN_ICONS "Support the Oxygen icon theme (KDE4)" OFF)
88 add_feature_info(WITH_OXYGEN_ICONS WITH_OXYGEN_ICONS "Support the Oxygen icon theme (KDE4)")
89
90 if (WITH_BUNDLED_ICONS)
91     add_definitions(-DWITH_BUNDLED_ICONS)
92 endif()
93 if (WITH_OXYGEN_ICONS)
94     add_definitions(-DWITH_OXYGEN_ICONS)
95 endif()
96
97 # For this, the feature info is added after we know if QtWebkit is installed
98 option(WITH_WEBKIT "WebKit support (for link previews) (legacy)" OFF)
99
100 # For this, the feature info is added after we know if QtWebEngine is installed
101 option(WITH_WEBENGINE "WebEngine support (for link previews)" ON)
102
103 if (APPLE)
104     # Notification Center is only available in > 10.8, which is Darwin v12
105     if (NOT CMAKE_SYSTEM_VERSION VERSION_LESS 12)
106         option(WITH_NOTIFICATION_CENTER "OS X Notification Center support" ON)
107         add_feature_info(WITH_NOTIFICATION_CENTER WITH_NOTIFICATION_CENTER "Use the OS X Notification Center")
108     endif()
109     find_library(CARBON_LIBRARY Carbon)
110     mark_as_advanced(CARBON_LIBRARY)
111     link_libraries(${CARBON_LIBRARY})
112 endif()
113
114 # Always embed on Windows or OSX; never embed when enabling KDE integration
115 set(EMBED_DEFAULT OFF)
116 if (WIN32 OR APPLE)
117     set(EMBED_DEFAULT ON)
118 endif()
119 cmake_dependent_option(EMBED_DATA "Embed icons and translations into the binaries instead of installing them" ${EMBED_DEFAULT}
120                                    "NOT WIN32;NOT WITH_KDE" ${EMBED_DEFAULT})
121 if (NOT EMBED_DEFAULT)
122     add_feature_info(EMBED_DATA EMBED_DATA "Embed icons and translations in the binaries instead of installing them")
123 endif()
124
125 # The following options are not for end-user consumption, so don't list them in the feature summary
126 cmake_dependent_option(DEPLOY "Add required libs to bundle resources and create a dmg. Note: requires Qt to be built with 10.4u SDK" OFF "APPLE" OFF)
127
128
129 # List of authenticators and the cmake flags to build them
130 # (currently that's just LDAP, but more can be added here).
131 ####################################################################
132 option(WITH_LDAP "Enable LDAP authentication support if present on system" ON)
133
134 # Setup CMake
135 #####################################################################
136
137 # Setting COMPILE_DEFINITIONS_<CONFIG> is deprecated since CMake 3.0 in favor of generator expressions.
138 # These have existed since CMake 2.8.10; until we depend on that, we have to explicitly enable the old policy.
139 if (POLICY CMP0043)
140     cmake_policy(SET CMP0043 OLD)
141 endif()
142
143 # Honor visibility settings for all target types
144 if (POLICY CMP0063)
145     cmake_policy(SET CMP0063 NEW)
146 endif()
147
148 # Don't automoc generated files
149 if (POLICY CMP0071)
150     cmake_policy(SET CMP0071 OLD)
151 endif()
152
153
154 # Simplify later checks
155 #####################################################################
156
157 if (WANT_MONO OR WANT_QTCLIENT)
158     set(BUILD_GUI true)
159 endif()
160 if (WANT_MONO OR WANT_CORE)
161     set(BUILD_CORE true)
162 endif()
163
164
165 # Set up Qt
166 #####################################################################
167
168 # Find package dependencies
169 #
170 # Note that you can forcefully disable optional packages
171 # using -DCMAKE_DISABLE_FIND_PACKAGE_<PkgName>=TRUE
172 #####################################################################
173
174 set(QT_MIN_VERSION "5.5.0")
175 add_definitions(-DHAVE_QT5)
176
177 find_package(Qt5Core ${QT_MIN_VERSION} QUIET)
178 set_package_properties(Qt5Core PROPERTIES TYPE REQUIRED
179     URL "https://www.qt.io/"
180     DESCRIPTION "contains core functionality for Qt"
181 )
182
183 # find_package without REQUIRED won't check for the version properly; also, older Qt5 versions
184 # used Qt5Core_VERSION_STRING... let's just make sure here that we bail out here if our Qt5 is not new enough.
185 if (NOT Qt5Core_VERSION OR Qt5Core_VERSION VERSION_LESS ${QT_MIN_VERSION})
186     message(FATAL_ERROR "Could NOT find Qt5 >= version ${QT_MIN_VERSION}!")
187 endif()
188
189 find_package(Qt5Network QUIET)
190 set_package_properties(Qt5Network PROPERTIES TYPE REQUIRED
191     DESCRIPTION "the network module for Qt5"
192 )
193
194 if (BUILD_GUI)
195     find_package(Qt5Gui QUIET)
196     set_package_properties(Qt5Gui PROPERTIES TYPE REQUIRED
197         DESCRIPTION "the GUI module for Qt5"
198     )
199     find_package(Qt5Widgets QUIET)
200     set_package_properties(Qt5Widgets PROPERTIES TYPE REQUIRED
201         DESCRIPTION "the widgets module for Qt5"
202     )
203
204     if (NOT WIN32)
205         find_package(Qt5DBus QUIET)
206         set_package_properties(Qt5DBus PROPERTIES TYPE RECOMMENDED
207             URL "https://www.qt.io/"
208             DESCRIPTION "D-Bus support for Qt5"
209             PURPOSE     "Needed for supporting D-Bus-based notifications and tray icon, used by most modern desktop environments"
210         )
211         if (Qt5DBus_FOUND)
212             find_package(dbusmenu-qt5 QUIET CONFIG)
213             set_package_properties(dbusmenu-qt5 PROPERTIES TYPE RECOMMENDED
214                 URL "https://launchpad.net/libdbusmenu-qt"
215                 DESCRIPTION "a library implementing the DBusMenu specification"
216                 PURPOSE     "Required for having a context menu for the D-Bus-based tray icon"
217             )
218         endif()
219     endif()
220
221     find_package(Qt5Multimedia QUIET)
222     set_package_properties(Qt5Multimedia PROPERTIES TYPE RECOMMENDED
223         URL "https://www.qt.io/"
224         DESCRIPTION "Multimedia support for Qt5"
225         PURPOSE     "Required for audio notifications"
226     )
227
228     find_package(LibsnoreQt5 0.7.0 QUIET)
229     set_package_properties(LibsnoreQt5 PROPERTIES TYPE OPTIONAL
230         URL "https://projects.kde.org/projects/playground/libs/snorenotify"
231         DESCRIPTION "a cross-platform notification framework"
232         PURPOSE     "Enable support for the snorenotify framework"
233     )
234     if(LibsnoreQt5_FOUND)
235         find_package(LibsnoreSettingsQt5)
236         set_package_properties(LibsnoreSettingsQt5 PROPERTIES TYPE REQUIRED
237             URL "https://projects.kde.org/projects/playground/libs/snorenotify"
238             DESCRIPTION "a cross-platform notification framework"
239             PURPOSE     "Enable support for the snorenotify framework"
240         )
241     endif()
242
243     if (WITH_WEBKIT)
244         find_package(Qt5WebKit QUIET)
245         set_package_properties(Qt5WebKit PROPERTIES TYPE RECOMMENDED
246             URL "https://www.qt.io/"
247             DESCRIPTION "a WebKit implementation for Qt"
248             PURPOSE     "Needed for displaying previews for URLs in chat"
249         )
250         if (Qt5WebKit_FOUND)
251             find_package(Qt5WebKitWidgets QUIET)
252             set_package_properties(Qt5WebKitWidgets PROPERTIES TYPE RECOMMENDED
253                 URL "https://www.qt.io/"
254                 DESCRIPTION "widgets for Qt's WebKit implementation"
255                 PURPOSE     "Needed for displaying previews for URLs in chat"
256             )
257         endif()
258     endif()
259
260     if (WITH_WEBKIT AND Qt5WebKitWidgets_FOUND)
261         set(HAVE_WEBKIT true)
262     endif()
263     add_feature_info("WITH_WEBKIT, QtWebKit and QtWebKitWidgets modules" HAVE_WEBKIT "Support showing previews for URLs in chat (legacy)")
264
265     if (WITH_WEBENGINE)
266         find_package(Qt5WebEngine QUIET)
267         set_package_properties(Qt5WebEngine PROPERTIES TYPE RECOMMENDED
268             URL "https://www.qt.io/"
269             DESCRIPTION "a WebEngine implementation for Qt"
270             PURPOSE     "Needed for displaying previews for URLs in chat"
271         )
272         if (Qt5WebEngine_FOUND)
273             find_package(Qt5WebEngineWidgets QUIET)
274             set_package_properties(Qt5WebEngineWidgets PROPERTIES TYPE RECOMMENDED
275                 URL "https://www.qt.io/"
276                 DESCRIPTION "widgets for Qt's WebEngine implementation"
277                 PURPOSE     "Needed for displaying previews for URLs in chat"
278             )
279         endif()
280     endif()
281
282     if (WITH_WEBENGINE AND Qt5WebEngineWidgets_FOUND)
283         set(HAVE_WEBENGINE true)
284     endif()
285     add_feature_info("WITH_WEBENGINE, QtWebEngine and QtWebEngineWidgets modules" HAVE_WEBENGINE "Support showing previews for URLs in chat")
286
287     # KDE Frameworks
288     ################
289
290     if (WITH_KDE)
291         set(ecm_find_type "REQUIRED")
292     else()
293         # Even with KDE integration disabled, we optionally use tier1 frameworks if we find them
294         set(ecm_find_type "RECOMMENDED")
295     endif()
296
297     # extra-cmake-modules
298     find_package(ECM NO_MODULE QUIET)
299     set_package_properties(ECM PROPERTIES TYPE ${ecm_find_type}
300         URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules"
301         DESCRIPTION "extra modules for CMake, maintained by the KDE project"
302         PURPOSE     "Required to find KDE Frameworks components"
303     )
304
305     if (ECM_FOUND)
306         list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
307         if (WITH_KDE)
308             find_package(KF5 COMPONENTS ConfigWidgets CoreAddons Notifications NotifyConfig Sonnet TextWidgets WidgetsAddons XmlGui QUIET)
309             set_package_properties(KF5 PROPERTIES TYPE REQUIRED
310                 URL "http://www.kde.org"
311                 DESCRIPTION "KDE Frameworks"
312                 PURPOSE     "Required for integration into the Plasma desktop"
313             )
314         else()
315             find_package(KF5Sonnet QUIET)
316             set_package_properties(KF5Sonnet PROPERTIES TYPE RECOMMENDED
317                 URL "http://api.kde.org/frameworks-api/frameworks5-apidocs/sonnet/html"
318                 DESCRIPTION "framework for providing spell-checking capabilities"
319                 PURPOSE "Enables spell-checking support in input widgets"
320             )
321         endif()
322     endif()
323
324 endif()
325
326 if (BUILD_CORE)
327     find_package(Qt5Script QUIET)
328     set_package_properties(Qt5Script PROPERTIES TYPE REQUIRED
329         DESCRIPTION "provides scripting support for Qt5"
330     )
331     find_package(Qt5Sql QUIET)
332     set_package_properties(Qt5Sql PROPERTIES TYPE REQUIRED
333         DESCRIPTION "the database support module for Qt5"
334     )
335
336     find_package(Qca-qt5 2.0)
337     set_package_properties(Qca-qt5 PROPERTIES TYPE RECOMMENDED
338         URL "https://projects.kde.org/projects/kdesupport/qca"
339         DESCRIPTION "Qt Cryptographic Architecture"
340         PURPOSE "Required for encryption support"
341     )
342
343 endif()
344
345 find_package(Qt5LinguistTools QUIET)
346 set_package_properties(Qt5LinguistTools PROPERTIES TYPE RECOMMENDED
347     DESCRIPTION "contains tools for handling translation files"
348     PURPOSE "Required for having translations"
349 )
350
351 # Some Qt5 versions do not define a target for lconvert, so we need to find it ourselves
352 if (Qt5LinguistTools_FOUND)
353     if (NOT TARGET Qt5::lconvert AND TARGET Qt5::lrelease)
354         get_target_property(_lrelease_location Qt5::lrelease LOCATION)
355         get_filename_component(_lrelease_path ${_lrelease_location} PATH)
356         find_program(QT_LCONVERT_EXECUTABLE NAMES lconvert-qt5 lconvert PATHS ${_lrelease_path} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
357     elseif(TARGET Qt5::lconvert AND NOT Qt5_LCONVERT_EXECUTABLE)
358         # Newer Qt5 versions define the target, but not the Qt5_LCONVERT_EXECUTABLE variable for some reason
359         get_target_property(QT_LCONVERT_EXECUTABLE Qt5::lconvert LOCATION)
360     endif()
361
362     # Compatibility with the Qt4 variables
363     set(QT_LRELEASE_EXECUTABLE ${Qt5_LRELEASE_EXECUTABLE})
364     set(QT_LUPDATE_EXECUTABLE ${Qt5_LUPDATE_EXECUTABLE})
365     if (Qt5_LCONVERT_EXECUTABLE)
366         set(QT_LCONVERT_EXECUTABLE ${Qt5_LCONVERT_EXECUTABLE})
367     endif()
368 endif()
369
370 # Non-Qt-based packages
371
372 find_package(ZLIB REQUIRED)
373 set_package_properties(ZLIB PROPERTIES TYPE REQUIRED
374     URL "http://www.zlib.net"
375     DESCRIPTION "a popular compression library"
376     PURPOSE     "Used for protocol compression"
377 )
378
379 if (NOT WIN32)
380     # Needed for generating backtraces
381     find_package(Backtrace QUIET)
382     set_package_properties(Backtrace PROPERTIES TYPE RECOMMENDED
383         DESCRIPTION "a header (and possibly library) for inspecting backtraces"
384         PURPOSE "Used for generating backtraces in case of a crash"
385     )
386 endif()
387
388 # Check for SSL support in Qt
389 # As there's no easy way to get Qt's configuration in particular for Qt5, let's just compile
390 # a small test program checking the defines. This works for both Qt4 and Qt5.
391 cmake_push_check_state(RESET)
392 set(CMAKE_REQUIRED_INCLUDES ${QT_INCLUDES} ${Qt5Core_INCLUDE_DIRS})
393 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
394
395 if (Qt5_POSITION_INDEPENDENT_CODE)
396     set(CMAKE_REQUIRED_FLAGS "-fPIC -DQT_NO_VERSION_TAGGING")
397 endif()
398
399 check_cxx_source_compiles("
400     #include \"qglobal.h\"
401     #if defined QT_NO_SSL
402     #  error \"No SSL support\"
403     #endif
404     int main() {}"
405     HAVE_SSL)
406 cmake_pop_check_state()
407
408 # Additional compile settings
409 #####################################################################
410
411 # This sets -fPIC and friends if required by the installed Qt5 library
412 if (Qt5_POSITION_INDEPENDENT_CODE)
413     set(CMAKE_POSITION_INDEPENDENT_CODE ON)
414     set(CMAKE_REQUIRED_FLAGS "-DQT_NO_VERSION_TAGGING")
415 endif()
416
417 # Needed to compile with mingw without kde
418 if (MINGW AND NOT WITH_KDE)
419     add_definitions(-D_WIN32_WINNT=0x0500)
420     message(STATUS "Added _WIN32_WINNT=0x0500 definition for MinGW")
421     # workaround for bug in mingw gcc 4.0
422     add_definitions(-U__STRICT_ANSI__)
423 endif()
424
425 # Sanitize compiler flags - old versions of KDE set -ansi, which breaks -std=c++11
426 if (CMAKE_COMPILER_IS_GNUCXX)
427     string(REPLACE "-ansi" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
428 endif()
429
430 # Setup LDAP Authentication support.
431 #####################################################################
432 if (WITH_LDAP)
433     find_package(Ldap)
434     if (LDAP_FOUND)
435         message(STATUS "Enabling LDAP authentication support")
436         set(HAVE_LDAP true)
437         add_definitions(-DHAVE_LDAP)
438     else()
439         message(STATUS "Disabling LDAP authentication support")
440     endif()
441 else()
442     message(STATUS "Not enabling LDAP authentication support")
443 endif()
444
445 # Setup support for KDE Frameworks
446 #####################################################################
447
448 # We want to do this up here, so we have the necessary variables and defines set before
449 # compiling anything
450
451 if (WITH_KDE)
452     # If KDE Frameworks are present, they're most probably providing Qt5 integration including icon loading
453     set(EMBED_DATA OFF)
454
455     include(KDEInstallDirs)
456     include(KDECompilerSettings)
457     include(KDECMakeSettings)
458
459     kde_enable_exceptions()
460     add_definitions(-DHAVE_KDE -DHAVE_KF5)
461     set(WITH_KF5 TRUE)
462 endif()
463
464 # This needs to come after setting up KDE integration, so we can use KDE-specific paths
465 include(QuasselInstallDirs)
466
467 # Various config-dependent checks and settings
468 #####################################################################
469
470 if (HAVE_SSL)
471     add_definitions(-DHAVE_SSL)
472 endif()
473 add_feature_info("SSL support in Qt" HAVE_SSL "Use secure network connections")
474
475 # Check for syslog support
476 if (NOT WIN32)
477     check_include_file_cxx(syslog.h HAVE_SYSLOG)
478     add_feature_info("syslog.h" HAVE_SYSLOG "Provide support for logging to the syslog")
479 endif()
480
481 add_feature_info("Qt Linguist Tools" QT_LCONVERT_EXECUTABLE "Translation support for Quassel")
482
483 if (EMBED_DATA)
484     message(STATUS "Embedding data files into the binary")
485 else()
486     message(STATUS "Installing data files separately")
487 endif()
488
489 if (NOT WIN32)
490     check_function_exists(umask HAVE_UMASK)
491     if(HAVE_UMASK)
492         add_definitions(-DHAVE_UMASK)
493     endif()
494 endif()
495
496
497 # Windows-specific stuff
498 #####################################################################
499
500 if (WIN32)
501     link_libraries(imm32 winmm dbghelp Secur32)  # missing by default :/
502     if (MSVC)
503         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /DNOMINMAX")
504         set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBUGINFO "/debug /INCREMENTAL:YES /NODEFAULTLIB:libcmt /DEFAULTLIB:msvcrt")
505         set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/debug /INCREMENTAL:YES /NODEFAULTLIB:libcmt")
506         set(CMAKE_EXE_LINKER_FLAGS_DEBUGFULL "${CMAKE_EXE_LINKER_FLAGS_DEBUG}")
507         link_libraries(Version dwmapi shlwapi)
508         set(QT_QTMAIN_LIBRARY Qt5::WinMain)
509     endif()
510 endif()
511
512
513 # Generate version information from Git
514 #####################################################################
515
516 include(GetGitRevisionDescription)
517 get_git_head_revision(GIT_REFSPEC GIT_HEAD)
518 git_describe(GIT_DESCRIBE --long)
519
520 # If in a Git repo we can get the commit-date from a git command
521 if (GIT_HEAD)
522     execute_process(
523         COMMAND git -c log.showsignature=false show -s --format=%ct
524         WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
525         OUTPUT_VARIABLE GIT_COMMIT_DATE
526         OUTPUT_STRIP_TRAILING_WHITESPACE
527     )
528 endif()
529
530 # If not in a Git repo try to read GIT_HEAD and GIT_DESCRIBE from
531 # enviroment
532 if (NOT GIT_HEAD OR NOT GIT_DESCRIBE)
533   if (DEFINED ENV{GIT_HEAD})
534       set(GIT_HEAD $ENV{GIT_HEAD})
535   endif()
536   if (DEFINED ENV{GIT_DESCRIBE})
537      set(GIT_DESCRIBE $ENV{GIT_DESCRIBE})
538   endif()
539 endif()
540
541 # Sanitize things if we're not in a Git repo
542 if (NOT GIT_HEAD OR NOT GIT_DESCRIBE)
543     set(GIT_HEAD "")
544     set(GIT_DESCRIBE "")
545     set(GIT_COMMIT_DATE 0)
546 endif()
547
548 configure_file(version.h.in ${CMAKE_BINARY_DIR}/version.h @ONLY)
549
550 # Prepare the build
551 #####################################################################
552
553 # These variables will be added to the main targets (CORE, QTCLIENT, MONO)
554 set(COMMON_DEPS ${RC_WIN32})
555 set(CORE_DEPS )
556 set(CLIENT_DEPS )
557
558 # Add needed subdirs - the order is important, since src needs some vars set by other dirs
559 add_subdirectory(data)
560 add_subdirectory(icons)
561 add_subdirectory(pics)
562 add_subdirectory(po)
563
564
565 # Set up and display feature summary
566 #####################################################################
567
568 feature_summary(WHAT ALL
569                 INCLUDE_QUIET_PACKAGES
570                 FATAL_ON_MISSING_REQUIRED_PACKAGES
571 )
572
573 # Finally, compile the sources
574 # We want this after displaying the feature summary to avoid ugly
575 # CMake backtraces in case a required Qt5 module is missing
576 #####################################################################
577
578 add_subdirectory(src)