summaryrefslogtreecommitdiffstats
path: root/tools/h5repack/CMakeLists.txt
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2013-09-06 15:15:50 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2013-09-06 15:15:50 (GMT)
commit145f1ce9e35414e40abf00c139114f69c5e1322d (patch)
treeb2528c469291939818ff0b296ce132138e12bb8e /tools/h5repack/CMakeLists.txt
parentddbc3c841cc71254243e87ede6dd99c403507914 (diff)
downloadhdf5-145f1ce9e35414e40abf00c139114f69c5e1322d.zip
hdf5-145f1ce9e35414e40abf00c139114f69c5e1322d.tar.gz
hdf5-145f1ce9e35414e40abf00c139114f69c5e1322d.tar.bz2
[svn-r24104] HDFFV-8345: add User Defined filters to h5repack.
Reviewed in H5T-61 Tested: local linux - cmake and autotools
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)