2015-02-19 00:56:22 +08:00
|
|
|
cmake_minimum_required (VERSION 3.1.0)
|
2010-09-01 04:15:13 +08:00
|
|
|
PROJECT (HDF5_HL_TEST)
|
2010-05-14 00:01:50 +08:00
|
|
|
# --------------------------------------------------------------------
|
|
|
|
# Notes: When creating unit test executables they should be prefixed
|
|
|
|
# with "hl_". This allows for easier filtering of the test suite when
|
|
|
|
# using ctest. An example would be
|
|
|
|
# ctest -R hl_
|
|
|
|
# which would only run the High Level based unit tests.
|
|
|
|
# --------------------------------------------------------------------
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Generate the H5srcdir_str.h file containing user settings needed by compilation
|
|
|
|
#-----------------------------------------------------------------------------
|
2014-03-12 05:14:57 +08:00
|
|
|
set (srcdir ${CMAKE_CURRENT_SOURCE_DIR})
|
2014-03-12 06:07:13 +08:00
|
|
|
configure_file (${HDF5_HL_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
# --------------------------------------------------------------------
|
|
|
|
# Macro used to add a unit test
|
|
|
|
# --------------------------------------------------------------------
|
2013-08-20 05:49:44 +08:00
|
|
|
MACRO (HL_ADD_EXE hl_name)
|
2014-03-12 05:14:57 +08:00
|
|
|
add_executable (hl_${hl_name} ${hl_name}.c)
|
2011-02-25 03:43:07 +08:00
|
|
|
TARGET_NAMING (hl_${hl_name} ${LIB_TYPE})
|
2015-03-26 06:08:46 +08:00
|
|
|
TARGET_C_PROPERTIES (hl_${hl_name} ${LIB_TYPE} " " " ")
|
2014-03-12 05:14:57 +08:00
|
|
|
target_link_libraries (hl_${hl_name}
|
2010-05-14 00:01:50 +08:00
|
|
|
${HDF5_HL_LIB_TARGET}
|
|
|
|
${HDF5_LIB_TARGET}
|
|
|
|
${HDF5_TEST_LIB_TARGET}
|
|
|
|
)
|
2014-03-12 05:14:57 +08:00
|
|
|
set_target_properties (hl_${hl_name} PROPERTIES FOLDER test/hl)
|
2013-08-20 05:49:44 +08:00
|
|
|
ENDMACRO (HL_ADD_EXE)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
2013-08-20 05:49:44 +08:00
|
|
|
HL_ADD_EXE (test_ds)
|
|
|
|
HL_ADD_EXE (test_dset_opt)
|
|
|
|
HL_ADD_EXE (test_image)
|
|
|
|
HL_ADD_EXE (test_lite)
|
|
|
|
HL_ADD_EXE (test_packet)
|
|
|
|
HL_ADD_EXE (test_table)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
# --------------------------------------------------------------------
|
|
|
|
# This executable is used to generate test files for the test_ds test.
|
|
|
|
# It should only be run during development when new test files are needed
|
|
|
|
# --------------------------------------------------------------------
|
2014-03-12 05:14:57 +08:00
|
|
|
if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS)
|
|
|
|
add_executable (hl_gen_test_ds gen_test_ds.c)
|
2015-04-02 05:02:43 +08:00
|
|
|
TARGET_NAMING (hl_gen_test_ds STATIC)
|
|
|
|
TARGET_C_PROPERTIES (hl_gen_test_ds STATIC " " " ")
|
2014-03-12 05:14:57 +08:00
|
|
|
target_link_libraries (hl_gen_test_ds
|
2010-05-14 00:01:50 +08:00
|
|
|
${HDF5_HL_LIB_TARGET}
|
|
|
|
${HDF5_LIB_TARGET}
|
|
|
|
${HDF5_TEST_LIB_TARGET}
|
|
|
|
)
|
2014-03-12 05:14:57 +08:00
|
|
|
set_target_properties (hl_gen_test_ds PROPERTIES FOLDER test/hl/gen)
|
|
|
|
endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS)
|
2013-08-20 05:49:44 +08:00
|
|
|
|
2014-03-12 05:14:57 +08:00
|
|
|
include (CMakeTests.cmake)
|