CMake: Replace deprecated module FindPythonInterp
This commit is contained in:
parent
b4f2980722
commit
d6380e7ae4
|
@ -375,6 +375,7 @@ set(LOG_RC_VERSION ${LOG_PROJECT_MAJOR_VERSION},${LOG_PROJECT_MINOR_VERSION},${P
|
|||
|
||||
message(STATUS "V: ${PROJECT_VERSION}, MaV: ${PROJECT_MAJOR_VERSION}, MiV: ${PROJECT_MINOR_VERSION}, PL: ${PROJECT_PATCH_VERSION}, EV: ${PROJECT_VERSION_EXTENSION}.")
|
||||
|
||||
find_package(Python3 3.6 REQUIRED)
|
||||
include(UseLemon)
|
||||
include(UseMakePluginReg)
|
||||
include(UseMakeTaps)
|
||||
|
@ -1163,11 +1164,6 @@ find_package(LEX REQUIRED)
|
|||
find_package(Perl)
|
||||
find_package(PCRE2 REQUIRED)
|
||||
|
||||
find_package(Python3 3.6 REQUIRED)
|
||||
# Several files (including LocatePythonModule) still use the old name
|
||||
# from FindPythonInterp, let's stick to it for now.
|
||||
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
|
||||
|
||||
if (NOT WIN32)
|
||||
find_package(Gettext)
|
||||
find_package(M REQUIRED)
|
||||
|
@ -1749,7 +1745,7 @@ if(VCSVERSION_OVERRIDE)
|
|||
else()
|
||||
add_custom_target(vcs_version
|
||||
BYPRODUCTS vcs_version.h
|
||||
COMMAND ${PYTHON_EXECUTABLE}
|
||||
COMMAND ${Python3_EXECUTABLE}
|
||||
${CMAKE_SOURCE_DIR}/tools/make-version.py
|
||||
${CMAKE_SOURCE_DIR}
|
||||
)
|
||||
|
@ -3715,7 +3711,7 @@ if(RPMBUILD_EXECUTABLE)
|
|||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND ${PYTHON_EXECUTABLE}
|
||||
COMMAND ${Python3_EXECUTABLE}
|
||||
${CMAKE_SOURCE_DIR}/tools/make-version.py
|
||||
${CMAKE_SOURCE_DIR}
|
||||
)
|
||||
|
@ -4106,7 +4102,7 @@ endif()
|
|||
|
||||
add_custom_target(test
|
||||
COMMAND ${CMAKE_COMMAND} -E env PYTHONIOENCODING=UTF-8
|
||||
${PYTHON_EXECUTABLE} -m pytest
|
||||
${Python3_EXECUTABLE} -m pytest
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
DEPENDS test-programs
|
||||
USES_TERMINAL
|
||||
|
@ -4125,7 +4121,7 @@ if (GIT_EXECUTABLE)
|
|||
# Update AUTHORS file with entries from git shortlog
|
||||
add_custom_target(
|
||||
gen-authors
|
||||
COMMAND ${PYTHON_EXECUTABLE} tools/generate_authors.py AUTHORS
|
||||
COMMAND ${Python3_EXECUTABLE} tools/generate_authors.py AUTHORS
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
)
|
||||
else (GIT_EXECUTABLE)
|
||||
|
|
|
@ -127,7 +127,7 @@ if(ASCIIDOCTOR_EXECUTABLE)
|
|||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT
|
||||
${_output_txt}
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/html2text.py
|
||||
COMMAND ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/html2text.py
|
||||
${_output_html}
|
||||
> ${_output_txt}
|
||||
DEPENDS
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
# After PATHS additional paths for python to search can be provided.
|
||||
# When REQUIRED is set, the function will abort the cmake execution is the module is not found
|
||||
function(LOCATE_PYTHON_MODULE module)
|
||||
if(NOT PYTHON_EXECUTABLE)
|
||||
find_package(PythonInterp)
|
||||
if(NOT Python3_EXECUTABLE)
|
||||
find_package(Python3)
|
||||
endif()
|
||||
|
||||
# Parse (additional) arguments
|
||||
|
@ -30,7 +30,7 @@ function(LOCATE_PYTHON_MODULE module)
|
|||
endif(LPM_PATHS)
|
||||
|
||||
# Use the (native) python impl module to find the location of the requested module
|
||||
execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c"
|
||||
execute_process(COMMAND "${Python3_EXECUTABLE}" "-c"
|
||||
"import imp; print(imp.find_module('${module}')[1])"
|
||||
RESULT_VARIABLE _${module}_status
|
||||
OUTPUT_VARIABLE _${module}_location
|
||||
|
|
|
@ -42,7 +42,7 @@ function(ASN2WRS)
|
|||
# Creates a dissector in the source directory and store the timestamp.
|
||||
add_custom_command(
|
||||
OUTPUT packet-${PROTOCOL_NAME}-stamp
|
||||
COMMAND "${PYTHON_EXECUTABLE}"
|
||||
COMMAND "${Python3_EXECUTABLE}"
|
||||
${PY_ASN2WRS}
|
||||
${A2W_FLAGS}
|
||||
${PROTO_OPT}
|
||||
|
@ -52,7 +52,7 @@ function(ASN2WRS)
|
|||
-O "${A2W_OUTPUT_DIR}"
|
||||
${EXT_ASN_FILE_LIST} ${ASN_FILE_LIST} ${EXT_ASN_FILE_LIST_LATE}
|
||||
COMMAND
|
||||
"${PYTHON_EXECUTABLE}" -c
|
||||
"${Python3_EXECUTABLE}" -c
|
||||
"import shutil, sys; x,s,d=sys.argv; open(d, 'w'); shutil.copystat(s, d)"
|
||||
"${A2W_OUTPUT_DIR}/packet-${PROTOCOL_NAME}.c"
|
||||
packet-${PROTOCOL_NAME}-stamp
|
||||
|
@ -71,7 +71,7 @@ function(ASN2WRS)
|
|||
foreach(_asn2wrs_export_file IN LISTS EXPORT_FILES)
|
||||
add_custom_command(
|
||||
OUTPUT ${_asn2wrs_export_file}
|
||||
COMMAND "${PYTHON_EXECUTABLE}"
|
||||
COMMAND "${Python3_EXECUTABLE}"
|
||||
"${PY_ASN2WRS}"
|
||||
-E
|
||||
${A2W_FLAGS}
|
||||
|
|
|
@ -7,7 +7,7 @@ function(register_plugin_files _outputfile _registertype)
|
|||
add_custom_command(
|
||||
OUTPUT
|
||||
${_outputfile}
|
||||
COMMAND ${PYTHON_EXECUTABLE}
|
||||
COMMAND ${Python3_EXECUTABLE}
|
||||
${PY_MAKE-PLUGIN-REG}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${_registertype}
|
||||
|
|
|
@ -5,7 +5,7 @@ MACRO(REGISTER_TAP_FILES _outputfile)
|
|||
OUTPUT
|
||||
${_outputfile}
|
||||
COMMAND
|
||||
${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/make-regs.py taps ${_outputfile} ${_sources}
|
||||
${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/make-regs.py taps ${_outputfile} ${_sources}
|
||||
DEPENDS
|
||||
${CMAKE_SOURCE_DIR}/tools/make-regs.py
|
||||
${_sources}
|
||||
|
|
|
@ -310,7 +310,7 @@ ADD_CUSTOM_COMMAND(
|
|||
OUTPUT
|
||||
wsluarm
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory wsluarm_src
|
||||
COMMAND ${PYTHON_EXECUTABLE}
|
||||
COMMAND ${Python3_EXECUTABLE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/make-wsluarm.py
|
||||
--output-directory wsluarm_src
|
||||
${WSLUA_MODULES}
|
||||
|
|
|
@ -29,7 +29,7 @@ endif()
|
|||
|
||||
add_custom_command(
|
||||
OUTPUT ps.c
|
||||
COMMAND ${PYTHON_EXECUTABLE}
|
||||
COMMAND ${Python3_EXECUTABLE}
|
||||
${CMAKE_SOURCE_DIR}/tools/rdps.py
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/print.ps
|
||||
ps.c
|
||||
|
|
|
@ -15,7 +15,7 @@ add_subdirectory(pidl EXCLUDE_FROM_ALL)
|
|||
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/packet-ncp2222.c
|
||||
COMMAND ${PYTHON_EXECUTABLE}
|
||||
COMMAND ${Python3_EXECUTABLE}
|
||||
${CMAKE_SOURCE_DIR}/tools/ncp2222.py
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/packet-ncp2222.c
|
||||
DEPENDS
|
||||
|
@ -2144,7 +2144,7 @@ file(GENERATE
|
|||
)
|
||||
add_custom_command(
|
||||
OUTPUT dissectors.c
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/make-regs.py dissectors dissectors.c @dissectors.in.txt
|
||||
COMMAND ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/make-regs.py dissectors dissectors.c @dissectors.in.txt
|
||||
DEPENDS ${CMAKE_SOURCE_DIR}/tools/make-regs.py ${ALL_DISSECTOR_SRC}
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/dissectors.in.txt"
|
||||
COMMENT "Making dissectors.c"
|
||||
|
|
|
@ -74,7 +74,7 @@ add_custom_command(
|
|||
# XXX taps.txt doesn't appear to be used anywhere.
|
||||
${CMAKE_BINARY_DIR}/epan/wslua/taps.txt
|
||||
COMMAND
|
||||
${PYTHON_EXECUTABLE}
|
||||
${Python3_EXECUTABLE}
|
||||
${CMAKE_SOURCE_DIR}/epan/wslua/make-taps.py
|
||||
${CMAKE_BINARY_DIR}/epan/wslua/taps_wslua.c
|
||||
${CMAKE_BINARY_DIR}/epan/wslua/taps.txt
|
||||
|
@ -91,7 +91,7 @@ add_custom_command(
|
|||
declare_wslua.h
|
||||
register_wslua.c
|
||||
COMMAND
|
||||
${PYTHON_EXECUTABLE}
|
||||
${Python3_EXECUTABLE}
|
||||
${CMAKE_SOURCE_DIR}/epan/wslua/make-reg.py
|
||||
${WSLUA_MODULES}
|
||||
DEPENDS
|
||||
|
|
|
@ -296,7 +296,7 @@ macro( ADD_NSIS_PACKAGE_TARGETS )
|
|||
)
|
||||
else()
|
||||
add_custom_command(OUTPUT ${_nsis_binary_dir}/wireshark-qt-manifest.nsh
|
||||
COMMAND ${PYTHON_EXECUTABLE} "${_nsis_source_dir}/windeployqt-to-nsis.py"
|
||||
COMMAND ${Python3_EXECUTABLE} "${_nsis_source_dir}/windeployqt-to-nsis.py"
|
||||
$<TARGET_FILE:wireshark>
|
||||
${_nsis_binary_dir}/wireshark-qt-manifest.nsh
|
||||
#$<$<CONFIG:Debug>:-DebugConfig>
|
||||
|
|
|
@ -669,7 +669,7 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/authors.qrc"
|
|||
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/authors.csv
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/make-authors-csv.py
|
||||
COMMAND ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/make-authors-csv.py
|
||||
< ${CMAKE_SOURCE_DIR}/AUTHORS
|
||||
> ${CMAKE_CURRENT_BINARY_DIR}/authors.csv
|
||||
DEPENDS
|
||||
|
|
|
@ -151,7 +151,7 @@ file(GENERATE
|
|||
)
|
||||
add_custom_command(
|
||||
OUTPUT wtap_modules.c
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/make-regs.py wtap_modules wtap_modules.c @wtap_modules.in.txt
|
||||
COMMAND ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/make-regs.py wtap_modules wtap_modules.c @wtap_modules.in.txt
|
||||
DEPENDS ${CMAKE_SOURCE_DIR}/tools/make-regs.py ${WIRETAP_MODULE_FILES}
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/wtap_modules.in.txt"
|
||||
COMMENT "Making wtap_modules.c"
|
||||
|
|
Loading…
Reference in New Issue