[libcalamares,ui] Make KF5::CoreAddons explicit

- libcalamares doesn't need it anymore, because it ported away
  from KPluginLoader,
- libcalamaresui does need it, because of KMacroExpander.
This commit is contained in:
Adriaan de Groot 2022-02-08 16:13:40 +01:00
parent e507a23795
commit b167d8da03
2 changed files with 119 additions and 184 deletions

View File

@ -13,12 +13,9 @@
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 "")
@ -31,13 +28,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
@ -46,7 +41,6 @@ set( libSources
locale/TranslatableString.cpp
locale/Translation.cpp
locale/TranslationsModel.cpp
# Modules
modulesystem/Config.cpp
modulesystem/Descriptor.cpp
@ -55,19 +49,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
@ -96,11 +86,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})
@ -108,10 +94,7 @@ if( WITH_PYTHON )
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
list( APPEND OPTIONAL_PRIVATE_LIBRARIES
${PYTHON_LIBRARIES}
${Boost_LIBRARIES}
)
list(APPEND OPTIONAL_PRIVATE_LIBRARIES ${PYTHON_LIBRARIES} ${Boost_LIBRARIES})
endif()
### OPTIONAL GeoIP XML support
@ -136,7 +119,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
@ -149,7 +134,8 @@ endif()
#
#
add_library(calamares SHARED ${libSources})
set_target_properties( calamares
set_target_properties(
calamares
PROPERTIES
VERSION ${CALAMARES_VERSION_SHORT}
SOVERSION ${CALAMARES_VERSION_SHORT}
@ -157,14 +143,10 @@ set_target_properties( calamares
)
calamares_automoc( calamares )
target_link_libraries( calamares
LINK_PRIVATE
${OPTIONAL_PRIVATE_LIBRARIES}
LINK_PUBLIC
yamlcpp::yamlcpp
Qt5::Core
KF5::CoreAddons
${OPTIONAL_PUBLIC_LIBRARIES}
target_link_libraries(
calamares
LINK_PRIVATE ${OPTIONAL_PRIVATE_LIBRARIES}
LINK_PUBLIC yamlcpp::yamlcpp Qt5::Core ${OPTIONAL_PUBLIC_LIBRARIES}
)
add_library(Calamares::calamares ALIAS calamares)
@ -172,27 +154,31 @@ 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")
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/CalamaresConfig.h
${CMAKE_CURRENT_BINARY_DIR}/CalamaresVersion.h
${rootHeaders}
FILES ${CMAKE_CURRENT_BINARY_DIR}/CalamaresConfig.h ${CMAKE_CURRENT_BINARY_DIR}/CalamaresVersion.h ${rootHeaders}
DESTINATION include/libcalamares
)
# Install each subdir-worth of header files
@ -201,22 +187,12 @@ foreach( subdir geoip locale modulesystem network partition utils )
install(FILES ${subdir_headers} DESTINATION include/libcalamares/${subdir})
endforeach()
### TESTING
#
#
calamares_add_test(
libcalamarestest
SOURCES
Tests.cpp
)
calamares_add_test(libcalamarestest SOURCES Tests.cpp)
calamares_add_test(
libcalamaresgeoiptest
SOURCES
geoip/GeoIPTests.cpp
${geoip_src}
)
calamares_add_test(libcalamaresgeoiptest SOURCES geoip/GeoIPTests.cpp ${geoip_src})
function(calamares_qrc_translations basename)
set(NAME ${ARGV0})
@ -237,7 +213,11 @@ function ( calamares_qrc_translations basename )
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" )
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)
@ -247,7 +227,15 @@ function ( calamares_qrc_translations basename )
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}
)
@ -256,63 +244,31 @@ function ( calamares_qrc_translations basename )
endfunction()
calamares_qrc_translations( localetest OUTPUT_VARIABLE localetest_qrc SUBDIRECTORY testdata LANGUAGES nl )
calamares_add_test(
libcalamareslocaletest
SOURCES
locale/Tests.cpp
${localetest_qrc}
)
calamares_add_test(libcalamareslocaletest SOURCES locale/Tests.cpp ${localetest_qrc})
calamares_add_test(
libcalamaresmodulesystemtest
SOURCES
modulesystem/Tests.cpp
)
calamares_add_test(libcalamaresmodulesystemtest SOURCES modulesystem/Tests.cpp)
calamares_add_test(
libcalamaresnetworktest
SOURCES
network/Tests.cpp
)
calamares_add_test(libcalamaresnetworktest SOURCES network/Tests.cpp)
calamares_add_test(
libcalamarespackagestest
SOURCES
packages/Tests.cpp
)
calamares_add_test(libcalamarespackagestest SOURCES packages/Tests.cpp)
calamares_add_test(
libcalamarespartitiontest
SOURCES
partition/Global.cpp
partition/Tests.cpp
LIBRARIES
${OPTIONAL_PRIVATE_LIBRARIES}
SOURCES partition/Global.cpp partition/Tests.cpp
LIBRARIES ${OPTIONAL_PRIVATE_LIBRARIES}
)
if(KPMcore_FOUND)
calamares_add_test(
libcalamarespartitionkpmtest
SOURCES
partition/KPMTests.cpp
LIBRARIES
${OPTIONAL_PRIVATE_LIBRARIES}
SOURCES partition/KPMTests.cpp
LIBRARIES ${OPTIONAL_PRIVATE_LIBRARIES}
)
endif()
calamares_add_test(
libcalamaresutilstest
SOURCES
utils/Tests.cpp
utils/Runner.cpp
)
calamares_add_test(
libcalamaresutilspathstest
SOURCES
utils/TestPaths.cpp
)
calamares_add_test(libcalamaresutilstest SOURCES utils/Tests.cpp utils/Runner.cpp)
calamares_add_test(libcalamaresutilspathstest SOURCES utils/TestPaths.cpp)
# This is not an actual test, it's a test / demo application
# for experimenting with GeoIP.

View File

@ -16,16 +16,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
@ -33,7 +30,6 @@ set( calamaresui_SOURCES
widgets/TranslationFix.cpp
widgets/WaitingWidget.cpp
${CMAKE_SOURCE_DIR}/3rdparty/waitingspinnerwidget.cpp
Branding.cpp
ViewManager.cpp
)
@ -44,16 +40,11 @@ mark_thirdparty_code(
)
if(WITH_PYTHON)
list( APPEND calamaresui_SOURCES
modulesystem/PythonJobModule.cpp
)
list(APPEND calamaresui_SOURCES modulesystem/PythonJobModule.cpp)
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
@ -70,6 +61,7 @@ calamares_add_library( calamaresui
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 KF5::CoreAddons)
endif()
if(WITH_QML)
target_link_libraries(calamaresui PUBLIC Qt5::QuickWidgets)
@ -77,7 +69,6 @@ endif()
add_library(Calamares::calamaresui ALIAS calamaresui)
### Installation
#
#
@ -86,12 +77,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)
@ -99,11 +85,4 @@ foreach( subdir modulesystem utils viewpages widgets )
install(FILES ${subdir_headers} DESTINATION include/libcalamares/${subdir})
endforeach()
calamares_add_test(
test_libcalamaresuipaste
SOURCES
utils/TestPaste.cpp
utils/Paste.cpp
LIBRARIES
calamaresui
)
calamares_add_test(test_libcalamaresuipaste SOURCES utils/TestPaste.cpp utils/Paste.cpp LIBRARIES calamaresui)