11# === This file is part of Calamares - <https://github.com/calamares> ===
22#
3+ # SPDX-FileCopyrightText: 2017 Adriaan de Groot <groot@kde.org>
4+ # SPDX-License-Identifier: GPL-3.0-or-later
5+ #
36# Calamares is free software: you can redistribute it and/or modify
47# it under the terms of the GNU General Public License as published by
58# the Free Software Foundation, either version 3 of the License, or
1316# You should have received a copy of the GNU General Public License
1417# along with Calamares. If not, see <http://www.gnu.org/licenses/>.
1518#
16- # SPDX-License-Identifier: GPL-3.0-or-later
17- # License-Filename: LICENSE
18- #
1919###
2020#
2121# Generally, this CMakeLists.txt will find all the dependencies for Calamares
4646# TODO:3.3: Require CMake 3.12
4747cmake_minimum_required ( VERSION 3.3 FATAL_ERROR )
4848project ( CALAMARES
49- VERSION 3.2.27
49+ VERSION 3.2.28.2
5050 LANGUAGES C CXX )
5151
5252set ( CALAMARES_VERSION_RC 0 ) # Set to 0 during release cycle, 1 during development
@@ -140,20 +140,18 @@ set( CALAMARES_DESCRIPTION_SUMMARY
140140# TODO: drop the es_ES translation from Transifex
141141#
142142# NOTE: move eo (Esperanto) to _ok once Qt can actually create a
143- # locale for it. (Qt 5.12.2 can, see check later on).
144- # NOTE: update these lines by running txstats.py, or copy these four lines
145- # and prefix each variable name with "p", so that the automatic
146- # checks for new languages and misspelled ones are done (that is,
147- # copy these four lines to four backup lines, add "p", and then update
148- # the original four lines with the current translations).
149- #
150- # Total 66 languages
151- set ( _tx_complete az az_AZ ca he hi hr ja sq tr_TR uk zh_TW )
152- set ( _tx_good as ast be cs_CZ da de es fi_FI fr hu it_IT ko lt ml
153- nl pt_BR pt_PT ru sk sv zh_CN )
154- set ( _tx_ok ar bg el en_GB es_MX es_PR et eu fa gl id is mr nb pl
155- ro sl sr sr@latin th )
156- set ( _tx_incomplete bn ca@valencia eo fr_CH gu kk kn lo lv mk ne_NP
143+ # locale for it. (Qt 5.12.2 can, see Translation Status section).
144+ # NOTE: move ie (Interlingue) to _ok once Qt supports it.
145+ # NOTE: update these lines by running `txstats.py`, or for full automation
146+ # `txstats.py -e`. See also
147+ #
148+ # Total 68 languages
149+ set ( _tx_complete ca fi_FI he hr nl pt_BR sq tg tr_TR uk zh_TW )
150+ set ( _tx_good as ast az az_AZ be cs_CZ da de es fr hi hu it_IT ja
151+ ko lt ml pt_PT ru sk sv zh_CN )
152+ set ( _tx_ok ar bg el en_GB es_MX es_PR et eu fa gl id is mr nb
153+ pl ro sl sr sr@latin th )
154+ set ( _tx_incomplete bn ca@valencia eo fr_CH gu ie kk kn lo lv mk ne_NP
157155 ur uz )
158156
159157### Required versions
@@ -286,14 +284,6 @@ find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED Concurrent Core Gui LinguistTool
286284if ( WITH_QML )
287285 find_package ( Qt5 ${QT_VERSION} CONFIG REQUIRED Quick QuickWidgets )
288286endif ()
289- if ( Qt5_VERSION VERSION_GREATER 5.12.1 )
290- # At least Qt 5.12.2 seems to support Esperanto in QLocale
291- if ( "eo" IN_LIST _tx_incomplete )
292- message (STATUS "Esperanto support since Qt 5.12.2, enabling Esperanto locale" )
293- list ( REMOVE_ITEM _tx_incomplete "eo" )
294- list ( APPEND _tx_ok "eo" )
295- endif ()
296- endif ()
297287# Optional Qt parts
298288find_package ( Qt5DBus CONFIG )
299289
@@ -355,23 +345,33 @@ set_package_properties(
355345 URL "https://python.org"
356346 PURPOSE "Python 3 interpreter for certain tests."
357347)
348+
349+ set ( _schema_explanation "" )
358350if ( PYTHONINTERP_FOUND )
359- message (STATUS "Found Python 3 interpreter ${PYTHON_EXECUTABLE} " )
360351 if ( BUILD_SCHEMA_TESTING )
361352 # The configuration validator script has some dependencies,
362353 # and if they are not installed, don't run. If errors out
363354 # with exit(1) on missing dependencies.
364- exec_program ( ${PYTHON_EXECUTABLE} ARGS "${CMAKE_SOURCE_DIR} /ci/configvalidator.py" -x RETURN_VALUE _validator_deps )
355+ if ( CALAMARES_CONFIGVALIDATOR_CHECKED )
356+ set ( _validator_deps ${CALAMARES_CONFIGVALIDATOR_RESULT} )
357+ else ()
358+ exec_program ( ${PYTHON_EXECUTABLE} ARGS "${CMAKE_SOURCE_DIR} /ci/configvalidator.py" -x RETURN_VALUE _validator_deps )
359+ set ( CALAMARES_CONFIGVALIDATOR_CHECKED TRUE CACHE INTERNAL "Dependencies for configvalidator checked" )
360+ set ( CALAMARES_CONFIGVALIDATOR_RESULT ${_validator_deps} CACHE INTERNAL "Result of configvalidator dependency check" )
361+ endif ()
365362 # It should never succeed, but only returns 1 when the imports fail
366363 if ( _validator_deps EQUAL 1 )
367- message ( STATUS "BUILD_SCHEMA_TESTING dependencies are missing ." )
364+ set ( _schema_explanation " Missing dependencies for configvalidator.py ." )
368365 set ( BUILD_SCHEMA_TESTING OFF )
369366 endif ()
370367 endif ()
371368else ()
372369 # Can't run schema tests without Python3.
370+ set ( _schema_explanation " Missing Python3." )
373371 set ( BUILD_SCHEMA_TESTING OFF )
374372endif ()
373+ add_feature_info( yaml-schema BUILD_SCHEMA_TESTING "Validate YAML (config files) with schema.${_schema_explanation} " )
374+
375375find_package ( PythonLibs ${PYTHONLIBS_VERSION} )
376376set_package_properties(
377377 PythonLibs PROPERTIES
@@ -419,30 +419,22 @@ set(Calamares_WITH_QML ${WITH_QML})
419419
420420### Transifex Translation status
421421#
422- # Construct language lists for use. If there are p_tx* variables,
423- # then run an extra cmake-time check for consistency of the old
424- # (p_tx*) and new (_tx*) lists.
422+ # Construct language lists for use.
425423#
426- set ( prev_tx ${p_tx_complete} ${p_tx_good} ${p_tx_ok} ${p_tx_incomplete} )
424+ if ( Qt5_VERSION VERSION_GREATER 5.12.1 )
425+ # At least Qt 5.12.2 seems to support Esperanto in QLocale
426+ if ( "eo" IN_LIST _tx_incomplete )
427+ message (STATUS "Esperanto support since Qt 5.12.2, enabling Esperanto locale" )
428+ list ( REMOVE_ITEM _tx_incomplete "eo" )
429+ list ( APPEND _tx_ok "eo" )
430+ endif ()
431+ endif ()
432+
427433set ( curr_tx ${_tx_complete} ${_tx_good} ${_tx_ok} ${_tx_incomplete} )
428434set ( tx_errors OFF )
429- if ( prev_tx )
430- # Gone in new list
431- foreach ( l ${prev_tx} )
432- list ( FIND curr_tx ${l} p_l )
433- if ( p_l EQUAL -1 )
434- message (WARNING "Language ${l} was present in previous translations and is now absent." )
435- set ( tx_errors ON )
436- endif ()
437- endforeach ()
438-
435+ if ( curr_tx )
439436 # New in list
440437 foreach ( l ${curr_tx} )
441- list ( FIND prev_tx ${l} p_l )
442- if ( p_l EQUAL -1 )
443- message (WARNING "Language ${l} is new." )
444- set ( tx_errors ON )
445- endif ()
446438 set ( p_l "lang/calamares_${l} .ts" )
447439 if ( NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR} /${p_l} )
448440 message (WARNING "Language ${l} has no .ts file yet." )
@@ -453,7 +445,6 @@ if ( prev_tx )
453445 unset ( p_l )
454446 unset ( l )
455447endif ()
456- unset ( prev_tx )
457448unset ( curr_tx )
458449if ( tx_errors )
459450 message ( FATAL_ERROR "Translation warnings, see above." )
@@ -464,14 +455,6 @@ list( SORT CALAMARES_TRANSLATION_LANGUAGES )
464455
465456add_subdirectory ( lang ) # i18n tools
466457
467- if ( INSTALL_COMPLETION )
468- if ( NOT CMAKE_INSTALL_BASHCOMPLETIONDIR )
469- set ( CMAKE_INSTALL_BASHCOMPLETIONDIR "${CMAKE_INSTALL_DATADIR} /bash-completion/completions" )
470- endif ()
471-
472- install ( FILES ${CMAKE_SOURCE_DIR} /data/completion/bash/calamares DESTINATION "${CMAKE_INSTALL_BASHCOMPLETIONDIR} " )
473- endif ()
474-
475458### Example Distro
476459#
477460# For testing purposes Calamares includes a very, very, limited sample
@@ -536,7 +519,11 @@ if( CALAMARES_VERSION_RC )
536519 set ( CALAMARES_VERSION ${CALAMARES_VERSION} rc${CALAMARES_VERSION_RC} )
537520endif ()
538521
539- # additional info for non-release builds
522+ # Additional info for non-release builds. The "extended" version information
523+ # with date and git information (commit, dirty status) is used only
524+ # by CalamaresVersionX.h, which is included by consumers that need a full
525+ # version number with all that information; normal consumers can include
526+ # CalamaresVersion.h with more stable numbers.
540527if ( NOT BUILD_RELEASE AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR} /.git/" )
541528 include ( CMakeDateStamp )
542529 set ( CALAMARES_VERSION_DATE "${CMAKE_DATESTAMP_YEAR}${CMAKE_DATESTAMP_MONTH}${CMAKE_DATESTAMP_DAY} " )
@@ -657,6 +644,14 @@ if( INSTALL_POLKIT )
657644 )
658645endif ()
659646
647+ if ( INSTALL_COMPLETION )
648+ if ( NOT CMAKE_INSTALL_BASHCOMPLETIONDIR )
649+ set ( CMAKE_INSTALL_BASHCOMPLETIONDIR "${CMAKE_INSTALL_DATADIR} /bash-completion/completions" )
650+ endif ()
651+
652+ install ( FILES ${CMAKE_SOURCE_DIR} /data/completion/bash/calamares DESTINATION "${CMAKE_INSTALL_BASHCOMPLETIONDIR} " )
653+ endif ()
654+
660655install (
661656 FILES calamares.desktop
662657 DESTINATION ${CMAKE_INSTALL_DATADIR} /applications
0 commit comments