Skip to content

Commit

Permalink
Find python directly instead of using GzPython
Browse files Browse the repository at this point in the history
Part of gazebosim/gz-cmake#350.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
  • Loading branch information
scpeters committed Apr 19, 2024
1 parent 2f1e049 commit 7776344
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,14 @@ endif()
if (SKIP_PYBIND11)
message(STATUS "SKIP_PYBIND11 set - disabling python bindings")
else()
include(GzPython)
find_package(PythonLibs QUIET)
if (NOT PYTHONLIBS_FOUND)
GZ_BUILD_WARNING("Python is missing: Python interfaces are disabled.")
message (STATUS "Searching for Python - not found.")
find_package(Python3 REQUIRED
COMPONENTS Interpreter
OPTIONAL_COMPONENTS Development
)
if (NOT Python3_Development_FOUND)
GZ_BUILD_WARNING("Python development libraries are missing: Python interfaces are disabled.")
else()
message (STATUS "Searching for Python - found version ${PYTHONLIBS_VERSION_STRING}.")

set(PYBIND11_PYTHON_VERSION 3)
find_package(Python3 QUIET COMPONENTS Interpreter Development)
find_package(pybind11 2.2 QUIET)

if (${pybind11_FOUND})
Expand Down

0 comments on commit 7776344

Please sign in to comment.