From 57374a327131d33809a695e0112327c0c779dffa Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 23 Aug 2022 12:32:42 +0200 Subject: [PATCH] CMake: blanket-apply gersemi --- src/CMakeLists.txt | 24 +-- src/calamares/CMakeLists.txt | 65 +++--- src/libcalamares/CMakeLists.txt | 203 +++++++++++------- src/libcalamaresui/CMakeLists.txt | 69 +++--- src/modules/CMakeLists.txt | 35 +-- src/modules/contextualprocess/CMakeLists.txt | 2 +- src/modules/dracutlukscfg/CMakeLists.txt | 2 +- src/modules/dummycpp/CMakeLists.txt | 2 +- src/modules/finished/CMakeLists.txt | 6 +- src/modules/finishedq/CMakeLists.txt | 12 +- src/modules/fsresizer/CMakeLists.txt | 19 +- src/modules/hostinfo/CMakeLists.txt | 6 +- src/modules/initcpio/CMakeLists.txt | 2 +- src/modules/initramfs/CMakeLists.txt | 2 +- .../interactiveterminal/CMakeLists.txt | 16 +- src/modules/keyboard/CMakeLists.txt | 2 +- src/modules/keyboardq/CMakeLists.txt | 8 +- src/modules/license/CMakeLists.txt | 4 +- src/modules/locale/CMakeLists.txt | 10 +- src/modules/localeq/CMakeLists.txt | 22 +- .../luksopenswaphookcfg/CMakeLists.txt | 2 +- src/modules/machineid/CMakeLists.txt | 2 +- src/modules/netinstall/CMakeLists.txt | 3 +- src/modules/notesqml/CMakeLists.txt | 4 +- src/modules/oemid/CMakeLists.txt | 2 +- src/modules/packagechooser/CMakeLists.txt | 43 ++-- src/modules/packagechooserq/CMakeLists.txt | 49 +++-- src/modules/partition/CMakeLists.txt | 55 ++--- src/modules/partition/tests/CMakeLists.txt | 5 +- src/modules/plasmalnf/CMakeLists.txt | 28 ++- src/modules/preservefiles/CMakeLists.txt | 2 +- src/modules/removeuser/CMakeLists.txt | 2 +- src/modules/shellprocess/CMakeLists.txt | 2 +- src/modules/summary/CMakeLists.txt | 4 +- src/modules/summaryq/CMakeLists.txt | 8 +- src/modules/tracking/CMakeLists.txt | 2 +- src/modules/umount/CMakeLists.txt | 2 +- src/modules/users/CMakeLists.txt | 38 ++-- src/modules/usersq/CMakeLists.txt | 38 ++-- src/modules/webview/CMakeLists.txt | 61 +++--- src/modules/welcome/CMakeLists.txt | 18 +- src/modules/welcomeq/CMakeLists.txt | 29 ++- src/modules/zfs/CMakeLists.txt | 3 +- src/qml/calamares/CMakeLists.txt | 49 +++-- 44 files changed, 534 insertions(+), 428 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5ce5349fb..b1a536f91 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,26 +3,26 @@ # SPDX-FileCopyrightText: 2020 Adriaan de Groot # SPDX-License-Identifier: BSD-2-Clause # -include( CalamaresAddBrandingSubdirectory ) -include( CalamaresAddLibrary ) -include( CalamaresAddModuleSubdirectory ) -include( CalamaresAddPlugin ) -include( CalamaresAddTest ) -include( CalamaresAddTranslations ) +include(CalamaresAddBrandingSubdirectory) +include(CalamaresAddLibrary) +include(CalamaresAddModuleSubdirectory) +include(CalamaresAddPlugin) +include(CalamaresAddTest) +include(CalamaresAddTranslations) # library -add_subdirectory( libcalamares ) +add_subdirectory(libcalamares) -add_subdirectory( libcalamaresui ) +add_subdirectory(libcalamaresui) # all things qml -add_subdirectory( qml/calamares ) +add_subdirectory(qml/calamares) # application -add_subdirectory( calamares ) +add_subdirectory(calamares) # plugins -add_subdirectory( modules ) +add_subdirectory(modules) # branding components -add_subdirectory( branding ) +add_subdirectory(branding) diff --git a/src/calamares/CMakeLists.txt b/src/calamares/CMakeLists.txt index d06a53d83..577b16105 100644 --- a/src/calamares/CMakeLists.txt +++ b/src/calamares/CMakeLists.txt @@ -4,27 +4,25 @@ # SPDX-License-Identifier: BSD-2-Clause # -set( calamaresSources +set(calamaresSources main.cpp CalamaresApplication.cpp CalamaresWindow.cpp - DebugWindow.cpp VariantModel.cpp - progresstree/ProgressTreeDelegate.cpp progresstree/ProgressTreeView.cpp ) -if( NOT WITH_KF5DBus ) - set( kdsagSources +if(NOT WITH_KF5DBus) + set(kdsagSources ${CMAKE_SOURCE_DIR}/3rdparty/kdsingleapplicationguard/kdsingleapplicationguard.cpp ${CMAKE_SOURCE_DIR}/3rdparty/kdsingleapplicationguard/kdsharedmemorylocker.cpp ${CMAKE_SOURCE_DIR}/3rdparty/kdsingleapplicationguard/kdtoolsglobal.cpp ${CMAKE_SOURCE_DIR}/3rdparty/kdsingleapplicationguard/kdlockedsharedmemorypointer.cpp ) mark_thirdparty_code( ${kdsagSources} ) - list( APPEND calamaresSources ${kdsagSources} ) + list(APPEND calamaresSources ${kdsagSources}) endif() include_directories( @@ -42,22 +40,22 @@ include_directories( # The calamares-i18n.cxx file -- full path in CALAMARES_TRANSLATIONS_SOURCE -- # is created as a target in the lang/ directory. This is compiled to a # 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 +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 ) calamares_automoc( calamares_bin ) calamares_autouic( calamares_bin ) calamares_autorcc( calamares_bin ) -if( kdsagSources ) - set_source_files_properties( ${kdsagSources} PROPERTIES AUTOMOC OFF ) +if(kdsagSources) + set_source_files_properties(${kdsagSources} PROPERTIES AUTOMOC OFF) endif() -target_link_libraries( calamares_bin +target_link_libraries( + calamares_bin PRIVATE calamares calamaresui @@ -66,21 +64,25 @@ target_link_libraries( calamares_bin Qt5::Widgets KF5::CoreAddons ) -if( WITH_KF5Crash ) - target_link_libraries( calamares_bin PRIVATE KF5::Crash ) - target_compile_definitions( calamares_bin PRIVATE WITH_KF5Crash ) +if(WITH_KF5Crash) + target_link_libraries(calamares_bin PRIVATE KF5::Crash) + target_compile_definitions(calamares_bin PRIVATE WITH_KF5Crash) endif() -if( WITH_KF5DBus ) - target_link_libraries( calamares_bin PRIVATE KF5::DBusAddons ) - target_compile_definitions( calamares_bin PRIVATE WITH_KF5DBus ) +if(WITH_KF5DBus) + target_link_libraries(calamares_bin PRIVATE KF5::DBusAddons) + 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 ) @@ -88,11 +90,14 @@ install( FILES ${CMAKE_SOURCE_DIR}/data/images/squid.svg ### TESTS # # -if( BUILD_TESTING ) +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 ) + add_executable(loadmodule testmain.cpp) + 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 ) + add_executable(test_conf test_conf.cpp) + target_link_libraries(test_conf PUBLIC yamlcpp::yamlcpp Qt5::Core) endif() diff --git a/src/libcalamares/CMakeLists.txt b/src/libcalamares/CMakeLists.txt index 95081bb5e..d64bc26ef 100644 --- a/src/libcalamares/CMakeLists.txt +++ b/src/libcalamares/CMakeLists.txt @@ -10,20 +10,26 @@ # (non-GUI) jobs. # -add_definitions( -DDLLEXPORT_PRO ) -include_directories( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ) +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 "" ) +set(OPTIONAL_PRIVATE_LIBRARIES "") +set(OPTIONAL_PUBLIC_LIBRARIES "") -set( libSources +set(libSources CalamaresAbout.cpp CppJob.cpp GlobalStorage.cpp @@ -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 @@ -88,20 +87,16 @@ set( libSources ### OPTIONAL Automount support (requires dbus) # # -if( Qt5DBus_FOUND) - list( APPEND libSources partition/AutoMount.cpp ) - list( APPEND OPTIONAL_PRIVATE_LIBRARIES Qt5::DBus ) +if(Qt5DBus_FOUND) + list(APPEND libSources partition/AutoMount.cpp) + list(APPEND OPTIONAL_PRIVATE_LIBRARIES Qt5::DBus) endif() ### OPTIONAL Python support # # -if( WITH_PYTHON ) - list( APPEND libSources - PythonHelper.cpp - PythonJob.cpp - PythonJobApi.cpp - ) +if(WITH_PYTHON) + 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} ) @@ -119,48 +116,52 @@ endif() # # find_package(Qt5 COMPONENTS Xml) -if( Qt5Xml_FOUND ) - list( APPEND libSources geoip/GeoIPXML.cpp ) - list( APPEND OPTIONAL_PUBLIC_LIBRARIES Qt5::Network Qt5::Xml ) +if(Qt5Xml_FOUND) + list(APPEND libSources geoip/GeoIPXML.cpp) + list(APPEND OPTIONAL_PUBLIC_LIBRARIES Qt5::Network Qt5::Xml) endif() ### OPTIONAL KPMcore support # # -include( KPMcoreHelper ) +include(KPMcoreHelper) -if ( KPMcore_FOUND ) - find_package( Qt5 REQUIRED DBus ) # Needed for KPMCore - find_package( KF5 REQUIRED I18n WidgetsAddons ) # Needed for KPMCore +if(KPMcore_FOUND) + find_package(Qt5 REQUIRED DBus) # Needed for KPMCore + find_package(KF5 REQUIRED I18n WidgetsAddons) # Needed for KPMCore - foreach ( d ${KPMcore_API_DEFINITIONS} ) - add_definitions( -D${d} ) + foreach(d ${KPMcore_API_DEFINITIONS}) + add_definitions(-D${d}) endforeach() - include_directories( ${KPMCORE_INCLUDE_DIR} ) - list( APPEND libSources + include_directories(${KPMCORE_INCLUDE_DIR}) + list( + APPEND + libSources partition/FileSystem.cpp partition/KPMManager.cpp partition/PartitionIterator.cpp partition/PartitionQuery.cpp ) - list( APPEND OPTIONAL_PRIVATE_LIBRARIES kpmcore ) + list(APPEND OPTIONAL_PRIVATE_LIBRARIES kpmcore) endif() ### LIBRARY # # -add_library( calamares SHARED ${libSources} ) -set_target_properties( calamares +add_library(calamares SHARED ${libSources}) +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,22 +174,29 @@ 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" ) +file(GLOB rootHeaders "*.h") install( FILES ${CMAKE_CURRENT_BINARY_DIR}/CalamaresConfig.h @@ -197,12 +205,11 @@ install( DESTINATION include/libcalamares ) # Install each subdir-worth of header files -foreach( subdir geoip locale modulesystem network partition utils ) - file( GLOB subdir_headers "${subdir}/*.h" ) - install( FILES ${subdir_headers} DESTINATION include/libcalamares/${subdir} ) +foreach(subdir geoip locale modulesystem network partition utils) + file(GLOB subdir_headers "${subdir}/*.h") + install(FILES ${subdir_headers} DESTINATION include/libcalamares/${subdir}) endforeach() - ### TESTING # # @@ -219,44 +226,70 @@ calamares_add_test( ${geoip_src} ) -function ( calamares_qrc_translations basename ) - set( NAME ${ARGV0} ) - set( options "" ) - set( oneValueArgs SUBDIRECTORY OUTPUT_VARIABLE ) - set( multiValueArgs LANGUAGES ) - cmake_parse_arguments( _qrt "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) +function(calamares_qrc_translations basename) + set(NAME ${ARGV0}) + set(options "") + set(oneValueArgs SUBDIRECTORY OUTPUT_VARIABLE) + set(multiValueArgs LANGUAGES) + cmake_parse_arguments( + _qrt + "${options}" + "${oneValueArgs}" + "${multiValueArgs}" + ${ARGN} + ) - if( NOT _qrt_OUTPUT_VARIABLE ) - set( _qrt_OUTPUT_VARIABLE "qrc_translations_${basename}" ) + if(NOT _qrt_OUTPUT_VARIABLE) + set(_qrt_OUTPUT_VARIABLE "qrc_translations_${basename}") endif() - set( translations_qrc_infile ${CMAKE_CURRENT_BINARY_DIR}/${basename}.qrc ) - set( translations_qrc_outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${basename}.cxx ) + set(translations_qrc_infile ${CMAKE_CURRENT_BINARY_DIR}/${basename}.qrc) + set(translations_qrc_outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${basename}.cxx) # Must use this variable name because of the @ substitution - set( calamares_i18n_qrc_content "" ) - set( calamares_i18n_ts_filelist "" ) - foreach( lang ${_qrt_LANGUAGES} ) - string( APPEND calamares_i18n_qrc_content "${basename}_${lang}.qm" ) - list( APPEND calamares_i18n_ts_filelist "${CMAKE_CURRENT_SOURCE_DIR}/${_qrt_SUBDIRECTORY}/${basename}_${lang}.ts" ) + set(calamares_i18n_qrc_content "") + set(calamares_i18n_ts_filelist "") + foreach(lang ${_qrt_LANGUAGES}) + string( + APPEND + calamares_i18n_qrc_content + "${basename}_${lang}.qm" + ) + 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} ) - set( ${_qrt_OUTPUT_VARIABLE} ${translations_qrc_outfile} PARENT_SCOPE ) + set(${_qrt_OUTPUT_VARIABLE} ${translations_qrc_outfile} PARENT_SCOPE) endfunction() -calamares_qrc_translations( localetest OUTPUT_VARIABLE localetest_qrc SUBDIRECTORY testdata LANGUAGES nl ) +calamares_qrc_translations(localetest OUTPUT_VARIABLE localetest_qrc SUBDIRECTORY testdata LANGUAGES nl) calamares_add_test( libcalamareslocaletest SOURCES @@ -291,7 +324,7 @@ calamares_add_test( ${OPTIONAL_PRIVATE_LIBRARIES} ) -if( KPMcore_FOUND ) +if(KPMcore_FOUND) calamares_add_test( libcalamarespartitionkpmtest SOURCES @@ -314,14 +347,18 @@ 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 ) +add_executable(test_geoip geoip/test_geoip.cpp ${geoip_src}) +target_link_libraries( + test_geoip + Calamares::calamares + Qt5::Network + yamlcpp::yamlcpp +) calamares_automoc( test_geoip ) -if ( Qt5DBus_FOUND ) - add_executable( test_automount partition/calautomount.cpp ) - target_link_libraries( test_automount Calamares::calamares Qt5::DBus ) +if(Qt5DBus_FOUND) + add_executable(test_automount partition/calautomount.cpp) + target_link_libraries(test_automount Calamares::calamares Qt5::DBus) endif() diff --git a/src/libcalamaresui/CMakeLists.txt b/src/libcalamaresui/CMakeLists.txt index 48e4c4b4d..90cdb329e 100644 --- a/src/libcalamaresui/CMakeLists.txt +++ b/src/libcalamaresui/CMakeLists.txt @@ -8,24 +8,25 @@ # 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 +set(calamaresui_SOURCES modulesystem/CppJobModule.cpp modulesystem/ModuleFactory.cpp 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 ) @@ -44,14 +44,14 @@ mark_thirdparty_code( ${CMAKE_SOURCE_DIR}/3rdparty/waitingspinnerwidget.cpp ) -if( WITH_PYTHON ) - list( APPEND calamaresui_SOURCES - modulesystem/PythonJobModule.cpp - ) +if(WITH_PYTHON) + list(APPEND calamaresui_SOURCES modulesystem/PythonJobModule.cpp) endif() -if( WITH_PYTHONQT ) - list( APPEND calamaresui_SOURCES +if(WITH_PYTHONQT) + list( + APPEND + calamaresui_SOURCES modulesystem/PythonQtViewModule.cpp utils/PythonQtUtils.cpp viewpages/PythonQtJob.cpp @@ -61,14 +61,11 @@ if( WITH_PYTHONQT ) ) endif() -if( WITH_QML ) - list( APPEND calamaresui_SOURCES - utils/Qml.cpp - viewpages/QmlViewStep.cpp - ) +if(WITH_QML) + list(APPEND calamaresui_SOURCES utils/Qml.cpp viewpages/QmlViewStep.cpp) endif() -calamares_add_library( calamaresui +calamares_add_library(calamaresui SOURCES ${calamaresui_SOURCES} EXPORT_MACRO UIDLLEXPORT_PRO LINK_LIBRARIES @@ -79,22 +76,27 @@ calamares_add_library( calamaresui utils/ErrorDialog/ErrorDialog.ui VERSION ${CALAMARES_VERSION_SHORT} ) -target_link_libraries( calamaresui PRIVATE yamlcpp::yamlcpp ) -if( KF5CoreAddons_FOUND AND KF5CoreAddons_VERSION VERSION_GREATER_EQUAL 5.58 ) - target_compile_definitions( calamaresui PRIVATE WITH_KOSRelease ) +target_link_libraries(calamaresui PRIVATE yamlcpp::yamlcpp) +if(KF5CoreAddons_FOUND AND KF5CoreAddons_VERSION VERSION_GREATER_EQUAL 5.58) + target_compile_definitions(calamaresui PRIVATE WITH_KOSRelease) endif() -if( WITH_PYTHONQT ) +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 ) +if(WITH_QML) + target_link_libraries(calamaresui PUBLIC Qt5::QuickWidgets) endif() add_library(Calamares::calamaresui ALIAS calamaresui) - ### Installation # # @@ -103,17 +105,12 @@ 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 ) - file( GLOB subdir_headers "${subdir}/*.h" ) - install( FILES ${subdir_headers} DESTINATION include/libcalamares/${subdir} ) +foreach(subdir modulesystem utils viewpages widgets) + file(GLOB subdir_headers "${subdir}/*.h") + install(FILES ${subdir_headers} DESTINATION include/libcalamares/${subdir}) endforeach() calamares_add_test( diff --git a/src/modules/CMakeLists.txt b/src/modules/CMakeLists.txt index 03384105e..593815459 100644 --- a/src/modules/CMakeLists.txt +++ b/src/modules/CMakeLists.txt @@ -8,7 +8,7 @@ # individual modules can also decide they must be skipped (e.g. OS-specific # modules, or ones with unmet dependencies). Collect the skipped modules # in this list. -set( LIST_SKIPPED_MODULES "" ) +set(LIST_SKIPPED_MODULES "") include_directories( ${CMAKE_SOURCE_DIR}/src/libcalamares @@ -16,29 +16,40 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/libcalamaresui ) -string( REPLACE " " ";" SKIP_LIST "${SKIP_MODULES}" ) +string(REPLACE " " ";" SKIP_LIST "${SKIP_MODULES}") -file( GLOB SUBDIRECTORIES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*" ) -list( SORT SUBDIRECTORIES ) +file(GLOB SUBDIRECTORIES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*") +list(SORT SUBDIRECTORIES) -foreach( SUBDIRECTORY ${SUBDIRECTORIES} ) +foreach(SUBDIRECTORY ${SUBDIRECTORIES}) calamares_add_module_subdirectory( ${SUBDIRECTORY} LIST_SKIPPED_MODULES ) 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" ) - if ( EXISTS "${_schema_file}" AND EXISTS "${_conf_file}" ) + foreach(SUBDIRECTORY ${SUBDIRECTORIES}) + 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() - diff --git a/src/modules/contextualprocess/CMakeLists.txt b/src/modules/contextualprocess/CMakeLists.txt index d7716bbfb..56cf409b5 100644 --- a/src/modules/contextualprocess/CMakeLists.txt +++ b/src/modules/contextualprocess/CMakeLists.txt @@ -3,7 +3,7 @@ # SPDX-FileCopyrightText: 2020 Adriaan de Groot # SPDX-License-Identifier: BSD-2-Clause # -calamares_add_plugin( contextualprocess +calamares_add_plugin(contextualprocess TYPE job EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES diff --git a/src/modules/dracutlukscfg/CMakeLists.txt b/src/modules/dracutlukscfg/CMakeLists.txt index aaa7a8c17..85efccc0c 100644 --- a/src/modules/dracutlukscfg/CMakeLists.txt +++ b/src/modules/dracutlukscfg/CMakeLists.txt @@ -3,7 +3,7 @@ # SPDX-FileCopyrightText: 2020 Adriaan de Groot # SPDX-License-Identifier: BSD-2-Clause # -calamares_add_plugin( dracutlukscfg +calamares_add_plugin(dracutlukscfg TYPE job EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES diff --git a/src/modules/dummycpp/CMakeLists.txt b/src/modules/dummycpp/CMakeLists.txt index 2916b4d67..b822a03be 100644 --- a/src/modules/dummycpp/CMakeLists.txt +++ b/src/modules/dummycpp/CMakeLists.txt @@ -3,7 +3,7 @@ # SPDX-FileCopyrightText: 2020 Adriaan de Groot # SPDX-License-Identifier: BSD-2-Clause # -calamares_add_plugin( dummycpp +calamares_add_plugin(dummycpp TYPE job EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES diff --git a/src/modules/finished/CMakeLists.txt b/src/modules/finished/CMakeLists.txt index 619f6d8b0..ab435a9eb 100644 --- a/src/modules/finished/CMakeLists.txt +++ b/src/modules/finished/CMakeLists.txt @@ -3,11 +3,11 @@ # SPDX-FileCopyrightText: 2020 Adriaan de Groot # SPDX-License-Identifier: BSD-2-Clause # -find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED DBus Network ) +find_package(Qt5 ${QT_VERSION} CONFIG REQUIRED DBus Network) -include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui ) +include_directories(${PROJECT_BINARY_DIR}/src/libcalamaresui) -calamares_add_plugin( finished +calamares_add_plugin(finished TYPE viewmodule EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES diff --git a/src/modules/finishedq/CMakeLists.txt b/src/modules/finishedq/CMakeLists.txt index facc2d691..2e688c45d 100644 --- a/src/modules/finishedq/CMakeLists.txt +++ b/src/modules/finishedq/CMakeLists.txt @@ -3,21 +3,21 @@ # SPDX-FileCopyrightText: 2021 Anke Boersma # SPDX-License-Identifier: BSD-2-Clause # -if( NOT WITH_QML ) +if(NOT WITH_QML) calamares_skip_module( "finishedq (QML is not supported in this build)" ) return() endif() -find_package( Qt5 ${QT_VERSION} CONFIG COMPONENTS DBus Network ) -if ( NOT TARGET Qt5::DBus OR NOT TARGET Qt5::Network ) +find_package(Qt5 ${QT_VERSION} CONFIG COMPONENTS DBus Network) +if(NOT TARGET Qt5::DBus OR NOT TARGET Qt5::Network) calamares_skip_module( "finishedq (missing DBus or Network)" ) return() endif() -set( _finished ${CMAKE_CURRENT_SOURCE_DIR}/../finished ) -include_directories( ${_finished} ) +set(_finished ${CMAKE_CURRENT_SOURCE_DIR}/../finished) +include_directories(${_finished}) -calamares_add_plugin( finishedq +calamares_add_plugin(finishedq TYPE viewmodule EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES diff --git a/src/modules/fsresizer/CMakeLists.txt b/src/modules/fsresizer/CMakeLists.txt index e721d7f6b..da4109195 100644 --- a/src/modules/fsresizer/CMakeLists.txt +++ b/src/modules/fsresizer/CMakeLists.txt @@ -3,18 +3,21 @@ # SPDX-FileCopyrightText: 2020 Adriaan de Groot # SPDX-License-Identifier: BSD-2-Clause # -find_package( KF5Config CONFIG ) -find_package( KF5I18n CONFIG ) -find_package( KF5WidgetsAddons CONFIG ) +find_package(KF5Config CONFIG) +find_package(KF5I18n CONFIG) +find_package(KF5WidgetsAddons CONFIG) -include( KPMcoreHelper ) +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 ) +if(KPMcore_FOUND AND Qt5DBus_FOUND AND KF5CoreAddons_FOUND AND KF5Config_FOUND) + 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. - calamares_add_plugin( fsresizer + calamares_add_plugin(fsresizer TYPE job EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES @@ -35,7 +38,7 @@ if ( KPMcore_FOUND AND Qt5DBus_FOUND AND KF5CoreAddons_FOUND AND KF5Config_FOUND DEFINITIONS ${KPMcore_API_DEFINITIONS} ) else() - if ( NOT KPMcore_FOUND ) + if(NOT KPMcore_FOUND) calamares_skip_module( "fsresizer (missing suitable KPMcore)" ) else() calamares_skip_module( "fsresizer (missing dependencies for KPMcore)" ) diff --git a/src/modules/hostinfo/CMakeLists.txt b/src/modules/hostinfo/CMakeLists.txt index 55be66f81..8f9f327e3 100644 --- a/src/modules/hostinfo/CMakeLists.txt +++ b/src/modules/hostinfo/CMakeLists.txt @@ -23,7 +23,7 @@ # - *hostCPU* the make (brand) of the CPU, if it can be determined. # Values are "Intel" or "AMD" or blank. -calamares_add_plugin( hostinfo +calamares_add_plugin(hostinfo TYPE job EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES @@ -32,8 +32,8 @@ calamares_add_plugin( hostinfo NO_CONFIG ) -if ( KF5CoreAddons_FOUND AND KF5CoreAddons_VERSION VERSION_GREATER_EQUAL 5.58 ) - target_compile_definitions( calamares_job_hostinfo PRIVATE WITH_KOSRelease ) +if(KF5CoreAddons_FOUND AND KF5CoreAddons_VERSION VERSION_GREATER_EQUAL 5.58) + target_compile_definitions(calamares_job_hostinfo PRIVATE WITH_KOSRelease) endif() calamares_add_test( diff --git a/src/modules/initcpio/CMakeLists.txt b/src/modules/initcpio/CMakeLists.txt index 48fd09371..9032d4d17 100644 --- a/src/modules/initcpio/CMakeLists.txt +++ b/src/modules/initcpio/CMakeLists.txt @@ -3,7 +3,7 @@ # SPDX-FileCopyrightText: 2020 Adriaan de Groot # SPDX-License-Identifier: BSD-2-Clause # -calamares_add_plugin( initcpio +calamares_add_plugin(initcpio TYPE job EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES diff --git a/src/modules/initramfs/CMakeLists.txt b/src/modules/initramfs/CMakeLists.txt index 2dec41cba..d56ca14ff 100644 --- a/src/modules/initramfs/CMakeLists.txt +++ b/src/modules/initramfs/CMakeLists.txt @@ -3,7 +3,7 @@ # SPDX-FileCopyrightText: 2020 Adriaan de Groot # SPDX-License-Identifier: BSD-2-Clause # -calamares_add_plugin( initramfs +calamares_add_plugin(initramfs TYPE job EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES diff --git a/src/modules/interactiveterminal/CMakeLists.txt b/src/modules/interactiveterminal/CMakeLists.txt index 20aee8257..05696f945 100644 --- a/src/modules/interactiveterminal/CMakeLists.txt +++ b/src/modules/interactiveterminal/CMakeLists.txt @@ -5,21 +5,23 @@ # find_package(ECM ${ECM_VERSION} REQUIRED NO_MODULE) -set( kf5_ver 5.41 ) +set(kf5_ver 5.41) -find_package( KF5Service ${kf5_ver} ) -find_package( KF5Parts ${kf5_ver} ) +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" ) -if ( KF5Parts_FOUND AND KF5Service_FOUND ) - calamares_add_plugin( interactiveterminal +if(KF5Parts_FOUND AND KF5Service_FOUND) + calamares_add_plugin(interactiveterminal TYPE viewmodule EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES diff --git a/src/modules/keyboard/CMakeLists.txt b/src/modules/keyboard/CMakeLists.txt index fe341cef0..51856709e 100644 --- a/src/modules/keyboard/CMakeLists.txt +++ b/src/modules/keyboard/CMakeLists.txt @@ -3,7 +3,7 @@ # SPDX-FileCopyrightText: 2020 Adriaan de Groot # SPDX-License-Identifier: BSD-2-Clause # -calamares_add_plugin( keyboard +calamares_add_plugin(keyboard TYPE viewmodule EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES diff --git a/src/modules/keyboardq/CMakeLists.txt b/src/modules/keyboardq/CMakeLists.txt index 2b0577aa7..9c7922d86 100644 --- a/src/modules/keyboardq/CMakeLists.txt +++ b/src/modules/keyboardq/CMakeLists.txt @@ -3,16 +3,16 @@ # SPDX-FileCopyrightText: 2020 Adriaan de Groot # SPDX-License-Identifier: BSD-2-Clause # -if( NOT WITH_QML ) +if(NOT WITH_QML) calamares_skip_module( "keyboardq (QML is not supported in this build)" ) return() endif() -set( _keyboard ${CMAKE_CURRENT_SOURCE_DIR}/../keyboard ) +set(_keyboard ${CMAKE_CURRENT_SOURCE_DIR}/../keyboard) -include_directories( ${_keyboard} ) +include_directories(${_keyboard}) -calamares_add_plugin( keyboardq +calamares_add_plugin(keyboardq TYPE viewmodule EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES diff --git a/src/modules/license/CMakeLists.txt b/src/modules/license/CMakeLists.txt index 0cd838799..d214d6ca7 100644 --- a/src/modules/license/CMakeLists.txt +++ b/src/modules/license/CMakeLists.txt @@ -3,9 +3,9 @@ # SPDX-FileCopyrightText: 2020 Adriaan de Groot # SPDX-License-Identifier: BSD-2-Clause # -include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui ) +include_directories(${PROJECT_BINARY_DIR}/src/libcalamaresui) -calamares_add_plugin( license +calamares_add_plugin(license TYPE viewmodule EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES diff --git a/src/modules/locale/CMakeLists.txt b/src/modules/locale/CMakeLists.txt index 272dea3de..6543d7d94 100644 --- a/src/modules/locale/CMakeLists.txt +++ b/src/modules/locale/CMakeLists.txt @@ -7,14 +7,14 @@ # When debugging the timezone widget, add this debugging definition # to have a debugging-friendly timezone widget, debug logging, # and no intrusive timezone-setting while clicking around. -option( DEBUG_TIMEZONES "Debug-friendly timezone widget." OFF ) -if( DEBUG_TIMEZONES ) - add_definitions( -DDEBUG_TIMEZONES ) +option(DEBUG_TIMEZONES "Debug-friendly timezone widget." OFF) +if(DEBUG_TIMEZONES) + add_definitions(-DDEBUG_TIMEZONES) endif() -include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui ) +include_directories(${PROJECT_BINARY_DIR}/src/libcalamaresui) -calamares_add_plugin( locale +calamares_add_plugin(locale TYPE viewmodule EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES diff --git a/src/modules/localeq/CMakeLists.txt b/src/modules/localeq/CMakeLists.txt index ee3f07314..85b3721d9 100644 --- a/src/modules/localeq/CMakeLists.txt +++ b/src/modules/localeq/CMakeLists.txt @@ -3,7 +3,7 @@ # SPDX-FileCopyrightText: 2020 Adriaan de Groot # SPDX-License-Identifier: BSD-2-Clause # -if( NOT WITH_QML ) +if(NOT WITH_QML) calamares_skip_module( "localeq (QML is not supported in this build)" ) return() endif() @@ -11,28 +11,32 @@ endif() # When debugging the timezone widget, add this debugging definition # to have a debugging-friendly timezone widget, debug logging, # and no intrusive timezone-setting while clicking around. -option( DEBUG_TIMEZONES "Debug-friendly timezone widget." OFF ) -if( DEBUG_TIMEZONES ) - add_definitions( -DDEBUG_TIMEZONES ) +option(DEBUG_TIMEZONES "Debug-friendly timezone widget." OFF) +if(DEBUG_TIMEZONES) + add_definitions(-DDEBUG_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 ) # Because we're sharing sources with the regular locale module -set( _locale ${CMAKE_CURRENT_SOURCE_DIR}/../locale ) +set(_locale ${CMAKE_CURRENT_SOURCE_DIR}/../locale) -include_directories( ${_locale} ) +include_directories(${_locale}) -calamares_add_plugin( localeq +calamares_add_plugin(localeq TYPE viewmodule EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES diff --git a/src/modules/luksopenswaphookcfg/CMakeLists.txt b/src/modules/luksopenswaphookcfg/CMakeLists.txt index caede06a7..dbec1dc55 100644 --- a/src/modules/luksopenswaphookcfg/CMakeLists.txt +++ b/src/modules/luksopenswaphookcfg/CMakeLists.txt @@ -6,7 +6,7 @@ # Because LUKS Open Swap Hook (Job) is such a mouthful, we'll # use LOSH all over the place as a shorthand. -calamares_add_plugin( luksopenswaphookcfg +calamares_add_plugin(luksopenswaphookcfg TYPE job EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES diff --git a/src/modules/machineid/CMakeLists.txt b/src/modules/machineid/CMakeLists.txt index 0ab035ab4..a0b60a6ef 100644 --- a/src/modules/machineid/CMakeLists.txt +++ b/src/modules/machineid/CMakeLists.txt @@ -3,7 +3,7 @@ # SPDX-FileCopyrightText: 2020 Adriaan de Groot # SPDX-License-Identifier: BSD-2-Clause # -calamares_add_plugin( machineid +calamares_add_plugin(machineid TYPE job EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES diff --git a/src/modules/netinstall/CMakeLists.txt b/src/modules/netinstall/CMakeLists.txt index 13c6fa0ce..6b51b1388 100644 --- a/src/modules/netinstall/CMakeLists.txt +++ b/src/modules/netinstall/CMakeLists.txt @@ -3,7 +3,7 @@ # SPDX-FileCopyrightText: 2020 Adriaan de Groot # SPDX-License-Identifier: BSD-2-Clause # -calamares_add_plugin( netinstall +calamares_add_plugin(netinstall TYPE viewmodule EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES @@ -32,4 +32,3 @@ calamares_add_test( LIBRARIES Qt5::Gui ) - diff --git a/src/modules/notesqml/CMakeLists.txt b/src/modules/notesqml/CMakeLists.txt index 5eab06663..c76ab5179 100644 --- a/src/modules/notesqml/CMakeLists.txt +++ b/src/modules/notesqml/CMakeLists.txt @@ -3,12 +3,12 @@ # SPDX-FileCopyrightText: 2020 Adriaan de Groot # SPDX-License-Identifier: BSD-2-Clause # -if( NOT WITH_QML ) +if(NOT WITH_QML) calamares_skip_module( "notesqml (QML is not supported in this build)" ) return() endif() -calamares_add_plugin( notesqml +calamares_add_plugin(notesqml TYPE viewmodule EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES diff --git a/src/modules/oemid/CMakeLists.txt b/src/modules/oemid/CMakeLists.txt index af7fe1ff7..45825c85e 100644 --- a/src/modules/oemid/CMakeLists.txt +++ b/src/modules/oemid/CMakeLists.txt @@ -3,7 +3,7 @@ # SPDX-FileCopyrightText: 2020 Adriaan de Groot # SPDX-License-Identifier: BSD-2-Clause # -calamares_add_plugin( oemid +calamares_add_plugin(oemid TYPE viewmodule EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES diff --git a/src/modules/packagechooser/CMakeLists.txt b/src/modules/packagechooser/CMakeLists.txt index d2e6ff118..4fbb0b533 100644 --- a/src/modules/packagechooser/CMakeLists.txt +++ b/src/modules/packagechooser/CMakeLists.txt @@ -3,45 +3,54 @@ # SPDX-FileCopyrightText: 2020 Adriaan de Groot # SPDX-License-Identifier: BSD-2-Clause # -find_package( Qt5 COMPONENTS Core Gui Widgets REQUIRED ) -set( _extra_libraries "" ) -set( _extra_src "" ) +find_package(Qt5 COMPONENTS Core Gui Widgets REQUIRED) +set(_extra_libraries "") +set(_extra_src "") ### OPTIONAL AppData XML support in PackageModel # # # 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 ) -if ( WITH_APPDATA ) +option( + WITH_APPDATA + "Support appdata: items in PackageChooser (requires QtXml)" + ON +) +if(WITH_APPDATA) find_package(Qt5 COMPONENTS Xml) - if ( Qt5Xml_FOUND ) - add_definitions( -DHAVE_APPDATA ) - list( APPEND _extra_libraries Qt5::Xml ) - list( APPEND _extra_src ItemAppData.cpp ) + if(Qt5Xml_FOUND) + add_definitions(-DHAVE_APPDATA) + list(APPEND _extra_libraries Qt5::Xml) + list(APPEND _extra_src ItemAppData.cpp) endif() endif() ### OPTIONAL AppStream support in PackageModel # # -option( WITH_APPSTREAM "Support appstream: items in PackageChooser (requires libappstream-qt)" ON ) -if ( WITH_APPSTREAM ) +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" TYPE OPTIONAL ) - if ( AppStreamQt_FOUND ) - add_definitions( -DHAVE_APPSTREAM ) - list( APPEND _extra_libraries AppStreamQt ) - list( APPEND _extra_src ItemAppStream.cpp ) + if(AppStreamQt_FOUND) + add_definitions(-DHAVE_APPSTREAM) + list(APPEND _extra_libraries AppStreamQt) + list(APPEND _extra_src ItemAppStream.cpp) endif() endif() -calamares_add_plugin( packagechooser +calamares_add_plugin(packagechooser TYPE viewmodule EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES diff --git a/src/modules/packagechooserq/CMakeLists.txt b/src/modules/packagechooserq/CMakeLists.txt index 51a17e215..e92b8b30e 100644 --- a/src/modules/packagechooserq/CMakeLists.txt +++ b/src/modules/packagechooserq/CMakeLists.txt @@ -4,55 +4,64 @@ # SPDX-FileCopyrightText: 2021 Anke Boersma # SPDX-License-Identifier: BSD-2-Clause # -if( NOT WITH_QML ) - calamares_skip_module( "packagechooserq (QML is not supported in this build)" ) +if(NOT WITH_QML) + calamares_skip_module("packagechooserq (QML is not supported in this build)") return() endif() -find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED Core ) +find_package(Qt5 ${QT_VERSION} CONFIG REQUIRED Core) # Add optional libraries here -set( USER_EXTRA_LIB ) +set(USER_EXTRA_LIB) # include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../packagechooser ) -set( _packagechooser ${CMAKE_CURRENT_SOURCE_DIR}/../packagechooser ) -include_directories( ${_packagechooser} ) +set(_packagechooser ${CMAKE_CURRENT_SOURCE_DIR}/../packagechooser) +include_directories(${_packagechooser}) ### OPTIONAL AppData XML support in PackageModel # # # 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 ) -if ( WITH_APPDATA ) +option( + WITH_APPDATA + "Support appdata: items in PackageChooser (requires QtXml)" + ON +) +if(WITH_APPDATA) find_package(Qt5 COMPONENTS Xml) - if ( Qt5Xml_FOUND ) - add_definitions( -DHAVE_APPDATA ) - list( APPEND _extra_libraries Qt5::Xml ) - list( APPEND _extra_src ${_packagechooser}/ItemAppData.cpp ) + if(Qt5Xml_FOUND) + add_definitions(-DHAVE_APPDATA) + list(APPEND _extra_libraries Qt5::Xml) + list(APPEND _extra_src ${_packagechooser}/ItemAppData.cpp) endif() endif() ### OPTIONAL AppStream support in PackageModel # # -option( WITH_APPSTREAM "Support appstream: items in PackageChooser (requires libappstream-qt)" ON ) -if ( WITH_APPSTREAM ) +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" TYPE OPTIONAL ) - if ( AppStreamQt_FOUND ) - add_definitions( -DHAVE_APPSTREAM ) - list( APPEND _extra_libraries AppStreamQt ) - list( APPEND _extra_src ${_packagechooser}/ItemAppStream.cpp ) + if(AppStreamQt_FOUND) + add_definitions(-DHAVE_APPSTREAM) + list(APPEND _extra_libraries AppStreamQt) + list(APPEND _extra_src ${_packagechooser}/ItemAppStream.cpp) endif() endif() -calamares_add_plugin( packagechooserq +calamares_add_plugin(packagechooserq TYPE viewmodule EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES diff --git a/src/modules/partition/CMakeLists.txt b/src/modules/partition/CMakeLists.txt index 940aacdd8..6c923cc5d 100644 --- a/src/modules/partition/CMakeLists.txt +++ b/src/modules/partition/CMakeLists.txt @@ -18,45 +18,49 @@ # modules since the partitions on disk won't match GS, but it can be # 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_SKIP "Don't actually do any partitioning." OFF) +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_SKIP "Don't actually do any partitioning." OFF) # This is very chatty, useful mostly if you don't know what KPMCore offers. -option( DEBUG_FILESYSTEMS "Log all available Filesystems from KPMCore." OFF ) +option(DEBUG_FILESYSTEMS "Log all available Filesystems from KPMCore." OFF) -include_directories( ${CMAKE_SOURCE_DIR} ) # For 3rdparty +include_directories(${CMAKE_SOURCE_DIR}) # For 3rdparty -set( _partition_defs ) -if( DEBUG_PARTITION_UNSAFE ) - if( DEBUG_PARTITION_BAIL_OUT ) - list( APPEND _partition_defs DEBUG_PARTITION_BAIL_OUT ) +set(_partition_defs) +if(DEBUG_PARTITION_UNSAFE) + if(DEBUG_PARTITION_BAIL_OUT) + list(APPEND _partition_defs DEBUG_PARTITION_BAIL_OUT) endif() - list( APPEND _partition_defs DEBUG_PARTITION_UNSAFE ) + list(APPEND _partition_defs DEBUG_PARTITION_UNSAFE) endif() -if ( DEBUG_FILESYSTEMS ) - list( APPEND _partition_defs DEBUG_FILESYSTEMS ) +if(DEBUG_FILESYSTEMS) + list(APPEND _partition_defs DEBUG_FILESYSTEMS) endif() -if( DEBUG_PARTITION_SKIP ) - list( APPEND _partition_defs DEBUG_PARTITION_SKIP ) +if(DEBUG_PARTITION_SKIP) + list(APPEND _partition_defs DEBUG_PARTITION_SKIP) endif() find_package(ECM ${ECM_VERSION} REQUIRED NO_MODULE) -include( KPMcoreHelper ) +include(KPMcoreHelper) -find_package( KF5Config CONFIG ) -find_package( KF5I18n CONFIG ) -find_package( KF5WidgetsAddons CONFIG ) +find_package(KF5Config CONFIG) +find_package(KF5I18n CONFIG) +find_package(KF5WidgetsAddons CONFIG) -if ( KPMcore_FOUND AND Qt5DBus_FOUND AND KF5CoreAddons_FOUND AND KF5Config_FOUND ) - list( APPEND _partition_defs ${KPMcore_API_DEFINITIONS} ) - include_directories( ${KPMCORE_INCLUDE_DIR} ) - include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui ) +if(KPMcore_FOUND AND Qt5DBus_FOUND AND KF5CoreAddons_FOUND AND KF5Config_FOUND) + list(APPEND _partition_defs ${KPMcore_API_DEFINITIONS}) + include_directories(${KPMCORE_INCLUDE_DIR}) + include_directories(${PROJECT_BINARY_DIR}/src/libcalamaresui) - add_subdirectory( tests ) + add_subdirectory(tests) - calamares_add_plugin( partition + calamares_add_plugin(partition TYPE viewmodule EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES @@ -124,10 +128,9 @@ if ( KPMcore_FOUND AND Qt5DBus_FOUND AND KF5CoreAddons_FOUND AND KF5Config_FOUND SHARED_LIB ) else() - if ( NOT KPMcore_FOUND ) + if(NOT KPMcore_FOUND) calamares_skip_module( "partition (missing suitable KPMcore)" ) else() calamares_skip_module( "partition (missing dependencies for KPMcore)" ) endif() endif() - diff --git a/src/modules/partition/tests/CMakeLists.txt b/src/modules/partition/tests/CMakeLists.txt index da017d96f..5fb2ebacf 100644 --- a/src/modules/partition/tests/CMakeLists.txt +++ b/src/modules/partition/tests/CMakeLists.txt @@ -3,9 +3,9 @@ # SPDX-FileCopyrightText: 2020 Adriaan de Groot # SPDX-License-Identifier: BSD-2-Clause # -find_package( Qt5 COMPONENTS Gui REQUIRED ) +find_package(Qt5 COMPONENTS Gui REQUIRED) -set( PartitionModule_SOURCE_DIR .. ) +set(PartitionModule_SOURCE_DIR ..) include_directories( ${Qt5Gui_INCLUDE_DIRS} @@ -40,7 +40,6 @@ calamares_add_test( DEFINITIONS ${_partition_defs} ) - calamares_add_test( partitioncreatelayoutstest SOURCES diff --git a/src/modules/plasmalnf/CMakeLists.txt b/src/modules/plasmalnf/CMakeLists.txt index 8ae205aed..60152fc84 100644 --- a/src/modules/plasmalnf/CMakeLists.txt +++ b/src/modules/plasmalnf/CMakeLists.txt @@ -7,28 +7,31 @@ find_package(ECM ${ECM_VERSION} REQUIRED NO_MODULE) # Requires a sufficiently recent Plasma framework, but also # needs a runtime support component (which we don't test for). -set( lnf_ver 5.41 ) +set(lnf_ver 5.41) -find_package( KF5Config ${lnf_ver} ) +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} ) +find_package(KF5Plasma ${lnf_ver}) set_package_properties( - KF5Plasma PROPERTIES + KF5Plasma + PROPERTIES PURPOSE "For Plasma Look-and-Feel selection" ) -find_package( KF5Package ${lnf_ver} ) +find_package(KF5Package ${lnf_ver}) set_package_properties( - KF5Package PROPERTIES + KF5Package + PROPERTIES PURPOSE "For Plasma Look-and-Feel selection" ) -if ( KF5Plasma_FOUND AND KF5Package_FOUND ) - calamares_add_plugin( plasmalnf +if(KF5Plasma_FOUND AND KF5Package_FOUND) + calamares_add_plugin(plasmalnf TYPE viewmodule EXPORT_MACRO PLUGINDLLEXPORT_PRO COMPILE_DEFINITIONS @@ -48,8 +51,11 @@ if ( KF5Plasma_FOUND AND KF5Package_FOUND ) KF5::Plasma SHARED_LIB ) - if ( KF5Config_FOUND ) - target_compile_definitions(calamares_viewmodule_plasmalnf PRIVATE WITH_KCONFIG) + if(KF5Config_FOUND) + target_compile_definitions( + calamares_viewmodule_plasmalnf + PRIVATE WITH_KCONFIG + ) endif() else() calamares_skip_module( "plasmalnf (missing requirements)" ) diff --git a/src/modules/preservefiles/CMakeLists.txt b/src/modules/preservefiles/CMakeLists.txt index 5df637321..aa8c3060d 100644 --- a/src/modules/preservefiles/CMakeLists.txt +++ b/src/modules/preservefiles/CMakeLists.txt @@ -3,7 +3,7 @@ # SPDX-FileCopyrightText: 2020 Adriaan de Groot # SPDX-License-Identifier: BSD-2-Clause # -calamares_add_plugin( preservefiles +calamares_add_plugin(preservefiles TYPE job EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES diff --git a/src/modules/removeuser/CMakeLists.txt b/src/modules/removeuser/CMakeLists.txt index 7663b3472..eaaf20157 100644 --- a/src/modules/removeuser/CMakeLists.txt +++ b/src/modules/removeuser/CMakeLists.txt @@ -3,7 +3,7 @@ # SPDX-FileCopyrightText: 2020 Adriaan de Groot # SPDX-License-Identifier: BSD-2-Clause # -calamares_add_plugin( removeuser +calamares_add_plugin(removeuser TYPE job EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES diff --git a/src/modules/shellprocess/CMakeLists.txt b/src/modules/shellprocess/CMakeLists.txt index ac6630c6d..aa1fadc6c 100644 --- a/src/modules/shellprocess/CMakeLists.txt +++ b/src/modules/shellprocess/CMakeLists.txt @@ -3,7 +3,7 @@ # SPDX-FileCopyrightText: 2020 Adriaan de Groot # SPDX-License-Identifier: BSD-2-Clause # -calamares_add_plugin( shellprocess +calamares_add_plugin(shellprocess TYPE job EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES diff --git a/src/modules/summary/CMakeLists.txt b/src/modules/summary/CMakeLists.txt index e3c1a381c..16f98ebb4 100644 --- a/src/modules/summary/CMakeLists.txt +++ b/src/modules/summary/CMakeLists.txt @@ -3,8 +3,8 @@ # SPDX-FileCopyrightText: 2020 Adriaan de Groot # SPDX-License-Identifier: BSD-2-Clause # -include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui ) -calamares_add_plugin( summary +include_directories(${PROJECT_BINARY_DIR}/src/libcalamaresui) +calamares_add_plugin(summary TYPE viewmodule EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES diff --git a/src/modules/summaryq/CMakeLists.txt b/src/modules/summaryq/CMakeLists.txt index 8aac1bc2f..071c344ef 100644 --- a/src/modules/summaryq/CMakeLists.txt +++ b/src/modules/summaryq/CMakeLists.txt @@ -3,15 +3,15 @@ # SPDX-FileCopyrightText: 2021 Anke Boersma # SPDX-License-Identifier: BSD-2-Clause # -if( NOT WITH_QML ) +if(NOT WITH_QML) calamares_skip_module( "summaryq (QML is not supported in this build)" ) return() endif() -set( _summary ${CMAKE_CURRENT_SOURCE_DIR}/../summary ) -include_directories( ${_summary} ) +set(_summary ${CMAKE_CURRENT_SOURCE_DIR}/../summary) +include_directories(${_summary}) -calamares_add_plugin( summaryq +calamares_add_plugin(summaryq TYPE viewmodule EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES diff --git a/src/modules/tracking/CMakeLists.txt b/src/modules/tracking/CMakeLists.txt index a878961b0..71ba1a8d7 100644 --- a/src/modules/tracking/CMakeLists.txt +++ b/src/modules/tracking/CMakeLists.txt @@ -3,7 +3,7 @@ # SPDX-FileCopyrightText: 2020 Adriaan de Groot # SPDX-License-Identifier: BSD-2-Clause # -calamares_add_plugin( tracking +calamares_add_plugin(tracking TYPE viewmodule EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES diff --git a/src/modules/umount/CMakeLists.txt b/src/modules/umount/CMakeLists.txt index d72847007..4e05d1b7c 100644 --- a/src/modules/umount/CMakeLists.txt +++ b/src/modules/umount/CMakeLists.txt @@ -3,7 +3,7 @@ # SPDX-FileCopyrightText: 2021 Adriaan de Groot # SPDX-License-Identifier: BSD-2-Clause # -calamares_add_plugin( umount +calamares_add_plugin(umount TYPE job EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES diff --git a/src/modules/users/CMakeLists.txt b/src/modules/users/CMakeLists.txt index 8203ecf08..d01dec572 100644 --- a/src/modules/users/CMakeLists.txt +++ b/src/modules/users/CMakeLists.txt @@ -3,39 +3,41 @@ # SPDX-FileCopyrightText: 2020 Adriaan de Groot # SPDX-License-Identifier: BSD-2-Clause # -find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED Core DBus Network ) -find_package( Crypt REQUIRED ) +find_package(Qt5 ${QT_VERSION} CONFIG REQUIRED Core DBus Network) +find_package(Crypt REQUIRED) # Add optional libraries here -set( USER_EXTRA_LIB ) +set(USER_EXTRA_LIB) -find_package( LibPWQuality ) +find_package(LibPWQuality) set_package_properties( - LibPWQuality PROPERTIES + LibPWQuality + PROPERTIES PURPOSE "Extra checks of password quality" ) -if( LibPWQuality_FOUND ) - list( APPEND USER_EXTRA_LIB ${LibPWQuality_LIBRARIES} ) - include_directories( ${LibPWQuality_INCLUDE_DIRS} ) - add_definitions( -DCHECK_PWQUALITY -DHAVE_LIBPWQUALITY ) +if(LibPWQuality_FOUND) + list(APPEND USER_EXTRA_LIB ${LibPWQuality_LIBRARIES}) + include_directories(${LibPWQuality_INCLUDE_DIRS}) + add_definitions(-DCHECK_PWQUALITY -DHAVE_LIBPWQUALITY) endif() -find_package( ICU COMPONENTS uc i18n ) +find_package(ICU COMPONENTS uc i18n) set_package_properties( - ICU PROPERTIES + ICU + PROPERTIES PURPOSE "Transliteration support for full name to username conversion" ) -if( ICU_FOUND ) - list( APPEND USER_EXTRA_LIB ICU::uc ICU::i18n ) - include_directories( ${ICU_INCLUDE_DIRS} ) - add_definitions( -DHAVE_ICU ) +if(ICU_FOUND) + list(APPEND USER_EXTRA_LIB ICU::uc ICU::i18n) + include_directories(${ICU_INCLUDE_DIRS}) + add_definitions(-DHAVE_ICU) endif() -include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui ) +include_directories(${PROJECT_BINARY_DIR}/src/libcalamaresui) -set( _users_src +set(_users_src # Jobs CreateUserJob.cpp MiscJobs.cpp @@ -59,7 +61,7 @@ calamares_add_library( ${CRYPT_LIBRARIES} ) -calamares_add_plugin( users +calamares_add_plugin(users TYPE viewmodule EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES diff --git a/src/modules/usersq/CMakeLists.txt b/src/modules/usersq/CMakeLists.txt index 8465b0246..3e58a4a24 100644 --- a/src/modules/usersq/CMakeLists.txt +++ b/src/modules/usersq/CMakeLists.txt @@ -3,45 +3,47 @@ # SPDX-FileCopyrightText: 2020 Adriaan de Groot # SPDX-License-Identifier: BSD-2-Clause # -if( NOT WITH_QML ) +if(NOT WITH_QML) calamares_skip_module( "usersq (QML is not supported in this build)" ) return() endif() -find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED Core DBus Network ) -find_package( Crypt REQUIRED ) +find_package(Qt5 ${QT_VERSION} CONFIG REQUIRED Core DBus Network) +find_package(Crypt REQUIRED) # Add optional libraries here -set( USER_EXTRA_LIB ) +set(USER_EXTRA_LIB) -include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../users ) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../users) -find_package( LibPWQuality ) +find_package(LibPWQuality) set_package_properties( - LibPWQuality PROPERTIES + LibPWQuality + PROPERTIES PURPOSE "Extra checks of password quality" ) -if( LibPWQuality_FOUND ) - list( APPEND USER_EXTRA_LIB ${LibPWQuality_LIBRARIES} ) - include_directories( ${LibPWQuality_INCLUDE_DIRS} ) - add_definitions( -DCHECK_PWQUALITY -DHAVE_LIBPWQUALITY ) +if(LibPWQuality_FOUND) + list(APPEND USER_EXTRA_LIB ${LibPWQuality_LIBRARIES}) + include_directories(${LibPWQuality_INCLUDE_DIRS}) + add_definitions(-DCHECK_PWQUALITY -DHAVE_LIBPWQUALITY) endif() #needed for ${_users}/Config.cpp -find_package( ICU COMPONENTS uc i18n ) +find_package(ICU COMPONENTS uc i18n) set_package_properties( - ICU PROPERTIES + ICU + PROPERTIES PURPOSE "Transliteration support for full name to username conversion" ) -if( ICU_FOUND ) - list( APPEND USER_EXTRA_LIB ICU::uc ICU::i18n ) - include_directories( ${ICU_INCLUDE_DIRS} ) - add_definitions( -DHAVE_ICU ) +if(ICU_FOUND) + list(APPEND USER_EXTRA_LIB ICU::uc ICU::i18n) + include_directories(${ICU_INCLUDE_DIRS}) + add_definitions(-DHAVE_ICU) endif() -calamares_add_plugin( usersq +calamares_add_plugin(usersq TYPE viewmodule EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES diff --git a/src/modules/webview/CMakeLists.txt b/src/modules/webview/CMakeLists.txt index 54e1d18b0..34ddb1738 100644 --- a/src/modules/webview/CMakeLists.txt +++ b/src/modules/webview/CMakeLists.txt @@ -3,52 +3,57 @@ # SPDX-FileCopyrightText: 2020 Adriaan de Groot # SPDX-License-Identifier: BSD-2-Clause # -set( CALA_WEBVIEW_LINK_LIBRARIES "" ) +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 "" ) +set(_reason "") -message( STATUS "Found Qt version ${Qt5Core_VERSION}") -if ( Qt5Core_VERSION VERSION_LESS 5.6 OR WEBVIEW_FORCE_WEBKIT ) - message( STATUS " .. using webkit") - find_package( Qt5 ${QT_VERSION} CONFIG COMPONENTS WebKit WebKitWidgets ) +message(STATUS "Found Qt version ${Qt5Core_VERSION}") +if(Qt5Core_VERSION VERSION_LESS 5.6 OR WEBVIEW_FORCE_WEBKIT) + message(STATUS " .. using 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 - ) - set( WEBVIEW_WITH_WEBKIT 1 ) + 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) + set(WEBVIEW_WITH_WEBKIT 1) else() - set( _reason "No suitable WebKit" ) + set(_reason "No suitable WebKit") endif() else() - message( STATUS " .. using webengine") - find_package( Qt5 ${QT_VERSION} CONFIG COMPONENTS WebEngine WebEngineWidgets ) + message(STATUS " .. using webengine") + find_package(Qt5 ${QT_VERSION} CONFIG COMPONENTS WebEngine WebEngineWidgets) - if ( Qt5WebEngine_FOUND AND Qt5WebEngineWidgets_FOUND ) - list( APPEND CALA_WEBVIEW_INCLUDE_DIRECTORIES + if(Qt5WebEngine_FOUND AND Qt5WebEngineWidgets_FOUND) + 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 ) - set( WEBVIEW_WITH_WEBENGINE 1 ) + set(WEBVIEW_WITH_WEBENGINE 1) else() - set( _reason "No suitable WebEngine" ) + set(_reason "No suitable WebEngine") endif() endif() -if ( NOT _reason ) - configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/WebViewConfig.h.in - ${CMAKE_CURRENT_BINARY_DIR}/WebViewConfig.h ) +if(NOT _reason) + configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/WebViewConfig.h.in + ${CMAKE_CURRENT_BINARY_DIR}/WebViewConfig.h + ) - calamares_add_plugin( webview + calamares_add_plugin(webview TYPE viewmodule EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES diff --git a/src/modules/welcome/CMakeLists.txt b/src/modules/welcome/CMakeLists.txt index 01a89703a..50f30839a 100644 --- a/src/modules/welcome/CMakeLists.txt +++ b/src/modules/welcome/CMakeLists.txt @@ -3,19 +3,19 @@ # SPDX-FileCopyrightText: 2020 Adriaan de Groot # SPDX-License-Identifier: BSD-2-Clause # -find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED DBus Network ) +find_package(Qt5 ${QT_VERSION} CONFIG REQUIRED DBus Network) -find_package( LIBPARTED ) -if ( LIBPARTED_FOUND ) - set( PARTMAN_SRC checker/partman_devices.c ) - set( PARTMAN_LIB ${LIBPARTED_LIBRARY} ) +find_package(LIBPARTED) +if(LIBPARTED_FOUND) + set(PARTMAN_SRC checker/partman_devices.c) + set(PARTMAN_LIB ${LIBPARTED_LIBRARY}) else() - set( PARTMAN_SRC ) - set( PARTMAN_LIB ) - add_definitions( -DWITHOUT_LIBPARTED ) + set(PARTMAN_SRC) + set(PARTMAN_LIB) + add_definitions(-DWITHOUT_LIBPARTED) endif() -calamares_add_plugin( welcome +calamares_add_plugin(welcome TYPE viewmodule EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES diff --git a/src/modules/welcomeq/CMakeLists.txt b/src/modules/welcomeq/CMakeLists.txt index b6f950dad..7afdf638c 100644 --- a/src/modules/welcomeq/CMakeLists.txt +++ b/src/modules/welcomeq/CMakeLists.txt @@ -7,34 +7,31 @@ # This is a re-write of the welcome module using QML view steps # instead of widgets. -if( NOT WITH_QML ) +if(NOT WITH_QML) calamares_skip_module( "welcomeq (QML is not supported in this build)" ) return() endif() -set( _welcome ${CMAKE_CURRENT_SOURCE_DIR}/../welcome ) +set(_welcome ${CMAKE_CURRENT_SOURCE_DIR}/../welcome) -include_directories( ${_welcome} ) +include_directories(${_welcome}) # DUPLICATED WITH WELCOME MODULE -find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED DBus Network ) +find_package(Qt5 ${QT_VERSION} CONFIG REQUIRED DBus Network) -find_package( LIBPARTED ) -if ( LIBPARTED_FOUND ) - set( PARTMAN_SRC ${_welcome}/checker/partman_devices.c ) - set( CHECKER_LINK_LIBRARIES ${LIBPARTED_LIBRARY} ) +find_package(LIBPARTED) +if(LIBPARTED_FOUND) + set(PARTMAN_SRC ${_welcome}/checker/partman_devices.c) + set(CHECKER_LINK_LIBRARIES ${LIBPARTED_LIBRARY}) else() - set( PARTMAN_SRC ) - set( CHECKER_LINK_LIBRARIES ) - add_definitions( -DWITHOUT_LIBPARTED ) + set(PARTMAN_SRC) + set(CHECKER_LINK_LIBRARIES) + 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 +calamares_add_plugin(welcomeq TYPE viewmodule EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES diff --git a/src/modules/zfs/CMakeLists.txt b/src/modules/zfs/CMakeLists.txt index 2feb911d0..07764a360 100644 --- a/src/modules/zfs/CMakeLists.txt +++ b/src/modules/zfs/CMakeLists.txt @@ -3,11 +3,10 @@ # SPDX-FileCopyrightText: 2020 Adriaan de Groot # SPDX-License-Identifier: BSD-2-Clause # -calamares_add_plugin( zfs +calamares_add_plugin(zfs TYPE job EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES ZfsJob.cpp SHARED_LIB ) - diff --git a/src/qml/calamares/CMakeLists.txt b/src/qml/calamares/CMakeLists.txt index d74e79ea0..38c46b484 100644 --- a/src/qml/calamares/CMakeLists.txt +++ b/src/qml/calamares/CMakeLists.txt @@ -12,29 +12,46 @@ # Iterate over all the subdirectories which have a qmldir file, copy them over to the build dir, # 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" ) - - set( QML_DIR share/calamares/qml ) - set( QML_MODULE_DESTINATION ${QML_DIR}/calamares/${SUBDIRECTORY} ) +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" + ) + 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}/*" ) - 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 ) + 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 + ) - 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() -message( "" ) +message("")