calamares/src/modules/fsresizer/CMakeLists.txt
Adriaan de Groot 1cd9b93a22 REUSE: Giant boilerplate cleanup
- point to main Calamares site in the 'part of' headers instead
  of to github (this is the "this file is part of Calamares"
  opening line for most files).
- remove boilerplate from all source files, CMake modules and completions,
  this is the 3-paragraph summary of the GPL-3.0-or-later, which has
  a meaning entirely covered by the SPDX tag.
2020-08-26 02:28:38 +02:00

54 lines
1.8 KiB
CMake

# === This file is part of Calamares - <https://calamares.io> ===
#
# SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org>
# SPDX-License-Identifier: BSD-2-Clause
#
find_package( KPMcore 3.3 )
find_package( KF5Config CONFIG )
find_package( KF5I18n CONFIG )
find_package( KF5WidgetsAddons CONFIG )
set( _partition_defs "" )
if ( KPMcore_FOUND AND Qt5DBus_FOUND AND KF5CoreAddons_FOUND AND KF5Config_FOUND )
include_directories( ${KPMCORE_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/src/modules/partition )
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" )
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 ${KPMcore_VERSION} are not supported" )
endif()
# 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.
calamares_add_plugin( fsresizer
TYPE job
EXPORT_MACRO PLUGINDLLEXPORT_PRO
SOURCES
ResizeFSJob.cpp
LINK_PRIVATE_LIBRARIES
kpmcore
calamares
COMPILE_DEFINITIONS ${_partition_defs}
SHARED_LIB
)
calamares_add_test(
fsresizertest
SOURCES
Tests.cpp
LIBRARIES
calamares_job_fsresizer # From above
yamlcpp
DEFINITIONS ${_partition_defs}
)
else()
if ( NOT KPMcore_FOUND )
calamares_skip_module( "fsresizer (missing suitable KPMcore)" )
else()
calamares_skip_module( "fsresizer (missing dependencies for KPMcore)" )
endif()
endif()