summaryrefslogtreecommitdiffstats
path: root/tools/test/h5copy/CMakeLists.txt
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2017-10-16 22:26:23 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2017-10-16 22:26:23 (GMT)
commit2cbdf46cb9ecd93803aaf5dca22f1f847e505bee (patch)
treef8c879a72a78af9b6ef18a05872122670e2d5435 /tools/test/h5copy/CMakeLists.txt
parente0bbff9d46eabbbc3a6d63f5b2f5e2f7ca0ed217 (diff)
downloadhdf5-2cbdf46cb9ecd93803aaf5dca22f1f847e505bee.zip
hdf5-2cbdf46cb9ecd93803aaf5dca22f1f847e505bee.tar.gz
hdf5-2cbdf46cb9ecd93803aaf5dca22f1f847e505bee.tar.bz2
HDFFV-10297 add h5copy test and fix h5diff errors
Diffstat (limited to 'tools/test/h5copy/CMakeLists.txt')
-rw-r--r--tools/test/h5copy/CMakeLists.txt48
1 files changed, 39 insertions, 9 deletions
diff --git a/tools/test/h5copy/CMakeLists.txt b/tools/test/h5copy/CMakeLists.txt
index 4a519ab..c57cd5e 100644
--- a/tools/test/h5copy/CMakeLists.txt
+++ b/tools/test/h5copy/CMakeLists.txt
@@ -10,14 +10,44 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib)
# Add the h5copy test executables
# --------------------------------------------------------------------
- if (HDF5_BUILD_GENERATORS)
- add_executable (h5copygentest ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/h5copygentest.c)
- TARGET_NAMING (h5copygentest STATIC)
- TARGET_C_PROPERTIES (h5copygentest STATIC " " " ")
- target_link_libraries (h5copygentest ${HDF5_LIB_TARGET})
- set_target_properties (h5copygentest PROPERTIES FOLDER generator/tools)
+if (HDF5_BUILD_GENERATORS)
+ add_executable (h5copygentest ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/h5copygentest.c)
+ TARGET_NAMING (h5copygentest STATIC)
+ TARGET_C_PROPERTIES (h5copygentest STATIC " " " ")
+ target_link_libraries (h5copygentest ${HDF5_LIB_TARGET})
+ set_target_properties (h5copygentest PROPERTIES FOLDER generator/tools)
- #add_test (NAME h5copygentest COMMAND $<TARGET_FILE:h5copygentest>)
- endif ()
+ #add_test (NAME h5copygentest COMMAND $<TARGET_FILE:h5copygentest>)
+endif ()
- include (CMakeTests.cmake)
+#-----------------------------------------------------------------------------
+# If plugin library tests can be tested
+#-----------------------------------------------------------------------------
+if (BUILD_SHARED_LIBS)
+ set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibcopy")
+ set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}")
+ set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME})
+ add_definitions (${HDF_EXTRA_C_FLAGS})
+ INCLUDE_DIRECTORIES (${HDF5_SRC_DIR})
+
+ add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_copy.c)
+ TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED " " " ")
+ target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+ H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION})
+
+ # make plugins dir
+ file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins")
+ #-----------------------------------------------------------------------------
+ # Copy plugin library to a plugins folder
+ #-----------------------------------------------------------------------------
+ add_custom_command (
+ TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET}
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different
+ "$<TARGET_FILE:${HDF5_TOOL_PLUGIN_LIB_TARGET}>"
+ "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${HDF5_TOOL_PLUGIN_LIB_TARGET}>"
+ )
+endif ()
+
+include (CMakeTests.cmake)