calamares/src/modules/CMakeLists.txt
Adriaan de Groot 88aa1755ce CMake: split out skip-module-checking to its own cmake module
The skip-checking is now in the functions for adding plugins and
subdirectories, so that third-party building should get it
as well, for free. Since AddModuleSubdirectory and AddPlugin
use the newly split-out module, handling SKIP_MODULES and USE_*
consistently across module repositories is now easier.

While here, make accumulating-the-skipped-modules explicit.
2021-03-23 01:47:10 +01:00

45 lines
1.7 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
#
# The variable SKIP_MODULES can be set to skip particular modules;
# individual modules can also decide they must be skipped (e.g. OS-specific
# modules, or ones with unmet dependencies). Collect the skipped modules
# in this list.
set( LIST_SKIPPED_MODULES "" )
include_directories(
${CMAKE_SOURCE_DIR}/src/libcalamares
${CMAKE_BINARY_DIR}/src/libcalamares
${CMAKE_SOURCE_DIR}/src/libcalamaresui
)
string( REPLACE " " ";" SKIP_LIST "${SKIP_MODULES}" )
file( GLOB SUBDIRECTORIES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*" )
list( SORT SUBDIRECTORIES )
foreach( SUBDIRECTORY ${SUBDIRECTORIES} )
calamares_add_module_subdirectory( ${SUBDIRECTORY} LIST_SKIPPED_MODULES )
endforeach()
# TODO:3.3: Use FindPython3
if ( BUILD_TESTING AND BUILD_SCHEMA_TESTING AND PYTHONINTERP_FOUND AND PYTHON_EXECUTABLE )
# The tests for each config file are independent of whether the
# module is enabled or not: the config file should match its schema
# regardless.
foreach( SUBDIRECTORY ${SUBDIRECTORIES} )
set( _schema_file "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}/${SUBDIRECTORY}.schema.yaml" )
set( _conf_file "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}/${SUBDIRECTORY}.conf" )
if ( EXISTS "${_schema_file}" AND EXISTS "${_conf_file}" )
add_test(
NAME validate-${SUBDIRECTORY}
COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_SOURCE_DIR}/ci/configvalidator.py" "${_schema_file}" "${_conf_file}"
)
endif()
endforeach()
endif()