2013-01-15 02:35:30 +08:00
|
|
|
cmake_minimum_required (VERSION 2.8.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
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS})
|
|
|
|
|
2010-05-14 00:01:50 +08:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Define Sources
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
SET (H5_TOOLS_LIB_SRCS
|
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
|
2010-05-14 00:01:50 +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
|
|
|
)
|
|
|
|
|
|
|
|
ADD_LIBRARY (${HDF5_TOOLS_LIB_TARGET} ${LIB_TYPE} ${H5_TOOLS_LIB_SRCS} ${H5_TOOLS_LIB_HDRS})
|
2013-06-11 01:46:48 +08:00
|
|
|
TARGET_C_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} " " " ")
|
2010-05-14 00:01:50 +08:00
|
|
|
TARGET_LINK_LIBRARIES (${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
|
2013-06-11 01:46:48 +08:00
|
|
|
SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIB_TARGET}")
|
2010-05-14 00:01:50 +08:00
|
|
|
H5_SET_LIB_OPTIONS (
|
|
|
|
${HDF5_TOOLS_LIB_TARGET} ${HDF5_TOOLS_LIB_NAME}
|
|
|
|
${LIB_TYPE}
|
|
|
|
HDF5_TOOLS_LIB_NAME_RELEASE
|
2011-08-02 03:37:34 +08:00
|
|
|
HDF5_TOOLS_LIB_NAME_DEBUG
|
2010-05-14 00:01:50 +08:00
|
|
|
)
|
2013-03-15 23:26:14 +08:00
|
|
|
#SET_TARGET_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} PROPERTIES COMPILE_DEFINITIONS H5DIFF_DEBUG)
|
|
|
|
SET_TARGET_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} PROPERTIES FOLDER libraries/tools)
|
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 file(s) to CMake Install
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
INSTALL (
|
|
|
|
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
|
|
|
)
|
|
|
|
|
2010-09-01 04:15:13 +08:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Because tools are installed into bin/tools we need to make sure the hdf5tools
|
|
|
|
# library will be installed into the proper location.
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
IF (APPLE)
|
|
|
|
OPTION (HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF)
|
|
|
|
IF (HDF5_BUILD_WITH_INSTALL_NAME)
|
|
|
|
SET_TARGET_PROPERTIES(${HDF5_TOOLS_LIB_TARGET} PROPERTIES
|
|
|
|
LINK_FLAGS "-current_version ${HDF5_PACKAGE_VERSION} -compatibility_version ${HDF5_PACKAGE_VERSION}"
|
2011-08-09 05:59:09 +08:00
|
|
|
INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib"
|
2010-09-01 04:15:13 +08:00
|
|
|
BUILD_WITH_INSTALL_RPATH ${HDF5_BUILD_WITH_INSTALL_NAME}
|
|
|
|
)
|
|
|
|
ENDIF (HDF5_BUILD_WITH_INSTALL_NAME)
|
|
|
|
ENDIF (APPLE)
|
|
|
|
|
2010-05-14 00:01:50 +08:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Add Target(s) to CMake Install for import into other projects
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
IF (HDF5_EXPORTED_TARGETS)
|
2014-02-04 23:11:36 +08:00
|
|
|
IF (BUILD_SHARED_LIBS)
|
|
|
|
INSTALL_TARGET_PDB (${HDF5_TOOLS_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} toolslibraries)
|
|
|
|
ENDIF (BUILD_SHARED_LIBS)
|
2012-05-25 05:50:06 +08:00
|
|
|
|
2010-05-14 00:01:50 +08:00
|
|
|
INSTALL (
|
|
|
|
TARGETS
|
|
|
|
${HDF5_TOOLS_LIB_TARGET}
|
|
|
|
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
|
2010-05-14 00:01:50 +08:00
|
|
|
)
|
|
|
|
ENDIF (HDF5_EXPORTED_TARGETS)
|