-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
124 lines (86 loc) · 2.24 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
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
cmake_minimum_required (VERSION 2.8)
project (yukkipaste)
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
${CMAKE_SOURCE_DIR}/cmake/Modules
)
add_definitions(-pedantic -Wall -g)
find_package(LibMagic)
configure_file ("${PROJECT_SOURCE_DIR}/src/yukkipaste/config.h.in"
"${PROJECT_BINARY_DIR}/config.h"
)
include_directories(
${PROJECT_BINARY_DIR}
src
)
set(YUKKIPASTE_MODULES_DIR /share/yukkipaste/modules)
add_library(yutils STATIC
src/yutils/yustring.c
src/yutils/yuutf.c
src/yutils/yulog.c
src/yutils/yupointerarray.c
src/yutils/yuarray.c
src/yutils/yuoptions.c
src/yutils/yujson.c
src/yutils/yusoundex.c
src/yutils/yumultipart.c
src/yutils/yurandom.c
src/yutils/yusectconf.c
)
set_target_properties(yutils PROPERTIES COMPILE_FLAGS "-fPIC")
add_executable(${PROJECT_NAME}
src/yukkipaste/main.c
)
target_link_libraries(${PROJECT_NAME}
yutils
dl
${LIBMAGIC_LIBRARIES}
)
install_targets(/bin ${PROJECT_NAME})
add_library(pocoo MODULE
src/yukkipaste-modules/pocoo/module.c
)
target_link_libraries(pocoo
yutils
)
install_targets(${YUKKIPASTE_MODULES_DIR} pocoo)
add_library(codepad MODULE
src/yukkipaste-modules/codepad/module.c
)
target_link_libraries(codepad
yutils
)
install_targets(${YUKKIPASTE_MODULES_DIR} codepad)
add_library(dpaste MODULE
src/yukkipaste-modules/dpaste/module.c
)
target_link_libraries(dpaste
yutils
)
install_targets(${YUKKIPASTE_MODULES_DIR} dpaste)
add_library(pastie MODULE
src/yukkipaste-modules/pastie/module.c
)
target_link_libraries(pastie
yutils
)
install_targets(${YUKKIPASTE_MODULES_DIR} pastie)
file(GLOB headers-api
"${CMAKE_SOURCE_DIR}/src/yukkipaste-api/*.h"
)
file(GLOB headers-utils
"${CMAKE_SOURCE_DIR}/src/yutils/*.h"
)
configure_file(
${CMAKE_SOURCE_DIR}/src/yukkipaste/yukkipaste.pc
${PROJECT_BINARY_DIR}/yukkipaste.pc
@ONLY
)
install_files(/lib/pkgconfig .pc
${PROJECT_BINARY_DIR}/yukkipaste.pc)
install_files(/include/yukkipaste/yukkipaste-api .h
${headers-api})
install_files(/include/yukkipaste/yutils .h
${headers-utils})
install_files(/share/doc/yukkipaste .example
${CMAKE_SOURCE_DIR}/src/yukkipaste/config.example)