mirror of
https://github.com/OpenVPN/openvpn.git
synced 2026-06-11 01:40:05 -04:00
Ensure that Python3 is available
Use the more standard cmake find_package to search for Python3 and make it required. This also provides a better error message than "version.cmake" not found when python3 is missing. Change-Id: I350fd615ed8474d34392a057a5f8bded78173949 Signed-off-by: Arne Schwabe <arne-openvpn@rfc2549.org> Acked-by: Lev Stipakov <lstipakov@gmail.com> Message-Id: <20241227112255.11992-1-gert@greenie.muc.de> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg30232.html Signed-off-by: Gert Doering <gert@greenie.muc.de>
This commit is contained in:
parent
c815217ab6
commit
e4c68b23e2
1 changed files with 3 additions and 3 deletions
|
|
@ -107,9 +107,9 @@ else ()
|
|||
endif ()
|
||||
endif ()
|
||||
|
||||
find_program(PYTHON NAMES python3 python)
|
||||
find_package(Python3 REQUIRED COMPONENTS Interpreter)
|
||||
execute_process(
|
||||
COMMAND ${PYTHON} ${CMAKE_CURRENT_SOURCE_DIR}/contrib/cmake/parse-version.m4.py ${CMAKE_CURRENT_SOURCE_DIR}/version.m4
|
||||
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/contrib/cmake/parse-version.m4.py ${CMAKE_CURRENT_SOURCE_DIR}/version.m4
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
include(${CMAKE_CURRENT_BINARY_DIR}/version.cmake)
|
||||
|
|
@ -339,7 +339,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR} src/compat include)
|
|||
|
||||
add_custom_command(
|
||||
OUTPUT always_rebuild config-version.h
|
||||
COMMAND ${PYTHON} ${CMAKE_CURRENT_SOURCE_DIR}/contrib/cmake/git-version.py
|
||||
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/contrib/cmake/git-version.py
|
||||
)
|
||||
set(HAVE_CONFIG_VERSION_H YES)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue