Commit 9ec81c63 authored by Brian Panneton's avatar Brian Panneton

Cleaned up some of the CMake files so it should work with HDF5 1.8.5 and 1.8.7

parent 5655c260
......@@ -197,6 +197,7 @@ endif(XDMF_WRAP_JAVA)
add_subdirectory(core)
include_directories(${XdmfCore_INCLUDE_DIRS})
link_directories(${XDMF_LIBRARY_DIRS})
option(XDMF_BUILD_CORE_ONLY OFF)
if(NOT XDMF_BUILD_CORE_ONLY)
......
......@@ -30,40 +30,47 @@ mark_as_advanced(CLEAR HDF5_hdf5_LIBRARY_DEBUG)
mark_as_advanced(CLEAR HDF5_hdf5_LIBRARY_RELEASE)
find_package(HDF5 REQUIRED)
if(HDF5_FOUND)
include_directories(${HDF5_INCLUDE_DIRS})
mark_as_advanced(FORCE HDF5_C_INCLUDE_DIR)
mark_as_advanced(FORCE HDF5_hdf5_LIBRARY_DEBUG)
mark_as_advanced(FORCE HDF5_hdf5_LIBRARY_RELEASE)
include_directories(${HDF5_INCLUDE_DIR})
include_directories(${HDF5_INCLUDE_DIRS})
get_filename_component(HDF5_LIBRARY_DIR "${HDF5_hdf5_LIBRARY_RELEASE}"
PATH)
set(XDMF_LIBRARY_DIRS ${XDMF_LIBRARY_DIRS}
${HDF5_LIBRARY_DIR})
message("${HDF5_LIBRARY_DIR}")
set(HDF5_LIBRARIES hdf5)
option(HDF5_IS_PARALLEL "Whether or not HDF5 has parallel IO support." OFF)
if(HDF5_IS_PARALLEL)
find_package(MPI REQUIRED)
if(MPI_FOUND)
include_directories(${MPI_INCLUDE_PATH})
link_directories(${MPI_INCLUDE_PATH}/../lib)
set(XDMF_LIBRARY_DIRS ${XDMF_LIBRARY_DIRS}
${MPI_INCLUDE_PATH}/../lib)
endif(MPI_FOUND)
option(XDMF_BUILD_DSM OFF)
if(XDMF_BUILD_DSM)
find_package(H5FDdsm REQUIRED NO_MODULE)
if(H5FDdsm_FOUND)
include_directories(${H5FD_DSM_INCLUDE_DIR})
set(XDMF_LIBRARY_DIRS ${XDMF_LIBRARY_DIRS}
${H5FD_DSM_INCLUDE_DIR}/../lib)
set(H5FD_DSM_LIBRARIES H5FDdsm)
else(H5FDdsm_FOUND)
message(SEND_ERROR
"Cannot find HDF5 DSM! Please set H5FDdsm_DIR and configure again.")
endif(H5FDdsm_FOUND)
endif(XDMF_BUILD_DSM)
endif(HDF5_IS_PARALLEL)
get_filename_component(HDF5_ROOT "${HDF5_INCLUDE_DIR}/../" REALPATH)
set(HDF5_BINARY_DIRS ${HDF5_ROOT}/bin ${HDF5_ROOT}/dll)
set(XDMF_LIBRARIES ${XDMF_LIBRARIES} ${HDF5_LIBRARIES})
set(XDMF_LIBRARIES ${XDMF_LIBRARIES} ${HDF5_LIBRARIES} ${H5FD_DSM_LIBRARIES})
set(XDMF_HDF5_BINARY_DIRS ${HDF5_BINARY_DIRS} PARENT_SCOPE)
set(XDMF_BINARIES ${XDMF_BINARIES} ${HDF5_BINARY_DIRS})
link_directories(${XDMF_LIBRARY_DIRS})
endif(HDF5_FOUND)
if(XDMF_BUILD_DSM)
find_path(HDF5DSM_DIR include/H5FDdsm.h)
if(HDF5DSM_DIR AND EXISTS ${HDF5DSM_DIR}/include/H5FDdsm.h)
include_directories(${HDF5DSM_DIR}/include)
find_library(HDF5DSM_LIBRARIES H5FDdsm ${HDF5DSM_DIR}/lib)
else(HDF5DSM_DIR AND EXISTS ${HDF5DSM_DIR}/include/H5FDdsm.h)
message(SEND_ERROR
"Cannot find HDF5DSM! Please set HDF5DSM_DIR and configure again.")
endif(HDF5DSM_DIR AND EXISTS ${HDF5DSM_DIR}/include/H5FDdsm.h)
find_package(MPI REQUIRED)
if(MPI_FOUND)
include_directories(${MPI_INCLUDE_PATH})
endif(MPI_FOUND)
endif(XDMF_BUILD_DSM)
find_package(LibXml2 REQUIRED)
if(LIBXML2_FOUND)
include_directories(${LIBXML2_INCLUDE_DIR})
......@@ -100,10 +107,8 @@ if(XDMF_BUILD_DSM)
endif(XDMF_BUILD_DSM)
add_library(XdmfCore ${XdmfCoreSources})
target_link_libraries(XdmfCore
${HDF5_hdf5_LIBRARY}
${HDF5DSM_LIBRARIES}
${LIBXML2_LIBRARIES})
link_directories(${XDMF_LIBRARY_DIRS})
target_link_libraries(XdmfCore ${XDMF_LIBRARIES})
if(WIN32)
add_definitions(-D_HDF5USEDLL_ -D_HDF5USEHLDLL_)
......@@ -127,6 +132,7 @@ if(XDMF_WRAP_PYTHON)
XDMF_SWIG_PYTHON(XdmfCore)
endif(XDMF_WRAP_PYTHON)
set(XDMF_LIBRARY_DIRS ${XDMF_LIBRARY_DIRS} PARENT_SCOPE)
if(WIN32)
set(XDMFCORE_LIBRARY ${CMAKE_INSTALL_PREFIX}/lib/XdmfCore.lib PARENT_SCOPE)
endif(WIN32)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment