summaryrefslogtreecommitdiffstats
path: root/Modules/FindPython
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2018-07-21 09:53:03 (GMT)
committerBrad King <brad.king@kitware.com>2018-07-23 15:08:16 (GMT)
commit50921cc04e1ae761a188d4df0cc3025719ace11c (patch)
tree3c96b65d033a7e7bd3496555ae3f499cf38f3fd5 /Modules/FindPython
parentf84c15ef2fa30dd074fcccafccec6b9b69266619 (diff)
downloadCMake-50921cc04e1ae761a188d4df0cc3025719ace11c.zip
CMake-50921cc04e1ae761a188d4df0cc3025719ace11c.tar.gz
CMake-50921cc04e1ae761a188d4df0cc3025719ace11c.tar.bz2
FindPython*: fix erroneous behavior on multiple 'find_package' calls
Fixes: #18192
Diffstat (limited to 'Modules/FindPython')
-rw-r--r--Modules/FindPython/Support.cmake6
1 files changed, 1 insertions, 5 deletions
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake
index 08f07fd..fe3df91 100644
--- a/Modules/FindPython/Support.cmake
+++ b/Modules/FindPython/Support.cmake
@@ -196,10 +196,6 @@ endif()
set (CMAKE_FIND_FRAMEWORK LAST)
-unset (${_PYTHON_PREFIX}_VERSION_MAJOR)
-unset (${_PYTHON_PREFIX}_VERSION_MINOR)
-unset (${_PYTHON_PREFIX}_VERSION_PATCH)
-
unset (_${_PYTHON_PREFIX}_REQUIRED_VARS)
unset (_${_PYTHON_PREFIX}_CACHED_VARS)
@@ -259,7 +255,7 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
# try more generic names
if (NOT ${_PYTHON_PREFIX}_EXECUTABLE)
find_program (${_PYTHON_PREFIX}_EXECUTABLE
- NAMES python${${_PYTHON_PREFIX}_VERSION_MAJOR} python
+ NAMES python${_${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR} python
${_${_PYTHON_PREFIX}_IRON_PYTHON_NAMES}
HINTS ${_${_PYTHON_PREFIX}_HINTS}
PATH_SUFFIXES bin)