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
|
|
|
|
2019-04-12 12:44:59 +02:00
|
|
|
if ( KPMcore_VERSION VERSION_GREATER "3.3.0")
|
|
|
|
list( APPEND _partition_defs WITH_KPMCORE331API) # kpmcore > 3.3.0 with deprecations
|
|
|
|
endif()
|
2019-04-12 11:18:29 +02:00
|
|
|
if ( KPMcore_VERSION VERSION_GREATER "3.90")
|
|
|
|
list( APPEND _partition_defs WITH_KPMCORE4API) # kpmcore 4 with new API
|
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
|
2018-09-25 12:39:14 +02:00
|
|
|
${PROJECT_SOURCE_DIR}/src/modules/partition/core/PartitionIterator.cpp
|
2018-09-14 13:56:18 +02:00
|
|
|
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
|
|
|
|
${YAMLCPP_LIBRARY}
|
|
|
|
)
|
|
|
|
if( TARGET fsresizertest )
|
2019-04-12 13:14:13 +02:00
|
|
|
target_compile_definitions( fsresizertest PRIVATE ${_partition_defs} )
|
2018-09-14 17:59:50 +02:00
|
|
|
endif()
|
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()
|