diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da058ae..3dba1fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -281,6 +281,7 @@ jobs: -DTRX_BUILD_TESTS=ON \ -DTRX_BUILD_EXAMPLES=ON \ -DTRX_ENABLE_NIFTI=ON \ + -DCMAKE_INSTALL_PREFIX="${GITHUB_WORKSPACE}/install" \ -DCMAKE_BUILD_TYPE=Release \ ${{ runner.os == 'Windows' && format('-DCMAKE_TOOLCHAIN_FILE={0}/vcpkg/scripts/buildsystems/vcpkg.cmake', github.workspace) || '' }} @@ -311,10 +312,15 @@ jobs: } EOF + prefix_path="${GITHUB_WORKSPACE}/install" + if [[ "$RUNNER_OS" == "macOS" ]]; then + prefix_path="$(brew --prefix);${prefix_path}" + fi cmake -S "$consumer" -B "$consumer/build" \ -G Ninja \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_PREFIX_PATH="${GITHUB_WORKSPACE}/build" + -DCMAKE_PREFIX_PATH="$prefix_path" \ + ${{ runner.os == 'Windows' && format('-DCMAKE_TOOLCHAIN_FILE={0}/vcpkg/scripts/buildsystems/vcpkg.cmake', github.workspace) || '' }} - name: Build downstream consumer run: cmake --build ci-consumer/build --config Release \ No newline at end of file diff --git a/cmake/trx-cppConfig.cmake.in b/cmake/trx-cppConfig.cmake.in index 85e15bb..f8074e7 100644 --- a/cmake/trx-cppConfig.cmake.in +++ b/cmake/trx-cppConfig.cmake.in @@ -2,8 +2,9 @@ include(CMakeFindDependencyMacro) find_dependency(Eigen3) +find_dependency(libzip CONFIG) # mio and json11 are header-only and vendored; no package required -# libzip is a PRIVATE dependency — consumers do not need it +# libzip is a transitive dependency of the static library include("${CMAKE_CURRENT_LIST_DIR}/trx-cppTargets.cmake")