Use simplified FetchContent CI

Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
This commit is contained in:
Cristian Le 2023-05-10 10:24:48 +02:00 committed by Cristian Le
parent 37438f9b59
commit caceccf1d5
Failed to extract signature
2 changed files with 8 additions and 16 deletions

View File

@ -59,21 +59,7 @@ jobs:
run: |
update-alternatives --install /usr/bin/clang++ clang++ $(which clang++-${{ matrix.compiler_version }}) 999
if: matrix.compiler_version && matrix.toolchain == 'llvm'
- name: Clone nlohmann json version ${{ matrix.json_version }}
uses: actions/checkout@v3
with:
repository: nlohmann/json
path: nlohmann-json
ref: ${{ matrix.json_version }}
# TODO: Move to FetchContent managed
- name: Build and install nlohmann json
run: |
cd nlohmann-json
cmake -S . -B build
cmake --build build --target install -j$(nproc)
cd ..
- name: Clone json-schema-validator
uses: actions/checkout@v3
- uses: actions/checkout@v3
# container version is < 3.25 which does not have workflows
- name: Get latest cmake version
uses: lukka/get-cmake@latest

View File

@ -33,7 +33,13 @@ option(JSON_VALIDATOR_INSTALL "JsonValidator: Install targets" ${PROJECT_IS_TOP_
option(JSON_VALIDATOR_BUILD_TESTS "JsonValidator: Build tests" ${PROJECT_IS_TOP_LEVEL})
option(JSON_VALIDATOR_BUILD_EXAMPLES "JsonValidator: Build examples" ${PROJECT_IS_TOP_LEVEL})
option(JSON_VALIDATOR_SHARED_LIBS "JsonValidator: Build as shared library" ${PROJECT_IS_TOP_LEVEL})
set(JSON_FETCH_VERSION v3.11.2 CACHE STRING "Fetch nlohmann::json version")
# Get a default JSON_FETCH_VERSION from environment variables to workaround the CI
if (DEFINED ENV{NLOHMANN_JSON_VERSION})
set(JSON_FETCH_VERSION_DEFAULT $ENV{NLOHMANN_JSON_VERSION})
else ()
set(JSON_FETCH_VERSION_DEFAULT v3.11.2)
endif ()
set(JSON_FETCH_VERSION ${JSON_FETCH_VERSION_DEFAULT} CACHE STRING "Fetch nlohmann::json version")
#[==============================================================================================[
# Project configuration #