Added dummy function in case HDF5 is not found
This commit is contained in:
parent
0eb308f1d0
commit
f94e2912d4
@ -8,6 +8,7 @@ include(GetGitRevisionDescription)
|
|||||||
get_git_head_revision(HEAD GIT_VER)
|
get_git_head_revision(HEAD GIT_VER)
|
||||||
|
|
||||||
option(BUILD_SHARED_LIBS "Build shared libraries." OFF)
|
option(BUILD_SHARED_LIBS "Build shared libraries." OFF)
|
||||||
|
option(BUILD_STATIC_LIBS "Build static libraries." ON)
|
||||||
|
|
||||||
find_path(NETCDF_INCLUDE_PATH NAMES netcdf.h)
|
find_path(NETCDF_INCLUDE_PATH NAMES netcdf.h)
|
||||||
find_path(GSL_INCLUDE_PATH NAMES gsl/gsl_blas.h)
|
find_path(GSL_INCLUDE_PATH NAMES gsl/gsl_blas.h)
|
||||||
|
@ -16,6 +16,10 @@ if (HDF5_FOUND)
|
|||||||
h5_readFlash.cpp
|
h5_readFlash.cpp
|
||||||
loadFlash.cpp
|
loadFlash.cpp
|
||||||
)
|
)
|
||||||
|
else(HDF5_FOUND)
|
||||||
|
set(CosmoTool_SRCS ${CosmoTool_SRCS}
|
||||||
|
loadFlash_dummy.cpp
|
||||||
|
)
|
||||||
endif (HDF5_FOUND)
|
endif (HDF5_FOUND)
|
||||||
|
|
||||||
SET(CosmoTool_SRCS ${CosmoTool_SRCS}
|
SET(CosmoTool_SRCS ${CosmoTool_SRCS}
|
||||||
@ -43,7 +47,6 @@ SET(CosmoTool_SRCS ${CosmoTool_SRCS}
|
|||||||
)
|
)
|
||||||
|
|
||||||
include_directories(${GSL_INCLUDE_PATH} ${NETCDF_INCLUDE_PATH})
|
include_directories(${GSL_INCLUDE_PATH} ${NETCDF_INCLUDE_PATH})
|
||||||
add_library(CosmoTool ${CosmoTool_SRCS})
|
|
||||||
|
|
||||||
set(CosmoTool_LIBS ${NETCDF_LIBRARY} ${NETCDFCPP_LIBRARY} ${GSL_LIBRARY} ${GSLCBLAS_LIBRARY})
|
set(CosmoTool_LIBS ${NETCDF_LIBRARY} ${NETCDFCPP_LIBRARY} ${GSL_LIBRARY} ${GSLCBLAS_LIBRARY})
|
||||||
if (HDF5_FOUND)
|
if (HDF5_FOUND)
|
||||||
@ -51,12 +54,27 @@ if (HDF5_FOUND)
|
|||||||
include_directories(${HDF5_INCLUDE_DIRS})
|
include_directories(${HDF5_INCLUDE_DIRS})
|
||||||
endif (HDF5_FOUND)
|
endif (HDF5_FOUND)
|
||||||
|
|
||||||
target_link_libraries(CosmoTool ${CosmoTool_LIBS})
|
if (BUILD_SHARED_LIBS)
|
||||||
|
add_library(CosmoTool SHARED ${CosmoTool_SRCS})
|
||||||
|
target_link_libraries(CosmoTool ${CosmoTool_LIBS})
|
||||||
|
|
||||||
|
if (BUILD_STATIC_LIBS)
|
||||||
|
add_library(CosmoTool_static STATIC ${CosmoTool_SRCS})
|
||||||
|
endif(BUILD_STATIC_LIBS)
|
||||||
|
else (BUILD_SHARED_LIBS)
|
||||||
|
add_library(CosmoTool STATIC ${CosmoTool_LIBS})
|
||||||
|
endif (BUILD_SHARED_LIBS)
|
||||||
|
|
||||||
install(TARGETS CosmoTool
|
install(TARGETS CosmoTool
|
||||||
LIBRARY DESTINATION lib
|
LIBRARY DESTINATION lib
|
||||||
ARCHIVE DESTINATION lib)
|
ARCHIVE DESTINATION lib)
|
||||||
|
|
||||||
|
if (BUILD_SHARED_LIBS)
|
||||||
|
install(TARGETS CosmoTool_static
|
||||||
|
LIBRARY DESTINATION lib
|
||||||
|
ARCHIVE DESTINATION lib)
|
||||||
|
endif (BUILD_SHARED_LIBS)
|
||||||
|
|
||||||
install(DIRECTORY . DESTINATION include/CosmoTool
|
install(DIRECTORY . DESTINATION include/CosmoTool
|
||||||
FILES_MATCHING PATTERN "*.hpp")
|
FILES_MATCHING PATTERN "*.hpp")
|
||||||
install(DIRECTORY . DESTINATION include/CosmoTool
|
install(DIRECTORY . DESTINATION include/CosmoTool
|
||||||
|
Loading…
Reference in New Issue
Block a user