Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ VP_OPTION(INSTALL_ANDROID_EXAMPLES "" "" "Install Android examples" ""
# Build python bindings as an option
VP_OPTION(BUILD_PYTHON_BINDINGS "" "" "Build Python bindings" "" ON IF (PYTHON3INTERP_FOUND AND USE_PYBIND11 AND NOT CMAKE_NOT_OK_FOR_BINDINGS AND VISP_PYTHON_INTERPRETER_ALLOWED AND NOT PYTHON3_NOT_OK_FOR_BINDINGS AND NOT CXX_STANDARD_NOT_OK_FOR_BINDINGS) )
VP_OPTION(BUILD_PYTHON_BINDINGS_DOC "" "" "Build the documentation for the Python bindings" "" ON IF BUILD_PYTHON_BINDINGS )
VP_OPTION(GENERATE_PYTHON_STUBS "" "" "Generate Python stubs" "" ON IF BUILD_PYTHON_BINDINGS )


# Build demos as an option.
Expand Down
20 changes: 14 additions & 6 deletions modules/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,21 @@ set(VISP_PYTHON_BINDINGS_BUILD_PATH "${CMAKE_CURRENT_BINARY_DIR}/bindings")
add_subdirectory(bindings)

# Step 4: Copy stubs dir and install stubs for autocompletion
add_subdirectory(stubs)
if(GENERATE_PYTHON_STUBS)
add_subdirectory(stubs)
# Global target: compile and install the Python bindings
add_custom_target(
visp_python_bindings
DEPENDS visp_python_bindings_stubs
)
else()
add_custom_target(
visp_python_bindings
DEPENDS visp_python_bindings_install
)
endif()


# Global target: compile and install the Python bindings
add_custom_target(
visp_python_bindings
DEPENDS visp_python_bindings_stubs
)

# Step 5: Build documentation
if(BUILD_PYTHON_BINDINGS_DOC)
Expand Down
Loading