1 diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake
\r
2 index bffa9fb..8fc90ee 100644
\r
3 --- a/Modules/FindPythonLibs.cmake
\r
4 +++ b/Modules/FindPythonLibs.cmake
\r
5 @@ -74,6 +74,19 @@ set(_Python_VERSIONS
\r
6 ${_PYTHON_FIND_OTHER_VERSIONS}
\r
9 +# Gentoo portage requries that you use exactly the given python version
\r
10 +if (CMAKE_BUILD_TYPE STREQUAL Gentoo)
\r
11 + execute_process(COMMAND python -c "import sys; sys.stdout.write('.'.join([str(x) for x in sys.version_info[:2]]))"
\r
12 + OUTPUT_VARIABLE _Gentoo_Python_VERSION)
\r
13 + list(FIND _Python_VERSIONS "${_Gentoo_Python_VERSION}" _Gentoo_Python_INDEX)
\r
14 + if (_Gentoo_Python_INDEX EQUAL -1)
\r
15 + # the current Gentoo python version is not compatible with what is requested
\r
16 + set(_Python_VERSIONS)
\r
18 + set(_Python_VERSIONS "${_Gentoo_Python_VERSION}")
\r
22 unset(_PYTHON_FIND_OTHER_VERSIONS)
\r
23 unset(_PYTHON1_VERSIONS)
\r
24 unset(_PYTHON2_VERSIONS)
\r