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 1 ) # 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.
97 # The following USE_* functionalities are available:
98 # - *services* picks one of the two service-configuration modules,
99 # for either systemd or openrc. This defaults to empty so that
100 # **both** modules are available.
101 set( USE_services "" CACHE STRING "Select the services module to use" )
103 ### Calamares application info
105 set( CALAMARES_ORGANIZATION_NAME "Calamares" )
106 set( CALAMARES_ORGANIZATION_DOMAIN "github.com/calamares" )
107 set( CALAMARES_APPLICATION_NAME "Calamares" )
108 set( CALAMARES_DESCRIPTION_SUMMARY
109 "The distribution-independent installer framework" )
111 ### Transifex (languages) info
113 # complete = 100% translated,
114 # good = nearly complete (use own judgement, right now >= 75%)
115 # ok = incomplete (more than 25% untranslated, at least 5% translated),
116 # incomplete = <5% translated, placeholder in tx; these are not included.
118 # Language en (source language) is added later. It isn't listed in
119 # Transifex either. Get the list of languages and their status
120 # from https://transifex.com/calamares/calamares/ , or (preferably)
121 # use ci/txstats.py to automatically check.
123 # When adding a new language, take care that it is properly loaded
124 # by the translation framework. Languages with alternate scripts
125 # (sr@latin in particular) may need special handling in CalamaresUtils.cpp.
127 # TODO: drop the es_ES translation from Transifex
129 # NOTE: move eo (Esperanto) to _ok once Qt can actually create a
130 # locale for it. (Qt 5.12.2 can, see Translation Status section).
131 # NOTE: move ie (Interlingue) to _ok once Qt supports it.
132 # NOTE: update these lines by running `txstats.py`, or for full automation
133 # `txstats.py -e`. See also
136 set( _tx_complete az az_AZ ca de fi_FI he hi hr ja ko lt pt_BR sq
138 set( _tx_good as be ca@valencia cs_CZ da fr fur it_IT ml nl pt_PT
139 ru sk tg tr_TR vi zh_CN )
140 set( _tx_ok ar ast bg bn el en_GB es es_MX es_PR et eu fa gl hu id
141 is mr nb pl ro si sl sr sr@latin th zh_HK )
142 set( _tx_incomplete eo es_PE fr_CH gu id_ID ie kk kn ko_KR lo lv mk
143 ne ne_NP ru_RU te ur uz zh )
145 ### Required versions
147 # See DEPENDENCIES section below.
148 set( QT_VERSION 5.9.0 )
149 set( YAMLCPP_VERSION 0.5.1 )
150 set( ECM_VERSION 5.18 )
151 set( PYTHONLIBS_VERSION 3.3 )
152 set( BOOSTPYTHON_VERSION 1.55.0 )
157 set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules" )
161 cmake_policy( SET CMP0057 NEW )
163 # Let ``AUTOMOC`` and ``AUTOUIC`` process ``GENERATED`` files.
165 cmake_policy( SET CMP0071 NEW )
167 # Recognize more macros to trigger automoc
168 if(NOT CMAKE_VERSION VERSION_LESS "3.10.0")
169 list(APPEND CMAKE_AUTOMOC_MACRO_NAMES
170 "K_PLUGIN_FACTORY_WITH_JSON"
171 "K_EXPORT_PLASMA_DATAENGINE_WITH_JSON"
172 "K_EXPORT_PLASMA_RUNNER"
177 include( CMakePackageConfigHelpers )
179 include( FeatureSummary )
182 include( CMakeColors )
186 set( CMAKE_CXX_STANDARD 17 )
187 set( CMAKE_CXX_STANDARD_REQUIRED ON )
188 set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror=return-type" )
189 set( CMAKE_CXX_FLAGS_DEBUG "-Og -g ${CMAKE_CXX_FLAGS_DEBUG}" )
190 set( CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG" )
191 set( CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" )
192 set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g" )
194 set( CMAKE_C_STANDARD 99 )
195 set( CMAKE_C_STANDARD_REQUIRED ON )
196 set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall" )
197 set( CMAKE_C_FLAGS_DEBUG "-Og -g" )
198 set( CMAKE_C_FLAGS_MINSIZEREL "-Os -DNDEBUG" )
199 set( CMAKE_C_FLAGS_RELEASE "-O4 -DNDEBUG" )
200 set( CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g" )
202 set( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined -Wl,--fatal-warnings" )
204 if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
205 message( STATUS "Found Clang ${CMAKE_CXX_COMPILER_VERSION}, setting up Clang-specific compiler flags." )
207 # Clang warnings: doing *everything* is counter-productive, since it warns
208 # about things which we can't fix (e.g. C++98 incompatibilities, but
209 # Calamares is C++17).
210 foreach( CLANG_WARNINGS
213 -Wno-c++98-compat-pedantic
215 -Wno-undefined-reinterpret-cast
216 -Wno-global-constructors
217 -Wno-exit-time-destructors
218 -Wno-missing-prototypes
219 -Wno-documentation-unknown-command
220 -Wno-unknown-warning-option
222 string( APPEND CMAKE_CXX_FLAGS " ${CLANG_WARNINGS}" )
225 # The dwarf-debugging flags are slightly different, too
226 string( APPEND CMAKE_CXX_FLAGS_DEBUG " -gdwarf" )
227 string( APPEND CMAKE_C_FLAGS_DEBUG " -gdwarf" )
229 # Third-party code where we don't care so much about compiler warnings
230 # (because it's uncomfortable to patch) get different flags; use
231 # mark_thirdparty_code( <file> [<file>...] )
232 # to switch off warnings for those sources.
233 set( SUPPRESS_3RDPARTY_WARNINGS "-Wno-everything" )
235 set( CMAKE_TOOLCHAIN_PREFIX "llvm-" )
237 # The path prefix is only relevant for CMake 3.16 and later, fixes #1286
238 set( CMAKE_AUTOMOC_PATH_PREFIX OFF )
239 set( CALAMARES_AUTOMOC_OPTIONS "-butils/moc-warnings.h" )
240 set( CALAMARES_AUTOUIC_OPTIONS --include utils/moc-warnings.h )
242 set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Woverloaded-virtual" )
244 set( SUPPRESS_3RDPARTY_WARNINGS "" )
247 # Use mark_thirdparty_code() to reduce warnings from the compiler
248 # on code that we're not going to fix. Call this with a list of files.
249 macro(mark_thirdparty_code)
250 set_source_files_properties( ${ARGV}
252 COMPILE_FLAGS "${SUPPRESS_3RDPARTY_WARNINGS}"
253 COMPILE_DEFINITIONS "THIRDPARTY"
257 if( CMAKE_COMPILER_IS_GNUCXX )
258 if( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9 OR
259 CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.9 )
260 message( STATUS "Found GNU g++ ${CMAKE_CXX_COMPILER_VERSION}, enabling colorized error messages." )
261 set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=auto" )
268 find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED Concurrent Core Gui LinguistTools Network Svg Widgets )
270 find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED Quick QuickWidgets )
273 find_package( Qt5DBus CONFIG )
275 find_package( YAMLCPP ${YAMLCPP_VERSION} REQUIRED )
277 find_package( PolkitQt5-1 REQUIRED )
279 # Find it anyway, for dependencies-reporting
280 find_package( PolkitQt5-1 )
282 set_package_properties(
283 PolkitQt5-1 PROPERTIES
284 DESCRIPTION "Qt5 support for Polkit"
285 URL "https://cgit.kde.org/polkit-qt-1.git"
286 PURPOSE "PolkitQt5-1 helps with installing Polkit configuration"
289 # Find ECM once, and add it to the module search path; Calamares
290 # modules that need ECM can do
291 # find_package(ECM ${ECM_VERSION} REQUIRED NO_MODULE),
292 # no need to mess with the module path after.
293 find_package(ECM ${ECM_VERSION} NO_MODULE)
295 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_MODULE_PATH})
297 # ECM implies that we can build the tests, too
298 find_package( Qt5 COMPONENTS Test REQUIRED )
299 include( ECMAddTests )
301 include(KDEInstallDirs)
304 find_package( KF5 QUIET COMPONENTS CoreAddons Crash DBusAddons )
305 set_package_properties(
306 KF5::CoreAddons PROPERTIES
308 DESCRIPTION "Classes built on QtCore for About Data"
309 URL "https://api.kde.org/frameworks/kcoreaddons/"
310 PURPOSE "About Calamares"
312 if( NOT KF5Crash_FOUND )
314 message(WARNING "WITH_KF5Crash is set, but KF5::Crash is not available.")
316 set( WITH_KF5Crash OFF )
318 if( NOT KF5DBusAddons_FOUND )
320 message(WARNING "WITH_KF5DBus is set, but KF5::DBusAddons is not available.")
322 set( WITH_KF5DBus OFF )
325 # TODO:3.3: Use FindPython3 instead
326 find_package( PythonInterp ${PYTHONLIBS_VERSION} )
327 set_package_properties(
328 PythonInterp PROPERTIES
329 DESCRIPTION "Python 3 interpreter."
330 URL "https://python.org"
331 PURPOSE "Python 3 interpreter for certain tests."
334 set( _schema_explanation "" )
335 if ( PYTHONINTERP_FOUND )
336 if ( BUILD_SCHEMA_TESTING )
337 # The configuration validator script has some dependencies,
338 # and if they are not installed, don't run. If errors out
339 # with exit(1) on missing dependencies.
340 if ( CALAMARES_CONFIGVALIDATOR_CHECKED )
341 set( _validator_deps ${CALAMARES_CONFIGVALIDATOR_RESULT} )
343 exec_program( ${PYTHON_EXECUTABLE} ARGS "${CMAKE_SOURCE_DIR}/ci/configvalidator.py" -x RETURN_VALUE _validator_deps )
344 set( CALAMARES_CONFIGVALIDATOR_CHECKED TRUE CACHE INTERNAL "Dependencies for configvalidator checked" )
345 set( CALAMARES_CONFIGVALIDATOR_RESULT ${_validator_deps} CACHE INTERNAL "Result of configvalidator dependency check" )
347 # It should never succeed, but only returns 1 when the imports fail
348 if ( _validator_deps EQUAL 1 )
349 set( _schema_explanation " Missing dependencies for configvalidator.py." )
350 set( BUILD_SCHEMA_TESTING OFF )
354 # Can't run schema tests without Python3.
355 set( _schema_explanation " Missing Python3." )
356 set( BUILD_SCHEMA_TESTING OFF )
358 add_feature_info( yaml-schema BUILD_SCHEMA_TESTING "Validate YAML (config files) with schema.${_schema_explanation}" )
360 find_package( PythonLibs ${PYTHONLIBS_VERSION} )
361 set_package_properties(
362 PythonLibs PROPERTIES
363 DESCRIPTION "C interface libraries for the Python 3 interpreter."
364 URL "https://python.org"
365 PURPOSE "Python 3 is used for Python job modules."
368 if ( PYTHONLIBS_FOUND )
369 # TODO:3.3: Require Boost + CMake; sort out Boost::Python
370 # Since Boost provides CMake config files (starting with Boost 1.70.
371 # or so) the mess that is the Calamares find code picks the wrong
372 # bits. Suppress those CMake config files, as suggested by @jmrcpn
373 set(Boost_NO_BOOST_CMAKE ON)
374 include( BoostPython3 )
375 find_boost_python3( ${BOOSTPYTHON_VERSION} ${PYTHONLIBS_VERSION_STRING} CALAMARES_BOOST_PYTHON3_FOUND )
376 set_package_properties(
378 PURPOSE "Boost.Python is used for Python job modules."
380 # TODO:3.3: Remove PythonQt support
381 find_package( PythonQt )
382 set_package_properties( PythonQt PROPERTIES
383 DESCRIPTION "A Python embedding solution for Qt applications."
384 URL "http://pythonqt.sourceforge.net"
385 PURPOSE "PythonQt is used for Python view modules."
389 if( NOT PYTHONLIBS_FOUND OR NOT CALAMARES_BOOST_PYTHON3_FOUND )
390 message(STATUS "Disabling Boost::Python modules")
391 set( WITH_PYTHON OFF )
393 if( NOT PYTHONLIBS_FOUND OR NOT PYTHONQT_FOUND )
394 message(STATUS "Disabling PythonQt modules")
395 set( WITH_PYTHONQT OFF )
398 # Now we know the state of the ABI-options, copy them into "Calamares_"
399 # prefixed variables, to match how the variables would-be-named
400 # when building out-of-tree.
401 set(Calamares_WITH_PYTHON ${WITH_PYTHON})
402 set(Calamares_WITH_PYTHONQT ${WITH_PYTHONQT})
403 set(Calamares_WITH_QML ${WITH_QML})
405 ### Transifex Translation status
407 # Construct language lists for use.
409 if( Qt5_VERSION VERSION_GREATER 5.12.1 )
410 # At least Qt 5.12.2 seems to support Esperanto in QLocale
411 if( "eo" IN_LIST _tx_incomplete )
412 message(STATUS "Esperanto support since Qt 5.12.2, enabling Esperanto locale")
413 list( REMOVE_ITEM _tx_incomplete "eo" )
414 list( APPEND _tx_ok "eo" )
418 set( curr_tx ${_tx_complete} ${_tx_good} ${_tx_ok} ${_tx_incomplete} )
422 foreach( l ${curr_tx} )
423 set( p_l "lang/calamares_${l}.ts" )
424 if( NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${p_l} )
425 message(WARNING "Language ${l} has no .ts file yet.")
435 message( FATAL_ERROR "Translation warnings, see above." )
438 set( CALAMARES_TRANSLATION_LANGUAGES en ${_tx_complete} ${_tx_good} ${_tx_ok} )
439 list( SORT CALAMARES_TRANSLATION_LANGUAGES )
441 add_subdirectory( lang ) # i18n tools
445 # For testing purposes Calamares includes a very, very, limited sample
446 # distro called "Generic". The root filesystem of "Generic" lives in
447 # data/example-root and can be squashed up as part of the build, so
448 # that a pure-upstream run of ./calamares -d from the build directory
449 # (with all the default settings and configurations) can actually
450 # do an complete example run.
452 # Some binaries from the build host (e.g. /bin and /lib) are also
453 # squashed into the example filesystem.
455 # To build the example distro (for use by the default, example,
456 # unsquashfs module), build the target 'example-distro', eg.:
458 # make example-distro
460 find_program( mksquashfs_PROGRAM mksquashfs )
461 if( mksquashfs_PROGRAM )
462 set( mksquashfs_FOUND ON )
463 set( src_fs ${CMAKE_SOURCE_DIR}/data/example-root/ )
464 set( dst_fs ${CMAKE_BINARY_DIR}/example.sqfs )
465 if( EXISTS ${src_fs} )
466 # based on the build host. If /lib64 exists, assume it is needed.
467 # Collect directories needed for a minimal binary distro,
468 # Note that the last path component is added to the root, so
469 # if you add /usr/sbin here, it will be put into /sbin_1.
470 # Add such paths to /etc/profile under ${src_fs}.
471 set( candidate_fs /sbin /bin /lib /lib64 )
473 foreach( c_fs ${candidate_fs} )
475 list( APPEND host_fs ${c_fs} )
480 COMMAND ${mksquashfs_PROGRAM} ${src_fs} ${dst_fs} -all-root
481 COMMAND ${mksquashfs_PROGRAM} ${host_fs} ${dst_fs} -all-root
483 add_custom_target(example-distro DEPENDS ${dst_fs})
486 set( mksquashfs_FOUND OFF )
488 # Doesn't list mksquashfs as an optional dep, though, because it
489 # hasn't been sent through the find_package() scheme.
491 # "http://tldp.org/HOWTO/SquashFS-HOWTO/creatingandusing.html"
492 add_feature_info( ExampleDistro ${mksquashfs_FOUND} "Create example-distro target.")
497 set( CALAMARES_VERSION ${CALAMARES_VERSION_MAJOR}.${CALAMARES_VERSION_MINOR}.${CALAMARES_VERSION_PATCH} )
498 # In rare cases we have hotfix-releases with a tweak
499 if( CALAMARES_VERSION_TWEAK )
500 set( CALAMARES_VERSION "${CALAMARES_VERSION}.${CALAMARES_VERSION_TWEAK}" )
502 set( CALAMARES_VERSION_SHORT "${CALAMARES_VERSION}" )
504 # Additional info for non-release builds. The "extended" version information
505 # with date and git information (commit, dirty status) is used only
506 # by CalamaresVersionX.h, which is included by consumers that need a full
507 # version number with all that information; normal consumers can include
508 # CalamaresVersion.h with more stable numbers.
509 if( NOT BUILD_RELEASE AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git/" )
510 include( ExtendedVersion )
511 extend_version( "${CALAMARES_VERSION}" OFF CALAMARES_VERSION_SHORT CALAMARES_VERSION )
514 # Special target for not-RC (e.g. might-be-release) builds.
515 # This is used by the release script to get the version.
516 if ( CALAMARES_VERSION_RC EQUAL 0 )
517 add_custom_target(show-version
518 ${CMAKE_COMMAND} -E echo CALAMARES_VERSION=${CALAMARES_VERSION_SHORT}
523 # enforce using constBegin, constEnd for const-iterators
525 -DQT_STRICT_ITERATORS
527 -DQT_SHAREDPOINTER_TRACK_POINTERS
531 set( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" )
532 set( CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" )
533 set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" )
535 # Better default installation paths: GNUInstallDirs defines
536 # CMAKE_INSTALL_FULL_SYSCONFDIR to be CMAKE_INSTALL_PREFIX/etc by default
537 # but we really want /etc
538 if( NOT DEFINED CMAKE_INSTALL_SYSCONFDIR )
539 set( CMAKE_INSTALL_SYSCONFDIR "/etc" )
542 # make predefined install dirs available everywhere
543 include( GNUInstallDirs )
545 # This is used by CalamaresAddLibrary; once Calamares is installed,
546 # the CalamaresConfig.cmake module sets this variable to the IMPORTED
547 # libraries for Calamares.
548 set( Calamares_LIBRARIES calamares )
550 add_subdirectory( src )
552 add_feature_info(Python ${WITH_PYTHON} "Python job modules")
553 add_feature_info(PythonQt ${WITH_PYTHONQT} "Python view modules")
554 add_feature_info(Config ${INSTALL_CONFIG} "Install Calamares configuration")
555 add_feature_info(KCrash ${WITH_KF5Crash} "Crash dumps via KCrash")
556 add_feature_info(KDBusAddons ${WITH_KF5DBus} "Unique-application via DBus")
558 ### CMake infrastructure installation
561 set( CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/Calamares" CACHE PATH "Installation directory for CMake files" )
562 set( CMAKE_INSTALL_FULL_CMAKEDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_CMAKEDIR}" )
564 export( PACKAGE Calamares )
565 configure_package_config_file(
566 "CalamaresConfig.cmake.in"
567 "${PROJECT_BINARY_DIR}/CalamaresConfig.cmake"
568 INSTALL_DESTINATION "${CMAKE_INSTALL_CMAKEDIR}"
570 CMAKE_INSTALL_INCLUDEDIR
572 CMAKE_INSTALL_DATADIR
574 write_basic_package_version_file(
575 ${PROJECT_BINARY_DIR}/CalamaresConfigVersion.cmake
576 VERSION ${PROJECT_VERSION}
577 COMPATIBILITY SameMajorVersion
581 DESTINATION "${CMAKE_INSTALL_CMAKEDIR}"
582 FILE "CalamaresTargets.cmake"
583 NAMESPACE Calamares::
586 # Install the cmake files
589 "${PROJECT_BINARY_DIR}/CalamaresConfig.cmake"
590 "${PROJECT_BINARY_DIR}/CalamaresConfigVersion.cmake"
591 "CMakeModules/CalamaresAddBrandingSubdirectory.cmake"
592 "CMakeModules/CalamaresAddLibrary.cmake"
593 "CMakeModules/CalamaresAddModuleSubdirectory.cmake"
594 "CMakeModules/CalamaresAddPlugin.cmake"
595 "CMakeModules/CalamaresAddTest.cmake"
596 "CMakeModules/CalamaresAddTranslations.cmake"
597 "CMakeModules/CalamaresAutomoc.cmake"
598 "CMakeModules/CalamaresCheckModuleSelection.cmake"
599 "CMakeModules/CMakeColors.cmake"
600 "CMakeModules/FindYAMLCPP.cmake"
602 "${CMAKE_INSTALL_CMAKEDIR}"
605 ### Miscellaneous installs
611 DESTINATION share/calamares
617 FILES com.github.calamares.calamares.policy
618 DESTINATION "${POLKITQT-1_POLICY_FILES_INSTALL_DIR}"
622 if ( INSTALL_COMPLETION )
623 if( NOT CMAKE_INSTALL_BASHCOMPLETIONDIR )
624 set( CMAKE_INSTALL_BASHCOMPLETIONDIR "${CMAKE_INSTALL_DATADIR}/bash-completion/completions" )
627 install( FILES ${CMAKE_SOURCE_DIR}/data/completion/bash/calamares DESTINATION "${CMAKE_INSTALL_BASHCOMPLETIONDIR}" )
631 FILES calamares.desktop
632 DESTINATION ${CMAKE_INSTALL_DATADIR}/applications
636 FILES man/calamares.8
637 DESTINATION ${CMAKE_INSTALL_MANDIR}/man8/
642 "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
643 "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
647 add_custom_target( uninstall
648 COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
651 ### CMAKE SUMMARY REPORT
653 get_directory_property( SKIPPED_MODULES
654 DIRECTORY src/modules
655 DEFINITION LIST_SKIPPED_MODULES
657 calamares_explain_skipped_modules( ${SKIPPED_MODULES} )
660 WHAT DISABLED_FEATURES
661 DESCRIPTION "The following features have been disabled:"
665 WHAT OPTIONAL_PACKAGES_NOT_FOUND
666 DESCRIPTION "The following OPTIONAL packages were not found:"
670 WHAT REQUIRED_PACKAGES_NOT_FOUND
671 FATAL_ON_MISSING_REQUIRED_PACKAGES
672 DESCRIPTION "The following REQUIRED packages were not found:"
678 # Note: most distro's will do distro-specific packaging rather than
679 # using CPack, and this duplicates information in the AppStream, too.
680 # TODO:3.3 With newer CMake, move HOMEPAGE_URL to the project()call
681 set(CPACK_PACKAGE_VENDOR calamares)
682 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A Linux system installer")
683 set(CPACK_PACKAGE_DESCRIPTION "Calamares is a Linux system installer, intended for Linux distributions to use on their ISOs and other bootable media to install the distribution to the end-user's computer. Calamares can also be used as an OEM configuration tool. It is modular, extensible and highly-configurable for Linux distributions from all five major Linux families.")
684 set(CPACK_PACKAGE_HOMEPAGE_URL "https://calamares.io")
685 set(CPACK_PACKAGE_ICON "data/images/squid.png")