Skip to content

Commit 25c4dc0

Browse files
authored
Unify Python3_Development_FOUND checks (#1541)
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]>
1 parent 5e4e591 commit 25c4dc0

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

CMakeLists.txt

+6-5
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,6 @@ if (BUILD_SDF)
9595
COMPONENTS Interpreter
9696
OPTIONAL_COMPONENTS Development
9797
)
98-
if (NOT Python3_Development_FOUND)
99-
GZ_BUILD_WARNING("Python development libraries are missing: Python interfaces are disabled.")
100-
endif()
10198
endif()
10299

103100
#################################################
@@ -151,8 +148,12 @@ if (BUILD_SDF)
151148
add_subdirectory(sdf)
152149
add_subdirectory(conf)
153150
add_subdirectory(doc)
154-
if (Python3_Development_FOUND AND NOT SKIP_PYBIND11)
155-
add_subdirectory(python)
151+
if (NOT SKIP_PYBIND11)
152+
if (Python3_Development_FOUND)
153+
add_subdirectory(python)
154+
else()
155+
message(WARNING "Python development libraries are missing: Python interfaces are disabled.")
156+
endif()
156157
endif()
157158
endif(BUILD_SDF)
158159

0 commit comments

Comments
 (0)