diff options
author | Brad King <brad.king@kitware.com> | 2019-07-31 15:45:29 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-07-31 15:45:38 (GMT) |
commit | ac7ac46fce54ce263dc32cdd12775a12a95814b7 (patch) | |
tree | d4f8b28436e0b70be5b2c79413e5b3d153eee962 | |
parent | dad7868db812addec83c96c50df106d851d6257b (diff) | |
parent | 800c3ab2e0b5eed54221ac37c634938ca3d273ab (diff) | |
download | CMake-ac7ac46fce54ce263dc32cdd12775a12a95814b7.zip CMake-ac7ac46fce54ce263dc32cdd12775a12a95814b7.tar.gz CMake-ac7ac46fce54ce263dc32cdd12775a12a95814b7.tar.bz2 |
Merge topic 'FindPythonInterp-no-version-verify'
800c3ab2e0 FindPythonInterp: Document lack of version filtering for plain `python`
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Rolf Eike Beer <eike@sf-mail.de>
Merge-request: !3631
-rw-r--r-- | Modules/FindPythonInterp.cmake | 9 | ||||
-rw-r--r-- | Tests/CMakeOnly/CMakeLists.txt | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/Modules/FindPythonInterp.cmake b/Modules/FindPythonInterp.cmake index da33301..ccc7d5b 100644 --- a/Modules/FindPythonInterp.cmake +++ b/Modules/FindPythonInterp.cmake @@ -39,6 +39,15 @@ If calling both ``find_package(PythonInterp)`` and ``find_package(PythonLibs)``, call ``find_package(PythonInterp)`` first to get the currently active Python version by default with a consistent version of PYTHON_LIBRARIES. + +.. note:: + + A call to ``find_package(PythonInterp ${V})`` for python version ``V`` + may find a ``python`` executable with no version suffix. In this case + no attempt is made to avoid python executables from other versions. + Use :module:`FindPython3`, :module:`FindPython2` or :module:`FindPython` + instead. + #]=======================================================================] unset(_Python_NAMES) diff --git a/Tests/CMakeOnly/CMakeLists.txt b/Tests/CMakeOnly/CMakeLists.txt index 1aeab8b..19f3f79 100644 --- a/Tests/CMakeOnly/CMakeLists.txt +++ b/Tests/CMakeOnly/CMakeLists.txt @@ -84,5 +84,5 @@ function(add_major_test module) endfunction() add_major_test(PythonLibs VERSIONS 2 3 VERSION_VAR PYTHONLIBS_VERSION_STRING) -add_major_test(PythonInterp NOLANG VERSIONS 2 3 VERSION_VAR PYTHON_VERSION_STRING) +add_major_test(PythonInterp NOLANG VERSIONS 3 VERSION_VAR PYTHON_VERSION_STRING) add_major_test(Qt VERSIONS 3 4 VERSION_VAR QT_VERSION_STRING) |