Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions cmake/hdf5.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#------------------------------------------------------------------------------#
# Copyright (c) 2014 Los Alamos National Security, LLC
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm being pedantic, but this should probably be changed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cmsquared: agree. I'll fix it in few minutes

# All rights reserved.
#------------------------------------------------------------------------------#

#------------------------------------------------------------------------------#
# Add HDF5 support.
#------------------------------------------------------------------------------#

option(ENABLE_HDF5 "Enable HDF5" OFF)

if(ENABLE_HDF5)

find_package(HDF5 REQUIRED)

if(NOT HDF5_FOUND)
message(FATAL_ERROR "HDF5 is required for this build configuration")
endif(NOT HDF5_FOUND)

set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${HDF5_LIBRARY_DIRS})

include_directories(${HDF5_INCLUDE_DIRS})

list(APPEND CINCH_RUNTIME_LIBRARIES ${HDF5_LIBRARIES} ${HDF5_CXX_LIBRARIES})

if(EXISTS "${HDF5_INCLUDE_DIRS}/../lib/libhdf5_cpp_debug.so")
list(APPEND CINCH_RUNTIME_LIBRARIES ${HDF5_INCLUDE_DIRS}/../lib/libhdf5_cpp_debug.so )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems a bit hackish to me!

endif()

if(EXISTS "${HDF5_INCLUDE_DIRS}/../lib/libhdf5_cpp.so")
list(APPEND CINCH_RUNTIME_LIBRARIES ${HDF5_INCLUDE_DIRS}/../lib/libhdf5_cpp.so )
endif()

message(STATUS "HDF5 found: ${HDF5_FOUND}")

endif(ENABLE_HDF5)

#------------------------------------------------------------------------------#
# Formatting options for emacs and vim.
# vim: set tabstop=4 shiftwidth=4 expandtab :
#------------------------------------------------------------------------------#
1 change: 1 addition & 0 deletions cmake/packages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ macro(cinch_load_extras)
include(boost)
include(coverage)
include(doxygen)
include(hdf5)
include(sphinx)
include(format)

Expand Down