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
12 changes: 11 additions & 1 deletion .github/workflows/cmake-linux-deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
release:
types: [ published ]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
Expand All @@ -18,6 +20,8 @@ jobs:
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-24.04
permissions:
contents: write

steps:
- name: Load repository cache
Expand All @@ -42,7 +46,7 @@ jobs:
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_WITH_UTILITY_APPLICATION=ON -DBUILD_WITH_BUNDLED_FREEGLUT=0 -DBUILD_WITH_BUNDLED_EIGEN=0 -DBUILD_WITH_BUNDLED_LIBLASZIP=0 -DBUILD_TESTING=ON -DCPACK_PACKAGE_FILE_NAME=hd_mapping-${{env.VERSION}}-amd64
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_WITH_UTILITY_APPLICATION=ON -DBUILD_WITH_BUNDLED_FREEGLUT=0 -DBUILD_WITH_BUNDLED_EIGEN=0 -DBUILD_WITH_BUNDLED_LIBLASZIP=0 -DBUILD_WITH_BUNDLED_ONETBB=0 -DBUILD_TESTING=ON -DCPACK_PACKAGE_FILE_NAME=hd_mapping-${{env.VERSION}}-amd64

- name: Build
# Build your program with the given configuration
Expand All @@ -59,3 +63,9 @@ jobs:
with:
name: hd_mapping-deb-${{env.VERSION}}
path: ${{github.workspace}}/build/*.deb

- name: Attach to GitHub release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v2
with:
files: ${{github.workspace}}/build/*.deb
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,17 @@ disable_target_warnings(Fusion)

# CPack configuration
set(CPACK_PACKAGE_NAME "hd_mapping")
set(CPACK_PACKAGE_VERSION "${HDMAPPING_VERSION_MAJOR}.${HDMAPPING_VERSION_MINOR}.${HDMAPPING_VERSION_PATCH}")
set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
# Package only the applications, not the headers, static libs and CMake configs
# that bundled third-party subprojects (eigen, glew, raylib, ...) install.
set(CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_BINARY_DIR};${PROJECT_NAME};${HDMAPPING_INSTALL_COMPONENT};/")

set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "HD Mapping debian package for Mandeye")
set(CPACK_PACKAGE_CONTACT "januszbedkowski@gmail.com")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Janusz Bedkowski <januszbedkowski@gmail.com>")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.28), libstdc++6 (>= 8.3.0), freeglut3-dev, libeigen3-dev, liblaszip-dev")
# Derive runtime dependencies (libglut, liblaszip, libtbb, libopencv-*, ...)
# from the packaged binaries instead of listing them by hand.
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
if(WIN32)
set(CPACK_GENERATOR "ZIP")
else()
Expand Down
9 changes: 6 additions & 3 deletions cmake/install_app.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ include_guard()
set(HDMAPPING_BINARY_PREFIX "hdmapping-" CACHE STRING
"Prefix applied to installed executable names")

# Install component holding the applications; CPack packages only this one.
set(HDMAPPING_INSTALL_COMPONENT "applications")

# hdmapping_install_app(<target>...)
#
# Installs each target into <prefix>/bin as "${HDMAPPING_BINARY_PREFIX}<name>",
Expand All @@ -18,7 +21,7 @@ set(HDMAPPING_BINARY_PREFIX "hdmapping-" CACHE STRING
# binary verbatim, so the installed executable keeps the build-tree RUNPATH
# (build/3rdparty/LASzip/lib) instead of having it stripped, and would resolve
# the bundled liblaszip.so from the build directory rather than the system
# liblaszip that CPACK_DEBIAN_PACKAGE_DEPENDS declares. So install(TARGETS)
# liblaszip the DEB depends on. So install(TARGETS)
# stays responsible for the copy (and its RPATH rewriting), and the file is
# renamed immediately afterwards by an install-time script.
#
Expand All @@ -32,7 +35,7 @@ function(hdmapping_install_app)
message(FATAL_ERROR "hdmapping_install_app: no such target '${target_name}'")
endif()

install(TARGETS ${target_name} RUNTIME DESTINATION bin)
install(TARGETS ${target_name} RUNTIME DESTINATION bin COMPONENT ${HDMAPPING_INSTALL_COMPONENT})

# Declared after the install(TARGETS) above and in the same directory,
# so it runs after it.
Expand All @@ -45,6 +48,6 @@ function(hdmapping_install_app)
file(RENAME \"\${_hdmapping_plain}\" \"\${_hdmapping_prefixed}\")
message(STATUS \"Installing: \${_hdmapping_prefixed}\")
endif()
")
" COMPONENT ${HDMAPPING_INSTALL_COMPONENT})
endforeach()
endfunction()
Loading