[CMake] CMake and manylinux Python Wheels

Seth G sethg at geographika.co.uk
Fri Aug 31 17:37:57 EDT 2018


Hi list,

I'm in the process of updating some SWIG Python bindings for the opensource project MapServer. This uses CMake for the 
build process, and my latest version of CMakeLists can be seen at: https://github.com/geographika/mapserver/blob/python-mapscript-build2/mapscript/python/CMakeLists.txt

I'm trying to automate the creation of Python Wheels for Linux, using the manylinux project (https://www.python.org/dev/peps/pep-0571/). In order to create Wheels that work on 
many different versions of Linux Python (libpython27.so) can't be linked to the Python extension - Python symbols need to be resolved at run-time. I'm not which compiler flags to add, or how to add them using CMake. From many searches I have found the following links are the closely related:

https://github.com/pybind/pybind11/issues/623
https://github.com/scikit-build/scikit-build/pull/47

However both projects are very complex so I'm unable to find exactly how they resolved it. Any hints on how to achieve this are appreciated. 
Please keep in mind both CMake and SWIG are fairly new to me. Any other suggestions/improvements to the CMakeLists file are very welcome. 

Regards,

Seth

--
web:http://geographika.co.uk
twitter: @geographika


More information about the CMake mailing list