summaryrefslogtreecommitdiffstats
path: root/tools/h5repack/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'tools/h5repack/CMakeLists.txt')
-rw-r--r--tools/h5repack/CMakeLists.txt35
1 files changed, 35 insertions, 0 deletions
diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt
index f03ad69..176fc2b 100644
--- a/tools/h5repack/CMakeLists.txt
+++ b/tools/h5repack/CMakeLists.txt
@@ -44,6 +44,41 @@ IF (BUILD_TESTING)
TARGET_LINK_LIBRARIES (h5repacktest ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
SET_TARGET_PROPERTIES (h5repacktest PROPERTIES FOLDER tools)
+ #-----------------------------------------------------------------------------
+ # If plugin library tests can be tested
+ #-----------------------------------------------------------------------------
+ IF (BUILD_SHARED_LIBS)
+ SET (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibadd")
+ 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 (${HDF5_EXTRA_C_FLAGS})
+ INCLUDE_DIRECTORIES (${HDF5_SRC_DIR})
+
+ ADD_LIBRARY (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SRC_DIR}/dynlib1.c)
+ TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} " " " ")
+ 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}
+ ${LIB_TYPE}
+ HDF5_TOOL_PLUGIN_LIB_NAME_RELEASE
+ HDF5_TOOL_PLUGIN_LIB_NAME_DEBUG
+ )
+
+ # 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 (BUILD_SHARED_LIBS)
+
INCLUDE (CMakeTests.cmake)
ENDIF (BUILD_TESTING)