Skip to content

Commit

Permalink
Move find Python3 logic earlier to fix windows
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
  • Loading branch information
scpeters committed Jan 24, 2024
1 parent 3b3a670 commit 4747771
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,24 @@ endif()
#============================================================================
message(STATUS "\n\n-- ====== Finding Dependencies ======")

#--------------------------------------
# Python interfaces
if (SKIP_PYBIND11)
message(STATUS "SKIP_PYBIND11 set - disabling python bindings")
else()
set(PYBIND11_PYTHON_VERSION 3)
find_package(pybind11 2.4 QUIET)

if (${pybind11_FOUND})
message (STATUS "Searching for pybind11 - found version ${pybind11_VERSION}.")
find_package(Python3 REQUIRED COMPONENTS Development Interpreter)
else()
GZ_BUILD_WARNING("pybind11 is missing: Python interfaces are disabled.")
message (STATUS "Searching for pybind11 - not found.")
endif()
endif()


#--------------------------------------
# Find Protobuf
gz_find_package(GzProtobuf
Expand Down Expand Up @@ -131,24 +149,6 @@ gz_find_package(SQLite3
#============================================================================
# Configure the build
#============================================================================

########################################
# Python interfaces
if (SKIP_PYBIND11)
message(STATUS "SKIP_PYBIND11 set - disabling python bindings")
else()
set(PYBIND11_PYTHON_VERSION 3)
find_package(pybind11 2.4 QUIET)

if (${pybind11_FOUND})
message (STATUS "Searching for pybind11 - found version ${pybind11_VERSION}.")
find_package(Python3 REQUIRED COMPONENTS Development Interpreter)
else()
GZ_BUILD_WARNING("pybind11 is missing: Python interfaces are disabled.")
message (STATUS "Searching for pybind11 - not found.")
endif()
endif()

gz_configure_build(QUIT_IF_BUILD_ERRORS
COMPONENTS log parameters)

Expand Down

0 comments on commit 4747771

Please sign in to comment.