Skip to content
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
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,10 @@ repos:
entry: 'Utilities/Hooks/kw-commit-msg'
language: system
stages: [commit-msg]
exclude: "\\/ThirdParty\\/"
- id: kw-pre-commit
name: 'kw-pre-commit'
entry: 'Utilities/Hooks/kw-pre-commit'
language: system
stages: [pre-commit]
exclude: "\\/ThirdParty\\/"
27 changes: 26 additions & 1 deletion Modules/ThirdParty/NIFTI/src/nifti/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,28 @@ endif()
# current build behavior
option( BUILD_SHARED_LIBS "Toggle building shared libraries." OFF)

# Add options to mimic FSL features, Can manually specify -DFSLSTYLE:BOOL=ON for parity support with makefile
if(NOT FSLSTYLE)
# If FSL_STYLE is not defined, then
option( FSLSTYLE_NAME_CONFLICTS "FSL behavior for name conflicts (generate error if both img.nii and img.nii.gz exists)" OFF)
option( FSLSTYLE_PIGZ_SUPPORT "PIGZ: Use PIGZ parallel compression if environment includes AFNI_COMPRESSOR=PIGZ" OFF)
option( FSLSTYLE_REJECT_COMPLEX "REJECT_COMPLEX: Generate error if file is complex datatype." OFF)
else()
set(FSLSTYLE_NAME_CONFLICTS ON CACHE BOOL "FSL behavior for name conflicts (ambiguous files img.nii and img.nii.gz is an error)" FORCE)
set(FSLSTYLE_PIGZ_SUPPORT ON CACHE BOOL "PIGZ support" FORCE)
set(FSLSTYLE_REJECT_COMPLEX ON CACHE BOOL "Reject complex images." FORCE)
endif()

if(FSLSTYLE_NAME_CONFLICTS)
ADD_DEFINITIONS(-DFSLSTYLE)
endif()
if(FSLSTYLE_PIGZ_SUPPORT)
ADD_DEFINITIONS(-DPIGZ)
endif()
if(FSLSTYLE_REJECT_COMPLEX)
ADD_DEFINITIONS(-DREJECT_COMPLEX)
endif()

# Include executables as part of the build
option(NIFTI_BUILD_APPLICATIONS "Build various utility tools" ON)
mark_as_advanced(NIFTI_BUILD_APPLICATIONS)
Expand All @@ -79,6 +101,7 @@ set_if_not_defined(NIFTI_INSTALL_ARCHIVE_DIR ${NIFTI_INSTALL_LIBRARY_DIR})
set_if_not_defined(NIFTI_INSTALL_INCLUDE_DIR include/nifti)
set_if_not_defined(NIFTI_INSTALL_MAN_DIR share/man/man1)
set_if_not_defined(NIFTI_INSTALL_DOC_DIR share/doc/${PROJECT_NAME})
set_if_not_defined(NIFTI_INSTALL_MODULE_DIR share/cmake/${PACKAGE_NAME})
set_if_not_defined(NIFTI_ZLIB_LIBRARIES "")
set_if_not_defined(ZNZ_COMPILE_DEF "")
if(NOT NIFTI_ZLIB_LIBRARIES) # If using a custom zlib library, skip the find package
Expand Down Expand Up @@ -141,9 +164,11 @@ if (NIFTI_BUILD_TESTING )
include(FetchContent) # fetch data a configure time to simplify tests
# If new or changed data is needed, add that data to the https://github.com/NIFTI-Imaging/nifti-test-data repo
# make a new release, and then update the URL and hash (shasum -a 256 <downloaded tarball>).
cmake_policy(SET CMP0169 OLD)
FetchContent_Declare( fetch_testing_data
URL https://github.com/NIFTI-Imaging/nifti-test-data/archive/v3.0.2.tar.gz
URL_HASH SHA256=5dafec078151018da7aaf3c941bd31f246f590bc34fa3fef29ce77a773db16a6
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
)
FetchContent_GetProperties(fetch_testing_data)
if(NOT fetch_testing_data_POPULATED)
Expand Down Expand Up @@ -243,7 +268,7 @@ if(NIFTI_INSTALL_EXPORT_NAME STREQUAL "NIFTITargets")
# NIFTI libraries into an external project
include(CMakePackageConfigHelpers)
set(CONFIG_SETUP_DIR ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME})
set(ConfigPackageLocation share/cmake/${PACKAGE_NAME})
set(ConfigPackageLocation ${NIFTI_INSTALL_MODULE_DIR})

write_basic_package_version_file(
${CONFIG_SETUP_DIR}/${PACKAGE_NAME}ConfigVersion.cmake
Expand Down
2 changes: 1 addition & 1 deletion Modules/ThirdParty/NIFTI/src/nifti/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ and, to contribute changes and enhancements to niftilib. Please contact us if
you would like to contribute additional functionality to the i/o library.

The main webpage for this project is [hosted on github](https://nifti-imaging.github.io/).
This web site provde historical information. Additional information from the [NIFTI DFWG](http://nifti.nimh.nih.gov)
This web site provides historical information. Additional information from the [NIFTI DFWG](http://nifti.nimh.nih.gov)

The testing dashboard for monitoring the health of the libraries is at
[my.cdash.org](https://my.cdash.org/index.php?project=nifti_clib).
Expand Down
5 changes: 4 additions & 1 deletion Modules/ThirdParty/NIFTI/src/nifti/cmake/nifti_macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function(install_nifti_target target_name)
elseif(CMAKE_VER_AT_LEAST_3_13 AND NOT IS_PROJECT_DIR)
# CMake >=3.13 has support for referencing targets in parent scopes of the
# one in which the target is defined. This enables a central management of
# the installation process, along with installating an target export set.
# the installation process, along with installing an target export set.
# No installation occurs from the directory in which the target is defined
return()
endif()
Expand All @@ -133,6 +133,9 @@ function(install_nifti_target target_name)
PUBLIC_HEADER
DESTINATION ${NIFTI_INSTALL_INCLUDE_DIR}
COMPONENT Development
PRIVATE_HEADER
DESTINATION ${NIFTI_INSTALL_INCLUDE_DIR}
COMPONENT Development
INCLUDES
DESTINATION ${NIFTI_INSTALL_INCLUDE_DIR}
)
Expand Down
2 changes: 2 additions & 0 deletions Modules/ThirdParty/NIFTI/src/nifti/niftilib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ if(BUILD_SHARED_LIBS)
VERSION ${NIFTI_VERSION}
SOVERSION ${NIFTI_MAJOR_VERSION}
)
target_compile_definitions(${NIFTI_NIFTILIB_NAME} PRIVATE NIFTIIO_BUILD_SHARED)
target_compile_definitions(${NIFTI_NIFTILIB_NAME} INTERFACE NIFTIIO_USE_SHARED)
endif()
install_nifti_target(${NIFTI_NIFTILIB_NAME})

Expand Down
Loading