Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download NifTI headers from remote host #2979

Merged
merged 4 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ option(MRTRIX_PYTHON_SOFTLINK "Build directory softlink to Python source code ra
option(MRTRIX_BUILD_NON_CORE_STATIC "Build MRtrix's non-core code as a static library" OFF)

set(MRTRIX_DEPENDENCIES_DIR "" CACHE PATH
"An optional local directory containing thirdparty dependencies:\n \
- Eigen3 https://gitlab.com/libeigen/eigen\n \
- Json for Modern C++ https://github.com/nlohmann/json\n \
- Half https://half.sourceforge.net/\n"
"An optional local directory containing all thirdparty dependencies:\n \
- Eigen3 https://gitlab.com/libeigen/eigen (version 3.4.0 in .tar.gz format)\n \
- Json for Modern C++ https://github.com/nlohmann/json (version 3.11.3 in .tar.xz format)\n \
- Half https://half.sourceforge.net/ (version 2.1.0 in zip format)\n \
- NIfTI C headers https://nifti.nimh.nih.gov/pub/dist/src/nifti2/ (nifti1.h and nifti2.h stored in nifti/ subdirectory)\n"
)

if(MRTRIX_BUILD_TESTS)
Expand Down
25 changes: 24 additions & 1 deletion cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,27 @@ 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")

if(MRTRIX_LOCAL_DEPENDENCIES)
target_include_directories(nifti INTERFACE "${MRTRIX_DEPENDENCIES_DIR}/nifti")
else()
include(ExternalProject)
ExternalProject_Add(
nifti1
PREFIX nifti
URL "https://nifti.nimh.nih.gov/pub/dist/src/nifti2/nifti1.h"
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
DOWNLOAD_NO_EXTRACT ON
DOWNLOAD_NO_PROGRESS ON
)
ExternalProject_Add(
nifti2
PREFIX nifti
URL "https://nifti.nimh.nih.gov/pub/dist/src/nifti2/nifti2.h"
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
DOWNLOAD_NO_EXTRACT ON
DOWNLOAD_NO_PROGRESS ON
)
target_include_directories(nifti INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/nifti/src/")
endif()

Loading
Loading