79189120

Date: 2024-11-14 14:19:16
Score: 1
Natty:
Report link

Building on the answer by @David Faure, I have the following simpler method:

find_package(Python3 REQUIRED COMPONENTS Interpreter Development.Module NumPy)

find_package(Boost 1.82 REQUIRE COMPONENTS 
             python${Python_VERSION_MAJOR}${Python_VERSION_MINOR} 
             # uses the versions found by find_package(Python3 ...) above,
             # without string parsing silliness

The CMake documentation for finding Python3 helped me know to use the variables Python_VERSION_MAJOR and Python_VERSION_MINOR.

Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @David
  • Low reputation (0.5):
Posted by: ofloveandhate