Skip to content

Commit

Permalink
Unify Python3_Development_FOUND checks
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]>
  • Loading branch information
scpeters committed Feb 10, 2025
1 parent fb01bae commit 2072e77
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@ else()
COMPONENTS Interpreter
OPTIONAL_COMPONENTS Development
)
if (NOT Python3_Development_FOUND)
GZ_BUILD_WARNING("Python development libraries are missing: Python interfaces are disabled.")
endif()
endif()

# Location of "fake install folder" used in tests
Expand Down
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ add_subdirectory(graph)
# Bindings subdirectories
if (Python3_Development_FOUND AND NOT SKIP_PYBIND11)
add_subdirectory(python_pybind11)
else()
message(WARNING "Python development libraries are missing: Python interfaces are disabled.")
endif()

if (SWIG_FOUND AND NOT SKIP_SWIG)
Expand Down

0 comments on commit 2072e77

Please sign in to comment.