File: CMakeLists.txt

package info (click to toggle)
biosig4c++ 1.9.3-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 6,220 kB
  • sloc: ansic: 41,218; cpp: 8,946; sh: 4,365; makefile: 1,758; python: 87; awk: 73; php: 40; perl: 36; java: 14; ruby: 7
file content (164 lines) | stat: -rw-r--r-- 4,381 bytes parent folder | download
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
cmake_minimum_required (VERSION 2.6)
project (libbiosig)

option (USE_ZLIB "Add support for compressed files." OFF)
option (USE_SUITESPARSE "Add support for automatic re-referencing." OFF)

# Version number
set (libbiosig_VERSION_MAJOR 1)
set (libbiosig_VERSION_MINOR 8)
set (libbiosig_VERSION_PATCH 4)

find_program (GAWK NAMES gawk)

add_custom_target (eventcodes
  COMMAND ${GAWK} -f eventcodes.awk extern/eventcodes.txt
  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
  DEPENDS eventcodes.awk extern/eventcodes.txt
)

add_custom_target (units
  COMMAND ${GAWK} -f units.awk extern/units.csv > "units.i"
  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
  DEPENDS units.awk extern/units.csv
)

add_custom_target (annexb
  COMMAND ${GAWK} -f annotatedECG.awk extern/11073-10102-AnnexB.txt > "11073-10102-AnnexB.i"
  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
  DEPENDS annotatedECG.awk extern/11073-10102-AnnexB.txt
)

set (headers
  t210/abfheadr.h
  XMLParser/tinyxml.h
  XMLParser/tinystr.h
  biosig.h
  gdftime.h
  physicalunits.h
)

set (sources
  t210/sopen_abf_read.c
  t210/sopen_alpha_read.c
  t210/sopen_axg_read.c
  t210/sopen_cfs_read.c
  t210/sopen_heka_read.c
  t210/sopen_igor.c
  t210/sopen_scp_read.c
  t210/scp-decode.cpp
  t220/crc4scp.c
  t220/sopen_scp_write.c
  t230/sopen_hl7aecg.cpp
  test0/sandbox.c
  XMLParser/tinystr.cpp
  XMLParser/tinyxml.cpp
  XMLParser/tinyxmlerror.cpp
  XMLParser/tinyxmlparser.cpp
  biosig.c
  gdftime.c
  mdc_ecg_codes.c
  physicalunits.c
)

if (WIN32)
  list (APPEND sources
    win32/getdelim.c
    win32/getline.c
    win32/getlogin.c
  )
endif ()

if (APPLE)
  list (APPEND sources
    win32/getdelim.c
    win32/getline.c
  )
endif ()

# Cannot have same name for static and shared library, 
# so we'll correct that later on
add_library (biosigstatic STATIC
  ${headers}
  ${sources}
)
set_target_properties(biosigstatic PROPERTIES OUTPUT_NAME biosig)

add_library (biosig2static STATIC
  ${headers}
  biosig2.h
  biosig-dev.h
  ${sources}
  biosig2.c
)
set_target_properties(biosig2static PROPERTIES OUTPUT_NAME biosig2)

add_library (biosigshared SHARED
  ${headers}
  ${sources}
)
set_target_properties(biosigshared PROPERTIES OUTPUT_NAME biosig)
if (APPLE)
  set_target_properties(biosigshared PROPERTIES
     INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib"
     )
endif ()

add_library (biosig2shared SHARED
  ${headers}
  biosig2.h
  biosig-dev.h
  ${sources}
  biosig2.c
)
set_target_properties(biosig2shared PROPERTIES OUTPUT_NAME biosig2)
if (APPLE)
  set_target_properties(biosigshared PROPERTIES
     INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib"
     )
endif ()

add_dependencies (biosigstatic eventcodes units annexb)
add_dependencies (biosigshared eventcodes units annexb)
add_dependencies (biosig2static eventcodes units annexb)
add_dependencies (biosig2shared eventcodes units annexb)

FIND_LIBRARY( ICONV_LIBRARY NAMES iconv )
MARK_AS_ADVANCED( ICONV_LIBRARY )
target_link_libraries( biosigstatic ${ICONV_LIBRARY} )
target_link_libraries( biosigshared ${ICONV_LIBRARY} )
target_link_libraries( biosig2static ${ICONV_LIBRARY} )
target_link_libraries( biosig2shared ${ICONV_LIBRARY} )

if (USE_ZLIB)
  add_definitions (-D=WITH_ZLIB)
  find_package( ZLIB REQUIRED )
    if ( ZLIB_FOUND )
      include_directories( ${ZLIB_INCLUDE_DIRS} )
      target_link_libraries( biosigstatic ${ZLIB_LIBRARIES} )
      target_link_libraries( biosigshared ${ZLIB_LIBRARIES} )
      target_link_libraries( biosig2static ${ZLIB_LIBRARIES} )
      target_link_libraries( biosig2shared ${ZLIB_LIBRARIES} )
    endif( ZLIB_FOUND )
endif ()

if (USE_SUITESPARSE)
  add_definitions (-D=WITH_CHOLMOD)
  FIND_LIBRARY( CHOLMOD_LIBRARY NAMES cholmod )
  MARK_AS_ADVANCED( CHOLMOD_LIBRARY )
  target_link_libraries( biosigstatic ${CHOLMOD_LIBRARY} )
  target_link_libraries( biosigshared ${CHOLMOD_LIBRARY} )
  target_link_libraries( biosig2static ${CHOLMOD_LIBRARY} )
  target_link_libraries( biosig2shared ${CHOLMOD_LIBRARY} )
endif ()

add_definitions (-D=WITHOUT_NETWORK)

install (TARGETS biosigstatic DESTINATION lib)
install (TARGETS biosigshared DESTINATION lib)
install (TARGETS biosig2static DESTINATION lib)
install (TARGETS biosig2shared DESTINATION lib)
install (FILES  biosig.h DESTINATION include)
install (FILES  biosig2.h DESTINATION include)
install (FILES  biosig-dev.h DESTINATION include)
install (FILES  gdftime.h DESTINATION include)