From beb713afb4d2fac7b43bb75ae2af21c897701c09 Mon Sep 17 00:00:00 2001 From: Berscheid <1885260+pantor@users.noreply.github.com> Date: Sun, 8 Dec 2024 10:28:19 +0100 Subject: [PATCH] Fix missing headers in Debian package (#203) * test build package * re-add pybind11 in ci * apt install with sudo * change example CMake dirs * fix missing header installation --- .github/workflows/ci.yml | 25 ++++++++++++++++++++++++- CMakeLists.txt | 5 ++++- examples/CMakeLists-directory.txt | 2 +- examples/CMakeLists-installed.txt | 2 +- 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f84706d..67b7fc0d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ name: CI on: [push, pull_request] jobs: - build: + build-and-test: runs-on: ${{ matrix.os }} strategy: @@ -63,6 +63,29 @@ jobs: ctest --test-dir ./build -T memcheck + build-package: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Configure and make + run: | + cmake -B build + cmake --build build -j2 -- package + + - name: Install package + working-directory: build + run: sudo apt-get install ./ruckig-*.deb + + - name: Test building examples + working-directory: examples + run: | + mv CMakeLists-installed.txt CMakeLists.txt + cmake -B build + cmake --build build -j2 + + lint-python: runs-on: ubuntu-latest diff --git a/CMakeLists.txt b/CMakeLists.txt index b45fa9ee..25a90f6f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,7 +48,7 @@ if(BUILD_CLOUD_CLIENT) target_sources(ruckig PRIVATE src/ruckig/cloud_client.cpp) target_include_directories(ruckig PUBLIC $ - $ + $ ) target_compile_definitions(ruckig PUBLIC WITH_CLOUD_CLIENT) endif() @@ -135,6 +135,9 @@ include(CMakePackageConfigHelpers) # Install headers install(DIRECTORY include/ruckig DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +if(BUILD_CLOUD_CLIENT) + install(DIRECTORY third_party/httplib third_party/nlohmann DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ruckig/third_party) +endif() # Install library install(TARGETS ruckig diff --git a/examples/CMakeLists-directory.txt b/examples/CMakeLists-directory.txt index 9f6e39ab..11138b58 100644 --- a/examples/CMakeLists-directory.txt +++ b/examples/CMakeLists-directory.txt @@ -8,7 +8,7 @@ include_directories(include) link_directories(lib) # Build the position example -add_executable(example-position examples/01_position.cpp) +add_executable(example-position 01_position.cpp) target_compile_features(example-position PUBLIC cxx_std_17) target_link_libraries(example-position ruckig) \ No newline at end of file diff --git a/examples/CMakeLists-installed.txt b/examples/CMakeLists-installed.txt index 438aca24..3719a9df 100644 --- a/examples/CMakeLists-installed.txt +++ b/examples/CMakeLists-installed.txt @@ -7,7 +7,7 @@ project(ruckig_examples) find_package(ruckig REQUIRED) # Build the position example -add_executable(example-position examples/01_position.cpp) +add_executable(example-position 01_position.cpp) target_compile_features(example-position PUBLIC cxx_std_17) target_link_libraries(example-position PRIVATE ruckig::ruckig) \ No newline at end of file