From 7c729c7f3d3766399f813193c5fcd001ed8603cf Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Wed, 11 Dec 2024 14:10:51 -0700 Subject: [PATCH] Let CMake make the build directory --- .github/workflows/test.yml | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 69154ba..2a5f230 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,8 +9,7 @@ jobs: build-on-unix: if: - github.event_name == 'push' || github.event.pull_request.head.repo.full_name != - github.repository + github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository runs-on: ${{ matrix.os }} @@ -35,21 +34,16 @@ jobs: create-args: >- make cmake + pkg-config fortran-compiler - - name: Make build directory - run: cmake -E make_directory build - - - name: Configure - working-directory: ${{ github.workspace }}/build - run: cmake .. -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_BUILD_TYPE=Release + - name: Configure project + run: cmake -B _build -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_BUILD_TYPE=Release - name: Build and install - working-directory: ${{ github.workspace }}/build - run: cmake --build . --target install --config Release + run: cmake --build _build --target install --config Release - name: Test - working-directory: ${{ github.workspace }}/build run: | test -h $CONDA_PREFIX/lib/libbmigiplf${{ env.SHLIB_EXT }} ctest @@ -57,8 +51,7 @@ jobs: build-on-windows: if: - github.event_name == 'push' || github.event.pull_request.head.repo.full_name != - github.repository + github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository runs-on: windows-latest @@ -81,14 +74,12 @@ jobs: - name: Make cmake build directory run: cmake -E make_directory build - - name: Configure, build, and install - working-directory: ${{ github.workspace }}/build + - name: Configure, build, and install project run: | - cmake .. -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX="${{ env.LIBRARY_PREFIX }}" -DCMAKE_BUILD_TYPE=Release - cmake --build . --target install --config Release + cmake -B _build -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX="${{ env.LIBRARY_PREFIX }}" -DCMAKE_BUILD_TYPE=Release + cmake --build _build --target install --config Release - name: Test - working-directory: ${{ github.workspace }}/build run: | if ( -not ( Test-Path -Path ${{ env.LIBRARY_PREFIX }}\lib\libbmigiplf.dll.a ) ){ exit 1 } if ( -not ( Test-Path -Path ${{ env.LIBRARY_PREFIX }}\bin\libbmigiplf.dll ) ){ exit 1 }