[interactiveterminal] Make optional if requirements not met

This is orthogonal to the SKIP_* mechanism already documented
for avoiding modules. If the module is enabled, but its dependencies
are not present, don't bother building the module. This follows
e.g. plasmalnf as an "avoidably heavy dependency".

Related to a misplaced comment in ISSUE #956
This commit is contained in:
Adriaan de Groot 2018-05-26 07:06:46 -04:00
parent 41f70975ea
commit 50dea6ded3

View File

@ -1,18 +1,20 @@
find_package(ECM ${ECM_VERSION} REQUIRED NO_MODULE) find_package(ECM ${ECM_VERSION} REQUIRED NO_MODULE)
include(KDEInstallDirs) set( kf5_ver 5.41 )
include(GenerateExportHeader)
find_package( KF5 REQUIRED Service Parts ) find_package( KF5Service ${kf5_ver} )
find_package( KF5Parts ${kf5_ver} )
set_package_properties(
KF5Service PROPERTIES
PURPOSE "For finding KDE services at runtime"
)
set_package_properties(
KF5Parts PROPERTIES
PURPOSE "For finding KDE parts at runtime"
)
include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui if ( KF5Parts_FOUND AND KF5Service_FOUND )
${QTERMWIDGET_INCLUDE_DIR} ) calamares_add_plugin( interactiveterminal
set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules )
calamares_add_plugin( interactiveterminal
TYPE viewmodule TYPE viewmodule
EXPORT_MACRO PLUGINDLLEXPORT_PRO EXPORT_MACRO PLUGINDLLEXPORT_PRO
SOURCES SOURCES
@ -24,4 +26,7 @@ calamares_add_plugin( interactiveterminal
KF5::Service KF5::Service
KF5::Parts KF5::Parts
SHARED_LIB SHARED_LIB
) )
else()
calamares_skip_module( "interactiveterminal (missing requirements)" )
endif()