diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/nifticlib | |
Diffstat (limited to 'vcpkg/ports/nifticlib')
| -rw-r--r-- | vcpkg/ports/nifticlib/portfile.cmake | 54 | ||||
| -rw-r--r-- | vcpkg/ports/nifticlib/vcpkg.json | 40 | ||||
| -rw-r--r-- | vcpkg/ports/nifticlib/zlib_include.patch | 12 |
3 files changed, 106 insertions, 0 deletions
diff --git a/vcpkg/ports/nifticlib/portfile.cmake b/vcpkg/ports/nifticlib/portfile.cmake new file mode 100644 index 0000000..56e3795 --- /dev/null +++ b/vcpkg/ports/nifticlib/portfile.cmake @@ -0,0 +1,54 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO NIFTI-Imaging/nifti_clib + REF 5a8016be2161058f116b39ca476734bd81bb83c5 + SHA512 782cb4e494d73b054f8e3ab5f059b952fa461ceb3a0e12989ef1485675d1009d107c496abe6a495fbc30214d92859faad2c58a3edb10899114b440476b613315 + HEAD_REF master + PATCHES + zlib_include.patch +) + +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +endif() + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES + "cifti" USE_CIFTI_CODE + "fsl" USE_FSL_CODE + "nifti2" USE_NIFTI2_CODE + "nifticdf" USE_NIFTICDF_CODE + "tools" NIFTI_BUILD_APPLICATIONS + "tests" BUILD_TESTING +) +set(TOOL_NAMES) +if("tools" IN_LIST FEATURES) + list(APPEND TOOL_NAMES nifti1_tool) + if("nifti2" IN_LIST FEATURES) + list(APPEND TOOL_NAMES nifti_tool) + endif() + if("nifticdf" IN_LIST FEATURES) + list(APPEND TOOL_NAMES nifti_stats) + endif() + if("cifti" IN_LIST FEATURES AND "nifti2" IN_LIST FEATURES) + list(APPEND TOOL_NAMES cifti_tool afni_xml_tool) + endif() +endif() + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + ${FEATURE_OPTIONS} +) + +vcpkg_cmake_install() +vcpkg_copy_pdbs() +vcpkg_cmake_config_fixup(CONFIG_PATH share/cmake/NIFTI PACKAGE_NAME nifti) + +if(TOOL_NAMES) + vcpkg_copy_tools(TOOL_NAMES ${TOOL_NAMES} AUTO_CLEAN) +endif() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/vcpkg/ports/nifticlib/vcpkg.json b/vcpkg/ports/nifticlib/vcpkg.json new file mode 100644 index 0000000..2e90bf0 --- /dev/null +++ b/vcpkg/ports/nifticlib/vcpkg.json @@ -0,0 +1,40 @@ +{ + "name": "nifticlib", + "version-date": "2022-07-04", + "description": "Nifticlib is a C I/O library for reading and writing files in the nifti-1 data format.", + "homepage": "https://github.com/NIFTI-Imaging/nifti_clib", + "license": null, + "supports": "!uwp", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, + "zlib" + ], + "default-features": [ + "nifti2", + "nifticdf" + ], + "features": { + "cifti": { + "description": "Build cifti libraries" + }, + "fsl": { + "description": "Build fsl libraries" + }, + "nifti2": { + "description": "Build nifti2 libraries" + }, + "nifticdf": { + "description": "Build nifticdf libraries" + }, + "tools": { + "description": "Builds the core tool and the tools for 'nifti2' and 'nifticdf' if selected" + } + } +} diff --git a/vcpkg/ports/nifticlib/zlib_include.patch b/vcpkg/ports/nifticlib/zlib_include.patch new file mode 100644 index 0000000..1ef462b --- /dev/null +++ b/vcpkg/ports/nifticlib/zlib_include.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 54150d739..c3ca8fe50 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -77,6 +77,7 @@ set_if_not_defined(ZNZ_COMPILE_DEF "") + if(NOT NIFTI_ZLIB_LIBRARIES) # If using a custom zlib library, skip the find package + ### USE AS STAND ALONE PACKAGE + find_package(ZLIB REQUIRED) ++ include_directories(${ZLIB_INCLUDE_DIRS}) + set(NIFTI_ZLIB_LIBRARIES ${ZLIB_LIBRARIES}) + endif() + #message(STATUS "---------------------ZLIB -${NIFTI_ZLIB_LIBRARIES}--") |