2018-03-10 02:31:58 +08:00
|
|
|
cmake_minimum_required (VERSION 3.10)
|
2010-05-14 00:01:50 +08:00
|
|
|
PROJECT (HDF5_TOOLS_LIB)
|
|
|
|
|
2012-09-19 06:08:07 +08:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Apply Definitions to compiler in this directory and below
|
|
|
|
#-----------------------------------------------------------------------------
|
2014-05-15 03:50:28 +08:00
|
|
|
add_definitions (${HDF_EXTRA_C_FLAGS})
|
2012-09-19 06:08:07 +08:00
|
|
|
|
2010-05-14 00:01:50 +08:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Define Sources
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
|
2016-05-04 23:06:05 +08:00
|
|
|
set (H5_TOOLS_LIB_SOURCES
|
2010-08-07 01:53:52 +08:00
|
|
|
${HDF5_TOOLS_LIB_SOURCE_DIR}/h5diff.c
|
|
|
|
${HDF5_TOOLS_LIB_SOURCE_DIR}/h5diff_array.c
|
|
|
|
${HDF5_TOOLS_LIB_SOURCE_DIR}/h5diff_attr.c
|
|
|
|
${HDF5_TOOLS_LIB_SOURCE_DIR}/h5diff_dset.c
|
|
|
|
${HDF5_TOOLS_LIB_SOURCE_DIR}/h5diff_util.c
|
|
|
|
${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools.c
|
2012-02-18 05:41:58 +08:00
|
|
|
${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools_dump.c
|
2010-08-07 01:53:52 +08:00
|
|
|
${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools_filters.c
|
|
|
|
${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools_ref.c
|
|
|
|
${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools_str.c
|
|
|
|
${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools_type.c
|
|
|
|
${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools_utils.c
|
|
|
|
${HDF5_TOOLS_LIB_SOURCE_DIR}/h5trav.c
|
2015-01-06 05:52:26 +08:00
|
|
|
${HDF5_TOOLS_LIB_SOURCE_DIR}/io_timer.c
|
2010-05-14 00:01:50 +08:00
|
|
|
)
|
|
|
|
|
2014-03-12 05:14:57 +08:00
|
|
|
set (H5_TOOLS_LIB_HDRS
|
2010-08-07 01:53:52 +08:00
|
|
|
${HDF5_TOOLS_LIB_SOURCE_DIR}/h5trav.h
|
|
|
|
${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools.h
|
2012-02-18 05:41:58 +08:00
|
|
|
${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools_dump.h
|
2010-08-07 01:53:52 +08:00
|
|
|
${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools_utils.h
|
|
|
|
${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools_str.h
|
|
|
|
${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools_ref.h
|
|
|
|
${HDF5_TOOLS_LIB_SOURCE_DIR}/h5diff.h
|
2010-05-14 00:01:50 +08:00
|
|
|
)
|
|
|
|
|
2016-05-04 23:06:05 +08:00
|
|
|
add_library (${HDF5_TOOLS_LIB_TARGET} STATIC ${H5_TOOLS_LIB_SOURCES} ${H5_TOOLS_LIB_HDRS})
|
2018-04-18 04:57:51 +08:00
|
|
|
target_include_directories(${HDF5_TOOLS_LIB_TARGET} INTERFACE "${HDF5_TOOLS_LIB_SOURCE_DIR}")
|
|
|
|
set_property(TARGET ${HDF5_TOOLS_LIB_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}")
|
2015-08-05 23:56:58 +08:00
|
|
|
TARGET_C_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} STATIC " " " ")
|
2017-12-21 07:00:24 +08:00
|
|
|
target_link_libraries (${HDF5_TOOLS_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET})
|
|
|
|
if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND)
|
|
|
|
target_link_libraries (${HDF5_TOOLS_LIB_TARGET} PRIVATE ${MPI_C_LIBRARIES})
|
|
|
|
endif ()
|
2014-03-12 05:14:57 +08:00
|
|
|
set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIB_TARGET}")
|
2018-04-10 21:55:17 +08:00
|
|
|
H5_SET_LIB_OPTIONS (${HDF5_TOOLS_LIB_TARGET} ${HDF5_TOOLS_LIB_NAME} STATIC 0)
|
2016-03-01 05:24:31 +08:00
|
|
|
set_target_properties (${HDF5_TOOLS_LIB_TARGET} PROPERTIES
|
2014-03-26 02:25:53 +08:00
|
|
|
FOLDER libraries/tools
|
|
|
|
INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
|
|
|
|
)
|
2015-08-05 23:56:58 +08:00
|
|
|
#set_property (TARGET ${HDF5_TOOLS_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS H5DIFF_DEBUG)
|
|
|
|
set (install_targets ${HDF5_TOOLS_LIB_TARGET})
|
|
|
|
|
|
|
|
if (BUILD_SHARED_LIBS)
|
2016-05-04 23:06:05 +08:00
|
|
|
add_library (${HDF5_TOOLS_LIBSH_TARGET} SHARED ${H5_TOOLS_LIB_SOURCES} ${H5_TOOLS_LIB_HDRS})
|
2018-04-18 04:57:51 +08:00
|
|
|
target_include_directories(${HDF5_TOOLS_LIBSH_TARGET} INTERFACE "${HDF5_TOOLS_LIB_SOURCE_DIR}")
|
|
|
|
set_property(TARGET ${HDF5_TOOLS_LIBSH_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}")
|
2015-08-05 23:56:58 +08:00
|
|
|
TARGET_C_PROPERTIES (${HDF5_TOOLS_LIBSH_TARGET} SHARED " " " ")
|
2017-12-21 07:00:24 +08:00
|
|
|
target_link_libraries (${HDF5_TOOLS_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET})
|
|
|
|
if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND)
|
|
|
|
target_link_libraries (${HDF5_TOOLS_LIBSH_TARGET} PRIVATE ${MPI_C_LIBRARIES})
|
|
|
|
endif ()
|
2015-08-05 23:56:58 +08:00
|
|
|
set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIBSH_TARGET}")
|
2018-04-10 21:55:17 +08:00
|
|
|
H5_SET_LIB_OPTIONS (${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TOOLS_LIB_NAME} SHARED "TOOLS")
|
2016-03-01 05:24:31 +08:00
|
|
|
set_target_properties (${HDF5_TOOLS_LIBSH_TARGET} PROPERTIES
|
2015-08-05 23:56:58 +08:00
|
|
|
FOLDER libraries/tools
|
|
|
|
COMPILE_DEFINITIONS "H5_BUILT_AS_DYNAMIC_LIB"
|
|
|
|
INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
|
|
|
|
INTERFACE_COMPILE_DEFINITIONS H5_BUILT_AS_DYNAMIC_LIB=1
|
|
|
|
)
|
|
|
|
#set_property (TARGET ${HDF5_TOOLS_LIBSH_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS H5DIFF_DEBUG)
|
|
|
|
set (install_targets ${install_targets} ${HDF5_TOOLS_LIBSH_TARGET})
|
2017-01-11 07:09:53 +08:00
|
|
|
endif ()
|
2011-10-25 14:59:10 +08:00
|
|
|
|
2010-08-26 06:33:59 +08:00
|
|
|
##############################################################################
|
|
|
|
##############################################################################
|
|
|
|
### I N S T A L L A T I O N ###
|
|
|
|
##############################################################################
|
|
|
|
##############################################################################
|
|
|
|
|
2010-05-14 00:01:50 +08:00
|
|
|
#-----------------------------------------------------------------------------
|
2015-07-10 00:56:16 +08:00
|
|
|
# Add file(s) to CMake Install
|
2010-05-14 00:01:50 +08:00
|
|
|
#-----------------------------------------------------------------------------
|
2014-03-12 05:14:57 +08:00
|
|
|
install (
|
2010-05-14 00:01:50 +08:00
|
|
|
FILES
|
|
|
|
${H5_TOOLS_LIB_HDRS}
|
|
|
|
DESTINATION
|
2011-08-02 03:37:34 +08:00
|
|
|
${HDF5_INSTALL_INCLUDE_DIR}
|
2010-05-20 04:11:00 +08:00
|
|
|
COMPONENT
|
|
|
|
toolsheaders
|
2010-05-14 00:01:50 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Add Target(s) to CMake Install for import into other projects
|
|
|
|
#-----------------------------------------------------------------------------
|
2014-03-12 05:14:57 +08:00
|
|
|
if (HDF5_EXPORTED_TARGETS)
|
|
|
|
if (BUILD_SHARED_LIBS)
|
2015-08-05 23:56:58 +08:00
|
|
|
INSTALL_TARGET_PDB (${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} toolslibraries)
|
2017-01-11 07:09:53 +08:00
|
|
|
endif ()
|
2017-02-04 02:41:30 +08:00
|
|
|
INSTALL_TARGET_PDB (${HDF5_TOOLS_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} toolslibraries)
|
2015-07-10 00:56:16 +08:00
|
|
|
|
2014-03-12 05:14:57 +08:00
|
|
|
install (
|
2010-05-14 00:01:50 +08:00
|
|
|
TARGETS
|
2015-08-05 23:56:58 +08:00
|
|
|
${install_targets}
|
2010-05-14 00:01:50 +08:00
|
|
|
EXPORT
|
|
|
|
${HDF5_EXPORTED_TARGETS}
|
2011-08-02 03:37:34 +08:00
|
|
|
LIBRARY DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT toolslibraries
|
|
|
|
ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT toolslibraries
|
|
|
|
RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolslibraries
|
2015-07-10 00:56:16 +08:00
|
|
|
FRAMEWORK DESTINATION ${HDF5_INSTALL_FWRK_DIR} COMPONENT toolslibraries
|
2016-10-15 00:22:22 +08:00
|
|
|
INCLUDES DESTINATION include
|
2010-05-14 00:01:50 +08:00
|
|
|
)
|
2017-01-11 07:09:53 +08:00
|
|
|
endif ()
|