summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2012-06-12 19:58:18 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2012-06-12 19:58:18 (GMT)
commitd6483cb542b91bb9297125cdaf9017fd8785ccd3 (patch)
tree25259a69e7aeffbac75be3d240c48b6c74023bd9 /Modules
parenta8fa345ea2361a6018a0dc62c3380397b1c2c5f9 (diff)
parent9d145b0998f21ae6d0571c5b6a7ab0168722df7c (diff)
downloadCMake-d6483cb542b91bb9297125cdaf9017fd8785ccd3.zip
CMake-d6483cb542b91bb9297125cdaf9017fd8785ccd3.tar.gz
CMake-d6483cb542b91bb9297125cdaf9017fd8785ccd3.tar.bz2
Merge topic 'FindPythonLibs-13216'
9d145b0 FindPythonLibs: honor EXACT version specification (#13216)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindPythonLibs.cmake10
1 files changed, 8 insertions, 2 deletions
diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake
index 478ebcb..11ff196 100644
--- a/Modules/FindPythonLibs.cmake
+++ b/Modules/FindPythonLibs.cmake
@@ -45,13 +45,19 @@ IF(PythonLibs_FIND_VERSION)
STRING(REGEX REPLACE "^([0-9]+\\.[0-9]+).*" "\\1" _PYTHON_FIND_MAJ_MIN "${PythonLibs_FIND_VERSION}")
STRING(REGEX REPLACE "^([0-9]+).*" "\\1" _PYTHON_FIND_MAJ "${_PYTHON_FIND_MAJ_MIN}")
UNSET(_PYTHON_FIND_OTHER_VERSIONS)
- IF(NOT PythonLibs_FIND_VERSION_EXACT)
+ IF(PythonLibs_FIND_VERSION_EXACT)
+ IF(_PYTHON_FIND_MAJ_MIN STREQUAL PythonLibs_FIND_VERSION)
+ SET(_PYTHON_FIND_OTHER_VERSIONS "${PythonLibs_FIND_VERSION}")
+ ELSE(_PYTHON_FIND_MAJ_MIN STREQUAL PythonLibs_FIND_VERSION)
+ SET(_PYTHON_FIND_OTHER_VERSIONS "${PythonLibs_FIND_VERSION}" "${_PYTHON_FIND_MAJ_MIN}")
+ ENDIF(_PYTHON_FIND_MAJ_MIN STREQUAL PythonLibs_FIND_VERSION)
+ ELSE(PythonLibs_FIND_VERSION_EXACT)
FOREACH(_PYTHON_V ${_PYTHON${_PYTHON_FIND_MAJ}_VERSIONS})
IF(NOT _PYTHON_V VERSION_LESS _PYTHON_FIND_MAJ_MIN)
LIST(APPEND _PYTHON_FIND_OTHER_VERSIONS ${_PYTHON_V})
ENDIF()
ENDFOREACH()
- ENDIF(NOT PythonLibs_FIND_VERSION_EXACT)
+ ENDIF(PythonLibs_FIND_VERSION_EXACT)
UNSET(_PYTHON_FIND_MAJ_MIN)
UNSET(_PYTHON_FIND_MAJ)
ELSE(PythonLibs_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")