2020-08-25 16:05:56 +02:00
|
|
|
# === This file is part of Calamares - <https://calamares.io> ===
|
2020-08-26 00:24:52 +02:00
|
|
|
#
|
|
|
|
# SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org>
|
|
|
|
# SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
#
|
2018-09-14 13:56:18 +02:00
|
|
|
find_package( KPMcore 3.3 )
|
2019-08-08 13:32:20 +02:00
|
|
|
find_package( KF5Config CONFIG )
|
|
|
|
find_package( KF5I18n CONFIG )
|
|
|
|
find_package( KF5WidgetsAddons CONFIG )
|
2018-09-14 13:56:18 +02:00
|
|
|
|
2019-04-12 11:18:29 +02:00
|
|
|
set( _partition_defs "" )
|
|
|
|
|
2019-08-08 13:32:20 +02:00
|
|
|
if ( KPMcore_FOUND AND Qt5DBus_FOUND AND KF5CoreAddons_FOUND AND KF5Config_FOUND )
|
2019-05-07 13:45:04 +02:00
|
|
|
include_directories( ${KPMCORE_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/src/modules/partition )
|
2018-09-14 13:56:18 +02:00
|
|
|
|
2020-03-16 22:25:55 +01:00
|
|
|
if( KPMcore_VERSION VERSION_GREATER_EQUAL "4.2" )
|
|
|
|
list( APPEND _partition_defs WITH_KPMCORE42API WITH_KPMCORE4API ) # kpmcore 4.2 with new API
|
|
|
|
elseif( KPMcore_VERSION VERSION_GREATER_EQUAL "4.0" )
|
2019-06-13 11:45:20 +02:00
|
|
|
list( APPEND _partition_defs WITH_KPMCORE4API ) # kpmcore 4 with new API
|
|
|
|
elseif( KPMcore_VERSION VERSION_GREATER "3.3.70" )
|
2019-06-14 23:57:07 +02:00
|
|
|
message( FATAL_ERROR "KPMCore beta versions ${KPMcore_VERSION} are not supported" )
|
2019-03-20 18:16:54 +01:00
|
|
|
endif()
|
|
|
|
|
2018-09-25 12:39:14 +02:00
|
|
|
# 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.
|
2018-09-14 13:56:18 +02:00
|
|
|
calamares_add_plugin( fsresizer
|
|
|
|
TYPE job
|
|
|
|
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
|
|
|
SOURCES
|
|
|
|
ResizeFSJob.cpp
|
|
|
|
LINK_PRIVATE_LIBRARIES
|
2018-09-17 12:58:18 +02:00
|
|
|
kpmcore
|
2018-09-14 13:56:18 +02:00
|
|
|
calamares
|
2019-04-12 11:18:29 +02:00
|
|
|
COMPILE_DEFINITIONS ${_partition_defs}
|
2018-09-14 13:56:18 +02:00
|
|
|
SHARED_LIB
|
|
|
|
)
|
2018-09-25 12:39:14 +02:00
|
|
|
|
2020-02-17 14:36:52 +01:00
|
|
|
calamares_add_test(
|
|
|
|
fsresizertest
|
|
|
|
SOURCES
|
|
|
|
Tests.cpp
|
|
|
|
LIBRARIES
|
|
|
|
calamares_job_fsresizer # From above
|
2020-02-17 14:55:12 +01:00
|
|
|
yamlcpp
|
2020-02-19 22:26:55 +01:00
|
|
|
DEFINITIONS ${_partition_defs}
|
2020-02-17 14:36:52 +01:00
|
|
|
)
|
2018-09-14 13:56:18 +02:00
|
|
|
else()
|
2019-08-08 13:32:20 +02:00
|
|
|
if ( NOT KPMcore_FOUND )
|
|
|
|
calamares_skip_module( "fsresizer (missing suitable KPMcore)" )
|
|
|
|
else()
|
|
|
|
calamares_skip_module( "fsresizer (missing dependencies for KPMcore)" )
|
|
|
|
endif()
|
2018-09-14 13:56:18 +02:00
|
|
|
endif()
|