Skip to content
Snippets Groups Projects
Commit 92e79ef2 authored by Elias Pipping's avatar Elias Pipping
Browse files

HDF5: Add add_dune_hdf5_flags() to cmake

parent fa991ca5
Branches
Tags
No related merge requests found
...@@ -9,8 +9,6 @@ find_package(dune-common REQUIRED) ...@@ -9,8 +9,6 @@ find_package(dune-common REQUIRED)
list(APPEND CMAKE_MODULE_PATH ${dune-common_MODULE_PATH}) list(APPEND CMAKE_MODULE_PATH ${dune-common_MODULE_PATH})
include(DuneMacros) include(DuneMacros)
find_package(HDF5 COMPONENTS C HL)
dune_project() dune_project()
add_subdirectory("doc") add_subdirectory("doc")
......
#
# Module providing convenience methods for compile binaries with HDF5 support.
#
# Provides the following functions:
#
# add_dune_hdf5_flags(target1 target2 ...)
#
# adds HDF5 flags to the targets for compilation and linking
#
function(add_dune_hdf5_flags _targets)
if(HDF5_FOUND)
foreach(_target ${_targets})
target_link_libraries(${_target} ${HDF5_LIBRARIES})
set_property(TARGET ${_target} APPEND PROPERTY INCLUDE_DIRECTORIES ${HDF5_INCLUDE_DIR})
endforeach(_target ${_targets})
endif(HDF5_FOUND)
endfunction(add_dune_hdf5_flags)
...@@ -42,9 +42,11 @@ set(Python_ADDITIONAL_VERSIONS 2.7 3 3.2) ...@@ -42,9 +42,11 @@ set(Python_ADDITIONAL_VERSIONS 2.7 3 3.2)
find_package(PythonLibs) find_package(PythonLibs)
find_package(Adolc) find_package(Adolc)
find_package(HDF5 COMPONENTS C HL)
find_package(Boost COMPONENTS serialization) find_package(Boost COMPONENTS serialization)
set(HAVE_BOOST_SERIALIZATION ${Boost_SERIALIZATION_FOUND}) set(HAVE_BOOST_SERIALIZATION ${Boost_SERIALIZATION_FOUND})
include(AddPythonLibsFlags) include(AddPythonLibsFlags)
include(AddAdolcFlags) include(AddAdolcFlags)
include(AddHDF5Flags)
...@@ -85,6 +85,5 @@ endif() ...@@ -85,6 +85,5 @@ endif()
if (HDF5_FOUND) if (HDF5_FOUND)
dune_add_test(SOURCES test-hdf5.cc) dune_add_test(SOURCES test-hdf5.cc)
set_property(TARGET test-hdf5 APPEND PROPERTY INCLUDE_DIRECTORIES ${HDF5_INCLUDE_DIR}) add_dune_hdf5_flags(test-hdf5)
target_link_libraries(test-hdf5 ${HDF5_LIBRARIES})
endif() endif()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment