Skip to content

Commit

Permalink
Unify Python3_Development_FOUND checks (#1541)
Browse files Browse the repository at this point in the history
The value of this variable may change if other code paths
call find_package(Python3), so move the warning to be
co-located with the add_subdirectory call.

Signed-off-by: Steve Peters <[email protected]>
(cherry picked from commit 25c4dc0)
  • Loading branch information
scpeters committed Feb 26, 2025
1 parent 5cd1440 commit 709e597
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,6 @@ if (BUILD_SDF)
COMPONENTS Interpreter
OPTIONAL_COMPONENTS Development
)
if (NOT Python3_Development_FOUND)
GZ_BUILD_WARNING("Python development libraries are missing: Python interfaces are disabled.")
endif()
endif()

#################################################
Expand Down Expand Up @@ -151,8 +148,12 @@ if (BUILD_SDF)
add_subdirectory(sdf)
add_subdirectory(conf)
add_subdirectory(doc)
if (Python3_Development_FOUND AND NOT SKIP_PYBIND11)
add_subdirectory(python)
if (NOT SKIP_PYBIND11)
if (Python3_Development_FOUND)
add_subdirectory(python)
else()
message(WARNING "Python development libraries are missing: Python interfaces are disabled.")
endif()
endif()
endif(BUILD_SDF)

Expand Down

0 comments on commit 709e597

Please sign in to comment.