-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2859 from MRtrix3/thirdparty
Improve handling of external dependencies
- Loading branch information
Showing
14 changed files
with
92 additions
and
30,060 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ jobs: | |
- name: install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install clang qt6-base-dev libglvnd-dev libeigen3-dev zlib1g-dev libfftw3-dev ninja-build python3-distutils python3-numpy | ||
sudo apt-get install clang qt6-base-dev libglvnd-dev zlib1g-dev libfftw3-dev ninja-build python3-distutils python3-numpy | ||
- name: Run sccache-cache | ||
uses: mozilla-actions/[email protected] | ||
|
@@ -86,7 +86,7 @@ jobs: | |
- name: install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install g++-9 qt6-base-dev libglvnd-dev libeigen3-dev zlib1g-dev libfftw3-dev ninja-build python3-numpy | ||
sudo apt-get install g++-9 qt6-base-dev libglvnd-dev zlib1g-dev libfftw3-dev ninja-build python3-numpy | ||
- name: Run sccache-cache | ||
uses: mozilla-actions/[email protected] | ||
|
@@ -208,7 +208,6 @@ jobs: | |
${{env.MINGW_PACKAGE_PREFIX}}-bc | ||
${{env.MINGW_PACKAGE_PREFIX}}-cmake | ||
${{env.MINGW_PACKAGE_PREFIX}}-diffutils | ||
${{env.MINGW_PACKAGE_PREFIX}}-eigen3 | ||
${{env.MINGW_PACKAGE_PREFIX}}-fftw | ||
${{env.MINGW_PACKAGE_PREFIX}}-gcc | ||
${{env.MINGW_PACKAGE_PREFIX}}-ninja | ||
|
@@ -282,5 +281,4 @@ jobs: | |
extensions: 'h,cpp' | ||
clangFormatVersion: 16 | ||
# Ignore third party headers | ||
exclude: './core/file/json.h ./core/file/nifti1.h ./core/file/nifti2.h' | ||
|
||
exclude: './thirdparty ./_deps' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ jobs: | |
- uses: ZedThree/[email protected] | ||
id: review | ||
with: | ||
apt_packages: g++,qt6-base-dev,libqt6opengl6-dev,libglvnd-dev,libeigen3-dev,zlib1g-dev,libfftw3-dev,ninja-build | ||
apt_packages: g++,qt6-base-dev,libqt6opengl6-dev,libglvnd-dev,zlib1g-dev,libfftw3-dev,ninja-build | ||
config_file: .clang-tidy | ||
|
||
- uses: ZedThree/clang-tidy-review/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
include(FetchContent) | ||
|
||
if(NOT ${MRTRIX_DEPENDENCIES_DIR} STREQUAL "") | ||
message(STATUS "Using local dependencies at ${MRTRIX_DEPENDENCIES_DIR}") | ||
set(MRTRIX_LOCAL_DEPENDENCIES ON) | ||
else() | ||
set(MRTRIX_LOCAL_DEPENDENCIES OFF) | ||
endif() | ||
|
||
# Eigen | ||
# We avoid configuring the Eigen library via FetchContent_MakeAvaiable | ||
# to avoid the verbosity of Eigen's CMake configuration output. | ||
if(MRTRIX_LOCAL_DEPENDENCIES) | ||
set(eigen_url ${MRTRIX_DEPENDENCIES_DIR}/eigen-3.4.0.tar.gz) | ||
else() | ||
set(eigen_url "https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz") | ||
endif() | ||
|
||
FetchContent_Declare( | ||
eigen3 | ||
DOWNLOAD_EXTRACT_TIMESTAMP ON | ||
URL ${eigen_url} | ||
) | ||
FetchContent_GetProperties(Eigen3) | ||
if(NOT eigen3_POPULATED) | ||
FetchContent_Populate(Eigen3) | ||
add_library(Eigen3 INTERFACE) | ||
add_library(Eigen3::Eigen ALIAS Eigen3) | ||
target_include_directories(Eigen3 INTERFACE "${eigen3_SOURCE_DIR}") | ||
endif() | ||
|
||
# Json for Modern C++ | ||
if(MRTRIX_LOCAL_DEPENDENCIES) | ||
set(json_url ${MRTRIX_DEPENDENCIES_DIR}/json.tar.xz) | ||
else() | ||
set(json_url "https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz") | ||
endif() | ||
FetchContent_Declare( | ||
json | ||
DOWNLOAD_EXTRACT_TIMESTAMP ON | ||
URL ${json_url} | ||
) | ||
FetchContent_MakeAvailable(json) | ||
|
||
|
||
# Half-precision floating-point library | ||
if(MRTRIX_LOCAL_DEPENDENCIES) | ||
set(half_url ${MRTRIX_DEPENDENCIES_DIR}/half-2.1.0.zip) | ||
else() | ||
set(half_url "https://sourceforge.net/projects/half/files/half/2.1.0/half-2.1.0.zip/download") | ||
endif() | ||
FetchContent_Declare( | ||
half | ||
DOWNLOAD_EXTRACT_TIMESTAMP ON | ||
URL ${half_url} | ||
) | ||
FetchContent_MakeAvailable(half) | ||
|
||
add_library(half INTERFACE) | ||
add_library(half::half ALIAS half) | ||
target_include_directories(half INTERFACE "${half_SOURCE_DIR}/include") | ||
|
||
|
||
# Nifti headers | ||
add_library(nifti INTERFACE) | ||
add_library(nifti::nifti ALIAS nifti) | ||
target_include_directories(nifti INTERFACE "${PROJECT_SOURCE_DIR}/thirdparty/nifti") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.