mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-12-03 02:32:04 +08:00
e65aa8c365
Corrected use/name of source folder aliases. Duplicated FindMPI.cmake so that non-c++ compiler is found first (recommemded commands did not work). Tested: local linux with mpich
57 lines
2.1 KiB
CMake
57 lines
2.1 KiB
CMake
cmake_minimum_required (VERSION 2.8)
|
|
PROJECT (HDF5_CPP_TEST)
|
|
# --------------------------------------------------------------------
|
|
# 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})
|
|
|
|
INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR} )
|
|
|
|
ADD_EXECUTABLE (cpp_testhdf5 ${CPP_TEST_SRCS} )
|
|
H5_NAMING (cpp_testhdf5)
|
|
IF (WIN32)
|
|
IF (MSVC)
|
|
IF (NOT BUILD_SHARED_LIBS)
|
|
SET_TARGET_PROPERTIES (cpp_testhdf5
|
|
PROPERTIES
|
|
LINK_FLAGS "/NODEFAULTLIB:MSVCRT"
|
|
)
|
|
ENDIF (NOT BUILD_SHARED_LIBS)
|
|
ENDIF (MSVC)
|
|
ENDIF (WIN32)
|
|
TARGET_LINK_LIBRARIES (cpp_testhdf5
|
|
${HDF5_CPP_LIB_TARGET}
|
|
${HDF5_LIB_TARGET}
|
|
${HDF5_TEST_LIB_TARGET}
|
|
)
|
|
|
|
ADD_TEST (NAME cpp_testhdf5 COMMAND $<TARGET_FILE:cpp_testhdf5>)
|