2018-03-10 02:31:58 +08:00
|
|
|
cmake_minimum_required (VERSION 3.10)
|
2018-04-20 23:11:55 +08:00
|
|
|
project (HDF5_TOOLS_LIB C)
|
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-27 05:41:04 +08:00
|
|
|
target_include_directories(${HDF5_TOOLS_LIB_TARGET}
|
|
|
|
PRIVATE "${HDF5_TOOLS_LIB_SOURCE_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
|
|
|
|
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
|
|
|
|
)
|
|
|
|
#target_compile_definitions(${HDF5_TOOLS_LIB_TARGET} PRIVATE H5DIFF_DEBUG>)
|
|
|
|
TARGET_C_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} STATIC)
|
|
|
|
target_link_libraries (${HDF5_TOOLS_LIB_TARGET}
|
|
|
|
PUBLIC ${HDF5_LIB_TARGET}
|
2018-07-28 03:58:01 +08:00
|
|
|
PRIVATE "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>"
|
2018-04-27 05:41:04 +08:00
|
|
|
)
|
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)
|
2018-04-27 05:41:04 +08:00
|
|
|
set_target_properties (${HDF5_TOOLS_LIB_TARGET} PROPERTIES FOLDER libraries/tools)
|
2015-08-05 23:56:58 +08:00
|
|
|
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-27 05:41:04 +08:00
|
|
|
target_include_directories(${HDF5_TOOLS_LIBSH_TARGET}
|
|
|
|
PRIVATE "${HDF5_TOOLS_LIB_SOURCE_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
|
|
|
|
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
|
|
|
|
)
|
|
|
|
target_compile_definitions(${HDF5_TOOLS_LIBSH_TARGET}
|
|
|
|
PUBLIC "H5_BUILT_AS_DYNAMIC_LIB"
|
|
|
|
#PRIVATE H5DIFF_DEBUG
|
|
|
|
)
|
|
|
|
TARGET_C_PROPERTIES (${HDF5_TOOLS_LIBSH_TARGET} SHARED)
|
|
|
|
target_link_libraries (${HDF5_TOOLS_LIBSH_TARGET}
|
|
|
|
PUBLIC ${HDF5_LIBSH_TARGET}
|
2018-07-28 03:58:01 +08:00
|
|
|
PRIVATE "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>"
|
2018-04-27 05:41:04 +08:00
|
|
|
)
|
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")
|
2018-04-27 05:41:04 +08:00
|
|
|
set_target_properties (${HDF5_TOOLS_LIBSH_TARGET} PROPERTIES FOLDER libraries/tools)
|
2015-08-05 23:56:58 +08:00
|
|
|
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
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# 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 ()
|