2020-02-22 06:16:06 +08:00
|
|
|
cmake_minimum_required (VERSION 3.12)
|
2018-04-20 23:11:55 +08:00
|
|
|
project (HDF5_HL_EXAMPLES C)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Define Sources
|
|
|
|
#-----------------------------------------------------------------------------
|
2014-03-12 05:14:57 +08:00
|
|
|
set (examples
|
2010-05-14 00:01:50 +08:00
|
|
|
ex_lite1
|
2013-11-02 05:15:37 +08:00
|
|
|
ex_lite2 #ex_lite2 PROPERTIES DEPENDS ex_lite1)
|
2010-05-14 00:01:50 +08:00
|
|
|
ex_lite3
|
|
|
|
ptExampleFL
|
|
|
|
ex_image1
|
|
|
|
ex_image2
|
|
|
|
ex_table_01
|
|
|
|
ex_table_02
|
|
|
|
ex_table_03
|
|
|
|
ex_table_04
|
|
|
|
ex_table_05
|
|
|
|
ex_table_06
|
|
|
|
ex_table_07
|
|
|
|
ex_table_08
|
|
|
|
ex_table_09
|
|
|
|
ex_table_10
|
|
|
|
ex_table_11
|
|
|
|
ex_table_12
|
|
|
|
ex_ds1
|
|
|
|
)
|
|
|
|
|
2014-03-12 05:14:57 +08:00
|
|
|
foreach (example ${examples})
|
|
|
|
add_executable (hl_ex_${example} ${HDF5_HL_EXAMPLES_SOURCE_DIR}/${example}.c)
|
2020-09-26 05:43:57 +08:00
|
|
|
target_include_directories (hl_ex_${example} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_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 (hl_ex_${example} STATIC)
|
|
|
|
target_link_libraries (hl_ex_${example} PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET})
|
|
|
|
else ()
|
|
|
|
TARGET_C_PROPERTIES (hl_ex_${example} SHARED)
|
|
|
|
target_link_libraries (hl_ex_${example} PRIVATE ${HDF5_HL_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
|
|
|
|
endif ()
|
2014-03-12 05:14:57 +08:00
|
|
|
set_target_properties (hl_ex_${example} PROPERTIES FOLDER examples/hl)
|
2020-09-05 05:36:52 +08:00
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Add Target to clang-format
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
if (HDF5_ENABLE_FORMATTERS)
|
|
|
|
clang_format (HDF5_HL_EXAMPLES_${example}_FORMAT hl_ex_${example})
|
|
|
|
endif ()
|
2017-01-11 07:09:53 +08:00
|
|
|
endforeach ()
|
2010-05-14 00:01:50 +08:00
|
|
|
|
2020-01-16 02:28:53 +08:00
|
|
|
if (BUILD_TESTING AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL)
|
2014-03-12 05:14:57 +08:00
|
|
|
include (CMakeTests.cmake)
|
2017-01-11 07:09:53 +08:00
|
|
|
endif ()
|