Skip to content

Commit

Permalink
Pass either HDF5_DIR or HDF5_ROOT via a new variable
Browse files Browse the repository at this point in the history
when we build HDF5 ourselves, and on Windows also when we download, it's best to use HDF5_DIR.
Otherwise we pass HDF5_ROOT if it was set. We use a new variable
HDF5_CMAKE_ARGS for this such that dependent projects don't need to
know.
  • Loading branch information
Kris Thielemans committed Jul 2, 2017
1 parent f5a3d2a commit 0eabb88
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
4 changes: 1 addition & 3 deletions SuperBuild/External_Gadgetron.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ endif ()
-DBOOST_LIBRARYDIR=${BOOST_LIBRARY_DIR}
-DMATLAB_ROOT=${MATLAB_ROOT}
-DGTEST_ROOT=${GTEST_ROOT}
-DHDF5_ROOT=${HDF5_ROOT}
-DHDF5_INCLUDE_DIRS=${HDF5_INCLUDE_DIRS}
-DHDF5_LIBRARIES=${HDF5_LIBRARIES}
${HDF5_CMAKE_ARGS}
-DFFTW_ROOT_DIR=${SUPERBUILD_INSTALL_DIR}
-DISMRMRD_DIR=${ISMRMRD_DIR}
-DMKLROOT_PATH=${MKLROOT_PATH}
Expand Down
11 changes: 11 additions & 0 deletions SuperBuild/External_HDF5.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,27 @@ if(NOT ( DEFINED "USE_SYSTEM_${externalProjName}" AND "${USE_SYSTEM_${externalPr
#set(HDF5_INCLUDE_DIR ${HDF5_SOURCE_DIR})

set( HDF5_ROOT ${HDF5_Install_Dir} )
set( HDF5_DIR ${HDF5_Install_Dir}/cmake )
set( HDF5_INCLUDE_DIRS ${HDF5_ROOT}/include )

set( HDF5_CMAKE_ARGS "-DHDF5_DIR:PATH=${HDF5_DIR}")

else()
if(${USE_SYSTEM_${externalProjName}})
find_package(${proj} ${${externalProjName}_REQUIRED_VERSION} REQUIRED)
message(STATUS "USING the system ${externalProjName}, found HDF5_INCLUDE_DIRS=${HDF5_INCLUDE_DIRS}, HDF5_C_LIBRARY_hdf5=${HDF5_C_LIBRARY_hdf5},HDF5_LIBRARIES=${HDF5_LIBRARIES}")
if (DEFINED HDF5_DIR)
set( HDF5_CMAKE_ARGS "-DHDF5_DIR:PATH=${HDF5_DIR}")
elseif (DEFINED HDF5_ROOT)
set( HDF5_CMAKE_ARGS "-DHDF5_ROOT:PATH=${HDF5_ROOT}")
endif()

endif()
ExternalProject_Add_Empty(${proj} "${${proj}_DEPENDENCIES}")
endif()

message(STATUS "HDF5_CMAKE_ARGS: ${HDF5_CMAKE_ARGS}")

mark_as_superbuild(
VARS
${externalProjName}_DIR:PATH
Expand Down
4 changes: 1 addition & 3 deletions SuperBuild/External_ISMRMRD.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ if(NOT ( DEFINED "USE_SYSTEM_${externalProjName}" AND "${USE_SYSTEM_${externalPr
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${ISMRMRD_Install_Dir}
-DCMAKE_PREFIX_PATH=${SUPERBUILD_INSTALL_DIR}
-DCMAKE_LIBRARY_PATH=${SUPERBUILD_INSTALL_DIR}/lib
-DHDF5_ROOT=${HDF5_ROOT}
-DHDF5_INCLUDE_DIRS=${HDF5_INCLUDE_DIRS}
-DHDF5_LIBRARIES=${HDF5_LIBRARIES}
${HDF5_CMAKE_ARGS}
-DBOOST_ROOT=${BOOST_ROOT}
INSTALL_DIR ${ISMRMRD_Install_Dir}
DEPENDS
Expand Down
3 changes: 1 addition & 2 deletions SuperBuild/External_SIRF.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ if(NOT ( DEFINED "USE_SYSTEM_${externalProjName}" AND "${USE_SYSTEM_${externalPr
-DBOOST_ROOT=${BOOST_ROOT}
-DMATLAB_ROOT=${MATLAB_ROOT}
-DSTIR_DIR=${STIR_DIR}
-DHDF5_ROOT=${HDF5_ROOT}
-DHDF5_INCLUDE_DIRS=${HDF5_INCLUDE_DIRS}
${HDF5_CMAKE_ARGS}
-DISMRMRD_DIR=${ISMRMRD_DIR}
-DSWIG_EXECUTABLE=${SWIG_EXECUTABLE}
-DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIR}
Expand Down

0 comments on commit 0eabb88

Please sign in to comment.