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_DEBIAN_PACKAGE option for Debian package support #6982

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
6 changes: 6 additions & 0 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ jobs:
name: open3d-devel-linux-x86_64-ML_${{ matrix.MLOPS }}
path: open3d-devel-*.tar.xz
if-no-files-found: error
- name: Upload Debian package to GitHub artifacts (if exist)
uses: actions/upload-artifact@v4
with:
name: open3d-debian
path: open3d-devel*.deb
if-no-files-found: ignore
- name: Upload viewer to GitHub artifacts
if: ${{ env.BUILD_SHARED_LIBS == 'OFF' }}
uses: actions/upload-artifact@v4
Expand Down
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,18 @@ if (NOT DEVELOPER_BUILD)
endif()
endif()

option(BUILD_DEBIAN_PACKAGE "Build debian package" ON)
# will work with cmake 3.22 and newer
# https://cmake.org/cmake/help/latest/command/cmake_host_system_information.html
if (BUILD_DEBIAN_PACKAGE)
cmake_host_system_information(RESULT ID_LIKE QUERY DISTRIB_ID_LIKE)
message(STATUS "Current Distrib ID_LIKE=${ID_LIKE}")
if(NOT ID_LIKE OR NOT ID_LIKE STREQUAL "debian")
message(WARNING "ID_LIKE is either blank or not 'debian'. Skipping debian package building.")
set(BUILD_DEBIAN_PACKAGE OFF)
endif()
endif()

# Default build type on single-config generators.
# For multi-config generators (e.g. Visual Studio), CMAKE_CONFIGURATION_TYPES
# will be set, and we don't specify a default CMAKE_BUILD_TYPE.
Expand Down
4 changes: 4 additions & 0 deletions cmake/Open3DPackaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,8 @@ set(CPACK_PACKAGE_FILE_NAME
"open3d-devel-${_sys}-${OPEN3D_VERSION_FULL}")
set(CPACK_THREADS 0) # Use all cores for compressing package

if (BUILD_DEBIAN_PACKAGE)
list(APPEND CPACK_GENERATOR DEB)
endif()

include(CPack)
1 change: 1 addition & 0 deletions cmake/Open3DPrintConfigurationSummary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ function(open3d_print_configuration_summary)
else()
open3d_aligned_print("Force GLIBCXX_USE_CXX11_ABI=" "0")
endif()
open3d_aligned_print("Build debian package" "${BUILD_DEBIAN_PACKAGE}")

message(STATUS "================================================================================")
message(STATUS "Third-Party Dependencies:")
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ RUN ccache -s \
&& CCACHE_DIR_PARENT=$(dirname ${CCACHE_DIR}) \
&& cd ${CCACHE_DIR_PARENT} \
&& tar -czf /${CCACHE_TAR_NAME}.tar.gz ${CCACHE_DIR_NAME} \
&& if [ "${PACKAGE}" = "ON" ]; then mv /root/Open3D/build/package/open3d-devel*.tar.xz /; fi \
&& if [ "${PACKAGE}" = "ON" ]; then mv /root/Open3D/build/package/open3d-devel* /; fi \
&& if [ "${PACKAGE}" = "VIEWER" ]; then mv /root/Open3D/build/package-Open3DViewer-deb/open3d-viewer-*-Linux.deb /; fi \
&& ls -alh /

Expand Down