forked from bytebrew/slope
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
77 lines (65 loc) · 1.45 KB
/
CMakeLists.txt
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
PROJECT(slope)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
SET(SLOPE_USE_GTK3 TRUE)
FIND_PACKAGE(PkgConfig REQUIRED)
IF(SLOPE_USE_GTK3 MATCHES "TRUE")
SET(SLOPE_GTK 1)
PKG_CHECK_MODULES(DEP "gtk+-3.0")
ELSE()
SET(SLOPE_GTK 0)
PKG_CHECK_MODULES(DEP "cairo")
ENDIF()
CONFIGURE_FILE (
"${PROJECT_SOURCE_DIR}/config.h.in"
"${PROJECT_BINARY_DIR}/config.h"
)
INCLUDE_DIRECTORIES(
${DEP_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}
)
SET(SLOPE_HDRS
slope/global.h
slope/primitives.h
slope/list.h
slope/figure.h
slope/metrics.h
slope/item.h
slope/xymetrics.h
slope/xyitem.h
slope/xyaxis.h
slope/legend.h
slope/slope.h
)
IF(SLOPE_USE_GTK3 MATCHES "TRUE")
SET(SLOPE_HDRS
${SLOPE_HDRS}
slope/gtk.h
slope/view.h
)
ENDIF()
SET(SLOPE_SRCS
slope/primitives.c
slope/list.c
slope/figure.c
slope/metrics.c
slope/item.c
slope/xymetrics.c
slope/xyitem.c
slope/xyaxis.c
slope/legend.c
slope/slope.c
)
IF(SLOPE_USE_GTK3 MATCHES "TRUE")
SET(SLOPE_SRCS
${SLOPE_SRCS}
slope/gtk.c
slope/view.c
)
ENDIF()
ADD_LIBRARY(slope SHARED ${SLOPE_SRCS})
TARGET_LINK_LIBRARIES(slope ${DEP_LIBRARIES})
ADD_EXECUTABLE(app test.c)
TARGET_LINK_LIBRARIES(app slope -lm)
INSTALL(TARGETS slope DESTINATION /usr/lib)
INSTALL(FILES ${SLOPE_HDRS} DESTINATION /usr/include/slope)
INSTALL(FILES "${PROJECT_BINARY_DIR}/config.h" DESTINATION /usr/include/slope)