File: CMakeLists.txt

package info (click to toggle)
edflib 1.19-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 548 kB
  • sloc: ansic: 8,736; makefile: 36; sh: 12
file content (71 lines) | stat: -rw-r--r-- 1,710 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
cmake_minimum_required(VERSION 2.8)
# Author: Mathieu Malaterre / BSD (as upstream)
project(edflib C)

add_definitions(
-D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE
)
add_library(edf SHARED edflib.c)
add_library(edf_static STATIC edflib.c)

set(VERSION_MAJOR 1)
set(VERSION_MINOR 19)
set(VERSION_FULL "${VERSION_MAJOR}.${VERSION_MINOR}")

set(API_VERSION "${VERSION_MAJOR}")
set(LIBRARY_PROPERTIES
  VERSION "${VERSION_FULL}"
  SOVERSION "${API_VERSION}"
  )
set_target_properties(edf
  PROPERTIES
  ${LIBRARY_PROPERTIES}
  )
set_target_properties(edf_static
  PROPERTIES
  ${LIBRARY_PROPERTIES}
  OUTPUT_NAME "edf"
  )

include(CheckSymbolExists)
set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
set(CMAKE_REQUIRED_LIBRARIES -lm)
check_symbol_exists(exp10 "math.h" HAVE_EXP10)

install(FILES edflib.h
  DESTINATION include
  )

if(NOT DEFINED EDFLIB_INSTALL_PATH)
  set(EDFLIB_INSTALL_PATH lib)
endif()
install(TARGETS edf
  LIBRARY DESTINATION ${EDFLIB_INSTALL_PATH}
  )
install(TARGETS edf_static
  LIBRARY DESTINATION ${EDFLIB_INSTALL_PATH}
  )

#
add_executable(test_edflib test_edflib.c)
target_link_libraries(test_edflib edf)

add_executable(sine_generator sine_generator.c)
target_link_libraries(sine_generator edf)

add_executable(test_generator test_generator.c)
target_link_libraries(test_generator edf)

add_executable(sweep_generator sweep_generator.c)
target_link_libraries(sweep_generator edf)
if(HAVE_EXP10)
  target_compile_definitions(sweep_generator PRIVATE expo=exp10)
else()
  target_compile_definitions(sweep_generator PRIVATE expo=__exp10)
endif()

if(UNIX)
  target_link_libraries(sine_generator m)
  target_link_libraries(test_generator m)
  target_link_libraries(sweep_generator m)
endif()