aboutsummaryrefslogtreecommitdiff
path: root/ports/ismrmrd/optional_hdf5_dependency.patch
diff options
context:
space:
mode:
authorPhil Christensen <philc@microsoft.com>2019-03-20 23:39:56 -0700
committerGitHub <noreply@github.com>2019-03-20 23:39:56 -0700
commit10014faad72347b9a321eb28e519b8a5e737d680 (patch)
tree0a3257e26290dfec1320345eb2533b405e5b2a29 /ports/ismrmrd/optional_hdf5_dependency.patch
parent64fc3202f557cdba7befd561d8ddb1bd83609606 (diff)
downloadvcpkg-10014faad72347b9a321eb28e519b8a5e737d680.tar.gz
vcpkg-10014faad72347b9a321eb28e519b8a5e737d680.zip
[ismrmrd] make optional hdf5 dependency explicit (#5757)
* [ismrmrd] make optional hdf5 dependency explicit This port will behave differently in the CI build depending on if hdf5 was installed before it. Make the hdf5 dependency explicit so it will behave consistently.
Diffstat (limited to 'ports/ismrmrd/optional_hdf5_dependency.patch')
-rw-r--r--ports/ismrmrd/optional_hdf5_dependency.patch77
1 files changed, 77 insertions, 0 deletions
diff --git a/ports/ismrmrd/optional_hdf5_dependency.patch b/ports/ismrmrd/optional_hdf5_dependency.patch
new file mode 100644
index 000000000..7c4772ed5
--- /dev/null
+++ b/ports/ismrmrd/optional_hdf5_dependency.patch
@@ -0,0 +1,77 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 456d4f4..3c235f2 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -7,6 +7,7 @@ set (ISMRMRD_CMAKE_DIR ${PROJECT_SOURCE_DIR}/cmake CACHE PATH
+
+ # command line options
+ option(USE_SYSTEM_PUGIXML "Use pugixml installed on the system" OFF)
++option(USE_HDF5_DATASET_SUPPORT "Use HDF5 library for dataset support" OFF)
+
+ # and include it to the search list
+ list(APPEND CMAKE_MODULE_PATH ${ISMRMRD_CMAKE_DIR})
+@@ -91,18 +92,23 @@ endif()
+ set(ISMRMRD_VERSION_STRING ${ISMRMRD_VERSION_MAJOR}.${ISMRMRD_VERSION_MINOR}.${ISMRMRD_VERSION_PATCH})
+ set(ISMRMRD_SOVERSION ${ISMRMRD_VERSION_MAJOR}.${ISMRMRD_VERSION_MINOR})
+
+-# Find HDF5 for dataset support
+-find_package(HDF5 1.8 COMPONENTS C)
+-
+-if (HDF5_FOUND)
+- set (ISMRMRD_DATASET_SUPPORT true)
+- set (ISMRMRD_DATASET_SOURCES libsrc/dataset.c libsrc/dataset.cpp)
+- set (ISMRMRD_DATASET_INCLUDE_DIR ${HDF5_C_INCLUDE_DIR})
+- set (ISMRMRD_DATASET_LIBRARIES ${HDF5_LIBRARIES})
+-else (HDF5_FOUND)
++if (USE_HDF5_DATASET_SUPPORT)
++ # Find HDF5 for dataset support
++ find_package(HDF5 1.8 COMPONENTS C)
++
++ if (HDF5_FOUND)
++ set (ISMRMRD_DATASET_SUPPORT true)
++ set (ISMRMRD_DATASET_SOURCES libsrc/dataset.c libsrc/dataset.cpp)
++ set (ISMRMRD_DATASET_INCLUDE_DIR ${HDF5_C_INCLUDE_DIR})
++ set (ISMRMRD_DATASET_LIBRARIES ${HDF5_LIBRARIES})
++ elseif (USE_HDF5_DATASET_SUPPORT)
++ set (ISMRMRD_DATASET_SUPPORT false)
++ # Dataset and file support was explicitly requested, force failure rather than succeed without support.
++ message (FATAL_ERROR "HDF5 not found. Dataset and file support unavailable!")
++ endif (HDF5_FOUND)
++else (USE_HDF5_DATASET_SUPPORT)
+ set (ISMRMRD_DATASET_SUPPORT false)
+- message (WARNING "HDF5 not found. Dataset and file support unavailable!")
+-endif (HDF5_FOUND)
++endif (USE_HDF5_DATASET_SUPPORT)
+
+ # Generate the version.h header file
+ find_package(Git)
+@@ -127,7 +133,7 @@ install(FILES ${CMAKE_BINARY_DIR}/include/ismrmrd/version.h DESTINATION include/
+
+ # --- Main Library (begin) ----
+ # in windows, install the HDF5 dependencies
+-if (HDF5_FOUND AND WIN32 AND ISMRMRD_INSTALL_DEPENDENCIES)
++if (USE_HDF5_DATASET_SUPPORT AND WIN32 AND ISMRMRD_INSTALL_DEPENDENCIES)
+ if(DEFINED ENV{HDF5_ROOT})
+ set(HDF5_BIN_DIR $ENV{HDF5_ROOT}/bin)
+ else (DEFINED ENV{HDF5_ROOT})
+@@ -135,7 +141,7 @@ if (HDF5_FOUND AND WIN32 AND ISMRMRD_INSTALL_DEPENDENCIES)
+ endif (DEFINED ENV{HDF5_ROOT})
+ message("Install hdf5 libraries from ${HDF5_BIN_DIR} ")
+ install( DIRECTORY ${HDF5_BIN_DIR} DESTINATION bin/.. FILES_MATCHING PATTERN "*.dll" )
+-endif (HDF5_FOUND AND WIN32 AND ISMRMRD_INSTALL_DEPENDENCIES)
++endif (USE_HDF5_DATASET_SUPPORT AND WIN32 AND ISMRMRD_INSTALL_DEPENDENCIES)
+
+ # include directories for main library
+ set(ISMRMRD_TARGET_INCLUDE_DIRS
+@@ -199,9 +205,9 @@ install(FILES cmake/FindIsmrmrd.cmake cmake/FindFFTW3.cmake DESTINATION share/is
+ add_subdirectory(doc)
+
+ add_subdirectory(utilities)
+-if (HDF5_FOUND)
++if (USE_HDF5_DATASET_SUPPORT)
+ add_subdirectory(examples/c)
+-endif (HDF5_FOUND)
++endif (USE_HDF5_DATASET_SUPPORT)
+
+ # TODO: make this work on Windows
+ if (NOT WIN32)