Skip to content

Commit

Permalink
Lower minimum CMake version to 3.16
Browse files Browse the repository at this point in the history
  • Loading branch information
daljit46 committed Sep 29, 2023
1 parent 4e34a48 commit 25adfae
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 24 deletions.
91 changes: 69 additions & 22 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,31 @@ jobs:
- name: Run sccache-cache
uses: mozilla-actions/[email protected]


- name: Get CMake
uses: lukka/get-cmake@latest
with:
cmakeVersion: '3.16.3'

- name: Print CMake version
run: cmake --version

- name: configure
run: cmake --preset ci-release-checks -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ .
run: >
cmake
-B build
-D CMAKE_BUILD_TYPE=Release
-D MRTRIX_STL_DEBUGGING=ON
-D MRTRIX_WARNING_AS_ERRORS=ON
- name: build
run: cmake --build ../mrtrix3-build-ci-release-checks
run: cmake --build build

- name: unit tests
run: ctest -R unit --test-dir ../mrtrix3-build-ci-release-checks
run: ctest -R unit --test-dir build

- name: binary tests
run: ctest -R bin --test-dir ../mrtrix3-build-ci-release-checks
run: ctest -R bin --test-dir build

linux-gcc-build:

Expand All @@ -63,18 +76,31 @@ jobs:
- name: Run sccache-cache
uses: mozilla-actions/[email protected]


- name: Get CMake
uses: lukka/get-cmake@latest
with:
cmakeVersion: '3.16.3'

- name: Print CMake version
run: cmake --version

- name: configure
run: cmake --preset ci-release-checks
run: >
cmake
-B build
-D CMAKE_BUILD_TYPE=Release
-D MRTRIX_STL_DEBUGGING=ON
-D MRTRIX_WARNING_AS_ERRORS=ON
- name: build
run: cmake --build ../mrtrix3-build-ci-release-checks
run: cmake --build build

- name: unit tests
run: ctest -R unit --test-dir ../mrtrix3-build-ci-release-checks
run: ctest -R unit --test-dir build

- name: binary tests
run: ctest -R bin --test-dir ../mrtrix3-build-ci-release-checks
run: ctest -R bin --test-dir build

macos-build:

Expand All @@ -99,19 +125,34 @@ jobs:
- name: Run sccache-cache
uses: mozilla-actions/[email protected]

- name: Run sccache-cache
uses: mozilla-actions/[email protected]

- name: Get CMake
uses: lukka/get-cmake@latest
with:
cmakeVersion: '3.16.3'

- name: Print CMake version
run: cmake --version

- name: configure
run: |
export PATH=/usr/local/opt/qt5/bin:$PATH
cmake --preset ci-release-checks
run: >
export PATH=/usr/local/opt/qt5/bin:$PATH;
cmake
-B build
-D CMAKE_BUILD_TYPE=Release
-D MRTRIX_STL_DEBUGGING=ON
-D MRTRIX_WARNING_AS_ERRORS=ON
- name: build
run: cmake --build ../mrtrix3-build-ci-release-checks
run: cmake --build build

- name: unit tests
run: ctest -R unit --test-dir ../mrtrix3-build-ci-release-checks
run: ctest -R unit --test-dir build

- name: binary tests
run: ctest -R bin --test-dir ../mrtrix3-build-ci-release-checks
run: ctest -R bin --test-dir build

windows-build:

Expand Down Expand Up @@ -160,18 +201,24 @@ jobs:
run: |
export SCCACHE_UNIX_PATH=$(cygpath -u "$SCCACHE_PATH")
echo "SCCACHE_UNIX_PATH=$SCCACHE_UNIX_PATH" >> $GITHUB_ENV
- name: configure
run: cmake --preset ci-release-checks -DCMAKE_CXX_COMPILER_LAUNCHER=${{env.SCCACHE_UNIX_PATH}} .
run: >
cmake
-B build
-D CMAKE_BUILD_TYPE=Release
-D MRTRIX_STL_DEBUGGING=ON
-D MRTRIX_WARNING_AS_ERRORS=ON
-D CMAKE_CXX_COMPILER_LAUNCHER=${{env.SCCACHE_UNIX_PATH}} .
- name: build
run: cmake --build ../mrtrix3-build-ci-release-checks
run: cmake --build build

- name: unit tests
run: ctest -R unit --test-dir ../mrtrix3-build-ci-release-checks
run: ctest -R unit --test-dir build

- name: binary tests
run: ctest -R bin --test-dir ../mrtrix3-build-ci-release-checks
run: ctest -R bin --test-dir build

secondary-checks:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -199,4 +246,4 @@ jobs:
run: ./update_copyright && git diff --exit-code

- name: check building of documentation
run: python3 -m sphinx -n -N -W -w sphinx.log docs/ tmp/
run: python3 -m sphinx -n -N -W -w sphinx.log docs/ tmp/
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)

project(mrtrix3 VERSION 3.0.4)
include(GNUInstallDirs)
Expand All @@ -14,7 +14,6 @@ option(MRTRIX_STL_DEBUGGING "Enable STL debug mode" OFF)
option(MRTRIX_BUILD_TESTS "Build tests executables" OFF)

if(MRTRIX_BUILD_TESTS)
list(APPEND CMAKE_CTEST_ARGUMENTS "--output-on-failure")
enable_testing()
endif()

Expand All @@ -28,6 +27,14 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

if(CMAKE_VERSION VERSION_LESS 3.21)
get_property(not_top DIRECTORY PROPERTY PARENT_DIRECTORY)
if(NOT not_top)
set(PROJECT_IS_TOP_LEVEL true)
endif()
endif()

if(APPLE)
set(base @loader_path)
else()
Expand Down

0 comments on commit 25adfae

Please sign in to comment.