2020-02-22 06:16:06 +08:00
|
|
|
cmake_minimum_required (VERSION 3.12)
|
2018-04-20 23:11:55 +08:00
|
|
|
project (HDF5_TEST_PAR C)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Define Tests
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
|
2016-05-04 23:06:05 +08:00
|
|
|
set (testphdf5_SOURCES
|
2010-05-14 00:01:50 +08:00
|
|
|
${HDF5_TEST_PAR_SOURCE_DIR}/testphdf5.c
|
|
|
|
${HDF5_TEST_PAR_SOURCE_DIR}/t_dset.c
|
|
|
|
${HDF5_TEST_PAR_SOURCE_DIR}/t_file.c
|
2012-04-05 02:01:29 +08:00
|
|
|
${HDF5_TEST_PAR_SOURCE_DIR}/t_file_image.c
|
2010-05-14 00:01:50 +08:00
|
|
|
${HDF5_TEST_PAR_SOURCE_DIR}/t_mdset.c
|
|
|
|
${HDF5_TEST_PAR_SOURCE_DIR}/t_ph5basic.c
|
|
|
|
${HDF5_TEST_PAR_SOURCE_DIR}/t_coll_chunk.c
|
|
|
|
${HDF5_TEST_PAR_SOURCE_DIR}/t_span_tree.c
|
|
|
|
${HDF5_TEST_PAR_SOURCE_DIR}/t_chunk_alloc.c
|
|
|
|
${HDF5_TEST_PAR_SOURCE_DIR}/t_filter_read.c
|
2012-09-27 04:53:18 +08:00
|
|
|
${HDF5_TEST_PAR_SOURCE_DIR}/t_prop.c
|
2018-08-26 11:54:30 +08:00
|
|
|
${HDF5_TEST_PAR_SOURCE_DIR}/t_coll_md_read.c
|
2010-05-14 00:01:50 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
#-- Adding test for testhdf5
|
2016-05-04 23:06:05 +08:00
|
|
|
add_executable (testphdf5 ${testphdf5_SOURCES})
|
2019-06-18 20:46:25 +08:00
|
|
|
target_include_directories (testphdf5
|
2018-04-27 05:41:04 +08:00
|
|
|
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
|
|
|
|
)
|
2019-06-18 20:46:25 +08:00
|
|
|
if (NOT BUILD_SHARED_LIBS)
|
|
|
|
TARGET_C_PROPERTIES (testphdf5 STATIC)
|
|
|
|
target_link_libraries (testphdf5
|
|
|
|
PRIVATE ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>"
|
|
|
|
)
|
|
|
|
else ()
|
|
|
|
TARGET_C_PROPERTIES (testphdf5 SHARED)
|
|
|
|
target_link_libraries (testphdf5
|
|
|
|
PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>"
|
|
|
|
)
|
|
|
|
endif ()
|
2014-03-12 05:14:57 +08:00
|
|
|
set_target_properties (testphdf5 PROPERTIES FOLDER test/par)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
2013-08-20 05:49:44 +08:00
|
|
|
MACRO (ADD_H5P_EXE file)
|
2014-03-12 05:14:57 +08:00
|
|
|
add_executable (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c)
|
2019-06-18 20:46:25 +08:00
|
|
|
target_include_directories (${file}
|
2018-04-27 05:41:04 +08:00
|
|
|
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
|
|
|
|
)
|
2019-06-18 20:46:25 +08:00
|
|
|
if (NOT BUILD_SHARED_LIBS)
|
|
|
|
TARGET_C_PROPERTIES (${file} STATIC)
|
|
|
|
target_link_libraries (${file}
|
|
|
|
PRIVATE ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>"
|
2019-08-28 23:19:03 +08:00
|
|
|
$<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:MinGW>>:ws2_32.lib>
|
2019-06-18 20:46:25 +08:00
|
|
|
)
|
|
|
|
else ()
|
|
|
|
TARGET_C_PROPERTIES (${file} SHARED)
|
|
|
|
target_link_libraries (${file}
|
|
|
|
PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>"
|
2019-08-28 23:19:03 +08:00
|
|
|
$<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:MinGW>>:ws2_32.lib>
|
2019-06-18 20:46:25 +08:00
|
|
|
)
|
|
|
|
endif ()
|
2014-03-12 05:14:57 +08:00
|
|
|
set_target_properties (${file} PROPERTIES FOLDER test/par)
|
2013-08-20 05:49:44 +08:00
|
|
|
ENDMACRO (ADD_H5P_EXE file)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
2014-03-12 05:14:57 +08:00
|
|
|
set (H5P_TESTS
|
2010-05-14 00:01:50 +08:00
|
|
|
t_mpi
|
2017-07-11 04:17:26 +08:00
|
|
|
t_bigio
|
2010-05-14 00:01:50 +08:00
|
|
|
t_cache
|
2019-08-28 05:49:10 +08:00
|
|
|
t_cache_image
|
2010-05-14 00:01:50 +08:00
|
|
|
t_pflush1
|
|
|
|
t_pflush2
|
2017-09-29 04:27:29 +08:00
|
|
|
t_pread
|
2015-02-23 23:14:43 +08:00
|
|
|
t_pshutdown
|
|
|
|
t_prestart
|
2015-06-09 04:52:48 +08:00
|
|
|
t_init_term
|
2011-01-31 23:42:46 +08:00
|
|
|
t_shapesame
|
2017-09-15 20:57:40 +08:00
|
|
|
t_filters_parallel
|
2019-12-06 22:33:55 +08:00
|
|
|
t_2Gio
|
2010-05-14 00:01:50 +08:00
|
|
|
)
|
|
|
|
|
2019-02-16 05:48:24 +08:00
|
|
|
foreach (h5_testp ${H5P_TESTS})
|
|
|
|
ADD_H5P_EXE(${h5_testp})
|
2017-03-02 04:47:53 +08:00
|
|
|
endforeach ()
|
2010-05-14 00:01:50 +08:00
|
|
|
|
2020-01-16 01:38:06 +08:00
|
|
|
if (HDF5_TEST_PARALLEL)
|
|
|
|
include (CMakeTests.cmake)
|
|
|
|
endif ()
|