Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to specify multiple Python versions to build Boost.Python #69

Open
yurybura opened this issue Jul 15, 2024 · 4 comments
Open

How to specify multiple Python versions to build Boost.Python #69

yurybura opened this issue Jul 15, 2024 · 4 comments

Comments

@yurybura
Copy link

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.

@pdimov
Copy link
Member

pdimov commented Jul 15, 2024

You should be able to set the Python_ROOT_DIR variable to point at the desired version.

@yurybura
Copy link
Author

yurybura commented Jul 15, 2024

You should be able to set the Python_ROOT_DIR variable 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.

@pdimov
Copy link
Member

pdimov commented Jul 15, 2024

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.

@yurybura
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants