diff --git a/.github/workflows/cpp_package.yaml b/.github/workflows/cpp_package.yaml index c5d68887d52..95666b7131f 100644 --- a/.github/workflows/cpp_package.yaml +++ b/.github/workflows/cpp_package.yaml @@ -56,7 +56,7 @@ jobs: with: crate: cargo-about - name: Prepare licenses - run: bash -x ../../scripts/prepare_binary_package.sh ../.. + run: bash -x ../../scripts/prepare_binary_package.sh ${{ runner.workspace }}/cppbuild working-directory: api/cpp/ # Pin Python version until https://github.com/slint-ui/slint/issues/6615 is fixed. - uses: actions/setup-python@v5 @@ -109,7 +109,7 @@ jobs: with: crate: cargo-about - name: Prepare licenses - run: bash -x ../../scripts/prepare_binary_package.sh ../.. + run: bash -x ../../scripts/prepare_binary_package.sh ${{ runner.workspace }}/cppbuild working-directory: api/cpp/ - name: C++ Build uses: lukka/run-cmake@v3.4 @@ -165,7 +165,7 @@ jobs: with: crate: cargo-about - name: Prepare licenses - run: bash -x ../../scripts/prepare_binary_package.sh ../.. + run: bash -x ../../scripts/prepare_binary_package.sh ${{ runner.workspace }}/cppbuild working-directory: api/cpp/ - name: C++ Build uses: lukka/run-cmake@v3.4 @@ -205,6 +205,12 @@ jobs: container: ghcr.io/slint-ui/slint/${{ matrix.rust_target }}-cpp steps: - uses: actions/checkout@v4 + - uses: baptiste0928/cargo-install@v3 + with: + crate: cargo-about + - name: Prepare licenses + run: bash -x ../../scripts/prepare_binary_package.sh ../../build + working-directory: api/cpp/ - name: CMake configure run: cmake -B build -S . -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=${{ matrix.cmake_system_processor }} -DRust_CARGO_TARGET=${{ matrix.rust_target}} -DCMAKE_C_COMPILER=${{ matrix.gcc_target }}-gcc -DCMAKE_CXX_COMPILER=${{ matrix.gcc_target }}-g++ -DSLINT_COMPILER=download ${{ env.SLINT_BINARY_FEATURES }} ${{ inputs.extra_cmake_flags }} - name: CMake build diff --git a/api/cpp/CMakeLists.txt b/api/cpp/CMakeLists.txt index 1d0f814a92f..335d74bea50 100644 --- a/api/cpp/CMakeLists.txt +++ b/api/cpp/CMakeLists.txt @@ -464,6 +464,11 @@ set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_LIST_DIR}/README.md") set(CPACK_STRIP_FILES ON) set(CPACK_NSIS_DEFINES "ManifestDPIAware true") +# Include a third-party license attribution folder, if generated by the CI. +if(EXISTS "${CMAKE_BINARY_DIR}/licenses") + list(APPEND CPACK_INSTALLED_DIRECTORIES "${CMAKE_BINARY_DIR}/licenses" licenses) +endif() + if(WIN32) if(MSVC) set(compiler_suffix "-MSVC")