[CMake] How to find Python 2.7 libraries if 3.x is installed too

Christopher Mullins christopher.mullins at kitware.com
Wed Nov 5 18:27:05 EST 2014


Consider doing what ITK does:

https://github.com/InsightSoftwareConsortium/ITK/blob/master/Wrapping/Generators/Python/CMakeLists.txt#L1-18

Also make sure you're using the latest CMake release.

On Wed, Nov 5, 2014 at 6:13 PM, René J.V. <rjvbertin at gmail.com> wrote:

> Hello,
>
> I am trying to get a not-so-old project to build (gizmod.sourceforge.net)
> which requires Python2.7 and libboost-python.
> I cannot seem to figure out how to do a find_package(PythonLibs REQUIRED)
> that will not consider that Python 3.4 is a suitable newer version of
> Python 2.7 . Is that even possible? The documentation in
> FindPythonLibs.cmake suggests that one can limit the search to specific
> versions, but that doesn't work.
> And using find_package(PythonLibs 2.7.5 EXACT REQUIRED) raises an error
> because it too finds v3.4 ...
>
> Thanks,
> R.B.
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>



-- 
Christopher Mullins
R&D Engineer
Kitware Inc.,
919.869.8871
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20141105/ddedd2f3/attachment.html>


More information about the CMake mailing list