CMake: blanket-apply gersemi

This commit is contained in:
Adriaan de Groot 2022-08-23 12:32:42 +02:00
parent 733e4d64e1
commit 57374a3271
44 changed files with 534 additions and 428 deletions

View File

@ -8,10 +8,8 @@ set( calamaresSources
main.cpp
CalamaresApplication.cpp
CalamaresWindow.cpp
DebugWindow.cpp
VariantModel.cpp
progresstree/ProgressTreeDelegate.cpp
progresstree/ProgressTreeView.cpp
)
@ -44,10 +42,9 @@ include_directories(
# library (it's just the result of a QRC compile).
add_executable(calamares_bin ${calamaresSources} calamares.qrc)
target_include_directories(calamares_bin PRIVATE ${CMAKE_SOURCE_DIR})
set_target_properties(calamares_bin
PROPERTIES
ENABLE_EXPORTS TRUE
RUNTIME_OUTPUT_NAME calamares
set_target_properties(
calamares_bin
PROPERTIES ENABLE_EXPORTS TRUE RUNTIME_OUTPUT_NAME calamares
)
calamares_automoc( calamares_bin )
calamares_autouic( calamares_bin )
@ -57,7 +54,8 @@ if( kdsagSources )
set_source_files_properties(${kdsagSources} PROPERTIES AUTOMOC OFF)
endif()
target_link_libraries( calamares_bin
target_link_libraries(
calamares_bin
PRIVATE
calamares
calamaresui
@ -75,12 +73,16 @@ if( WITH_KF5DBus )
target_compile_definitions(calamares_bin PRIVATE WITH_KF5DBus)
endif()
install( TARGETS calamares_bin
BUNDLE DESTINATION .
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
install(
TARGETS calamares_bin
BUNDLE
DESTINATION .
RUNTIME
DESTINATION ${CMAKE_INSTALL_BINDIR}
)
install( FILES ${CMAKE_SOURCE_DIR}/data/images/squid.svg
install(
FILES ${CMAKE_SOURCE_DIR}/data/images/squid.svg
RENAME calamares.svg
DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps
)
@ -91,7 +93,10 @@ install( FILES ${CMAKE_SOURCE_DIR}/data/images/squid.svg
if(BUILD_TESTING)
# Don't install, these are just for enable_testing
add_executable(loadmodule testmain.cpp)
target_link_libraries( loadmodule PRIVATE Qt5::Core Qt5::Widgets calamares calamaresui )
target_link_libraries(
loadmodule
PRIVATE Qt5::Core Qt5::Widgets calamares calamaresui
)
add_executable(test_conf test_conf.cpp)
target_link_libraries(test_conf PUBLIC yamlcpp::yamlcpp Qt5::Core)

View File

@ -13,12 +13,18 @@
add_definitions(-DDLLEXPORT_PRO)
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/CalamaresConfig.h.in
${CMAKE_CURRENT_BINARY_DIR}/CalamaresConfig.h )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/CalamaresVersion.h.in
${CMAKE_CURRENT_BINARY_DIR}/CalamaresVersion.h )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/CalamaresVersionX.h.in
${CMAKE_CURRENT_BINARY_DIR}/CalamaresVersionX.h )
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/CalamaresConfig.h.in
${CMAKE_CURRENT_BINARY_DIR}/CalamaresConfig.h
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/CalamaresVersion.h.in
${CMAKE_CURRENT_BINARY_DIR}/CalamaresVersion.h
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/CalamaresVersionX.h.in
${CMAKE_CURRENT_BINARY_DIR}/CalamaresVersionX.h
)
set(OPTIONAL_PRIVATE_LIBRARIES "")
set(OPTIONAL_PUBLIC_LIBRARIES "")
@ -32,13 +38,11 @@ set( libSources
JobQueue.cpp
ProcessJob.cpp
Settings.cpp
# GeoIP services
geoip/Interface.cpp
geoip/GeoIPFixed.cpp
geoip/GeoIPJSON.cpp
geoip/Handler.cpp
# Locale-data service
locale/Global.cpp
locale/Lookup.cpp
@ -47,7 +51,6 @@ set( libSources
locale/TranslatableString.cpp
locale/Translation.cpp
locale/TranslationsModel.cpp
# Modules
modulesystem/Config.cpp
modulesystem/Descriptor.cpp
@ -56,19 +59,15 @@ set( libSources
modulesystem/Preset.cpp
modulesystem/RequirementsChecker.cpp
modulesystem/RequirementsModel.cpp
# Network service
network/Manager.cpp
# Packages service
packages/Globals.cpp
# Partition service
partition/Global.cpp
partition/Mount.cpp
partition/PartitionSize.cpp
partition/Sync.cpp
# Utility service
utils/CalamaresUtilsSystem.cpp
utils/CommandList.cpp
@ -97,11 +96,7 @@ endif()
#
#
if(WITH_PYTHON)
list( APPEND libSources
PythonHelper.cpp
PythonJob.cpp
PythonJobApi.cpp
)
list(APPEND libSources PythonHelper.cpp PythonJob.cpp PythonJobApi.cpp)
include_directories(${PYTHON_INCLUDE_DIRS})
link_directories(${PYTHON_LIBRARIES})
@ -109,7 +104,9 @@ if( WITH_PYTHON )
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
list( APPEND OPTIONAL_PRIVATE_LIBRARIES
list(
APPEND
OPTIONAL_PRIVATE_LIBRARIES
${PYTHON_LIBRARIES}
${Boost_LIBRARIES}
)
@ -137,7 +134,9 @@ if ( KPMcore_FOUND )
add_definitions(-D${d})
endforeach()
include_directories(${KPMCORE_INCLUDE_DIR})
list( APPEND libSources
list(
APPEND
libSources
partition/FileSystem.cpp
partition/KPMManager.cpp
partition/PartitionIterator.cpp
@ -150,17 +149,19 @@ endif()
#
#
add_library(calamares SHARED ${libSources})
set_target_properties( calamares
set_target_properties(
calamares
PROPERTIES
VERSION ${CALAMARES_VERSION_SHORT}
SOVERSION ${CALAMARES_VERSION_SHORT}
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_INSTALL_FULL_INCLUDEDIR}/libcalamares
INTERFACE_INCLUDE_DIRECTORIES
${CMAKE_INSTALL_FULL_INCLUDEDIR}/libcalamares
)
calamares_automoc( calamares )
target_link_libraries( calamares
LINK_PRIVATE
${OPTIONAL_PRIVATE_LIBRARIES}
target_link_libraries(
calamares
LINK_PRIVATE ${OPTIONAL_PRIVATE_LIBRARIES}
LINK_PUBLIC
yamlcpp::yamlcpp
Qt5::Core
@ -173,19 +174,26 @@ add_library(Calamares::calamares ALIAS calamares)
### Installation
#
#
install( TARGETS calamares
install(
TARGETS calamares
EXPORT Calamares
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME
DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY
DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE
DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
# Make symlink lib/calamares/libcalamares.so to lib/libcalamares.so.VERSION so
# lib/calamares can be used as module path for the Python interpreter.
install( CODE "
install(
CODE
"
file( MAKE_DIRECTORY \"\$ENV{DESTDIR}/${CMAKE_INSTALL_FULL_LIBDIR}/calamares\" )
execute_process( COMMAND \"${CMAKE_COMMAND}\" -E create_symlink ../libcalamares.so.${CALAMARES_VERSION_SHORT} libcalamares.so WORKING_DIRECTORY \"\$ENV{DESTDIR}/${CMAKE_INSTALL_FULL_LIBDIR}/calamares\" )
")
"
)
# Install header files
file(GLOB rootHeaders "*.h")
@ -202,7 +210,6 @@ foreach( subdir geoip locale modulesystem network partition utils )
install(FILES ${subdir_headers} DESTINATION include/libcalamares/${subdir})
endforeach()
### TESTING
#
#
@ -224,7 +231,13 @@ function ( calamares_qrc_translations basename )
set(options "")
set(oneValueArgs SUBDIRECTORY OUTPUT_VARIABLE)
set(multiValueArgs LANGUAGES)
cmake_parse_arguments( _qrt "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
cmake_parse_arguments(
_qrt
"${options}"
"${oneValueArgs}"
"${multiValueArgs}"
${ARGN}
)
if(NOT _qrt_OUTPUT_VARIABLE)
set(_qrt_OUTPUT_VARIABLE "qrc_translations_${basename}")
@ -237,18 +250,38 @@ function ( calamares_qrc_translations basename )
set(calamares_i18n_qrc_content "")
set(calamares_i18n_ts_filelist "")
foreach(lang ${_qrt_LANGUAGES})
string( APPEND calamares_i18n_qrc_content "<file>${basename}_${lang}.qm</file>" )
list( APPEND calamares_i18n_ts_filelist "${CMAKE_CURRENT_SOURCE_DIR}/${_qrt_SUBDIRECTORY}/${basename}_${lang}.ts" )
string(
APPEND
calamares_i18n_qrc_content
"<file>${basename}_${lang}.qm</file>"
)
list(
APPEND
calamares_i18n_ts_filelist
"${CMAKE_CURRENT_SOURCE_DIR}/${_qrt_SUBDIRECTORY}/${basename}_${lang}.ts"
)
endforeach()
configure_file( ${CMAKE_SOURCE_DIR}/lang/calamares_i18n.qrc.in ${translations_qrc_infile} @ONLY )
configure_file(
${CMAKE_SOURCE_DIR}/lang/calamares_i18n.qrc.in
${translations_qrc_infile}
@ONLY
)
qt5_add_translation(QM_FILES ${calamares_i18n_ts_filelist})
# Run the resource compiler (rcc_options should already be set)
add_custom_command(
OUTPUT ${translations_qrc_outfile}
COMMAND "${Qt5Core_RCC_EXECUTABLE}"
ARGS ${rcc_options} --format-version 1 -name ${basename} -o ${translations_qrc_outfile} ${translations_qrc_infile}
ARGS
${rcc_options}
--format-version
1
-name
${basename}
-o
${translations_qrc_outfile}
${translations_qrc_infile}
MAIN_DEPENDENCY ${translations_qrc_infile}
DEPENDS ${QM_FILES}
)
@ -314,11 +347,15 @@ calamares_add_test(
utils/TestPaths.cpp
)
# This is not an actual test, it's a test / demo application
# for experimenting with GeoIP.
add_executable(test_geoip geoip/test_geoip.cpp ${geoip_src})
target_link_libraries( test_geoip Calamares::calamares Qt5::Network yamlcpp::yamlcpp )
target_link_libraries(
test_geoip
Calamares::calamares
Qt5::Network
yamlcpp::yamlcpp
)
calamares_automoc( test_geoip )
if(Qt5DBus_FOUND)

View File

@ -8,7 +8,11 @@
# view modules, view steps, widgets, and branding.
# The UI libs use the non-UI library
include_directories( ${CMAKE_SOURCE_DIR}/src/libcalamares ${CMAKE_BINARY_DIR}/src/libcalamares ${CMAKE_SOURCE_DIR} )
include_directories(
${CMAKE_SOURCE_DIR}/src/libcalamares
${CMAKE_BINARY_DIR}/src/libcalamares
${CMAKE_SOURCE_DIR}
)
set(calamaresui_SOURCES
modulesystem/CppJobModule.cpp
@ -16,16 +20,13 @@ set( calamaresui_SOURCES
modulesystem/ModuleManager.cpp
modulesystem/ProcessJobModule.cpp
modulesystem/ViewModule.cpp
utils/CalamaresUtilsGui.cpp
utils/ImageRegistry.cpp
utils/Paste.cpp
viewpages/BlankViewStep.cpp
viewpages/ExecutionViewStep.cpp
viewpages/Slideshow.cpp
viewpages/ViewStep.cpp
widgets/ClickableLabel.cpp
widgets/ErrorDialog.cpp
widgets/FixedAspectRatioLabel.cpp
@ -34,7 +35,6 @@ set( calamaresui_SOURCES
widgets/TranslationFix.cpp
widgets/WaitingWidget.cpp
${CMAKE_SOURCE_DIR}/3rdparty/waitingspinnerwidget.cpp
Branding.cpp
ViewManager.cpp
)
@ -45,13 +45,13 @@ mark_thirdparty_code(
)
if(WITH_PYTHON)
list( APPEND calamaresui_SOURCES
modulesystem/PythonJobModule.cpp
)
list(APPEND calamaresui_SOURCES modulesystem/PythonJobModule.cpp)
endif()
if(WITH_PYTHONQT)
list( APPEND calamaresui_SOURCES
list(
APPEND
calamaresui_SOURCES
modulesystem/PythonQtViewModule.cpp
utils/PythonQtUtils.cpp
viewpages/PythonQtJob.cpp
@ -62,10 +62,7 @@ if( WITH_PYTHONQT )
endif()
if(WITH_QML)
list( APPEND calamaresui_SOURCES
utils/Qml.cpp
viewpages/QmlViewStep.cpp
)
list(APPEND calamaresui_SOURCES utils/Qml.cpp viewpages/QmlViewStep.cpp)
endif()
calamares_add_library(calamaresui
@ -85,8 +82,14 @@ if( KF5CoreAddons_FOUND AND KF5CoreAddons_VERSION VERSION_GREATER_EQUAL 5.58 )
endif()
if(WITH_PYTHONQT)
# *_DIRS because we also use extensions
target_include_directories( calamaresui PRIVATE ${PYTHON_INCLUDE_DIRS} ${PYTHONQT_INCLUDE_DIRS} )
target_link_libraries( calamaresui PRIVATE ${PYTHON_LIBRARIES} ${PYTHONQT_LIBRARIES} )
target_include_directories(
calamaresui
PRIVATE ${PYTHON_INCLUDE_DIRS} ${PYTHONQT_INCLUDE_DIRS}
)
target_link_libraries(
calamaresui
PRIVATE ${PYTHON_LIBRARIES} ${PYTHONQT_LIBRARIES}
)
endif()
if(WITH_QML)
target_link_libraries(calamaresui PUBLIC Qt5::QuickWidgets)
@ -94,7 +97,6 @@ endif()
add_library(Calamares::calamaresui ALIAS calamaresui)
### Installation
#
#
@ -103,12 +105,7 @@ add_library(Calamares::calamaresui ALIAS calamaresui)
# where libcalamares and libcalamaresui live in different branches,
# we're going to glom it all together in the installed headers location.
install(
FILES
Branding.h
ViewManager.h
DESTINATION include/libcalamares
)
install(FILES Branding.h ViewManager.h DESTINATION include/libcalamares)
# Install each subdir-worth of header files
foreach(subdir modulesystem utils viewpages widgets)

View File

@ -26,19 +26,30 @@ foreach( SUBDIRECTORY ${SUBDIRECTORIES} )
endforeach()
# TODO:3.3: Use FindPython3
if ( BUILD_TESTING AND BUILD_SCHEMA_TESTING AND PYTHONINTERP_FOUND AND PYTHON_EXECUTABLE )
if(
BUILD_TESTING
AND BUILD_SCHEMA_TESTING
AND PYTHONINTERP_FOUND
AND PYTHON_EXECUTABLE
)
# The tests for each config file are independent of whether the
# module is enabled or not: the config file should match its schema
# regardless.
foreach(SUBDIRECTORY ${SUBDIRECTORIES})
set( _schema_file "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}/${SUBDIRECTORY}.schema.yaml" )
set( _conf_file "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}/${SUBDIRECTORY}.conf" )
set(_schema_file
"${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}/${SUBDIRECTORY}.schema.yaml"
)
set(_conf_file
"${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}/${SUBDIRECTORY}.conf"
)
if(EXISTS "${_schema_file}" AND EXISTS "${_conf_file}")
add_test(
NAME validate-${SUBDIRECTORY}
COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_SOURCE_DIR}/ci/configvalidator.py" "${_schema_file}" "${_conf_file}"
COMMAND
${PYTHON_EXECUTABLE}
"${CMAKE_SOURCE_DIR}/ci/configvalidator.py"
"${_schema_file}" "${_conf_file}"
)
endif()
endforeach()
endif()

View File

@ -10,7 +10,10 @@ find_package( KF5WidgetsAddons CONFIG )
include(KPMcoreHelper)
if(KPMcore_FOUND AND Qt5DBus_FOUND AND KF5CoreAddons_FOUND AND KF5Config_FOUND)
include_directories( ${KPMCORE_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/src/modules/partition )
include_directories(
${KPMCORE_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}/src/modules/partition
)
# The PartitionIterator is a small class, and it's easiest -- but also a
# gross hack -- to just compile it again from the partition module tree.

View File

@ -10,11 +10,13 @@ set( kf5_ver 5.41 )
find_package(KF5Service ${kf5_ver})
find_package(KF5Parts ${kf5_ver})
set_package_properties(
KF5Service PROPERTIES
KF5Service
PROPERTIES
PURPOSE "For finding KDE services at runtime"
)
set_package_properties(
KF5Parts PROPERTIES
KF5Parts
PROPERTIES
PURPOSE "For finding KDE parts at runtime"
)

View File

@ -17,12 +17,16 @@ if( DEBUG_TIMEZONES )
endif()
find_package(Qt5Location CONFIG)
set_package_properties(Qt5Location PROPERTIES
set_package_properties(
Qt5Location
PROPERTIES
DESCRIPTION "Used for rendering the map"
TYPE RUNTIME
)
find_package(Qt5Positioning CONFIG)
set_package_properties(Qt5Positioning PROPERTIES
set_package_properties(
Qt5Positioning
PROPERTIES
DESCRIPTION "Used for GeoLocation and GeoCoding"
TYPE RUNTIME
)

View File

@ -32,4 +32,3 @@ calamares_add_test(
LIBRARIES
Qt5::Gui
)

View File

@ -11,7 +11,11 @@ set( _extra_src "" )
#
#
# TODO:3.3:WITH->BUILD (this doesn't affect the ABI offered by Calamares)
option( WITH_APPDATA "Support appdata: items in PackageChooser (requires QtXml)" ON )
option(
WITH_APPDATA
"Support appdata: items in PackageChooser (requires QtXml)"
ON
)
if(WITH_APPDATA)
find_package(Qt5 COMPONENTS Xml)
if(Qt5Xml_FOUND)
@ -24,11 +28,16 @@ endif()
### OPTIONAL AppStream support in PackageModel
#
#
option( WITH_APPSTREAM "Support appstream: items in PackageChooser (requires libappstream-qt)" ON )
option(
WITH_APPSTREAM
"Support appstream: items in PackageChooser (requires libappstream-qt)"
ON
)
if(WITH_APPSTREAM)
find_package(AppStreamQt)
set_package_properties(
AppStreamQt PROPERTIES
AppStreamQt
PROPERTIES
DESCRIPTION "Support for AppStream (cache) data"
URL "https://github.com/ximion/appstream"
PURPOSE "AppStream provides package data"

View File

@ -22,7 +22,11 @@ include_directories( ${_packagechooser} )
#
#
# TODO:3.3:WITH->BUILD (this doesn't affect the ABI offered by Calamares)
option( WITH_APPDATA "Support appdata: items in PackageChooser (requires QtXml)" ON )
option(
WITH_APPDATA
"Support appdata: items in PackageChooser (requires QtXml)"
ON
)
if(WITH_APPDATA)
find_package(Qt5 COMPONENTS Xml)
if(Qt5Xml_FOUND)
@ -35,11 +39,16 @@ endif()
### OPTIONAL AppStream support in PackageModel
#
#
option( WITH_APPSTREAM "Support appstream: items in PackageChooser (requires libappstream-qt)" ON )
option(
WITH_APPSTREAM
"Support appstream: items in PackageChooser (requires libappstream-qt)"
ON
)
if(WITH_APPSTREAM)
find_package(AppStreamQt)
set_package_properties(
AppStreamQt PROPERTIES
AppStreamQt
PROPERTIES
DESCRIPTION "Support for AppStream (cache) data"
URL "https://github.com/ximion/appstream"
PURPOSE "AppStream provides package data"

View File

@ -19,7 +19,11 @@
# useful for debugging simulated installations that don't need to
# mount the target filesystems.
option(DEBUG_PARTITION_UNSAFE "Allow unsafe partitioning choices." OFF)
option( DEBUG_PARTITION_BAIL_OUT "Unsafe partitioning will error out on exec." ON )
option(
DEBUG_PARTITION_BAIL_OUT
"Unsafe partitioning will error out on exec."
ON
)
option(DEBUG_PARTITION_SKIP "Don't actually do any partitioning." OFF)
# This is very chatty, useful mostly if you don't know what KPMCore offers.
@ -130,4 +134,3 @@ else()
calamares_skip_module( "partition (missing dependencies for KPMcore)" )
endif()
endif()

View File

@ -40,7 +40,6 @@ calamares_add_test(
DEFINITIONS ${_partition_defs}
)
calamares_add_test(
partitioncreatelayoutstest
SOURCES

View File

@ -11,19 +11,22 @@ set( lnf_ver 5.41 )
find_package(KF5Config ${lnf_ver})
set_package_properties(
KF5Config PROPERTIES
KF5Config
PROPERTIES
PURPOSE "For finding default Plasma Look-and-Feel"
)
find_package(KF5Plasma ${lnf_ver})
set_package_properties(
KF5Plasma PROPERTIES
KF5Plasma
PROPERTIES
PURPOSE "For Plasma Look-and-Feel selection"
)
find_package(KF5Package ${lnf_ver})
set_package_properties(
KF5Package PROPERTIES
KF5Package
PROPERTIES
PURPOSE "For Plasma Look-and-Feel selection"
)
@ -49,7 +52,10 @@ if ( KF5Plasma_FOUND AND KF5Package_FOUND )
SHARED_LIB
)
if(KF5Config_FOUND)
target_compile_definitions(calamares_viewmodule_plasmalnf PRIVATE WITH_KCONFIG)
target_compile_definitions(
calamares_viewmodule_plasmalnf
PRIVATE WITH_KCONFIG
)
endif()
else()
calamares_skip_module( "plasmalnf (missing requirements)" )

View File

@ -11,7 +11,8 @@ set( USER_EXTRA_LIB )
find_package(LibPWQuality)
set_package_properties(
LibPWQuality PROPERTIES
LibPWQuality
PROPERTIES
PURPOSE "Extra checks of password quality"
)
@ -23,7 +24,8 @@ endif()
find_package(ICU COMPONENTS uc i18n)
set_package_properties(
ICU PROPERTIES
ICU
PROPERTIES
PURPOSE "Transliteration support for full name to username conversion"
)

View File

@ -18,7 +18,8 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../users )
find_package(LibPWQuality)
set_package_properties(
LibPWQuality PROPERTIES
LibPWQuality
PROPERTIES
PURPOSE "Extra checks of password quality"
)
@ -31,7 +32,8 @@ endif()
#needed for ${_users}/Config.cpp
find_package(ICU COMPONENTS uc i18n)
set_package_properties(
ICU PROPERTIES
ICU
PROPERTIES
PURPOSE "Transliteration support for full name to username conversion"
)

View File

@ -5,7 +5,11 @@
#
set(CALA_WEBVIEW_LINK_LIBRARIES "")
option( WEBVIEW_FORCE_WEBKIT "Always build webview with WebKit instead of WebEngine regardless of Qt version." OFF)
option(
WEBVIEW_FORCE_WEBKIT
"Always build webview with WebKit instead of WebEngine regardless of Qt version."
OFF
)
set(_reason "")
@ -15,13 +19,8 @@ if ( Qt5Core_VERSION VERSION_LESS 5.6 OR WEBVIEW_FORCE_WEBKIT )
find_package(Qt5 ${QT_VERSION} CONFIG COMPONENTS WebKit WebKitWidgets)
if(Qt5WebKit_FOUND AND Qt5WebKitWidgets_FOUND)
list( APPEND CALA_WEBVIEW_INCLUDE_DIRECTORIES
${QT_QTWEBKIT_INCLUDE_DIR}
)
list( APPEND CALA_WEBVIEW_LINK_LIBRARIES
Qt5::WebKit
Qt5::WebKitWidgets
)
list(APPEND CALA_WEBVIEW_INCLUDE_DIRECTORIES ${QT_QTWEBKIT_INCLUDE_DIR})
list(APPEND CALA_WEBVIEW_LINK_LIBRARIES Qt5::WebKit Qt5::WebKitWidgets)
set(WEBVIEW_WITH_WEBKIT 1)
else()
set(_reason "No suitable WebKit")
@ -31,10 +30,14 @@ else()
find_package(Qt5 ${QT_VERSION} CONFIG COMPONENTS WebEngine WebEngineWidgets)
if(Qt5WebEngine_FOUND AND Qt5WebEngineWidgets_FOUND)
list( APPEND CALA_WEBVIEW_INCLUDE_DIRECTORIES
list(
APPEND
CALA_WEBVIEW_INCLUDE_DIRECTORIES
${QT_QTWEBENGINE_INCLUDE_DIR}
)
list( APPEND CALA_WEBVIEW_LINK_LIBRARIES
list(
APPEND
CALA_WEBVIEW_LINK_LIBRARIES
Qt5::WebEngine
Qt5::WebEngineWidgets
)
@ -45,8 +48,10 @@ else()
endif()
if(NOT _reason)
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/WebViewConfig.h.in
${CMAKE_CURRENT_BINARY_DIR}/WebViewConfig.h )
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/WebViewConfig.h.in
${CMAKE_CURRENT_BINARY_DIR}/WebViewConfig.h
)
calamares_add_plugin(webview
TYPE viewmodule

View File

@ -29,10 +29,7 @@ else()
add_definitions(-DWITHOUT_LIBPARTED)
endif()
set( CHECKER_SOURCES
${_welcome}/checker/GeneralRequirements.cpp
${PARTMAN_SRC}
)
set(CHECKER_SOURCES ${_welcome}/checker/GeneralRequirements.cpp ${PARTMAN_SRC})
calamares_add_plugin(welcomeq
TYPE viewmodule

View File

@ -10,4 +10,3 @@ calamares_add_plugin( zfs
ZfsJob.cpp
SHARED_LIB
)

View File

@ -14,26 +14,43 @@
# and install them into share/calamares/qml/calamares
file(GLOB SUBDIRECTORIES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*")
foreach(SUBDIRECTORY ${SUBDIRECTORIES})
if( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}"
AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}/qmldir" )
if(
IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}"
AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}/qmldir"
)
set(QML_DIR share/calamares/qml)
set(QML_MODULE_DESTINATION ${QML_DIR}/calamares/${SUBDIRECTORY})
# We glob all the files inside the subdirectory, and we make sure they are
# synced with the bindir structure and installed.
file( GLOB QML_MODULE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY} "${SUBDIRECTORY}/*" )
file(
GLOB QML_MODULE_FILES
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}
"${SUBDIRECTORY}/*"
)
foreach(QML_MODULE_FILE ${QML_MODULE_FILES})
if( NOT IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}/${QML_MODULE_FILE} )
configure_file( ${SUBDIRECTORY}/${QML_MODULE_FILE} ${SUBDIRECTORY}/${QML_MODULE_FILE} COPYONLY )
if(
NOT
IS_DIRECTORY
${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}/${QML_MODULE_FILE}
)
configure_file(
${SUBDIRECTORY}/${QML_MODULE_FILE}
${SUBDIRECTORY}/${QML_MODULE_FILE}
COPYONLY
)
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBDIRECTORY}/${QML_MODULE_FILE}
DESTINATION ${QML_MODULE_DESTINATION} )
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/${SUBDIRECTORY}/${QML_MODULE_FILE}
DESTINATION ${QML_MODULE_DESTINATION}
)
endif()
endforeach()
message( "-- ${BoldYellow}Configured QML module: ${BoldRed}calamares.${SUBDIRECTORY}${ColorReset}" )
message(
"-- ${BoldYellow}Configured QML module: ${BoldRed}calamares.${SUBDIRECTORY}${ColorReset}"
)
endif()
endforeach()