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 choose a specific Python to be used rather than allowing CMake to pick what it likes? #174

Open
barracuda156 opened this issue Jan 3, 2024 · 1 comment

Comments

@barracuda156
Copy link

The build picks Python at random, ignoring configure args like -DPYTHON_EXECUTABLE=, -DPYTHON3_EXECUTABLE= and whatever I tried so far.

This is rather a CMake bug, but maybe a configure option can be provided to select a specific Python rather than relying on a defunct CMake module?
See, for instance: https://gitlab.kitware.com/cmake/cmake/-/issues/23139

@barracuda156
Copy link
Author

barracuda156 commented Jan 3, 2024

Okay, this works:

if(USE_PYTHON)
  if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.18)
      find_package(Python3 3.11 REQUIRED EXACT COMPONENTS Development.Module)
      find_package(Python3 3.11 EXACT COMPONENTS Interpreter Development.Embed)
  else()
    find_package(Python3 3.11 REQUIRED EXACT COMPONENTS Interpreter Development)
  endif()

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

1 participant