Silence deprecation warning from CMake 3.0+
[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 2.8.9)
10 project(QuasselIRC)
11
12 # Versions
13 set(QUASSEL_MAJOR  0)
14 set(QUASSEL_MINOR 11)
15 set(QUASSEL_PATCH  0)
16 set(QUASSEL_VERSION_STRING "0.11-pre")
17
18 # Tell CMake about or own modules
19 set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
20
21 # General conveniences
22 set(CMAKE_AUTOMOC ON)
23 set(CMAKE_INCLUDE_CURRENT_DIR ON)
24
25 # Include various CMake modules...
26 include(CMakePushCheckState)
27 include(CheckFunctionExists)
28 include(CheckIncludeFile)
29 include(CheckCXXSourceCompiles)
30 include(CMakeDependentOption)
31 include(FeatureSummary)
32
33 # ... and our own stuff
34 include(QuasselCompileSettings)
35 include(QuasselMacros)
36
37 # Setting COMPILE_DEFINITIONS_<CONFIG> is deprecated since CMake 3.0 in favor of generator expressions.
38 # These have existed since CMake 2.8.10; until we depend on that, we have to explicitly enable the old policy.
39 cmake_policy(SET CMP0043 OLD)
40
41
42 # Options and variables that can be set on the command line
43 #####################################################################
44
45 # First, choose a Qt version. We support USE_QT4 and USE_QT5; if neither is set, prefer Qt4 for now
46 option(USE_QT5 "Enable support for Qt5 (disables KDE integration)" OFF)
47 if (USE_QT4) # takes precedence
48     set(USE_QT5 OFF)
49 else()
50     if (NOT USE_QT5)
51         set(USE_QT4 ON)
52     endif()
53 endif()
54
55 # Select the binaries to build
56 option(WANT_CORE     "Build the core (server) binary"           ON)
57 option(WANT_QTCLIENT "Build the client-only binary"             ON)
58 option(WANT_MONO     "Build the monolithic (all-in-one) binary" ON)
59 add_feature_info(WANT_CORE WANT_CORE "Build the core (server) binary")
60 add_feature_info(WANT_QTCLIENT WANT_QTCLIENT "Build the client-only binary (requires a core to connect to)")
61 add_feature_info(WANT_MONO WANT_MONO "Build the monolithic (all-in-one) binary")
62
63 # Whether to enable KDE integration (pulls in kdelibs and friends as a dependency); requires Qt4 for now
64 cmake_dependent_option(WITH_KDE "KDE4 integration" OFF "USE_QT4" OFF)
65 add_feature_info(WITH_KDE WITH_KDE "Enable KDE4 integration")
66
67 cmake_dependent_option(WITH_OXYGEN "Install Oxygen icon set (usually shipped with KDE)" ON "NOT WITH_KDE" OFF)
68 if (NOT WITH_KDE)
69     add_feature_info(WITH_OXYGEN WITH_OXYGEN "Install Oxygen icon set")
70 endif()
71
72 # For this, the feature info is added after we know if QtWebkit is installed
73 option(WITH_WEBKIT "WebKit support (for link previews)" ON)
74
75 if (APPLE)
76     # Notification Center is only available in > 10.8, which is Darwin v12
77     if (CMAKE_SYSTEM_VERSION VERSION_GREATER "11.9.9")
78         option(WITH_NOTIFICATION_CENTER "OS X Notification Center support" ON)
79         add_feature_info(WITH_NOTIFICATION_CENTER WITH_NOTIFICATION_CENTER "Use the OS X Notification Center")
80     endif()
81 endif()
82
83 # Always embed on Windows, OSX or for a static build; never embed when enabling KDE integration
84 set(EMBED_DEFAULT OFF)
85 if (STATIC OR WIN32 OR APPLE)
86     set(EMBED_DEFAULT ON)
87 endif()
88 cmake_dependent_option(EMBED_DATA "Embed icons and translations into the binaries instead of installing them" ${EMBED_DEFAULT}
89                                    "NOT STATIC;NOT WIN32;NOT WITH_KDE" ${EMBED_DEFAULT})
90 if (NOT EMBED_DEFAULT)
91     add_feature_info(EMBED_DATA EMBED_DATA "Embed icons and translations in the binaries instead of installing them")
92 endif()
93
94 # The following options are not for end-user consumption, so don't list them in the feature summary
95 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)
96
97 # Handle with care
98 set(QT_PATH "" CACHE PATH "Path to a Qt4 installation to use instead of the system Qt (e.g. for static builds)")
99
100 # Static builds are not supported and require some manual setup! Don't enable unless you know what you're doing (we don't know either)
101 cmake_dependent_option(STATIC      "Enable static building (not supported)" OFF "NOT WITH_KDE" OFF)
102
103 # For static builds, arbitrary extra libs might need to be linked
104 # Define a comma-separated list here
105 # e.g. for pgsql, we need -DLINK_EXTRA=pq;crypt
106 set(LINK_EXTRA "" CACHE STRING "Semicolon-separated list of libraries to be linked")
107 if (LINK_EXTRA)
108     string(REPLACE "," ";" LINK_EXTRA ${LINK_EXTRA})
109     link_libraries(${LINK_EXTRA})
110 endif()
111
112
113 # Simplify later checks
114 #####################################################################
115
116 if (WANT_MONO OR WANT_QTCLIENT)
117     set(BUILD_GUI true)
118 endif()
119 if (WANT_MONO OR WANT_CORE)
120     set(BUILD_CORE true)
121 endif()
122
123
124 # Set up Qt
125 #####################################################################
126
127 if (USE_QT5)
128     message(STATUS "Building for Qt5...")
129     set(QT_MIN_VERSION "5.2.0")
130     add_definitions(-DHAVE_QT5)
131 else()
132     message(STATUS "Building for Qt4...")
133     if (BUILD_GUI)
134         set(QT_MIN_VERSION "4.6.0")
135     else()
136         set(QT_MIN_VERSION "4.4.0")
137     endif()
138
139     # Select a Qt installation here, if you don't want to use system Qt
140     if(QT_PATH)
141         # FindQt4 will look for the qmake binary in $PATH, so we just prepend QT_PATH
142         set(ENV{PATH} ${QT_PATH}/bin:$ENV{PATH})
143     endif()
144 endif()
145
146 # Find package dependencies
147 #
148 # Note that you can forcefully disable optional packages
149 # using -DCMAKE_DISABLE_FIND_PACKAGE_<PkgName>=TRUE
150 #####################################################################
151
152 if (USE_QT5)
153     find_package(Qt5Core ${QT_MIN_VERSION} QUIET)
154     set_package_properties(Qt5Core PROPERTIES TYPE REQUIRED
155         URL "http://qt.digia.com"
156         DESCRIPTION "contains core functionality for Qt"
157     )
158     # find_package without REQUIRED won't check for the version properly; also, older Qt5 versions
159     # used Qt5Core_VERSION_STRING... let's just make sure here that we bail out here if our Qt5 is not new enough.
160     if (NOT Qt5Core_VERSION OR Qt5Core_VERSION VERSION_LESS ${QT_MIN_VERSION})
161         message(FATAL_ERROR "Could NOT find Qt5 >= version ${QT_MIN_VERSION}!")
162     endif()
163
164     find_package(Qt5Network QUIET)
165     set_package_properties(Qt5Network PROPERTIES TYPE REQUIRED
166         DESCRIPTION "the network module for Qt5"
167     )
168
169     if (BUILD_GUI)
170         find_package(Qt5Gui QUIET)
171         set_package_properties(Qt5Gui PROPERTIES TYPE REQUIRED
172             DESCRIPTION "the GUI module for Qt5"
173         )
174         find_package(Qt5Widgets QUIET)
175         set_package_properties(Qt5Widgets PROPERTIES TYPE REQUIRED
176             DESCRIPTION "the widgets module for Qt5"
177         )
178
179         find_package(Qt5DBus QUIET)
180         set_package_properties(Qt5DBus PROPERTIES TYPE RECOMMENDED
181             URL "http://qt.digia.com"
182             DESCRIPTION "D-Bus support for Qt5"
183             PURPOSE     "Needed for supporting D-Bus-based notifications and tray icon, used by most modern desktop environments"
184         )
185         if (Qt5DBus_FOUND)
186             find_package(dbusmenu-qt5 QUIET CONFIG)
187             set_package_properties(dbusmenu-qt5 PROPERTIES TYPE RECOMMENDED
188                 URL "https://launchpad.net/libdbusmenu-qt"
189                 DESCRIPTION "a library implementing the DBusMenu specification"
190                 PURPOSE     "Required for having a context menu for the D-Bus-based tray icon"
191             )
192         endif()
193
194         find_package(Phonon4Qt5 QUIET)
195         set_package_properties(Phonon4Qt5 PROPERTIES TYPE RECOMMENDED
196             URL "https://projects.kde.org/projects/kdesupport/phonon"
197             DESCRIPTION "a multimedia abstraction library"
198             PURPOSE     "Required for audio notifications"
199         )
200
201         find_package(LibsnoreQt5 QUIET)
202         set_package_properties(LibsnoreQt5 PROPERTIES TYPE OPTIONAL
203             URL "https://github.com/TheOneRing/Snorenotify"
204             DESCRIPTION "a cross-platform notification framework"
205             PURPOSE     "Enable support for the snorenotify framework"
206         )
207
208         if (WITH_WEBKIT)
209             find_package(Qt5WebKit QUIET)
210             set_package_properties(Qt5WebKit PROPERTIES TYPE RECOMMENDED
211                 URL "http://qt.digia.com"
212                 DESCRIPTION "a WebKit implementation for Qt"
213                 PURPOSE     "Needed for displaying previews for URLs in chat"
214             )
215             if (Qt5WebKit_FOUND)
216                 find_package(Qt5WebKitWidgets QUIET)
217                 set_package_properties(Qt5WebKitWidgets PROPERTIES TYPE RECOMMENDED
218                     URL "http://qt.digia.com"
219                     DESCRIPTION "widgets for Qt's WebKit implementation"
220                     PURPOSE     "Needed for displaying previews for URLs in chat"
221                 )
222             endif()
223         endif()
224         add_feature_info("WITH_WEBKIT, QtWebKit and QtWebKitWidgets modules" Qt5WebKitWidgets_FOUND "Support showing previews for URLs in chat")
225
226     endif(BUILD_GUI)
227     if (BUILD_CORE)
228         find_package(Qt5Script QUIET)
229         set_package_properties(Qt5Script PROPERTIES TYPE REQUIRED
230             DESCRIPTION "provides scripting support for Qt5"
231         )
232         find_package(Qt5Sql QUIET)
233         set_package_properties(Qt5Sql PROPERTIES TYPE REQUIRED
234             DESCRIPTION "the database support module for Qt5"
235         )
236
237         # While QCA2 seems to support Qt5, it is not actually co-installable or distinguishable from the Qt4 version...
238         # In order to avoid linking against the Qt4 version (which is probably the one installed), disable this for now
239         #find_package(QCA2 QUIET)
240         #set_package_properties(QCA2 PROPERTIES TYPE RECOMMENDED
241         #    URL "https://projects.kde.org/projects/kdesupport/qca"
242         #    DESCRIPTION "Qt Cryptographic Architecture"
243         #    PURPOSE "Required for encryption support"
244         #)
245
246     endif(BUILD_CORE)
247
248     find_package(Qt5LinguistTools QUIET)
249     set_package_properties(Qt5LinguistTools PROPERTIES TYPE RECOMMENDED
250                            DESCRIPTION "contains tools for handling translation files"
251                            PURPOSE "Required for having translations"
252     )
253     # Some Qt5 versions do not define a target for lconvert, so we need to find it ourselves
254     if (Qt5LinguistTools_FOUND)
255         if (NOT TARGET Qt5::lconvert AND TARGET Qt5::lrelease)
256             get_target_property(_lrelease_location Qt5::lrelease LOCATION)
257             get_filename_component(_lrelease_path ${_lrelease_location} PATH)
258             find_program(QT_LCONVERT_EXECUTABLE NAMES lconvert-qt5 lconvert PATHS ${_lrelease_path} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
259         elseif(TARGET Qt5::lconvert AND NOT Qt5_LCONVERT_EXECUTABLE)
260             # Newer Qt5 versions define the target, but not the Qt5_LCONVERT_EXECUTABLE variable for some reason
261             get_target_property(QT_LCONVERT_EXECUTABLE Qt5::lconvert LOCATION)
262         endif()
263
264         # Compatibility with the Qt4 variables
265         set(QT_LRELEASE_EXECUTABLE ${Qt5_LRELEASE_EXECUTABLE})
266         set(QT_LUPDATE_EXECUTABLE ${Qt5_LUPDATE_EXECUTABLE})
267         if (Qt5_LCONVERT_EXECUTABLE)
268             set(QT_LCONVERT_EXECUTABLE ${Qt5_LCONVERT_EXECUTABLE})
269         endif()
270     endif()
271
272 else(USE_QT5)
273     find_package(Qt4 ${QT_MIN_VERSION} QUIET REQUIRED)
274
275     if (BUILD_GUI)
276         add_feature_info("QtDBus module" QT_QTDBUS_FOUND "Needed for supporting D-Bus-based notifications and tray icon, used by most modern desktop environments")
277         if (QT_QTDBUS_FOUND)
278             find_package(dbusmenu-qt QUIET CONFIG)
279             set_package_properties(dbusmenu-qt PROPERTIES TYPE RECOMMENDED
280                 URL "https://launchpad.net/libdbusmenu-qt"
281                 DESCRIPTION "a library implementing the DBusMenu specification"
282                 PURPOSE     "Required for having a context menu for the D-Bus-based tray icon"
283             )
284         endif()
285
286         if (WITH_WEBKIT AND QT_QTWEBKIT_FOUND)
287             set(HAVE_WEBKIT true)
288         endif()
289         add_feature_info("WITH_WEBKIT and QtWebKit module" HAVE_WEBKIT "Support showing previews for URLs in chat")
290
291         if (WITH_KDE)
292             # KDE has overzealous CFLAGS making miniz not compile, so save our old flags
293             set(_cflags ${CMAKE_C_FLAGS})
294             find_package(KDE4 4.4 QUIET)
295             set_package_properties(KDE4 PROPERTIES TYPE REQUIRED
296                 URL "http://www.kde.org"
297                 DESCRIPTION "a world-class desktop environment"
298                 PURPOSE "Enables various bits for improving integration with KDE"
299             )
300             set(CMAKE_C_FLAGS ${_cflags})
301
302         else(WITH_KDE)
303             find_package(Phonon QUIET)
304             set_package_properties(Phonon PROPERTIES TYPE RECOMMENDED
305                 URL "https://projects.kde.org/projects/kdesupport/phonon"
306                 DESCRIPTION "a multimedia abstraction library"
307                 PURPOSE     "Required for audio notifications"
308             )
309
310             find_package(Libsnore QUIET)
311             set_package_properties(Libsnore PROPERTIES TYPE OPTIONAL
312                 URL "https://github.com/TheOneRing/Snorenotify"
313                 DESCRIPTION "a cross-platform notification framework"
314                 PURPOSE     "Enable support for the snorenotify framework"
315             )
316         endif(WITH_KDE)
317
318         find_package(IndicateQt QUIET)
319         set_package_properties(IndicateQt PROPERTIES TYPE OPTIONAL
320             URL "https://launchpad.net/libindicate-qt/"
321             DESCRIPTION "a library to raise flags on DBus for other components of the desktop to pick up and visualize"
322             PURPOSE     "Provides integration into the Ayatana notification system used by e.g. Ubuntu"
323         )
324
325     endif(BUILD_GUI)
326     if (BUILD_CORE)
327
328         find_package(QCA2 QUIET)
329         set_package_properties(QCA2 PROPERTIES TYPE RECOMMENDED
330             URL "https://projects.kde.org/projects/kdesupport/qca"
331             DESCRIPTION "Qt Cryptographic Architecture"
332             PURPOSE     "Required for encryption support"
333         )
334
335
336     endif()
337
338     # Qt4 does not consider lconvert relevant, so they don't support finding it...
339     # Rather than shipping hacked buildsys files, let's just infer the path from lrelease
340     if (QT_LRELEASE_EXECUTABLE)
341         get_filename_component(_lrelease_path ${QT_LRELEASE_EXECUTABLE} PATH)
342         find_program(QT_LCONVERT_EXECUTABLE NAMES lconvert-qt4 lconvert PATHS ${_lrelease_path} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
343     endif()
344 endif()
345
346
347 # Non-Qt-based packages
348
349 # zlib for compression, however we can always fall back to miniz
350 find_package(ZLIB QUIET)
351 set_package_properties(ZLIB PROPERTIES TYPE RECOMMENDED
352     URL "http://www.zlib.net"
353     DESCRIPTION "a popular compression library"
354     PURPOSE     "Use the most common library for protocol compression, instead of the bundled miniz implementation"
355 )
356
357
358 if (NOT WIN32)
359     # Execinfo is needed for generating backtraces
360     find_package(ExecInfo QUIET)
361     set_package_properties(ExecInfo PROPERTIES TYPE OPTIONAL
362         DESCRIPTION "a library for inspecting backtraces"
363         PURPOSE "Used for generating backtraces in case of a crash"
364     )
365 endif()
366
367
368 # Various checks
369 #####################################################################
370
371 if (NOT ZLIB_FOUND)
372     message(STATUS "zlib NOT found, using bundled miniz for compression")
373     if (${CMAKE_SIZEOF_VOID_P} EQUAL 4)
374         message(STATUS "WARNING: This may be slow on 32 bit systems!")
375     endif()
376 endif()
377
378 if (KDE4_FOUND)
379     # We always use external icons for KDE4 support, since we use its iconloader rather than our own
380     set(EMBED_DATA OFF)
381
382     # Better have the compile flags global, even for the core, to avoid problems with linking the mono client
383     add_definitions(-DHAVE_KDE ${KDE4_DEFINITIONS})
384 endif()
385
386 # Check for SSL support in Qt
387 # As there's no easy way to get Qt's configuration in particular for Qt5, let's just compile
388 # a small test program checking the defines. This works for both Qt4 and Qt5.
389 cmake_push_check_state(RESET)
390 if (Qt5_POSITION_INDEPENDENT_CODE)
391     set(CMAKE_POSITION_INDEPENDENT_CODE ON)
392 endif()
393 set(CMAKE_REQUIRED_INCLUDES ${QT_INCLUDES} ${Qt5Core_INCLUDE_DIRS})
394 check_cxx_source_compiles("
395     #include \"qglobal.h\"
396     #if defined QT_NO_OPENSSL || defined QT_NO_SSL
397     #  error \"No SSL support\"
398     #endif
399     int main() {}"
400     HAVE_SSL)
401 cmake_pop_check_state()
402
403 if (HAVE_SSL)
404     add_definitions(-DHAVE_SSL)
405 endif()
406 add_feature_info("SSL support in Qt" HAVE_SSL "Use secure network connections")
407
408 # Check for syslog support
409 if (NOT WIN32)
410     check_include_file(syslog.h HAVE_SYSLOG)
411     add_feature_info("syslog.h" HAVE_SYSLOG "Provide support for logging to the syslog")
412 endif()
413
414 add_feature_info("Qt Linguist Tools" QT_LCONVERT_EXECUTABLE "Translation support for Quassel")
415
416 # Various settings
417 ##################
418
419 # needed to compile with mingw without kde
420 if (MINGW AND NOT KDE4_FOUND)
421     add_definitions(-D_WIN32_WINNT=0x0500)
422     message(STATUS "Added _WIN32_WINNT=0x0500 definition for MinGW")
423 # workaround for bug in mingw gcc 4.0
424     add_definitions(-U__STRICT_ANSI__)
425 endif()
426
427 # Now set up install locations; those are set by KDE if integration is enabled
428 if(NOT KDE4_FOUND)
429   if(WIN32)
430     set(BIN_INSTALL_DIR ${CMAKE_INSTALL_PREFIX} CACHE FILEPATH "Install path for binaries")
431     set(DATA_INSTALL_DIR $ENV{APPDATA}/quassel-irc.org/share/apps CACHE FILEPATH "Install path for data files")
432     set(ICON_INSTALL_DIR $ENV{APPDATA}/quassel-irc.org/share/icons CACHE FILEPATH "Global icon install path")
433     set(XDG_APPS_INSTALL_DIR $ENV{APPDATA}/quassel-irc.org/share/applications CACHE FILEPATH "Install path for .desktop files")
434   else(WIN32)
435     set(BIN_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/bin CACHE FILEPATH "Install path for binaries")
436     set(DATA_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/apps CACHE FILEPATH "Install path for data files")
437     set(ICON_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/icons CACHE FILEPATH "Global icon install path")
438     set(XDG_APPS_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/applications CACHE FILEPATH "Install path for .desktop files")
439   endif(WIN32)
440 endif()
441
442 if(EMBED_DATA)
443   message(STATUS "Embedding data files into the binary")
444 else(EMBED_DATA)
445   message(STATUS "Installing data files separately")
446 endif(EMBED_DATA)
447
448 # RPATH needs to be set correctly
449 # Do this down here, since otherwise KDE wants to handle it itself, and fails
450 set(CMAKE_INSTALL_RPATH_USE_LINK_PATH 1)
451 set(CMAKE_BUILD_WITH_INSTALL_RPATH 1)
452
453 # Set global buildflags
454 # This is very much non-portable, so don't use -DSTATIC until you know what
455 # you do.
456 if(STATIC AND CMAKE_COMPILER_IS_GNUCXX)
457   set(CMAKE_CXX_FLAGS "-static-libgcc ${CMAKE_CXX_FLAGS}")
458   link_directories(${CMAKE_BINARY_DIR}/staticlibs) # override dynamic libs
459   if(HAVE_SSL)
460     set(QUASSEL_SSL_LIBRARIES ssl crypto)  # these miss in static builds
461   endif(HAVE_SSL)
462 endif(STATIC AND CMAKE_COMPILER_IS_GNUCXX)
463
464 if(WIN32)
465   link_libraries(imm32 winmm dbghelp Secur32)  # missing by default :/
466   if(MSVC)
467     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /DNOMINMAX")
468     set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBUGINFO "/debug /INCREMENTAL:YES /NODEFAULTLIB:libcmt /DEFAULTLIB:msvcrt")
469     set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/debug /INCREMENTAL:YES /NODEFAULTLIB:libcmt")
470     set(CMAKE_EXE_LINKER_FLAGS_DEBUGFULL "${CMAKE_EXE_LINKER_FLAGS_DEBUG}")
471     link_libraries(Version dwmapi shlwapi)
472     if(USE_QT5)
473       set(QT_QTMAIN_LIBRARY Qt5::WinMain)
474     endif(USE_QT5)
475   endif(MSVC)
476   if(HAVE_SSL AND STATIC)
477      find_package(OpenSSL REQUIRED)
478      link_libraries(${OPENSSL_LIBRARIES} ${OPENSSL_EAY_LIBRARIES})
479   endif(HAVE_SSL AND STATIC)
480 endif(WIN32)
481
482 if(INDICATEQT_FOUND)
483   add_definitions(-DXDG_APPS_INSTALL_DIR=${XDG_APPS_INSTALL_DIR})
484 endif()
485
486 if(NOT WIN32)
487   check_function_exists(umask HAVE_UMASK)
488   if(HAVE_UMASK)
489     add_definitions(-DHAVE_UMASK)
490   endif(HAVE_UMASK)
491 endif(NOT WIN32)
492
493 # Generate version information from Git
494 include(GetGitRevisionDescription)
495 get_git_head_revision(GIT_REFSPEC GIT_HEAD)
496 git_describe(GIT_DESCRIBE --long)
497
498 # Sanitize things if we're not in a Git repo
499 if(NOT GIT_HEAD OR NOT GIT_DESCRIBE)
500     set(GIT_HEAD "")
501     set(GIT_DESCRIBE "")
502 endif()
503
504 configure_file(version.h.in ${CMAKE_BINARY_DIR}/version.h @ONLY)
505
506 # These variables will be added to the main targets (CORE, QTCLIENT, MONO)
507 set(COMMON_DEPS ${RC_WIN32})
508 set(CORE_DEPS )
509 set(CLIENT_DEPS )
510
511 # Add needed subdirs - the order is important, since src needs some vars set by other dirs
512 add_subdirectory(data)
513 add_subdirectory(icons)
514 add_subdirectory(pics)
515 add_subdirectory(po)
516
517 # Set up and display feature summary
518 #####################################################################
519
520 feature_summary(WHAT ALL
521                 INCLUDE_QUIET_PACKAGES
522                 FATAL_ON_MISSING_REQUIRED_PACKAGES
523 )
524
525 # Finally, compile the sources
526 # We want this after displaying the feature summary to avoid ugly
527 # CMake backtraces in case a required Qt5 modules misses
528 #####################################################################
529
530 add_subdirectory(src)