From 5793fbd6248921296c0b3166e0a427abf9e37211 Mon Sep 17 00:00:00 2001 From: juan-lunarg Date: Fri, 16 Jun 2023 12:31:04 -0600 Subject: [PATCH] cmake: Fix CMake 3.27 warnings The FindPythonInterp and FindPythonLibs modules, which have been deprecated since CMake 3.12, have been removed by policy CMP0148. Port projects to FindPython3, FindPython2, or FindPython. --- CMakeLists.txt | 2 +- StandAlone/CMakeLists.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d2eb3c51..6e868150 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -276,7 +276,7 @@ else() endif() if(BUILD_EXTERNAL AND IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/External) - find_host_package(PythonInterp 3 REQUIRED) + find_host_package(Python3 REQUIRED) # We depend on these for later projects, so they should come first. add_subdirectory(External) diff --git a/StandAlone/CMakeLists.txt b/StandAlone/CMakeLists.txt index ad831f7b..ee9004a7 100644 --- a/StandAlone/CMakeLists.txt +++ b/StandAlone/CMakeLists.txt @@ -31,7 +31,7 @@ # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. -find_host_package(PythonInterp 3 REQUIRED) +find_host_package(Python3 REQUIRED) set(GLSLANG_INTRINSIC_H "${GLSLANG_GENERATED_INCLUDEDIR}/glslang/glsl_intrinsic_header.h") set(GLSLANG_INTRINSIC_PY "${CMAKE_CURRENT_SOURCE_DIR}/../gen_extension_headers.py") @@ -39,7 +39,7 @@ set(GLSLANG_INTRINSIC_HEADER_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../glslang/Extensi add_custom_command( OUTPUT ${GLSLANG_INTRINSIC_H} - COMMAND ${PYTHON_EXECUTABLE} "${GLSLANG_INTRINSIC_PY}" + COMMAND Python3::Interpreter "${GLSLANG_INTRINSIC_PY}" "-i" ${GLSLANG_INTRINSIC_HEADER_DIR} "-o" ${GLSLANG_INTRINSIC_H} DEPENDS ${GLSLANG_INTRINSIC_PY}