summaryrefslogtreecommitdiffstats
path: root/tools/lib/CMakeLists.txt
blob: e12a7a6723911bf63e5a62fdd28a322f7e501e55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
cmake_minimum_required (VERSION 2.8)
PROJECT (HDF5_TOOLS_LIB)

#-----------------------------------------------------------------------------
# Define Sources
#-----------------------------------------------------------------------------
#INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib)
#INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test)

SET (H5_TOOLS_LIB_SRCS
    ${HDF5_TOOLS_SOURCE_DIR}/lib/h5diff.c
    ${HDF5_TOOLS_SOURCE_DIR}/lib/h5diff_array.c
    ${HDF5_TOOLS_SOURCE_DIR}/lib/h5diff_attr.c
    ${HDF5_TOOLS_SOURCE_DIR}/lib/h5diff_dset.c
    ${HDF5_TOOLS_SOURCE_DIR}/lib/h5diff_util.c
    ${HDF5_TOOLS_SOURCE_DIR}/lib/h5tools.c
    ${HDF5_TOOLS_SOURCE_DIR}/lib/h5tools_filters.c
    ${HDF5_TOOLS_SOURCE_DIR}/lib/h5tools_ref.c
    ${HDF5_TOOLS_SOURCE_DIR}/lib/h5tools_str.c
    ${HDF5_TOOLS_SOURCE_DIR}/lib/h5tools_type.c
    ${HDF5_TOOLS_SOURCE_DIR}/lib/h5tools_utils.c
    ${HDF5_TOOLS_SOURCE_DIR}/lib/h5trav.c
)

SET (H5_TOOLS_LIB_HDRS
    ${HDF5_TOOLS_SOURCE_DIR}/lib/h5trav.h
    ${HDF5_TOOLS_SOURCE_DIR}/lib/h5tools.h
    ${HDF5_TOOLS_SOURCE_DIR}/lib/h5tools_utils.h
    ${HDF5_TOOLS_SOURCE_DIR}/lib/h5tools_str.h
    ${HDF5_TOOLS_SOURCE_DIR}/lib/h5tools_ref.h
    ${HDF5_TOOLS_SOURCE_DIR}/lib/h5diff.h
)

#-- Always build a static library for linking the ${HDF5_LIB_NAME} tools together
ADD_LIBRARY (${HDF5_TOOLS_LIB_TARGET} ${LIB_TYPE} ${H5_TOOLS_LIB_SRCS} ${H5_TOOLS_LIB_HDRS})
TARGET_LINK_LIBRARIES (${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
SET_GLOBAL_VARIABLE( HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIB_TARGET}")
H5_SET_LIB_OPTIONS (
    ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TOOLS_LIB_NAME}
    ${LIB_TYPE}
    HDF5_TOOLS_LIB_NAME_RELEASE
	HDF5_TOOLS_LIB_NAME_DEBUG
)

#-----------------------------------------------------------------------------
# Add file(s) to CMake Install 
#-----------------------------------------------------------------------------
INSTALL (
    FILES
        ${H5_TOOLS_LIB_HDRS}
    DESTINATION
        include/tools
    COMPONENT
        toolsheaders
)

#-----------------------------------------------------------------------------
# Add Target(s) to CMake Install for import into other projects
#-----------------------------------------------------------------------------
IF (HDF5_EXPORTED_TARGETS)
  INSTALL (
      TARGETS
          ${HDF5_TOOLS_LIB_TARGET}
      EXPORT
          ${HDF5_EXPORTED_TARGETS}
      LIBRARY DESTINATION lib/tools COMPONENT toolslibraries
      ARCHIVE DESTINATION lib/tools COMPONENT toolslibraries
      RUNTIME DESTINATION bin/tools COMPONENT toolslibraries
  )
ENDIF (HDF5_EXPORTED_TARGETS)