CMake: fix Python3-executable uses

This commit is contained in:
Adriaan de Groot 2022-04-27 16:57:18 +02:00
parent 7096ee760e
commit a9df841770
3 changed files with 5 additions and 6 deletions

View File

@ -364,7 +364,7 @@ if(Python_Interpreter_FOUND)
set(_validator_deps ${CALAMARES_CONFIGVALIDATOR_RESULT})
else()
exec_program(
Python::Interpreter
${Python_EXECUTABLE}
ARGS
"${CMAKE_SOURCE_DIR}/ci/configvalidator.py"
-x

View File

@ -25,8 +25,7 @@ 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)
if(BUILD_TESTING AND BUILD_SCHEMA_TESTING AND Python_Interpreter_FOUND)
# The tests for each config file are independent of whether the
# module is enabled or not: the config file should match its schema
# regardless.
@ -52,7 +51,7 @@ if(BUILD_TESTING AND BUILD_SCHEMA_TESTING AND PYTHONINTERP_FOUND AND PYTHON_EXEC
add_test(
NAME validate-${SUBDIRECTORY}-${_conf_base}
COMMAND
${PYTHON_EXECUTABLE} "${CMAKE_SOURCE_DIR}/ci/configvalidator.py" "${_schema_file}"
${Python_EXECUTABLE} "${CMAKE_SOURCE_DIR}/ci/configvalidator.py" "${_schema_file}"
"${_conf_file}"
)
endif()

View File

@ -27,7 +27,7 @@ add_test(
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
if(BUILD_TESTING AND BUILD_SCHEMA_TESTING AND PYTHONINTERP_FOUND AND PYTHON_EXECUTABLE)
if(BUILD_TESTING AND BUILD_SCHEMA_TESTING AND Python_Interpreter_FOUND)
set(_module packages)
set(_schema_file "${CMAKE_CURRENT_SOURCE_DIR}/${_module}/${_module}.schema.yaml")
message(STATUS "Schema ${_schema_file}")
@ -37,7 +37,7 @@ if(BUILD_TESTING AND BUILD_SCHEMA_TESTING AND PYTHONINTERP_FOUND AND PYTHON_EXEC
add_test(
NAME validate-packages-${_cf}
COMMAND
${PYTHON_EXECUTABLE} "${CMAKE_SOURCE_DIR}/ci/configvalidator.py" "${_schema_file}" "${_conf_file}"
${Python_EXECUTABLE} "${CMAKE_SOURCE_DIR}/ci/configvalidator.py" "${_schema_file}" "${_conf_file}"
)
else()
message(FATAL_ERROR "Missing ${_conf_file}")