From 942cabd880a0bca7945ca16fc1a5412e8f9fc99e Mon Sep 17 00:00:00 2001 From: scivision Date: Thu, 9 May 2024 23:41:15 -0400 Subject: [PATCH] correct is_top_level --- .github/workflows/ci.yml | 5 +++-- .github/workflows/ci_build.yml | 5 +++-- options.cmake | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ea9835..25cfc99 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,8 @@ env: CTEST_NO_TESTS_ACTION: error CTEST_PARALLEL_LEVEL: 4 CMAKE_BUILD_PARALLEL_LEVEL: 4 + CMAKE_INSTALL_PREFIX: ~/libs + CMAKE_PREFIX_PATH: ~/libs on: push: @@ -70,7 +72,6 @@ jobs: - name: Configure run: >- cmake --preset multi - --install-prefix ${{ runner.temp }} -DBUILD_SHARED_LIBS:BOOL=${{ matrix.shared }} - name: Build / test Debug @@ -83,7 +84,7 @@ jobs: run: cmake --install build - name: example workflow - run: cmake -S example -B example/build -DCMAKE_PREFIX_PATH=${{ runner.temp }} + run: cmake -S example -B example/build - run: cmake --build example/build diff --git a/.github/workflows/ci_build.yml b/.github/workflows/ci_build.yml index d314c8a..14d1505 100644 --- a/.github/workflows/ci_build.yml +++ b/.github/workflows/ci_build.yml @@ -3,7 +3,6 @@ name: build env: HOMEBREW_NO_INSTALL_CLEANUP: 1 CTEST_NO_TESTS_ACTION: error - FC: gfortran-13 CTEST_PARALLEL_LEVEL: 0 CMAKE_BUILD_PARALLEL_LEVEL: 4 CMAKE_INSTALL_PREFIX: ~/libs @@ -30,6 +29,9 @@ jobs: - os: macos-latest shared: false + env: + FC: gfortran-13 + runs-on: ${{ matrix.os}} steps: @@ -39,7 +41,6 @@ jobs: run: >- cmake -S scripts -B scripts/build - --install-prefix ${{ runner.temp }} -DBUILD_SHARED_LIBS:BOOL=${{ matrix.shared }} - name: Build/install HDF5 diff --git a/options.cmake b/options.cmake index 642c4fd..2c641f3 100644 --- a/options.cmake +++ b/options.cmake @@ -5,7 +5,9 @@ include(GNUInstallDirs) # this is NECESSARY for CMake 3.21 -- parent projects will error on CMake configure! if(CMAKE_VERSION VERSION_LESS 3.21) get_property(not_top DIRECTORY PROPERTY PARENT_DIRECTORY) - if(NOT not_top) + if(not_top) + set(${PROJECT_NAME}_IS_TOP_LEVEL false) + else() set(${PROJECT_NAME}_IS_TOP_LEVEL true) endif() endif()