Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add BUILD_LEGACY_PYBACKEND default OFF #12124

Merged
merged 1 commit into from
Aug 23, 2023
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 CMake/lrs_options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ option(BUILD_PCL_EXAMPLES "Build PCL examples" OFF)
option(BUILD_TOOLS "Build tools (fw-updater, etc.) that are not examples" ON)
option(ENFORCE_METADATA "Require WinSDK with Metadata support during compilation. Windows OS Only" OFF)
option(BUILD_PYTHON_BINDINGS "Build Python bindings" OFF)
option(BUILD_LEGACY_PYBACKEND "Build deprecated Python backend bindings" OFF)
option(BUILD_PYTHON_DOCS "Build Documentation for Python bindings" OFF)
option(BUILD_CSHARP_BINDINGS "Build C# bindings" OFF)
option(BUILD_MATLAB_BINDINGS "Build Matlab bindings" OFF)
Expand Down
19 changes: 11 additions & 8 deletions wrappers/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ if(${BACKEND} STREQUAL RS2_USE_LIBUVC_BACKEND)
)
endif()

if( BUILD_LEGACY_PYBACKEND )
pybind11_add_module(pybackend2 SHARED ${RAW_RS})

if(USE_EXTERNAL_USB)
Expand All @@ -147,6 +148,16 @@ if(APPLE)
endif()
endif()

install(TARGETS pybackend2 pyrealsense2
EXPORT pyrealsense2Targets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${PYTHON_INSTALL_DIR}
ARCHIVE DESTINATION ${PYTHON_INSTALL_DIR}
)

target_include_directories(pybackend2 PRIVATE ../../src)
endif() # BUILD_LEGACY_PYBACKEND

write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/pyrealsense2ConfigVersion.cmake"
VERSION ${REALSENSE_VERSION_STRING} COMPATIBILITY AnyNewerVersion)

Expand All @@ -156,13 +167,6 @@ configure_package_config_file(../../CMake/pyrealsense2Config.cmake.in pyrealsens
PATH_VARS CMAKE_INSTALL_INCLUDEDIR
)

install(TARGETS pybackend2 pyrealsense2
EXPORT pyrealsense2Targets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${PYTHON_INSTALL_DIR}
ARCHIVE DESTINATION ${PYTHON_INSTALL_DIR}
)

install(EXPORT pyrealsense2Targets
FILE pyrealsense2Targets.cmake
NAMESPACE pyrealsense2::
Expand All @@ -176,7 +180,6 @@ install(FILES "${CMAKE_BINARY_DIR}/wrappers/python/pyrealsense2ConfigVersion.cma
DESTINATION ${CMAKECONFIG_PY_INSTALL_DIR}
)

target_include_directories(pybackend2 PRIVATE ../../src)
target_include_directories(pyrealsense2 PRIVATE ../../src)

if (BUILD_PYTHON_DOCS)
Expand Down