diff options
Diffstat (limited to 'Modules/FindPythonLibs.cmake')
-rw-r--r-- | Modules/FindPythonLibs.cmake | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake index 91cf49b..68e1228 100644 --- a/Modules/FindPythonLibs.cmake +++ b/Modules/FindPythonLibs.cmake @@ -53,16 +53,18 @@ set(_Python_LIBRARY_PATH_HINT) if(PYTHON_EXECUTABLE) if(WIN32) - get_filename_component(_PREFIX ${PYTHON_EXECUTABLE} PATH) - if(_PREFIX) - set(_Python_LIBRARY_PATH_HINT ${_PREFIX}/libs) + get_filename_component(_Python_PREFIX ${PYTHON_EXECUTABLE} PATH) + if(_Python_PREFIX) + set(_Python_LIBRARY_PATH_HINT ${_Python_PREFIX}/libs) endif() + unset(_Python_PREFIX) else() - get_filename_component(_PREFIX ${PYTHON_EXECUTABLE} PATH) - get_filename_component(_PREFIX ${_PREFIX} PATH) - if(_PREFIX) - set(_Python_LIBRARY_PATH_HINT ${_PREFIX}/lib) + get_filename_component(_Python_PREFIX ${PYTHON_EXECUTABLE} PATH) + get_filename_component(_Python_PREFIX ${_Python_PREFIX} PATH) + if(_Python_PREFIX) + set(_Python_LIBRARY_PATH_HINT ${_Python_PREFIX}/lib) endif() + unset(_Python_PREFIX) endif() endif() @@ -175,11 +177,12 @@ foreach(_CURRENT_VERSION ${_Python_VERSIONS}) # Use the library's install prefix as a hint set(_Python_INCLUDE_PATH_HINT) - get_filename_component(_PREFIX ${PYTHON_LIBRARY} PATH) - get_filename_component(_PREFIX ${_PREFIX} PATH) - if(_PREFIX) - set(_Python_INCLUDE_PATH_HINT ${_PREFIX}/include) + get_filename_component(_Python_PREFIX ${PYTHON_LIBRARY} PATH) + get_filename_component(_Python_PREFIX ${_Python_PREFIX} PATH) + if(_Python_PREFIX) + set(_Python_INCLUDE_PATH_HINT ${_Python_PREFIX}/include) endif() + unset(_Python_PREFIX) # Add framework directories to the search paths set(PYTHON_FRAMEWORK_INCLUDES) |