Print this page
| Split |
Close |
| Expand all |
| Collapse all |
--- old/CMakeLists.txt
+++ new/CMakeLists.txt
1 1 #
2 2 # Copyright (c) 2011-2020 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
3 3 #
4 4 # Permission is hereby granted, free of charge, to any person obtaining a copy
5 5 # of this software and associated documentation files (the "Software"), to deal
6 6 # in the Software without restriction, including without limitation the rights
7 7 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 8 # copies of the Software, and to permit persons to whom the Software is
9 9 # furnished to do so, subject to the following conditions:
10 10 #
11 11 # The above copyright notice and this permission notice shall be included in
12 12 # all copies or substantial portions of the Software.
13 13 #
14 14 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 15 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 16 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 17 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 18 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 19 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 20 # SOFTWARE.
21 21 #
22 22
23 23 cmake_minimum_required(VERSION 2.8.12.2)
24 24 project(blahgd)
25 25
26 26 enable_testing()
27 27
28 28 include(cmake/64-bit.cmake)
29 29 include(config.cmake)
30 30
31 31 add_definitions(
32 32 -D__EXTENSIONS__
33 33 -D_REENTRANT
34 34 )
35 35
36 36 add_compile_options(
37 37 -Wall
38 38 -O2
39 39 -g
40 40 -std=gnu99
41 41 -fno-omit-frame-pointer
42 42 $<$<C_COMPILER_ID:gcc>:-fno-inline-small-functions>
43 43 $<$<C_COMPILER_ID:gcc>:-fno-inline-functions-called-once>
44 44 )
45 45
46 46 find_package(BISON)
47 47 find_package(FLEX)
48 48
49 49 BISON_TARGET(fmt3 post_fmt3.y post_fmt3.tab.c COMPILE_FLAGS "-p fmt3_")
50 50 FLEX_TARGET(fmt3 post_fmt3.l post_fmt3.lex.c COMPILE_FLAGS "-P fmt3_")
51 51 ADD_FLEX_BISON_DEPENDENCY(fmt3 fmt3)
52 52
53 53 BISON_TARGET(tmpl template.y template.tab.c COMPILE_FLAGS "-p tmpl_")
54 54 FLEX_TARGET(tmpl template.l template.lex.c COMPILE_FLAGS "-P tmpl_")
55 55 ADD_FLEX_BISON_DEPENDENCY(tmpl tmpl)
56 56
57 57 include_directories(
58 58 ${JEFFPC_INCLUDE_DIR}
59 59 )
60 60
61 61 add_custom_target(revisiontag ALL)
62 62
63 63 add_custom_command(TARGET revisiontag
64 64 COMMAND ${CMAKE_COMMAND}
65 65 -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}
66 66 -DBINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}
67 67 -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/hg.cmake
68 68 )
69 69
70 70 add_library(blahg
71 71 version.c
72 72
73 73 # post - all formats
|
↓ open down ↓ |
73 lines elided |
↑ open up ↑ |
74 74 post.c
75 75 post_index.c
76 76 post_nv.c
77 77
78 78 # post - format 3
79 79 ${FLEX_fmt3_OUTPUTS} ${BISON_fmt3_OUTPUTS}
80 80 post_fmt3_cmds.c
81 81 listing.c
82 82 mangle.c
83 83
84 + # post - format 4
85 + # XXX KEBE ASKS -- any clever way to pin an external library?
86 + post_fmt4.c
87 +
84 88 # templates
85 89 ${FLEX_tmpl_OUTPUTS} ${BISON_tmpl_OUTPUTS}
86 90 render.c
87 91 pipeline.c
88 92
89 93 # nvlist related things
90 94 nvl.c
91 95 vars.c
92 96
93 97 # misc
94 98 config.c
95 99 error.c
96 100 utils.c
97 101 sidebar.c
98 102 )
99 103
100 104 add_dependencies(blahg revisiontag)
101 105
102 106 target_link_libraries(blahg
103 107 m
104 108 ${JEFFPC_LIBRARY}
105 109 )
106 110
107 111 add_executable(blahgd
108 112 daemon.c
109 113
110 114 # request processing
111 115 req.c
112 116
113 117 # pages
114 118 admin.c
115 119 comment.c
116 120 index.c
117 121 story.c
118 122 tag.c
119 123 static.c
120 124 )
121 125
122 126 target_link_libraries(blahgd
123 127 blahg
124 128 pthread
125 129 )
126 130
127 131 add_executable(lisplint
128 132 lisplint.c
129 133 )
130 134
131 135 target_link_libraries(lisplint
132 136 blahg
133 137 )
134 138
135 139 include(GNUInstallDirs)
136 140 install(TARGETS blahgd
137 141 DESTINATION ${CMAKE_INSTALL_SBINDIR}
138 142 PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE
139 143 GROUP_READ GROUP_EXECUTE
140 144 WORLD_READ WORLD_EXECUTE)
141 145 install(TARGETS lisplint
142 146 DESTINATION libexec/blahgd
143 147 PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE
144 148 GROUP_READ GROUP_EXECUTE
145 149 WORLD_READ WORLD_EXECUTE)
146 150
147 151 add_executable(test_fmt3
148 152 test_fmt3.c
149 153 )
150 154
151 155 target_link_libraries(test_fmt3
152 156 blahg
153 157 )
154 158
155 159 function(simple_c_test type section bin data)
156 160 add_test(NAME "${type}:${section}:${data}"
157 161 COMMAND "${CMAKE_BINARY_DIR}/test_${bin}"
158 162 "${CMAKE_CURRENT_SOURCE_DIR}/${data}"
159 163 )
160 164 endfunction()
161 165
162 166 add_subdirectory(tests)
|
↓ open down ↓ |
69 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX