cmake: fix python path with use multi-version python

This commit is contained in:
xz-dev 2024-10-23 20:00:38 +08:00 committed by mark9064
parent 8aefa3b9a6
commit a77a3dcb8b
2 changed files with 2 additions and 0 deletions

View File

@ -11,6 +11,7 @@ configure_file(${CMAKE_CURRENT_LIST_DIR}/jetbrains_mono_bold_20.c_M.patch
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12) if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12)
# FindPython3 module introduces with CMake 3.12 # FindPython3 module introduces with CMake 3.12
# https://cmake.org/cmake/help/latest/module/FindPython3.html # https://cmake.org/cmake/help/latest/module/FindPython3.html
set(Python3_FIND_STRATEGY LOCATION) # https://discourse.cmake.org/t/find-package-python3-is-not-finding-the-correct-python/10563
find_package(Python3 REQUIRED) find_package(Python3 REQUIRED)
else() else()
set(Python3_EXECUTABLE "python") set(Python3_EXECUTABLE "python")

View File

@ -10,6 +10,7 @@ message(STATUS "Using ${LV_IMG_CONV} to generate font files")
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12) if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12)
# FindPython3 module introduces with CMake 3.12 # FindPython3 module introduces with CMake 3.12
# https://cmake.org/cmake/help/latest/module/FindPython3.html # https://cmake.org/cmake/help/latest/module/FindPython3.html
set(Python3_FIND_STRATEGY LOCATION) # https://discourse.cmake.org/t/find-package-python3-is-not-finding-the-correct-python/10563
find_package(Python3 REQUIRED) find_package(Python3 REQUIRED)
else() else()
set(Python3_EXECUTABLE "python") set(Python3_EXECUTABLE "python")