Fix vcpkg find of python libraries

This commit is contained in:
Marek Roszko 2021-04-26 22:18:38 -04:00 committed by Seth Hillbrand
parent 04ab71c47c
commit 3c361aae59
1 changed files with 8 additions and 2 deletions

View File

@ -188,8 +188,14 @@ if(CMAKE_HOST_WIN32)
if(NOT EXISTS "${PYTHON_LIBRARY}")
get_filename_component(_PYTHON_ROOT ${PYTHON_INCLUDE_DIR} DIRECTORY)
set(PYTHON_LIBRARY "${_PYTHON_ROOT}/libs/python${PYTHON_LIBRARY_SUFFIX}.lib")
elseif(DEFINED VCPKG_TOOLCHAIN AND NOT EXISTS "${PYTHON_LIBRARY}")
set(PYTHON_LIBRARY "${PYTHON_PREFIX}/../../lib/python${PYTHON_LIBRARY_SUFFIX}.lib")
endif()
if(DEFINED VCPKG_TOOLCHAIN)
unset(PYTHON_LIBRARY)
find_library(
PYTHON_LIBRARY
NAMES "python${PYTHON_LIBRARY_SUFFIX}"
NO_SYSTEM_ENVIRONMENT_PATH)
endif()
# if we are in MSYS & MINGW, and we didn't find windows python lib, look for system python lib