diff --git a/CHANGES-3.3 b/CHANGES-3.3 index 6227bfcf0..3e79c5476 100644 --- a/CHANGES-3.3 +++ b/CHANGES-3.3 @@ -10,9 +10,12 @@ the history of the 3.2 series (2018-05 - 2022-08). # 3.3.2 (unreleased) This release contains contributions from (alphabetically by first name): - - nobody, yet! + - Adriaan de Groot + - Jonathan Riddell ## Core ## + - Slideshow support code (QML) now ported to Qt and made available + as two separate directories of support-code. (thanks Jon) ## Modules ## diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bc60e9706..e342c962f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -14,13 +14,7 @@ include(CalamaresAddTranslations) add_subdirectory(libcalamares) add_subdirectory(libcalamaresui) -if(WITH_QT6) - # all things qml - add_subdirectory(qml/calamares-qt6) -else() - # all things qml - add_subdirectory(qml/calamares-qt5) -endif() +add_subdirectory(qml) # application add_subdirectory(calamares) diff --git a/src/qml/CMakeLists.txt b/src/qml/CMakeLists.txt new file mode 100644 index 000000000..fa0ee8fac --- /dev/null +++ b/src/qml/CMakeLists.txt @@ -0,0 +1,50 @@ +# === This file is part of Calamares - === +# +# SPDX-FileCopyrightText: 2020 Adriaan de Groot +# SPDX-License-Identifier: BSD-2-Clause +# + +# Install "slideshows" and other QML-sources for Calamares. +# +# In practice, in the central source repositoy, this means +# just-install-the-slideshow-example. For alternative slideshows, +# see the approach in the calamares-extensions repository. + +function(calamares_install_qml) + # 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}/${qml_subdir} "*") + 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) + + 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}") + endif() + endforeach() + + message("") +endfunction() + +if(WITH_QT6) + add_subdirectory(calamares-qt6) +else() + add_subdirectory(calamares-qt5) +endif() diff --git a/src/qml/calamares-qt5/CMakeLists.txt b/src/qml/calamares-qt5/CMakeLists.txt index 07e376bfa..456f967cb 100644 --- a/src/qml/calamares-qt5/CMakeLists.txt +++ b/src/qml/calamares-qt5/CMakeLists.txt @@ -1,42 +1 @@ -# === This file is part of Calamares - === -# -# SPDX-FileCopyrightText: 2020 Adriaan de Groot -# SPDX-License-Identifier: BSD-2-Clause -# - -# Install "slideshows" and other QML-sources for Calamares. -# -# In practice, in the central source repositoy, this means -# just-install-the-slideshow-example. For alternative slideshows, -# see the approach in the calamares-extensions repository. - -# 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}) - - # 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) - - 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}") - endif() -endforeach() - -message("") +calamares_install_qml() diff --git a/src/qml/calamares-qt6/CMakeLists.txt b/src/qml/calamares-qt6/CMakeLists.txt index 07e376bfa..456f967cb 100644 --- a/src/qml/calamares-qt6/CMakeLists.txt +++ b/src/qml/calamares-qt6/CMakeLists.txt @@ -1,42 +1 @@ -# === This file is part of Calamares - === -# -# SPDX-FileCopyrightText: 2020 Adriaan de Groot -# SPDX-License-Identifier: BSD-2-Clause -# - -# Install "slideshows" and other QML-sources for Calamares. -# -# In practice, in the central source repositoy, this means -# just-install-the-slideshow-example. For alternative slideshows, -# see the approach in the calamares-extensions repository. - -# 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}) - - # 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) - - 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}") - endif() -endforeach() - -message("") +calamares_install_qml()