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 28, 2023
1 parent 4e34a48 commit fec7bf0
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 5 deletions.
33 changes: 30 additions & 3 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,15 @@ 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++ .

Expand Down Expand Up @@ -63,7 +71,15 @@ 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

Expand Down Expand Up @@ -99,6 +115,17 @@ 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
Expand Down Expand Up @@ -160,7 +187,7 @@ 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}} .

Expand Down
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 fec7bf0

Please sign in to comment.