Skip to content

Commit

Permalink
Correct reference copy for 16 API (#4244)
Browse files Browse the repository at this point in the history
  • Loading branch information
byrnHDF authored Mar 26, 2024
1 parent eacb015 commit 42f9d24
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 71 deletions.
48 changes: 33 additions & 15 deletions HDF5Examples/C/H5T/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ if (HDF5_BUILD_TOOLS)
if (NOT ${example_name} STREQUAL "h5ex_t_convert")
if (${example_name} STREQUAL "h5ex_t_vlen" OR ${example_name} STREQUAL "h5ex_t_vlenatt")
if (HDF5_VERSION_STRING VERSION_GREATER_EQUAL "1.14.3")
if (${H5_LIBVER_DIR} EQUAL 16 AND ${example_name} STREQUAL "h5ex_t_vlenatt")
if ((${EXAMPLE_VARNAME}_USE_16_API OR ${H5_LIBVER_DIR} EQUAL 16) AND ${example_name} STREQUAL "h5ex_t_vlenatt")
add_custom_command (
TARGET ${EXAMPLE_VARNAME}_${example_name}
POST_BUILD
Expand All @@ -130,7 +130,7 @@ if (HDF5_BUILD_TOOLS)
ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/tfiles/114/${example_name}.ddl ${PROJECT_BINARY_DIR}/${example_name}.ddl
)
endif ()
elseif (${H5_LIBVER_DIR} EQUAL 16)
elseif (${EXAMPLE_VARNAME}_USE_16_API OR ${H5_LIBVER_DIR} EQUAL 16)
add_custom_command (
TARGET ${EXAMPLE_VARNAME}_${example_name}
POST_BUILD
Expand Down Expand Up @@ -180,7 +180,7 @@ if (HDF5_BUILD_TOOLS)
)
endif ()
elseif (HDF5_VERSION_MAJOR VERSION_GREATER_EQUAL "1.12")
if (${H5_LIBVER_DIR} EQUAL 16)
if (${EXAMPLE_VARNAME}_USE_16_API OR ${H5_LIBVER_DIR} EQUAL 16)
add_custom_command (
TARGET ${EXAMPLE_VARNAME}_${example_name}
POST_BUILD
Expand All @@ -196,12 +196,21 @@ if (HDF5_BUILD_TOOLS)
)
endif ()
else ()
add_custom_command (
TARGET ${EXAMPLE_VARNAME}_${example_name}
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/tfiles/18/${example_name}.ddl ${PROJECT_BINARY_DIR}/${example_name}.ddl
)
if (${EXAMPLE_VARNAME}_USE_16_API OR ${H5_LIBVER_DIR} EQUAL 16)
add_custom_command (
TARGET ${EXAMPLE_VARNAME}_${example_name}
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/tfiles/16/${example_name}.ddl ${PROJECT_BINARY_DIR}/${example_name}.ddl
)
else ()
add_custom_command (
TARGET ${EXAMPLE_VARNAME}_${example_name}
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/tfiles/18/${example_name}.ddl ${PROJECT_BINARY_DIR}/${example_name}.ddl
)
endif ()
endif ()
else ()
if (HDF5_VERSION_MAJOR VERSION_EQUAL "1.8")
Expand Down Expand Up @@ -260,12 +269,21 @@ if (HDF5_BUILD_TOOLS)
ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/tfiles/16/${example_name}.ddl ${PROJECT_BINARY_DIR}/${example_name}.ddl
)
else ()
add_custom_command (
TARGET ${EXAMPLE_VARNAME}_${example_name}
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/tfiles/18/${example_name}.ddl ${PROJECT_BINARY_DIR}/${example_name}.ddl
)
if (${EXAMPLE_VARNAME}_USE_16_API)
add_custom_command (
TARGET ${EXAMPLE_VARNAME}_${example_name}
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/tfiles/16/${example_name}.ddl ${PROJECT_BINARY_DIR}/${example_name}.ddl
)
else ()
add_custom_command (
TARGET ${EXAMPLE_VARNAME}_${example_name}
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/tfiles/18/${example_name}.ddl ${PROJECT_BINARY_DIR}/${example_name}.ddl
)
endif ()
endif ()
endif ()
endforeach ()
Expand Down
Loading

0 comments on commit 42f9d24

Please sign in to comment.