How to specify multiple Python versions to build Boost.Python
Is there an alternative to specifying and building multiple binaries for a Boost.Python project?
For example, boost-python310 and boost-python312 are not compatible. How to build both binaries using CMake?
B2 provides the following solution: https://www.boost.org/doc/libs/1_85_0/tools/build/doc/html/index.html#bbv2.reference.tools.libraries.python.
You should be able to set the Python_ROOT_DIR variable to point at the desired version.
You should be able to set the
Python_ROOT_DIRvariable to point at the desired version.
With the B2 tool, you can specify multiple versions of Python in a single build using the python=3.10,3.12 command line option. B2 will create both libraries.
I don't think this is possible with CMake. It doesn't support building the same target several times with different configurations like b2 does.
I don't think this is possible with CMake. It doesn't support building the same target several times with different configurations like b2 does.
Many projects do this with CMake using ExternalProject_Add.