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}) set(_validator_deps ${CALAMARES_CONFIGVALIDATOR_RESULT})
else() else()
exec_program( exec_program(
Python::Interpreter ${Python_EXECUTABLE}
ARGS ARGS
"${CMAKE_SOURCE_DIR}/ci/configvalidator.py" "${CMAKE_SOURCE_DIR}/ci/configvalidator.py"
-x -x

View File

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

View File

@ -27,7 +27,7 @@ add_test(
WORKING_DIRECTORY ${CMAKE_BINARY_DIR} 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(_module packages)
set(_schema_file "${CMAKE_CURRENT_SOURCE_DIR}/${_module}/${_module}.schema.yaml") set(_schema_file "${CMAKE_CURRENT_SOURCE_DIR}/${_module}/${_module}.schema.yaml")
message(STATUS "Schema ${_schema_file}") message(STATUS "Schema ${_schema_file}")
@ -37,7 +37,7 @@ if(BUILD_TESTING AND BUILD_SCHEMA_TESTING AND PYTHONINTERP_FOUND AND PYTHON_EXEC
add_test( add_test(
NAME validate-packages-${_cf} NAME validate-packages-${_cf}
COMMAND 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() else()
message(FATAL_ERROR "Missing ${_conf_file}") message(FATAL_ERROR "Missing ${_conf_file}")