mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-12 09:08:58 -05:00
Merge topic 'FindPythonLibs-names-per-dir'
192ab741FindPythonLibs: Allow find_library to search paths from system environment3976a106FindPythonLibs: Prefer libs early in search path regardless of name Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1378
This commit is contained in:
@@ -122,6 +122,7 @@ foreach(_CURRENT_VERSION ${_Python_VERSIONS})
|
||||
if(WIN32)
|
||||
find_library(PYTHON_DEBUG_LIBRARY
|
||||
NAMES python${_CURRENT_VERSION_NO_DOTS}_d python
|
||||
NAMES_PER_DIR
|
||||
HINTS ${_Python_LIBRARY_PATH_HINT}
|
||||
PATHS
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug
|
||||
@@ -145,20 +146,18 @@ foreach(_CURRENT_VERSION ${_Python_VERSIONS})
|
||||
python${_CURRENT_VERSION}m
|
||||
python${_CURRENT_VERSION}u
|
||||
python${_CURRENT_VERSION}
|
||||
NAMES_PER_DIR
|
||||
HINTS
|
||||
${_Python_LIBRARY_PATH_HINT}
|
||||
PATHS
|
||||
${PYTHON_FRAMEWORK_LIBRARIES}
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
|
||||
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
|
||||
# Avoid finding the .dll in the PATH. We want the .lib.
|
||||
NO_SYSTEM_ENVIRONMENT_PATH
|
||||
)
|
||||
# Look for the static library in the Python config directory
|
||||
find_library(PYTHON_LIBRARY
|
||||
NAMES python${_CURRENT_VERSION_NO_DOTS} python${_CURRENT_VERSION}
|
||||
# Avoid finding the .dll in the PATH. We want the .lib.
|
||||
NO_SYSTEM_ENVIRONMENT_PATH
|
||||
NAMES_PER_DIR
|
||||
# This is where the static library is usually located
|
||||
PATH_SUFFIXES python${_CURRENT_VERSION}/config
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user