diff options
author | David Gobbi <david.gobbi@gmail.com> | 2015-09-17 16:00:03 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-09-17 16:43:56 (GMT) |
commit | 19934b67e96c91f927a1887ce85a3e6b30b2f9a0 (patch) | |
tree | 102aca3bd542152f463ae4d3fbd2effc3206b022 /Modules | |
parent | f8bc4e1118d133a45974a56239cfe768785ca09f (diff) | |
download | CMake-19934b67e96c91f927a1887ce85a3e6b30b2f9a0.zip CMake-19934b67e96c91f927a1887ce85a3e6b30b2f9a0.tar.gz CMake-19934b67e96c91f927a1887ce85a3e6b30b2f9a0.tar.bz2 |
FindPythonLibs: unset temporary _PREFIX variable
To avoid pollution, unset variables that are only meant for local use.
Diffstat (limited to 'Modules')
-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) |