Adjusted all paths for HDF5

This commit is contained in:
Guilhem Lavaux 2015-10-22 13:20:33 +02:00
parent 0096b696a3
commit bd6853d96d
4 changed files with 10 additions and 22 deletions

View File

@ -51,12 +51,6 @@ ENDIF(YORICK_SUPPORT)
find_program(CYTHON cython) find_program(CYTHON cython)
find_library(ZLIB z) find_library(ZLIB z)
if(HDF5_ROOTDIR)
SET(ENV{HDF5_ROOT} ${HDF5_ROOTDIR})
endif(HDF5_ROOTDIR)
find_package(HDF5 COMPONENTS CXX HL)
set(NETCDF_FIND_REQUIRED ${YORICK_SUPPORT}) set(NETCDF_FIND_REQUIRED ${YORICK_SUPPORT})
set(GSL_FIND_REQUIRED TRUE) set(GSL_FIND_REQUIRED TRUE)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(NetCDF DEFAULT_MSG NETCDF_LIBRARY NETCDFCPP_LIBRARY NETCDF_INCLUDE_PATH) FIND_PACKAGE_HANDLE_STANDARD_ARGS(NetCDF DEFAULT_MSG NETCDF_LIBRARY NETCDFCPP_LIBRARY NETCDF_INCLUDE_PATH)

View File

@ -67,24 +67,19 @@ if (INTERNAL_HDF5)
) )
SET(cosmotool_DEPS ${cosmotool_DEPS} hdf5) SET(cosmotool_DEPS ${cosmotool_DEPS} hdf5)
SET(hdf5_built hdf5) SET(hdf5_built hdf5)
set(HDF5_LIBRARY ${HDF5_BIN_DIR}/lib/libhdf5.a CACHE STRING "HDF5 lib" FORCE)
set(HDF5_CPP_LIBRARY ${HDF5_BIN_DIR}/lib/libhdf5_cpp.a CACHE STRING "HDF5 C++ lib" FORCE)
set(HDF5_HL_LIBRARY ${HDF5_BIN_DIR}/lib/libhdf5_hl.a CACHE STRING "HDF5-HL lib" FORCE)
set(HDF5_HL_CPP_LIBRARY ${HDF5_BIN_DIR}/lib/libhdf5_hl_cpp.a CACHE STRING "HDF5-HL C++ lib" FORCE)
SET(HDF5_INCLUDE_PATH ${HDF5_BIN_DIR}/include CACHE STRING "HDF5 include path" FORCE)
SET(ENV{HDF5_ROOT} ${HDF5_BIN_DIR}) SET(ENV{HDF5_ROOT} ${HDF5_BIN_DIR})
SET(HDF5_ROOTDIR ${HDF5_BIN_DIR}) SET(HDF5_ROOTDIR ${HDF5_BIN_DIR})
SET(CONFIGURE_LDFLAGS "${CONFIGURE_LDFLAGS} -L${HDF5_BIN_DIR}/lib") SET(CONFIGURE_LDFLAGS "${CONFIGURE_LDFLAGS} -L${HDF5_BIN_DIR}/lib")
SET(CONFIGURE_LIBS "${CONFIGURE_LIBS} -ldl") SET(CONFIGURE_LIBS "${CONFIGURE_LIBS} -ldl")
else (INTERNAL_HDF5) else (INTERNAL_HDF5)
find_path(HDF5_INCLUDE_PATH hdf5.h) if(HDF5_ROOTDIR)
find_library(HDF5_LIBRARY hdf5) SET(ENV{HDF5_ROOT} ${HDF5_ROOTDIR})
find_library(HDF5_CPP_LIBRARY hdf5_cpp) endif(HDF5_ROOTDIR)
find_library(HDF5_HL_CPP_LIBRARY hdf5_hl_cpp)
find_library(HDF5_HL_LIBRARY hdf5_hl)
endif (INTERNAL_HDF5) endif (INTERNAL_HDF5)
SET(CONFIGURE_CPP_FLAGS "${CONFIGURE_CPP_FLAGS} -I${HDF5_INCLUDE_PATH}") find_package(HDF5 COMPONENTS C CXX HL)
mark_as_advanced(HDF5_INCLUDE_PATH HDF5_LIBRARY HDF5_CPP_LIBRARY HDF5_HL_LIBRARY HDF5_HL_CPP_LIBRARY) mark_as_advanced(HDF5_INCLUDE_DIR HDF5_LIBRARY HDF5_HL_LIBRARY)
SET(CONFIGURE_CPP_FLAGS "${CONFIGURE_CPP_FLAGS} -I${HDF5_INCLUDE_DIR}")
############### ###############
# Build NetCDF # Build NetCDF

View File

@ -35,8 +35,7 @@ add_executable(testPool testPool.cpp)
target_link_libraries(testPool ${tolink}) target_link_libraries(testPool ${tolink})
if (HDF5_FOUND) if (HDF5_FOUND)
include_directories(${HDF5_INCLUDE_PATH}) include_directories(${HDF5_INCLUDE_DIR})
SET(tolink ${tolink} ${HDF5_CPP_LIBRARY} ${HDF5_LIBRARY} ${ZLIB})
add_executable(testReadFlash testReadFlash.cpp) add_executable(testReadFlash testReadFlash.cpp)
target_link_libraries(testReadFlash ${tolink}) target_link_libraries(testReadFlash ${tolink})

View File

@ -76,7 +76,7 @@ if(YORICK_SUPPORT)
include_directories(${NETCDF_INCLUDE_PATH} ${NETCDFCPP_INCLUDE_PATH}) include_directories(${NETCDF_INCLUDE_PATH} ${NETCDFCPP_INCLUDE_PATH})
endif(YORICK_SUPPORT) endif(YORICK_SUPPORT)
if (HDF5_FOUND) if (HDF5_FOUND)
set(CosmoTool_LIBS ${CosmoTool_LIBS} ${HDF5_CXX_LIBRARIES} ${HDF5_LIBRARIES}) set(CosmoTool_LIBS ${CosmoTool_LIBS} ${HDF5_CXX_LIBRARY} ${HDF5_C_LIBRARY} ${ZLIB})
include_directories(${HDF5_INCLUDE_DIRS}) include_directories(${HDF5_INCLUDE_DIRS})
endif (HDF5_FOUND) endif (HDF5_FOUND)