Skip to content

Commit

Permalink
PR IntelRealSense#12124 from Eran: add BUILD_LEGACY_PYBACKEND default…
Browse files Browse the repository at this point in the history
… OFF
  • Loading branch information
maloel authored Aug 23, 2023
2 parents 7abd935 + 953bb06 commit 36a0745
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
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

0 comments on commit 36a0745

Please sign in to comment.