Skip to content

Commit

Permalink
correct is_top_level
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed May 10, 2024
1 parent 938c7a8 commit 942cabd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/ci_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -30,6 +29,9 @@ jobs:
- os: macos-latest
shared: false

env:
FC: gfortran-13

runs-on: ${{ matrix.os}}

steps:
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 942cabd

Please sign in to comment.