2013-01-15 02:35:30 +08:00
|
|
|
cmake_minimum_required (VERSION 2.8.10)
|
2010-09-01 04:15:13 +08:00
|
|
|
PROJECT (HDF5_CPP_TEST)
|
2010-05-14 00:01:50 +08:00
|
|
|
# --------------------------------------------------------------------
|
|
|
|
# Notes: When creating unit test executables they should be prefixed
|
|
|
|
# with "cpp_". This allows for easier filtering of the test suite when
|
|
|
|
# using ctest. An example would be
|
|
|
|
# ctest -R cpp_
|
|
|
|
# which would only run the C++ based unit tests.
|
|
|
|
# --------------------------------------------------------------------
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Define Sources
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
SET (CPP_TEST_SRCS
|
|
|
|
${HDF5_CPP_TEST_SOURCE_DIR}/testhdf5.cpp
|
|
|
|
${HDF5_CPP_TEST_SOURCE_DIR}/tattr.cpp
|
|
|
|
${HDF5_CPP_TEST_SOURCE_DIR}/tcompound.cpp
|
|
|
|
${HDF5_CPP_TEST_SOURCE_DIR}/tfile.cpp
|
|
|
|
${HDF5_CPP_TEST_SOURCE_DIR}/tfilter.cpp
|
|
|
|
${HDF5_CPP_TEST_SOURCE_DIR}/th5s.cpp
|
|
|
|
${HDF5_CPP_TEST_SOURCE_DIR}/tlinks.cpp
|
|
|
|
${HDF5_CPP_TEST_SOURCE_DIR}/trefer.cpp
|
|
|
|
${HDF5_CPP_TEST_SOURCE_DIR}/ttypes.cpp
|
|
|
|
${HDF5_CPP_TEST_SOURCE_DIR}/tvlstr.cpp
|
|
|
|
${HDF5_CPP_TEST_SOURCE_DIR}/dsets.cpp
|
|
|
|
${HDF5_CPP_TEST_SOURCE_DIR}/h5cpputil.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Generate the H5srcdir_str.h file containing user settings needed by compilation
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
SET (srcdir ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
CONFIGURE_FILE (${HDF5_CPP_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY)
|
|
|
|
INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
|
2010-09-01 04:15:13 +08:00
|
|
|
INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR} )
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
ADD_EXECUTABLE (cpp_testhdf5 ${CPP_TEST_SRCS} )
|
2011-02-25 03:43:07 +08:00
|
|
|
TARGET_NAMING (cpp_testhdf5 ${LIB_TYPE})
|
2013-06-11 01:46:48 +08:00
|
|
|
TARGET_C_PROPERTIES (cpp_testhdf5 " " " ")
|
2010-05-14 00:01:50 +08:00
|
|
|
TARGET_LINK_LIBRARIES (cpp_testhdf5
|
|
|
|
${HDF5_CPP_LIB_TARGET}
|
|
|
|
${HDF5_LIB_TARGET}
|
|
|
|
${HDF5_TEST_LIB_TARGET}
|
|
|
|
)
|
2011-10-26 00:52:58 +08:00
|
|
|
SET_TARGET_PROPERTIES (cpp_testhdf5 PROPERTIES FOLDER test/cpp)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
2012-08-24 00:07:43 +08:00
|
|
|
ADD_CUSTOM_COMMAND (
|
|
|
|
TARGET cpp_testhdf5
|
|
|
|
POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND}
|
|
|
|
ARGS -E copy_if_different ${HDF5_CPP_TEST_SOURCE_DIR}/th5s.h5 ${PROJECT_BINARY_DIR}/th5s.h5
|
|
|
|
)
|
|
|
|
|
2013-08-20 05:49:44 +08:00
|
|
|
INCLUDE (CMakeTests.cmake)
|