1 # === This file is part of Calamares - <https://calamares.io> ===
3 # SPDX-FileCopyrightText: 2017 Adriaan de Groot <groot@kde.org>
4 # SPDX-License-Identifier: BSD-2-Clause
8 # Calamares is Free Software: see the License-Identifier above.
10 # Individual files may have different licenses (like the CMake
11 # infrastructure, which is BSD-2-Clause licensed). Check the SPDX
12 # identifiers in each file.
16 # Generally, this CMakeLists.txt will find all the dependencies for Calamares
17 # and complain appropriately. See below (later in this file) for CMake-level
18 # options. There are some "secret" options as well:
20 # SKIP_MODULES : a space or semicolon-separated list of directory names
21 # under src/modules that should not be built.
22 # USE_<foo> : fills in SKIP_MODULES for modules called <foo>-<something>
23 # WITH_<foo> : try to enable <foo> (these usually default to ON). For
24 # a list of WITH_<foo> grep CMakeCache.txt after running
25 # CMake once. These affect the ABI offered by Calamares.
26 # - PYTHON (enable Python Job modules)
27 # - QML (enable QML UI View modules)
28 # - PYTHONQT # TODO:3.3: remove
29 # BUILD_<foo> : choose additional things to build
30 # - TESTING (standard CMake option)
31 # - SCHEMA_TESTING (requires Python, see ci/configvalidator.py)
32 # DEBUG_<foo> : special developer flags for debugging
36 # cmake . -DSKIP_MODULES="partition luksbootkeycfg"
38 # One special target is "show-version", which can be built
39 # to obtain the version number from here.
41 # TODO:3.3: Require CMake 3.12
42 cmake_minimum_required( VERSION 3.3 FATAL_ERROR )
48 set( CALAMARES_VERSION_RC 0 ) # Set to 0 during release cycle, 1 during development
52 option( INSTALL_CONFIG "Install configuration files" OFF )
53 option( INSTALL_POLKIT "Install Polkit configuration" ON )
54 option( INSTALL_COMPLETION "Install shell completions" OFF )
55 # Options for the calamares executable
56 option( WITH_KF5Crash "Enable crash reporting with KCrash." ON ) # TODO:3.3: WITH->BUILD (this isn't an ABI thing)
57 option( WITH_KF5DBus "Use DBus service for unique-application." OFF ) # TODO:3.3: WITH->BUILD
58 # When adding WITH_* that affects the ABI offered by libcalamares,
59 # also update libcalamares/CalamaresConfig.h.in
60 option( WITH_PYTHON "Enable Python modules API (requires Boost.Python)." ON )
61 option( WITH_PYTHONQT "Enable Python view modules API (deprecated, requires PythonQt)." OFF ) # TODO:3.3: remove
62 option( WITH_QML "Enable QML UI options." ON )
64 # Additional parts to build
65 option( BUILD_SCHEMA_TESTING "Enable schema-validation-tests" ON )
68 # Possible debugging flags are:
69 # - DEBUG_TIMEZONES draws latitude and longitude lines on the timezone
70 # widget and enables chatty debug logging, for dealing with the timezone
72 # - DEBUG_FILESYSTEMS does extra logging and checking when looking at
73 # partition configuration. Lists known KPMCore FS types.
74 # - DEBUG_PARTITION_UNSAFE (see partition/CMakeLists.txt)
75 # - DEBUG_PARTITION_LAME (see partition/CMakeLists.txt)
80 # By convention, when there are multiple modules that implement similar
81 # functionality, and it only makes sense to have **at most one** of them
82 # enabled at any time, those modules are named <foo>-<implementation>.
83 # For example, services-systemd and services-openrc.
85 # Setting up SKIP_MODULES to ignore "the ones you don't want" can be
86 # annoying and error-prone (e.g. if a new module shows up). The USE_*
87 # modules provide a way to do automatic selection. To pick exactly
88 # one of the implementations from group <foo>, set USE_<foo> to the
89 # name of the implementation. If USE_<foo> is unset, or empty, then
90 # all the implementations are enabled (this just means they are
91 # **available** to `settings.conf`, not that they are used).
93 # To explicitly disable a set of modules, set USE_<foo>=none
94 # (e.g. the literal string none), which won't match any of the
95 # modules but is handled specially. This is the default for
96 # USE_os, which are modules for specialty non-Linux distributions.
98 # The following USE_* functionalities are available:
99 # - *services* picks one of the two service-configuration modules,
100 # for either systemd or openrc. This defaults to empty so that
101 # **both** modules are available.
102 # - *os* picks an OS-specific module for things-that-are-not-Linux.
103 # It is generally discouraged to use this unless your distro is
104 # completely unable to use standard Linux tools for configuration.
105 # This defaults to *none* so that nothing gets picked up and nothing
106 # is packaged -- you must explicitly set it to empty to get all of
107 # the modules, but that hardly makes sense. Note, too that there
108 # are currently no os-* modules shipped with Calamares.
109 set( USE_services "" CACHE STRING "Select the services module to use" )
110 set( USE_os "none" CACHE STRING "Select the OS-specific module to include" )
112 ### Calamares application info
114 set( CALAMARES_ORGANIZATION_NAME "Calamares" )
115 set( CALAMARES_ORGANIZATION_DOMAIN "github.com/calamares" )
116 set( CALAMARES_APPLICATION_NAME "Calamares" )
117 set( CALAMARES_DESCRIPTION_SUMMARY
118 "The distribution-independent installer framework" )
120 ### Transifex (languages) info
122 # complete = 100% translated,
123 # good = nearly complete (use own judgement, right now >= 75%)
124 # ok = incomplete (more than 25% untranslated, at least 5% translated),
125 # incomplete = <5% translated, placeholder in tx; these are not included.
127 # Language en (source language) is added later. It isn't listed in
128 # Transifex either. Get the list of languages and their status
129 # from https://transifex.com/calamares/calamares/ , or (preferably)
130 # use ci/txstats.py to automatically check.
132 # When adding a new language, take care that it is properly loaded
133 # by the translation framework. Languages with alternate scripts
134 # (sr@latin in particular) may need special handling in CalamaresUtils.cpp.
136 # TODO: drop the es_ES translation from Transifex
138 # NOTE: move eo (Esperanto) to _ok once Qt can actually create a
139 # locale for it. (Qt 5.12.2 can, see Translation Status section).
140 # NOTE: move ie (Interlingue) to _ok once Qt supports it.
141 # NOTE: update these lines by running `txstats.py`, or for full automation
142 # `txstats.py -e`. See also
145 set( _tx_complete az ca fi_FI fur he hr ja lt sq uk zh_CN zh_TW )
146 set( _tx_good as ast az_AZ be cs_CZ da de es fa fr hi hu it_IT ko
147 ml nl pt_BR pt_PT ru sk sv tg tr_TR vi )
148 set( _tx_ok ar bg bn el en_GB es_MX es_PR et eu gl id is mr nb pl
149 ro sl sr sr@latin th )
150 set( _tx_incomplete ca@valencia eo fr_CH gu ie kk kn lo lv mk ne_NP
153 ### Required versions
155 # See DEPENDENCIES section below.
156 set( QT_VERSION 5.9.0 )
157 set( YAMLCPP_VERSION 0.5.1 )
158 set( ECM_VERSION 5.18 )
159 set( PYTHONLIBS_VERSION 3.3 )
160 set( BOOSTPYTHON_VERSION 1.55.0 )
165 set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules" )
169 cmake_policy( SET CMP0057 NEW )
171 # Let ``AUTOMOC`` and ``AUTOUIC`` process ``GENERATED`` files.
173 cmake_policy( SET CMP0071 NEW )
175 # Recognize more macros to trigger automoc
176 if(NOT CMAKE_VERSION VERSION_LESS "3.10.0")
177 list(APPEND CMAKE_AUTOMOC_MACRO_NAMES
178 "K_PLUGIN_FACTORY_WITH_JSON"
179 "K_EXPORT_PLASMA_DATAENGINE_WITH_JSON"
180 "K_EXPORT_PLASMA_RUNNER"
185 include( CMakePackageConfigHelpers )
187 include( FeatureSummary )
190 include( CMakeColors )
194 set( CMAKE_CXX_STANDARD 17 )
195 set( CMAKE_CXX_STANDARD_REQUIRED ON )
196 set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror=return-type" )
197 set( CMAKE_CXX_FLAGS_DEBUG "-g ${CMAKE_CXX_FLAGS_DEBUG}" )
198 set( CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG" )
199 set( CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" )
200 set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g" )
202 set( CMAKE_C_STANDARD 99 )
203 set( CMAKE_C_STANDARD_REQUIRED ON )
204 set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall" )
205 set( CMAKE_C_FLAGS_DEBUG "-g" )
206 set( CMAKE_C_FLAGS_MINSIZEREL "-Os -DNDEBUG" )
207 set( CMAKE_C_FLAGS_RELEASE "-O4 -DNDEBUG" )
208 set( CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g" )
210 set( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined -Wl,--fatal-warnings" )
212 if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
213 message( STATUS "Found Clang ${CMAKE_CXX_COMPILER_VERSION}, setting up Clang-specific compiler flags." )
215 # Clang warnings: doing *everything* is counter-productive, since it warns
216 # about things which we can't fix (e.g. C++98 incompatibilities, but
217 # Calamares is C++17).
218 foreach( CLANG_WARNINGS
221 -Wno-c++98-compat-pedantic
223 -Wno-undefined-reinterpret-cast
224 -Wno-global-constructors
225 -Wno-exit-time-destructors
226 -Wno-missing-prototypes
227 -Wno-documentation-unknown-command
228 -Wno-unknown-warning-option
230 string( APPEND CMAKE_CXX_FLAGS " ${CLANG_WARNINGS}" )
233 # Third-party code where we don't care so much about compiler warnings
234 # (because it's uncomfortable to patch) get different flags; use
235 # mark_thirdparty_code( <file> [<file>...] )
236 # to switch off warnings for those sources.
237 set( SUPPRESS_3RDPARTY_WARNINGS "-Wno-everything" )
239 set( CMAKE_TOOLCHAIN_PREFIX "llvm-" )
241 # The path prefix is only relevant for CMake 3.16 and later, fixes #1286
242 set( CMAKE_AUTOMOC_PATH_PREFIX OFF )
243 set( CALAMARES_AUTOMOC_OPTIONS "-butils/moc-warnings.h" )
244 set( CALAMARES_AUTOUIC_OPTIONS --include utils/moc-warnings.h )
246 set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Woverloaded-virtual" )
248 set( SUPPRESS_3RDPARTY_WARNINGS "" )
251 # Use mark_thirdparty_code() to reduce warnings from the compiler
252 # on code that we're not going to fix. Call this with a list of files.
253 macro(mark_thirdparty_code)
254 set_source_files_properties( ${ARGV}
256 COMPILE_FLAGS "${SUPPRESS_3RDPARTY_WARNINGS}"
257 COMPILE_DEFINITIONS "THIRDPARTY"
261 if( CMAKE_COMPILER_IS_GNUCXX )
262 if( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9 OR
263 CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.9 )
264 message( STATUS "Found GNU g++ ${CMAKE_CXX_COMPILER_VERSION}, enabling colorized error messages." )
265 set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=auto" )
272 find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED Concurrent Core Gui LinguistTools Network Svg Widgets )
274 find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED Quick QuickWidgets )
277 find_package( Qt5DBus CONFIG )
279 find_package( YAMLCPP ${YAMLCPP_VERSION} REQUIRED )
281 find_package( PolkitQt5-1 REQUIRED )
283 # Find it anyway, for dependencies-reporting
284 find_package( PolkitQt5-1 )
286 set_package_properties(
287 PolkitQt5-1 PROPERTIES
288 DESCRIPTION "Qt5 support for Polkit"
289 URL "https://cgit.kde.org/polkit-qt-1.git"
290 PURPOSE "PolkitQt5-1 helps with installing Polkit configuration"
293 # Find ECM once, and add it to the module search path; Calamares
294 # modules that need ECM can do
295 # find_package(ECM ${ECM_VERSION} REQUIRED NO_MODULE),
296 # no need to mess with the module path after.
297 find_package(ECM ${ECM_VERSION} NO_MODULE)
299 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_MODULE_PATH})
301 # ECM implies that we can build the tests, too
302 find_package( Qt5 COMPONENTS Test REQUIRED )
303 include( ECMAddTests )
305 include(KDEInstallDirs)
308 find_package( KF5 QUIET COMPONENTS CoreAddons Crash DBusAddons )
309 set_package_properties(
310 KF5::CoreAddons PROPERTIES
312 DESCRIPTION "Classes built on QtCore for About Data"
313 URL "https://api.kde.org/frameworks/kcoreaddons/"
314 PURPOSE "About Calamares"
316 if( NOT KF5Crash_FOUND )
318 message(WARNING "WITH_KF5Crash is set, but KF5::Crash is not available.")
320 set( WITH_KF5Crash OFF )
322 if( NOT KF5DBusAddons_FOUND )
324 message(WARNING "WITH_KF5DBus is set, but KF5::DBusAddons is not available.")
326 set( WITH_KF5DBus OFF )
329 # TODO:3.3: Use FindPython3 instead
330 find_package( PythonInterp ${PYTHONLIBS_VERSION} )
331 set_package_properties(
332 PythonInterp PROPERTIES
333 DESCRIPTION "Python 3 interpreter."
334 URL "https://python.org"
335 PURPOSE "Python 3 interpreter for certain tests."
338 set( _schema_explanation "" )
339 if ( PYTHONINTERP_FOUND )
340 if ( BUILD_SCHEMA_TESTING )
341 # The configuration validator script has some dependencies,
342 # and if they are not installed, don't run. If errors out
343 # with exit(1) on missing dependencies.
344 if ( CALAMARES_CONFIGVALIDATOR_CHECKED )
345 set( _validator_deps ${CALAMARES_CONFIGVALIDATOR_RESULT} )
347 exec_program( ${PYTHON_EXECUTABLE} ARGS "${CMAKE_SOURCE_DIR}/ci/configvalidator.py" -x RETURN_VALUE _validator_deps )
348 set( CALAMARES_CONFIGVALIDATOR_CHECKED TRUE CACHE INTERNAL "Dependencies for configvalidator checked" )
349 set( CALAMARES_CONFIGVALIDATOR_RESULT ${_validator_deps} CACHE INTERNAL "Result of configvalidator dependency check" )
351 # It should never succeed, but only returns 1 when the imports fail
352 if ( _validator_deps EQUAL 1 )
353 set( _schema_explanation " Missing dependencies for configvalidator.py." )
354 set( BUILD_SCHEMA_TESTING OFF )
358 # Can't run schema tests without Python3.
359 set( _schema_explanation " Missing Python3." )
360 set( BUILD_SCHEMA_TESTING OFF )
362 add_feature_info( yaml-schema BUILD_SCHEMA_TESTING "Validate YAML (config files) with schema.${_schema_explanation}" )
364 find_package( PythonLibs ${PYTHONLIBS_VERSION} )
365 set_package_properties(
366 PythonLibs PROPERTIES
367 DESCRIPTION "C interface libraries for the Python 3 interpreter."
368 URL "https://python.org"
369 PURPOSE "Python 3 is used for Python job modules."
372 if ( PYTHONLIBS_FOUND )
373 # TODO:3.3: Require Boost + CMake; sort out Boost::Python
374 # Since Boost provides CMake config files (starting with Boost 1.70.
375 # or so) the mess that is the Calamares find code picks the wrong
376 # bits. Suppress those CMake config files, as suggested by @jmrcpn
377 set(Boost_NO_BOOST_CMAKE ON)
378 include( BoostPython3 )
379 find_boost_python3( ${BOOSTPYTHON_VERSION} ${PYTHONLIBS_VERSION_STRING} CALAMARES_BOOST_PYTHON3_FOUND )
380 set_package_properties(
382 PURPOSE "Boost.Python is used for Python job modules."
384 # TODO:3.3: Remove PythonQt support
385 find_package( PythonQt )
386 set_package_properties( PythonQt PROPERTIES
387 DESCRIPTION "A Python embedding solution for Qt applications."
388 URL "http://pythonqt.sourceforge.net"
389 PURPOSE "PythonQt is used for Python view modules."
393 if( NOT PYTHONLIBS_FOUND OR NOT CALAMARES_BOOST_PYTHON3_FOUND )
394 message(STATUS "Disabling Boost::Python modules")
395 set( WITH_PYTHON OFF )
397 if( NOT PYTHONLIBS_FOUND OR NOT PYTHONQT_FOUND )
398 message(STATUS "Disabling PythonQt modules")
399 set( WITH_PYTHONQT OFF )
402 # Now we know the state of the ABI-options, copy them into "Calamares_"
403 # prefixed variables, to match how the variables would-be-named
404 # when building out-of-tree.
405 set(Calamares_WITH_PYTHON ${WITH_PYTHON})
406 set(Calamares_WITH_PYTHONQT ${WITH_PYTHONQT})
407 set(Calamares_WITH_QML ${WITH_QML})
409 ### Transifex Translation status
411 # Construct language lists for use.
413 if( Qt5_VERSION VERSION_GREATER 5.12.1 )
414 # At least Qt 5.12.2 seems to support Esperanto in QLocale
415 if( "eo" IN_LIST _tx_incomplete )
416 message(STATUS "Esperanto support since Qt 5.12.2, enabling Esperanto locale")
417 list( REMOVE_ITEM _tx_incomplete "eo" )
418 list( APPEND _tx_ok "eo" )
422 set( curr_tx ${_tx_complete} ${_tx_good} ${_tx_ok} ${_tx_incomplete} )
426 foreach( l ${curr_tx} )
427 set( p_l "lang/calamares_${l}.ts" )
428 if( NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${p_l} )
429 message(WARNING "Language ${l} has no .ts file yet.")
439 message( FATAL_ERROR "Translation warnings, see above." )
442 set( CALAMARES_TRANSLATION_LANGUAGES en ${_tx_complete} ${_tx_good} ${_tx_ok} )
443 list( SORT CALAMARES_TRANSLATION_LANGUAGES )
445 add_subdirectory( lang ) # i18n tools
449 # For testing purposes Calamares includes a very, very, limited sample
450 # distro called "Generic". The root filesystem of "Generic" lives in
451 # data/example-root and can be squashed up as part of the build, so
452 # that a pure-upstream run of ./calamares -d from the build directory
453 # (with all the default settings and configurations) can actually
454 # do an complete example run.
456 # Some binaries from the build host (e.g. /bin and /lib) are also
457 # squashed into the example filesystem.
459 # To build the example distro (for use by the default, example,
460 # unsquashfs module), build the target 'example-distro', eg.:
462 # make example-distro
464 find_program( mksquashfs_PROGRAM mksquashfs )
465 if( mksquashfs_PROGRAM )
466 set( mksquashfs_FOUND ON )
467 set( src_fs ${CMAKE_SOURCE_DIR}/data/example-root/ )
468 set( dst_fs ${CMAKE_BINARY_DIR}/example.sqfs )
469 if( EXISTS ${src_fs} )
470 # based on the build host. If /lib64 exists, assume it is needed.
471 # Collect directories needed for a minimal binary distro,
472 # Note that the last path component is added to the root, so
473 # if you add /usr/sbin here, it will be put into /sbin_1.
474 # Add such paths to /etc/profile under ${src_fs}.
475 set( candidate_fs /sbin /bin /lib /lib64 )
477 foreach( c_fs ${candidate_fs} )
479 list( APPEND host_fs ${c_fs} )
484 COMMAND ${mksquashfs_PROGRAM} ${src_fs} ${dst_fs} -all-root
485 COMMAND ${mksquashfs_PROGRAM} ${host_fs} ${dst_fs} -all-root
487 add_custom_target(example-distro DEPENDS ${dst_fs})
490 set( mksquashfs_FOUND OFF )
492 # Doesn't list mksquashfs as an optional dep, though, because it
493 # hasn't been sent through the find_package() scheme.
495 # "http://tldp.org/HOWTO/SquashFS-HOWTO/creatingandusing.html"
496 add_feature_info( ExampleDistro ${mksquashfs_FOUND} "Create example-distro target.")
501 set( CALAMARES_VERSION ${CALAMARES_VERSION_MAJOR}.${CALAMARES_VERSION_MINOR}.${CALAMARES_VERSION_PATCH} )
502 # In rare cases we have hotfix-releases with a tweak
503 if( CALAMARES_VERSION_TWEAK )
504 set( CALAMARES_VERSION "${CALAMARES_VERSION}.${CALAMARES_VERSION_TWEAK}" )
506 set( CALAMARES_VERSION_SHORT "${CALAMARES_VERSION}" )
507 if( CALAMARES_VERSION_RC )
508 set( CALAMARES_VERSION ${CALAMARES_VERSION}rc${CALAMARES_VERSION_RC} )
511 # Additional info for non-release builds. The "extended" version information
512 # with date and git information (commit, dirty status) is used only
513 # by CalamaresVersionX.h, which is included by consumers that need a full
514 # version number with all that information; normal consumers can include
515 # CalamaresVersion.h with more stable numbers.
516 if( NOT BUILD_RELEASE AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git/" )
517 include( CMakeDateStamp )
518 set( CALAMARES_VERSION_DATE "${CMAKE_DATESTAMP_YEAR}${CMAKE_DATESTAMP_MONTH}${CMAKE_DATESTAMP_DAY}" )
519 if( CALAMARES_VERSION_DATE GREATER 0 )
520 set( CALAMARES_VERSION ${CALAMARES_VERSION}.${CALAMARES_VERSION_DATE} )
523 include( CMakeVersionSource )
524 if( CMAKE_VERSION_SOURCE )
525 set( CALAMARES_VERSION ${CALAMARES_VERSION}-${CMAKE_VERSION_SOURCE} )
529 # Special target for not-RC (e.g. might-be-release) builds.
530 # This is used by the release script to get the version.
531 if ( CALAMARES_VERSION_RC EQUAL 0 )
532 add_custom_target(show-version
533 ${CMAKE_COMMAND} -E echo CALAMARES_VERSION=${CALAMARES_VERSION_SHORT}
538 # enforce using constBegin, constEnd for const-iterators
540 -DQT_STRICT_ITERATORS
542 -DQT_SHAREDPOINTER_TRACK_POINTERS
546 set( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" )
547 set( CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" )
548 set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" )
550 # Better default installation paths: GNUInstallDirs defines
551 # CMAKE_INSTALL_FULL_SYSCONFDIR to be CMAKE_INSTALL_PREFIX/etc by default
552 # but we really want /etc
553 if( NOT DEFINED CMAKE_INSTALL_SYSCONFDIR )
554 set( CMAKE_INSTALL_SYSCONFDIR "/etc" )
557 # make predefined install dirs available everywhere
558 include( GNUInstallDirs )
560 # This is used by CalamaresAddLibrary; once Calamares is installed,
561 # the CalamaresConfig.cmake module sets this variable to the IMPORTED
562 # libraries for Calamares.
563 set( Calamares_LIBRARIES calamares )
565 add_subdirectory( src )
567 add_feature_info(Python ${WITH_PYTHON} "Python job modules")
568 add_feature_info(PythonQt ${WITH_PYTHONQT} "Python view modules")
569 add_feature_info(Config ${INSTALL_CONFIG} "Install Calamares configuration")
570 add_feature_info(KCrash ${WITH_KF5Crash} "Crash dumps via KCrash")
571 add_feature_info(KDBusAddons ${WITH_KF5DBus} "Unique-application via DBus")
573 ### CMake infrastructure installation
576 set( CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/Calamares" CACHE PATH "Installation directory for CMake files" )
577 set( CMAKE_INSTALL_FULL_CMAKEDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_CMAKEDIR}" )
579 export( PACKAGE Calamares )
580 configure_package_config_file(
581 "CalamaresConfig.cmake.in"
582 "${PROJECT_BINARY_DIR}/CalamaresConfig.cmake"
583 INSTALL_DESTINATION "${CMAKE_INSTALL_CMAKEDIR}"
585 CMAKE_INSTALL_INCLUDEDIR
587 CMAKE_INSTALL_DATADIR
589 write_basic_package_version_file(
590 ${PROJECT_BINARY_DIR}/CalamaresConfigVersion.cmake
591 VERSION ${PROJECT_VERSION}
592 COMPATIBILITY SameMajorVersion
596 DESTINATION "${CMAKE_INSTALL_CMAKEDIR}"
597 FILE "CalamaresTargets.cmake"
598 NAMESPACE Calamares::
601 # Install the cmake files
604 "${PROJECT_BINARY_DIR}/CalamaresConfig.cmake"
605 "${PROJECT_BINARY_DIR}/CalamaresConfigVersion.cmake"
606 "CMakeModules/CalamaresAddBrandingSubdirectory.cmake"
607 "CMakeModules/CalamaresAddLibrary.cmake"
608 "CMakeModules/CalamaresAddModuleSubdirectory.cmake"
609 "CMakeModules/CalamaresAddPlugin.cmake"
610 "CMakeModules/CalamaresAddTest.cmake"
611 "CMakeModules/CalamaresAddTranslations.cmake"
612 "CMakeModules/CalamaresAutomoc.cmake"
613 "CMakeModules/CMakeColors.cmake"
614 "CMakeModules/FindYAMLCPP.cmake"
616 "${CMAKE_INSTALL_CMAKEDIR}"
619 ### Miscellaneous installs
625 DESTINATION share/calamares
631 FILES com.github.calamares.calamares.policy
632 DESTINATION "${POLKITQT-1_POLICY_FILES_INSTALL_DIR}"
636 if ( INSTALL_COMPLETION )
637 if( NOT CMAKE_INSTALL_BASHCOMPLETIONDIR )
638 set( CMAKE_INSTALL_BASHCOMPLETIONDIR "${CMAKE_INSTALL_DATADIR}/bash-completion/completions" )
641 install( FILES ${CMAKE_SOURCE_DIR}/data/completion/bash/calamares DESTINATION "${CMAKE_INSTALL_BASHCOMPLETIONDIR}" )
645 FILES calamares.desktop
646 DESTINATION ${CMAKE_INSTALL_DATADIR}/applications
650 FILES man/calamares.8
651 DESTINATION ${CMAKE_INSTALL_MANDIR}/man8/
656 "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
657 "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
661 add_custom_target( uninstall
662 COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
665 ### CMAKE SUMMARY REPORT
667 get_directory_property( SKIPPED_MODULES
668 DIRECTORY src/modules
669 DEFINITION LIST_SKIPPED_MODULES
671 calamares_explain_skipped_modules( ${SKIPPED_MODULES} )
674 WHAT DISABLED_FEATURES
675 DESCRIPTION "The following features have been disabled:"
679 WHAT OPTIONAL_PACKAGES_NOT_FOUND
680 DESCRIPTION "The following OPTIONAL packages were not found:"
684 WHAT REQUIRED_PACKAGES_NOT_FOUND
685 FATAL_ON_MISSING_REQUIRED_PACKAGES
686 DESCRIPTION "The following REQUIRED packages were not found:"