diff options
author | Brad King <brad.king@kitware.com> | 2014-03-17 13:31:21 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-03-17 13:31:21 (GMT) |
commit | 6e466c6f2ee5160202aaa76a9d643d34bd7d908a (patch) | |
tree | 1117fe63347f333a4e20d1698cb791c6c3506e6a /Modules/FindPythonLibs.cmake | |
parent | c903b5319bfcf383964c625bb84d7bc958aba2e9 (diff) | |
parent | 6313be44aa465ea883e3578b3a0424ae0c217d5c (diff) | |
download | CMake-6e466c6f2ee5160202aaa76a9d643d34bd7d908a.zip CMake-6e466c6f2ee5160202aaa76a9d643d34bd7d908a.tar.gz CMake-6e466c6f2ee5160202aaa76a9d643d34bd7d908a.tar.bz2 |
Merge branch 'master' into CONFIG-LOCATION-CMP0026
Diffstat (limited to 'Modules/FindPythonLibs.cmake')
-rw-r--r-- | Modules/FindPythonLibs.cmake | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake index 1dbc967..cc875ad 100644 --- a/Modules/FindPythonLibs.cmake +++ b/Modules/FindPythonLibs.cmake @@ -31,6 +31,10 @@ # # PYTHON_LIBRARY - path to the python library # PYTHON_INCLUDE_DIR - path to where Python.h is found +# +# If also calling find_package(PythonInterp), call find_package(PythonInterp) +# first to get the currently active Python version by default with a consistent +# version of PYTHON_LIBRARIES. #============================================================================= # Copyright 2001-2009 Kitware, Inc. @@ -80,10 +84,14 @@ endif() # Set up the versions we know about, in the order we will search. Always add # the user supplied additional versions to the front. -set(_Python_VERSIONS - ${Python_ADDITIONAL_VERSIONS} - ${_PYTHON_FIND_OTHER_VERSIONS} - ) +# If FindPythonInterp has already found the major and minor version, +# insert that version between the user supplied versions and the stock +# version list. +set(_Python_VERSIONS ${Python_ADDITIONAL_VERSIONS}) +if(DEFINED PYTHON_VERSION_MAJOR AND DEFINED PYTHON_VERSION_MINOR) + list(APPEND _Python_VERSIONS ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}) +endif() +list(APPEND _Python_VERSIONS ${_PYTHON_FIND_OTHER_VERSIONS}) unset(_PYTHON_FIND_OTHER_VERSIONS) unset(_PYTHON1_VERSIONS) |