2015-02-19 00:56:22 +08:00
|
|
|
cmake_minimum_required (VERSION 3.1.0)
|
2010-05-14 00:01:50 +08:00
|
|
|
PROJECT (HDF5_TOOLS_H5REPACK)
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Setup include Directories
|
|
|
|
#-----------------------------------------------------------------------------
|
2010-09-01 04:15:13 +08:00
|
|
|
INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib)
|
|
|
|
INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR})
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
# --------------------------------------------------------------------
|
2010-08-26 06:33:59 +08:00
|
|
|
# Add h5Repack executables
|
2010-05-14 00:01:50 +08:00
|
|
|
# --------------------------------------------------------------------
|
2014-03-12 05:14:57 +08:00
|
|
|
set (REPACK_COMMON_SRCS
|
2010-05-14 00:01:50 +08:00
|
|
|
${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_copy.c
|
|
|
|
${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_filters.c
|
|
|
|
${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_opttable.c
|
|
|
|
${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_parse.c
|
|
|
|
${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_refs.c
|
|
|
|
${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_verify.c
|
|
|
|
${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack.c
|
|
|
|
)
|
2010-09-01 04:15:13 +08:00
|
|
|
|
2014-03-12 05:14:57 +08:00
|
|
|
add_executable (h5repack ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_main.c)
|
2015-08-05 23:56:58 +08:00
|
|
|
TARGET_NAMING (h5repack STATIC)
|
|
|
|
TARGET_C_PROPERTIES (h5repack STATIC " " " ")
|
2014-09-04 03:04:18 +08:00
|
|
|
target_link_libraries (h5repack ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
|
2014-03-12 05:14:57 +08:00
|
|
|
set_target_properties (h5repack PROPERTIES FOLDER tools)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
2014-03-12 05:14:57 +08:00
|
|
|
set (H5_DEP_EXECUTABLES h5repack)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
2014-03-12 05:14:57 +08:00
|
|
|
if (BUILD_TESTING)
|
2010-08-26 06:33:59 +08:00
|
|
|
# --------------------------------------------------------------------
|
|
|
|
# Add h5Repack test executables
|
|
|
|
# --------------------------------------------------------------------
|
2014-03-12 05:14:57 +08:00
|
|
|
add_executable (testh5repack_detect_szip ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testh5repack_detect_szip.c)
|
2015-08-05 23:56:58 +08:00
|
|
|
TARGET_NAMING (testh5repack_detect_szip STATIC)
|
|
|
|
TARGET_C_PROPERTIES (testh5repack_detect_szip STATIC " " " ")
|
2014-03-12 05:14:57 +08:00
|
|
|
target_link_libraries (testh5repack_detect_szip ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
|
|
|
|
set_target_properties (testh5repack_detect_szip PROPERTIES FOLDER tools)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
2014-03-12 05:14:57 +08:00
|
|
|
add_executable (h5repacktest ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repacktst.c)
|
2015-08-05 23:56:58 +08:00
|
|
|
TARGET_NAMING (h5repacktest STATIC)
|
|
|
|
TARGET_C_PROPERTIES (h5repacktest STATIC " " " ")
|
2014-03-12 05:14:57 +08:00
|
|
|
target_link_libraries (h5repacktest ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
|
|
|
|
set_target_properties (h5repacktest PROPERTIES FOLDER tools)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
2013-09-06 23:15:50 +08:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# If plugin library tests can be tested
|
|
|
|
#-----------------------------------------------------------------------------
|
2015-08-05 23:56:58 +08:00
|
|
|
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 (${HDF_EXTRA_C_FLAGS})
|
|
|
|
INCLUDE_DIRECTORIES (${HDF5_SRC_DIR})
|
2013-09-06 23:15:50 +08:00
|
|
|
|
2015-08-05 23:56:58 +08:00
|
|
|
add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_rpk.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_TOOL_PLUGIN_LIB_NAME_RELEASE
|
|
|
|
HDF5_TOOL_PLUGIN_LIB_NAME_DEBUG
|
|
|
|
)
|
2013-09-06 23:15:50 +08:00
|
|
|
|
2015-08-05 23:56:58 +08:00
|
|
|
# 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
|
2013-09-06 23:15:50 +08:00
|
|
|
"$<TARGET_FILE:${HDF5_TOOL_PLUGIN_LIB_TARGET}>"
|
|
|
|
"${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${HDF5_TOOL_PLUGIN_LIB_TARGET}>"
|
2015-08-05 23:56:58 +08:00
|
|
|
)
|
2013-09-06 23:15:50 +08:00
|
|
|
|
2014-03-12 05:14:57 +08:00
|
|
|
include (CMakeTests.cmake)
|
2015-08-05 23:56:58 +08:00
|
|
|
|
2014-03-12 05:14:57 +08:00
|
|
|
endif (BUILD_TESTING)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
2010-08-26 06:33:59 +08:00
|
|
|
##############################################################################
|
|
|
|
##############################################################################
|
|
|
|
### I N S T A L L A T I O N ###
|
|
|
|
##############################################################################
|
|
|
|
##############################################################################
|
|
|
|
|
2014-04-26 05:27:37 +08:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Rules for Installation of tools using make Install target
|
|
|
|
#-----------------------------------------------------------------------------
|
2012-05-25 05:50:06 +08:00
|
|
|
|
2012-08-29 01:39:30 +08:00
|
|
|
#INSTALL_PROGRAM_PDB (h5repack ${HDF5_INSTALL_BIN_DIR} toolsapplications)
|
2012-05-25 05:50:06 +08:00
|
|
|
|
2014-03-12 05:14:57 +08:00
|
|
|
install (
|
2010-05-14 00:01:50 +08:00
|
|
|
TARGETS
|
|
|
|
h5repack
|
2015-07-10 00:56:16 +08:00
|
|
|
RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications
|
2010-05-14 00:01:50 +08:00
|
|
|
)
|