From 3360ad612e19ed47ec903607ccf0280a667d15c4 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Sun, 3 Jul 2022 11:43:01 +0200 Subject: [PATCH] [libcalamares] Use Calamares interface-library to kpmcore --- src/libcalamares/CMakeLists.txt | 6 +++--- src/modules/fsresizer/CMakeLists.txt | 4 ++-- src/modules/partition/CMakeLists.txt | 6 ++---- src/modules/partition/tests/CMakeLists.txt | 8 ++++---- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/libcalamares/CMakeLists.txt b/src/libcalamares/CMakeLists.txt index 09291707c..1798d2ee4 100644 --- a/src/libcalamares/CMakeLists.txt +++ b/src/libcalamares/CMakeLists.txt @@ -123,7 +123,7 @@ if(KPMcore_FOUND) partition/PartitionIterator.cpp partition/PartitionQuery.cpp ) - target_link_libraries(calamares PRIVATE kpmcore) + target_link_libraries(calamares PRIVATE calamares::kpmcore) endif() ### LIBRARY @@ -238,8 +238,8 @@ calamares_add_test(libcalamaresnetworktest SOURCES network/Tests.cpp) calamares_add_test(libcalamarespackagestest SOURCES packages/Tests.cpp) if(KPMcore_FOUND) - calamares_add_test(libcalamarespartitiontest SOURCES partition/Global.cpp partition/Tests.cpp LIBRARIES kpmcore) - calamares_add_test(libcalamarespartitionkpmtest SOURCES partition/KPMTests.cpp LIBRARIES kpmcore) + calamares_add_test(libcalamarespartitiontest SOURCES partition/Global.cpp partition/Tests.cpp LIBRARIES calamares::kpmcore) + calamares_add_test(libcalamarespartitionkpmtest SOURCES partition/KPMTests.cpp LIBRARIES calamares::kpmcore) endif() calamares_add_test(libcalamaresutilstest SOURCES utils/Tests.cpp utils/Runner.cpp) diff --git a/src/modules/fsresizer/CMakeLists.txt b/src/modules/fsresizer/CMakeLists.txt index 189e7c1dc..f4c94bc8b 100644 --- a/src/modules/fsresizer/CMakeLists.txt +++ b/src/modules/fsresizer/CMakeLists.txt @@ -9,7 +9,7 @@ find_package(KF5WidgetsAddons CONFIG) include(KPMcoreHelper) -if(KPMcore_FOUND AND Qt5DBus_FOUND AND KF5CoreAddons_FOUND AND KF5Config_FOUND) +if(KPMcore_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 @@ -20,7 +20,7 @@ if(KPMcore_FOUND AND Qt5DBus_FOUND AND KF5CoreAddons_FOUND AND KF5Config_FOUND) SOURCES ResizeFSJob.cpp LINK_PRIVATE_LIBRARIES - kpmcore + calamares::kpmcore COMPILE_DEFINITIONS ${KPMcore_API_DEFINITIONS} SHARED_LIB ) diff --git a/src/modules/partition/CMakeLists.txt b/src/modules/partition/CMakeLists.txt index 6d07ec281..3b6269854 100644 --- a/src/modules/partition/CMakeLists.txt +++ b/src/modules/partition/CMakeLists.txt @@ -49,9 +49,7 @@ 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}) +if(KPMcore_FOUND) include_directories(${PROJECT_BINARY_DIR}/src/libcalamaresui) add_subdirectory(tests) @@ -118,7 +116,7 @@ if(KPMcore_FOUND AND Qt5DBus_FOUND AND KF5CoreAddons_FOUND AND KF5Config_FOUND) gui/ReplaceWidget.ui gui/VolumeGroupBaseDialog.ui LINK_PRIVATE_LIBRARIES - kpmcore + calamares::kpmcore KF5::CoreAddons COMPILE_DEFINITIONS ${_partition_defs} SHARED_LIB diff --git a/src/modules/partition/tests/CMakeLists.txt b/src/modules/partition/tests/CMakeLists.txt index 26a1d83f9..9c5dd3257 100644 --- a/src/modules/partition/tests/CMakeLists.txt +++ b/src/modules/partition/tests/CMakeLists.txt @@ -25,14 +25,14 @@ calamares_add_test( ${PartitionModule_SOURCE_DIR}/jobs/DeletePartitionJob.cpp ${PartitionModule_SOURCE_DIR}/jobs/PartitionJob.cpp ${PartitionModule_SOURCE_DIR}/jobs/ResizePartitionJob.cpp - LIBRARIES kpmcore + LIBRARIES calamares::kpmcore DEFINITIONS ${_partition_defs} ) calamares_add_test( partitionclearmountsjobtest SOURCES ${PartitionModule_SOURCE_DIR}/jobs/ClearMountsJob.cpp ClearMountsJobTests.cpp - LIBRARIES kpmcore + LIBRARIES calamares::kpmcore DEFINITIONS ${_partition_defs} ) @@ -45,7 +45,7 @@ calamares_add_test( ${PartitionModule_SOURCE_DIR}/core/PartitionLayout.cpp ${PartitionModule_SOURCE_DIR}/core/PartUtils.cpp ${PartitionModule_SOURCE_DIR}/core/DeviceModel.cpp - LIBRARIES kpmcore Calamares::calamaresui + LIBRARIES calamares::kpmcore Calamares::calamaresui DEFINITIONS ${_partition_defs} ) @@ -58,6 +58,6 @@ calamares_add_test( calamares_add_test( partitiondevicestest SOURCES DevicesTests.cpp ${PartitionModule_SOURCE_DIR}/core/DeviceList.cpp - LIBRARIES kpmcore + LIBRARIES calamares::kpmcore DEFINITIONS ${_partition_defs} )