Boost.Python: A minimal CMake Config
Although most of the examples and Boost’s documentation uses bjam
, you can also use CMake for your Boost.Python projects. A minimal CMakeLists.txt
to compile your Python library is provided below.
You may want to compile Boost as a static library such that you only have to ship one file. This can be achieved by providing cxxflags="-fPIC" link=static install
to b2
when compiling Boost from source. I personally always use Docker containers (one for each Python version with the correct header files) and use the following command to integrate the statically-linked boost library into the container:
Read other posts