2018-09-14 13:56:18 +02:00
|
|
|
find_package( KPMcore 3.3 )
|
|
|
|
|
2019-04-12 11:18:29 +02:00
|
|
|
set( _partition_defs "" )
|
|
|
|
|
2018-09-17 12:58:18 +02:00
|
|
|
if ( KPMcore_FOUND )
|
2019-04-30 13:38:46 +02:00
|
|
|
find_package( Qt5 REQUIRED DBus ) # Needed for KPMCore
|
|
|
|
find_package( KF5 REQUIRED I18n WidgetsAddons ) # Needed for KPMCore
|
|
|
|
|
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-06-13 11:45:20 +02:00
|
|
|
if( KPMcore_VERSION VERSION_GREATER_EQUAL "4.0" )
|
|
|
|
list( APPEND _partition_defs WITH_KPMCORE4API ) # kpmcore 4 with new API
|
|
|
|
elseif( KPMcore_VERSION VERSION_GREATER "3.3.70" )
|
|
|
|
message( FATAL_ERROR "KPMCore beta versions 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
|
|
|
|
2018-10-05 15:19:25 +02:00
|
|
|
if( ECM_FOUND AND BUILD_TESTING )
|
2018-09-14 17:59:50 +02:00
|
|
|
ecm_add_test(
|
|
|
|
Tests.cpp
|
|
|
|
TEST_NAME
|
|
|
|
fsresizertest
|
|
|
|
LINK_LIBRARIES
|
|
|
|
${CALAMARES_LIBRARIES}
|
|
|
|
calamares
|
|
|
|
calamares_job_fsresizer # From above
|
|
|
|
${YAMLCPP_LIBRARY}
|
|
|
|
Qt5::Core
|
|
|
|
Qt5::Test
|
|
|
|
)
|
|
|
|
set_target_properties( fsresizertest PROPERTIES AUTOMOC TRUE )
|
2019-04-12 13:14:13 +02:00
|
|
|
target_include_directories( fsresizertest PRIVATE /usr/local/include )
|
|
|
|
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()
|
|
|
|
calamares_skip_module( "fsresizer (missing suitable KPMcore)" )
|
|
|
|
endif()
|