CMake: restrict Qt6 build

- build **only** libcalamares
- switch the finding and linking of Qt modules to use qtname
This commit is contained in:
Adriaan de Groot 2023-09-03 14:01:38 +02:00
parent 953479422c
commit b905afb169
3 changed files with 15 additions and 9 deletions

View File

@ -453,7 +453,9 @@ endif()
set(CALAMARES_TRANSLATION_LANGUAGES en ${_tx_complete} ${_tx_good} ${_tx_ok}) set(CALAMARES_TRANSLATION_LANGUAGES en ${_tx_complete} ${_tx_good} ${_tx_ok})
list(SORT CALAMARES_TRANSLATION_LANGUAGES) list(SORT CALAMARES_TRANSLATION_LANGUAGES)
if(NOT WITH_QT6) # TODO: Qt6
add_subdirectory(lang) # i18n tools add_subdirectory(lang) # i18n tools
endif()
### Example Distro ### Example Distro
# #
@ -638,7 +640,9 @@ endif()
### CMAKE SUMMARY REPORT ### CMAKE SUMMARY REPORT
# #
if(NOT WITH_QT6) # TODO: Qt6
get_directory_property(SKIPPED_MODULES DIRECTORY src/modules DEFINITION LIST_SKIPPED_MODULES) get_directory_property(SKIPPED_MODULES DIRECTORY src/modules DEFINITION LIST_SKIPPED_MODULES)
endif()
calamares_explain_skipped_modules( ${SKIPPED_MODULES} ) calamares_explain_skipped_modules( ${SKIPPED_MODULES} )
feature_summary(WHAT DISABLED_FEATURES DESCRIPTION "The following features have been disabled:" QUIET_ON_EMPTY) feature_summary(WHAT DISABLED_FEATURES DESCRIPTION "The following features have been disabled:" QUIET_ON_EMPTY)

View File

@ -13,6 +13,7 @@ include(CalamaresAddTranslations)
# library # library
add_subdirectory(libcalamares) add_subdirectory(libcalamares)
if(NOT WITH_QT6) # TODO: Qt6
add_subdirectory(libcalamaresui) add_subdirectory(libcalamaresui)
# all things qml # all things qml
@ -26,3 +27,4 @@ add_subdirectory(modules)
# branding components # branding components
add_subdirectory(branding) add_subdirectory(branding)
endif()

View File

@ -100,14 +100,14 @@ set_target_properties(
SOVERSION ${CALAMARES_SOVERSION} SOVERSION ${CALAMARES_SOVERSION}
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_INSTALL_FULL_INCLUDEDIR}/libcalamares INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_INSTALL_FULL_INCLUDEDIR}/libcalamares
) )
target_link_libraries(calamares LINK_PUBLIC yamlcpp::yamlcpp Qt5::Core KF5::CoreAddons) target_link_libraries(calamares LINK_PUBLIC yamlcpp::yamlcpp ${qtname}::Core KF5::CoreAddons)
### OPTIONAL Automount support (requires dbus) ### OPTIONAL Automount support (requires dbus)
# #
# #
if(Qt5DBus_FOUND) if(TARGET ${qtname}::DBus)
target_sources(calamares PRIVATE partition/AutoMount.cpp) target_sources(calamares PRIVATE partition/AutoMount.cpp)
target_link_libraries(calamares PRIVATE Qt5::DBus) target_link_libraries(calamares PRIVATE ${qtname}::DBus)
endif() endif()
### OPTIONAL Python support ### OPTIONAL Python support
@ -121,10 +121,10 @@ endif()
### OPTIONAL GeoIP XML support ### OPTIONAL GeoIP XML support
# #
# #
find_package(Qt5 COMPONENTS Xml) find_package(${qtname} ${QT_VERSION} COMPONENTS Xml)
if(Qt5Xml_FOUND) if(TARGET ${qtname}::Xml)
target_sources(calamares PRIVATE geoip/GeoIPXML.cpp) target_sources(calamares PRIVATE geoip/GeoIPXML.cpp)
target_link_libraries(calamares PRIVATE Qt5::Network Qt5::Xml) target_link_libraries(calamares PRIVATE ${qtname}::Network ${qtname}::Xml)
endif() endif()
### OPTIONAL KPMcore support ### OPTIONAL KPMcore support
@ -274,10 +274,10 @@ calamares_add_test(libcalamaresutilspathstest SOURCES utils/TestPaths.cpp)
# This is not an actual test, it's a test / demo application # This is not an actual test, it's a test / demo application
# for experimenting with GeoIP. # for experimenting with GeoIP.
add_executable(test_geoip geoip/test_geoip.cpp ${geoip_src}) 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 ${qtname}::Network yamlcpp::yamlcpp)
calamares_automoc( test_geoip ) calamares_automoc( test_geoip )
if(Qt5DBus_FOUND) if(TARGET ${qtname}::DBus)
add_executable(test_automount partition/calautomount.cpp) add_executable(test_automount partition/calautomount.cpp)
target_link_libraries(test_automount Calamares::calamares Qt5::DBus) target_link_libraries(test_automount Calamares::calamares ${qtname}::DBus)
endif() endif()