2014-03-13 23:05:09 +08:00
|
|
|
cmake_minimum_required (VERSION 2.8.11)
|
2010-05-14 00:01:50 +08:00
|
|
|
PROJECT (HDF5_CPP)
|
|
|
|
|
2012-09-19 06:08:07 +08:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Apply Definitions to compiler in this directory and below
|
|
|
|
#-----------------------------------------------------------------------------
|
2014-05-15 03:50:28 +08:00
|
|
|
add_definitions (${HDF_EXTRA_C_FLAGS})
|
2012-09-19 06:08:07 +08:00
|
|
|
|
2010-05-14 00:01:50 +08:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Shared/Static Libs
|
|
|
|
#-----------------------------------------------------------------------------
|
2014-03-12 05:14:57 +08:00
|
|
|
if (BUILD_SHARED_LIBS)
|
|
|
|
set (CPP_BUILT_AS_DYNAMIC_LIB 1)
|
|
|
|
else (BUILD_SHARED_LIBS)
|
|
|
|
set (CPP_BUILT_AS_STATIC_LIB 1)
|
|
|
|
endif (BUILD_SHARED_LIBS)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Generate configure file
|
|
|
|
#-----------------------------------------------------------------------------
|
2014-05-15 03:50:28 +08:00
|
|
|
configure_file (${HDF_RESOURCES_DIR}/H5cxx_config.h.in
|
2010-05-14 00:01:50 +08:00
|
|
|
${HDF5_BINARY_DIR}/H5cxx_pubconf.h
|
|
|
|
)
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Setup Include directories
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
INCLUDE_DIRECTORIES (${HDF5_CPP_SOURCE_DIR}/src)
|
|
|
|
INCLUDE_DIRECTORIES (${HDF5_BINARY_DIR})
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Parallel/MPI, prevent spurious cpp/cxx warnings
|
|
|
|
#-----------------------------------------------------------------------------
|
2014-03-12 05:14:57 +08:00
|
|
|
if (H5_HAVE_PARALLEL)
|
|
|
|
add_definitions ("-DMPICH_SKIP_MPICXX")
|
|
|
|
add_definitions ("-DMPICH_IGNORE_CXX_SEEK")
|
|
|
|
endif (H5_HAVE_PARALLEL)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
2014-03-19 00:21:46 +08:00
|
|
|
add_subdirectory (${HDF5_CPP_SOURCE_DIR}/src ${HDF5_CPP_BINARY_DIR}/src)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Build the CPP Examples
|
|
|
|
#-----------------------------------------------------------------------------
|
2014-03-12 05:14:57 +08:00
|
|
|
if (HDF5_BUILD_EXAMPLES)
|
2014-03-19 00:21:46 +08:00
|
|
|
add_subdirectory (${HDF5_CPP_SOURCE_DIR}/examples ${HDF5_CPP_BINARY_DIR}/examples)
|
2014-03-12 05:14:57 +08:00
|
|
|
endif (HDF5_BUILD_EXAMPLES)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Build the CPP unit tests
|
|
|
|
#-----------------------------------------------------------------------------
|
2014-03-12 05:14:57 +08:00
|
|
|
if (BUILD_TESTING)
|
2014-03-19 00:21:46 +08:00
|
|
|
add_subdirectory (${HDF5_CPP_SOURCE_DIR}/test ${HDF5_CPP_BINARY_DIR}/test)
|
2014-03-12 05:14:57 +08:00
|
|
|
endif (BUILD_TESTING)
|