2010-05-14 00:01:50 +08:00
|
|
|
cmake_minimum_required (VERSION 2.8)
|
|
|
|
PROJECT (HDF5_TOOLS_H5JAM)
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Setup include Directories
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib)
|
|
|
|
INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test)
|
|
|
|
|
|
|
|
# --------------------------------------------------------------------
|
2010-08-26 06:33:59 +08:00
|
|
|
# Add the h5jam executables
|
2010-05-14 00:01:50 +08:00
|
|
|
# --------------------------------------------------------------------
|
|
|
|
ADD_EXECUTABLE (h5jam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jam.c)
|
|
|
|
H5_NAMING (h5jam)
|
2010-06-30 04:09:03 +08:00
|
|
|
IF (WIN32)
|
|
|
|
IF (MSVC)
|
|
|
|
IF (NOT BUILD_SHARED_LIBS)
|
|
|
|
SET_TARGET_PROPERTIES (h5jam
|
|
|
|
PROPERTIES
|
|
|
|
LINK_FLAGS "/NODEFAULTLIB:MSVCRT"
|
|
|
|
)
|
|
|
|
ENDIF (NOT BUILD_SHARED_LIBS)
|
|
|
|
ENDIF (MSVC)
|
|
|
|
ENDIF (WIN32)
|
2010-05-14 00:01:50 +08:00
|
|
|
TARGET_LINK_LIBRARIES (h5jam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
|
|
|
|
|
|
|
|
ADD_EXECUTABLE (getub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/getub.c)
|
|
|
|
H5_NAMING (getub)
|
2010-06-30 04:09:03 +08:00
|
|
|
IF (WIN32)
|
|
|
|
IF (MSVC)
|
|
|
|
IF (NOT BUILD_SHARED_LIBS)
|
|
|
|
SET_TARGET_PROPERTIES (getub
|
|
|
|
PROPERTIES
|
|
|
|
LINK_FLAGS "/NODEFAULTLIB:MSVCRT"
|
|
|
|
)
|
|
|
|
ENDIF (NOT BUILD_SHARED_LIBS)
|
|
|
|
ENDIF (MSVC)
|
|
|
|
ENDIF (WIN32)
|
2010-05-14 00:01:50 +08:00
|
|
|
TARGET_LINK_LIBRARIES (getub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
|
|
|
|
|
|
|
|
ADD_EXECUTABLE (tellub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/tellub.c)
|
|
|
|
H5_NAMING (tellub)
|
2010-06-30 04:09:03 +08:00
|
|
|
IF (WIN32)
|
|
|
|
IF (MSVC)
|
|
|
|
IF (NOT BUILD_SHARED_LIBS)
|
|
|
|
SET_TARGET_PROPERTIES (tellub
|
|
|
|
PROPERTIES
|
|
|
|
LINK_FLAGS "/NODEFAULTLIB:MSVCRT"
|
|
|
|
)
|
|
|
|
ENDIF (NOT BUILD_SHARED_LIBS)
|
|
|
|
ENDIF (MSVC)
|
|
|
|
ENDIF (WIN32)
|
2010-05-14 00:01:50 +08:00
|
|
|
TARGET_LINK_LIBRARIES (tellub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
|
|
|
|
|
|
|
|
ADD_EXECUTABLE (h5unjam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5unjam.c)
|
|
|
|
H5_NAMING (h5unjam)
|
2010-06-30 04:09:03 +08:00
|
|
|
IF (WIN32)
|
|
|
|
IF (MSVC)
|
|
|
|
IF (NOT BUILD_SHARED_LIBS)
|
|
|
|
SET_TARGET_PROPERTIES (h5unjam
|
|
|
|
PROPERTIES
|
|
|
|
LINK_FLAGS "/NODEFAULTLIB:MSVCRT"
|
|
|
|
)
|
|
|
|
ENDIF (NOT BUILD_SHARED_LIBS)
|
|
|
|
ENDIF (MSVC)
|
|
|
|
ENDIF (WIN32)
|
2010-05-14 00:01:50 +08:00
|
|
|
TARGET_LINK_LIBRARIES (h5unjam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
|
|
|
|
|
|
|
|
SET (H5_DEP_EXECUTABLES
|
|
|
|
h5jam
|
|
|
|
getub
|
|
|
|
tellub
|
|
|
|
h5unjam
|
|
|
|
)
|
|
|
|
|
2010-08-26 06:33:59 +08:00
|
|
|
##############################################################################
|
|
|
|
##############################################################################
|
|
|
|
### T E S T I N G ###
|
|
|
|
##############################################################################
|
|
|
|
##############################################################################
|
|
|
|
|
2010-05-14 00:01:50 +08:00
|
|
|
IF (BUILD_TESTING)
|
2010-08-26 06:33:59 +08:00
|
|
|
# --------------------------------------------------------------------
|
|
|
|
# Add the h5jam test executables
|
|
|
|
# --------------------------------------------------------------------
|
2010-05-14 00:01:50 +08:00
|
|
|
IF (NOT BUILD_SHARED_LIBS)
|
|
|
|
ADD_EXECUTABLE (h5jamgentest ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jamgentest.c)
|
|
|
|
H5_NAMING (h5jamgentest)
|
2010-06-30 04:09:03 +08:00
|
|
|
IF (WIN32)
|
|
|
|
IF (MSVC)
|
|
|
|
SET_TARGET_PROPERTIES (h5jamgentest
|
|
|
|
PROPERTIES
|
|
|
|
LINK_FLAGS "/NODEFAULTLIB:MSVCRT"
|
|
|
|
)
|
|
|
|
ENDIF (MSVC)
|
|
|
|
ENDIF (WIN32)
|
2010-05-14 00:01:50 +08:00
|
|
|
TARGET_LINK_LIBRARIES (h5jamgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
|
|
|
|
|
|
|
|
#ADD_TEST (NAME h5jamgentest COMMAND $<TARGET_FILE:h5jamgentest>)
|
|
|
|
ENDIF (NOT BUILD_SHARED_LIBS)
|
2010-08-26 06:33:59 +08:00
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
##############################################################################
|
|
|
|
### T H E T E S T S M A C R O S ###
|
|
|
|
##############################################################################
|
|
|
|
##############################################################################
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
##############################################################################
|
|
|
|
### T H E T E S T S ###
|
|
|
|
##############################################################################
|
|
|
|
##############################################################################
|
|
|
|
|
2010-05-14 00:01:50 +08:00
|
|
|
ENDIF (BUILD_TESTING)
|
|
|
|
|
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
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Rules for Installation of tools using make Install target
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
INSTALL (
|
|
|
|
TARGETS
|
|
|
|
h5jam h5unjam
|
|
|
|
RUNTIME DESTINATION
|
|
|
|
bin/tools
|
2010-05-20 04:11:00 +08:00
|
|
|
COMPONENT
|
|
|
|
toolsapplications
|
2010-05-14 00:01:50 +08:00
|
|
|
)
|