-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
245 lines (222 loc) · 10.8 KB
/
CMakeLists.txt
File metadata and controls
245 lines (222 loc) · 10.8 KB
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
cmake_minimum_required(VERSION 2.8)
project(ccframework)
# The version number.
set (ccframework_VERSION_MAJOR 0)
set (ccframework_VERSION_MINOR 2)
set (ccframework_VERSION_PATCH 3)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ")
set(ac_cv_cxx_hash_map "<tr1/unordered_map>")
set(ac_cv_cxx_hash_set "<tr1/unordered_set>")
set(ac_cv_cxx_hash_set_class "std::tr1::unordered_set")
set(ac_cv_cxx_hash_map_class "std::tr1::unordered_map")
set(ac_cv_have_stdint_h "1")
set(ac_cv_have_inttypes_h "1")
set(ac_have_attribute_weak "1")
set(ac_google_attribute "1")
set(ac_cv_uint64 "u_int64_t")
set(ac_google_namespace "::ctemplate")
set(ac_google_start_namespace "namespace ctemplate {")
set(ac_cv_cxx_hash_map_class "std::tr1::unordered_map")
set(PC_FILE ${CMAKE_BINARY_DIR}/src/ccframework.pc)
add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
CONFIGURE_FILE(src/include/ccframework/ctemplate/config.h.in src/include/ccframework/ctemplate/config.h)
CONFIGURE_FILE(src/include/ccframework/ctemplate/template.h.in src/include/ccframework/ctemplate/template.h)
CONFIGURE_FILE(src/include/ccframework/ctemplate/find_ptr.h.in src/include/ccframework/ctemplate/find_ptr.h)
CONFIGURE_FILE(src/include/ccframework/ctemplate/per_expand_data.h.in src/include/ccframework/ctemplate/per_expand_data.h)
CONFIGURE_FILE(src/include/ccframework/ctemplate/str_ref.h.in src/include/ccframework/ctemplate/str_ref.h)
CONFIGURE_FILE(src/include/ccframework/ctemplate/template_annotator.h.in src/include/ccframework/ctemplate/template_annotator.h)
CONFIGURE_FILE(src/include/ccframework/ctemplate/template_cache.h.in src/include/ccframework/ctemplate/template_cache.h)
CONFIGURE_FILE(src/include/ccframework/ctemplate/template_dictionary.h.in src/include/ccframework/ctemplate/template_dictionary.h)
CONFIGURE_FILE(src/include/ccframework/ctemplate/template_dictionary_interface.h.in src/include/ccframework/ctemplate/template_dictionary_interface.h)
CONFIGURE_FILE(src/include/ccframework/ctemplate/template_emitter.h.in src/include/ccframework/ctemplate/template_emitter.h)
CONFIGURE_FILE(src/include/ccframework/ctemplate/template_enums.h.in src/include/ccframework/ctemplate/template_enums.h)
CONFIGURE_FILE(src/include/ccframework/ctemplate/template_modifiers.h.in src/include/ccframework/ctemplate/template_modifiers.h)
CONFIGURE_FILE(src/include/ccframework/ctemplate/template_namelist.h.in src/include/ccframework/ctemplate/template_namelist.h)
CONFIGURE_FILE(src/include/ccframework/ctemplate/template_pathops.h.in src/include/ccframework/ctemplate/template_pathops.h)
CONFIGURE_FILE(src/include/ccframework/ctemplate/template_string.h.in src/include/ccframework/ctemplate/template_string.h)
CONFIGURE_FILE(src/ccframework.pc.in ${PC_FILE} @ONLY)
set(HEADER_FILES
src/include/ccframework/ctemplate/find_ptr.h
src/include/ccframework/ctemplate/per_expand_data.h
src/include/ccframework/ctemplate/str_ref.h
src/include/ccframework/ctemplate/template.h
src/include/ccframework/ctemplate/template_annotator.h
src/include/ccframework/ctemplate/template_cache.h
src/include/ccframework/ctemplate/template_dictionary.h
src/include/ccframework/ctemplate/template_dictionary_interface.h
src/include/ccframework/ctemplate/template_emitter.h
src/include/ccframework/ctemplate/template_enums.h
src/include/ccframework/ctemplate/template_modifiers.h
src/include/ccframework/ctemplate/template_namelist.h
src/include/ccframework/ctemplate/template_pathops.h
src/include/ccframework/ctemplate/template_string.h
src/include/ccframework/ccAcl.h
src/include/ccframework/ccApp.h
src/include/ccframework/ccBaseForm.h
src/include/ccframework/ccBaseFormElement.h
src/include/ccframework/ccBaseHelper.h
src/include/ccframework/ccClassDeclarations.h
src/include/ccframework/ccCommon.h
src/include/ccframework/ccComponentHelper.h
src/include/ccframework/ccConfig.h
src/include/ccframework/ccConfigLoader.h
src/include/ccframework/ccController.h
src/include/ccframework/ccCookie.h
src/include/ccframework/ccEvent.h
src/include/ccframework/ccEventDispatcher.h
src/include/ccframework/ccException.h
src/include/ccframework/ccFormElementFormStart.h
src/include/ccframework/ccFormElementLabel.h
src/include/ccframework/ccFormElementText.h
src/include/ccframework/ccFramework.h
src/include/ccframework/ccMemorySessionProvider.h
src/include/ccframework/ccMultipartParser.h
src/include/ccframework/ccPregRoute.h
src/include/ccframework/ccQueryParser.h
src/include/ccframework/ccRequest.h
src/include/ccframework/ccResource.h
src/include/ccframework/ccResponse.h
src/include/ccframework/ccRole.h
src/include/ccframework/ccRoute.h
src/include/ccframework/ccRouter.h
src/include/ccframework/ccSession.h
src/include/ccframework/ccSessionProvider.h
src/include/ccframework/ccStaticRoute.h
src/include/ccframework/ccTemplateResponse.h
src/include/ccframework/ccYamlSessionProvider.h
)
set(SOURCE_FILES
src/ccframework/acl/ccAcl.cc
src/ccframework/acl/ccResource.cc
src/ccframework/acl/ccRole.cc
src/ccframework/config/ccConfig.cc
src/ccframework/config/ccConfigLoader.cc
src/ccframework/events/ccEvent.cc
src/ccframework/events/ccEventDispatcher.cc
src/ccframework/form/element/ccBaseFormElement.cc
src/ccframework/form/ccBaseForm.cc
src/ccframework/helpers/ccBaseHelper.cc
src/ccframework/helpers/ccComponentHelper.cc
src/ccframework/parsers/ccMultipartParser.cc
src/ccframework/parsers/ccQueryParser.cc
src/ccframework/response/ccResponse.cc
src/ccframework/response/ccTemplateResponse.cc
src/ccframework/router/ccPregRoute.cc
src/ccframework/router/ccRoute.cc
src/ccframework/router/ccRouter.cc
src/ccframework/router/ccStaticRoute.cc
src/ccframework/session/ccMemorySessionProvider.cc
src/ccframework/session/ccSession.cc
src/ccframework/session/ccSessionProvider.cc
src/ccframework/session/ccYamlSessionProvider.cc
src/ccframework/ccApp.cc
src/ccframework/ccCommon.cc
src/ccframework/ccController.cc
src/ccframework/ccCookie.cc
src/ccframework/ccException.cc
src/ccframework/ccRequest.cc
src/vendor/ctemplate/base/arena-inl.h
src/vendor/ctemplate/base/arena.cc
src/vendor/ctemplate/base/arena.h
src/vendor/ctemplate/base/fileutil.h
src/vendor/ctemplate/base/macros.h
src/vendor/ctemplate/base/manual_constructor.h
src/vendor/ctemplate/base/mutex.h
src/vendor/ctemplate/base/small_map.h
src/vendor/ctemplate/base/thread_annotations.h
src/vendor/ctemplate/base/util.h
src/vendor/ctemplate/htmlparser/htmlparser.cc
src/vendor/ctemplate/htmlparser/htmlparser.h
src/vendor/ctemplate/htmlparser/htmlparser_cpp.h
src/vendor/ctemplate/htmlparser/htmlparser_fsm.h
src/vendor/ctemplate/htmlparser/jsparser.cc
src/vendor/ctemplate/htmlparser/jsparser.h
src/vendor/ctemplate/htmlparser/jsparser_fsm.h
src/vendor/ctemplate/htmlparser/statemachine.cc
src/vendor/ctemplate/htmlparser/statemachine.h
src/vendor/ctemplate/diff_tpl_auto_escape.cc
src/vendor/ctemplate/indented_writer.h
src/vendor/ctemplate/make_tpl_varnames_h.cc
src/vendor/ctemplate/per_expand_data.cc
src/vendor/ctemplate/template.cc
src/vendor/ctemplate/template_annotator.cc
src/vendor/ctemplate/template_cache.cc
src/vendor/ctemplate/template_dictionary.cc
src/vendor/ctemplate/template_modifiers.cc
src/vendor/ctemplate/template_modifiers_internal.h
src/vendor/ctemplate/template_namelist.cc
src/vendor/ctemplate/template_pathops.cc
src/vendor/ctemplate/template_string.cc
src/vendor/md5/md5.cc
src/vendor/md5/md5.h)
set(FROM_TEST_SOURCE_FILES
src/test/form_test.cc)
set(ROUTER_TEST_SOURCE_FILES
src/test/router_test.cc)
set(REQUEST_TEST_SOURCE_FILES
src/test/request_test.cc)
find_package(Fcgi)
find_package(Threads REQUIRED)
find_package(Boost)
find_package(PCRE)
find_package(YamlCpp)
include_directories(src/include/ccframework)
include_directories(src/include/ccframework/ctemplate)
include_directories(src/vendor/ctemplate)
include_directories(${PCRE_INCLUDE_DIRS})
include_directories(${YAMLCPP_INCLUDE_DIRS})
add_library(ccframework ${SOURCE_FILES} src/ccframework/server/ccPreforkServer.cc src/include/ccframework/ccHttpCodes.h)
add_executable(router-test ${ROUTER_TEST_SOURCE_FILES})
add_executable(form-test ${FROM_TEST_SOURCE_FILES})
add_executable(request-test ${REQUEST_TEST_SOURCE_FILES})
target_link_libraries(router-test ccframework
${FCGI_LIBRARY}
${FCGICC_LIBRARY}
${CMAKE_THREAD_LIBS_INIT}
${YAMLCPP_LIBRARY}
${PCRE_LIBRARY})
target_link_libraries(form-test ccframework
${FCGI_LIBRARY}
${FCGICC_LIBRARY}
${CMAKE_THREAD_LIBS_INIT}
${YAMLCPP_LIBRARY}
${PCRE_LIBRARY})
target_link_libraries(request-test ccframework
${FCGI_LIBRARY}
${FCGICC_LIBRARY}
${CMAKE_THREAD_LIBS_INIT}
${YAMLCPP_LIBRARY}
${PCRE_LIBRARY})
install(TARGETS ccframework DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
install(DIRECTORY ${PROJECT_SOURCE_DIR}/src/include DESTINATION ${CMAKE_INSTALL_PREFIX} FILES_MATCHING PATTERN "*")
install(FILES ${PC_FILE} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)
# build a CPack driven installer package
include (InstallRequiredSystemLibraries)
set(CPACK_RESOURCE_FILE_LICENSE
"${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
set(CPACK_PACKAGE_VERSION_MAJOR "${ccframework_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${ccframework_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${ccframework_VERSION_PATCH}")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Piotr Hałas <halaspiotr@gmail.com>") #required
set(CPACK_GENERATOR "DEB")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libyaml-cpp0.5, libpcre3, libboost-dev, libfcgi")
set(CPACK_SOURCE_GENERATOR "TGZ")
set(CPACK_SOURCE_PACKAGE_FILE_NAME
"${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
set(CPACK_SOURCE_IGNORE_FILES "/_CPack_Packages/;/CMakeFiles/;/.git/;/.osc/;~$;${CPACK_SOURCE_IGNORE_FILES}")
list(APPEND CPACK_SOURCE_IGNORE_FILES ".gitignore")
list(APPEND CPACK_SOURCE_IGNORE_FILES ".tar.gz")
list(APPEND CPACK_SOURCE_IGNORE_FILES ".fcgi")
list(APPEND CPACK_SOURCE_IGNORE_FILES "ccframework.pc$")
list(APPEND CPACK_SOURCE_IGNORE_FILES "libccframework.a")
list(APPEND CPACK_SOURCE_IGNORE_FILES "router-test")
list(APPEND CPACK_SOURCE_IGNORE_FILES "form-test")
list(APPEND CPACK_SOURCE_IGNORE_FILES "request-test")
list(APPEND CPACK_SOURCE_IGNORE_FILES "Makefile")
list(APPEND CPACK_SOURCE_IGNORE_FILES "install_manifest.txt")
list(APPEND CPACK_SOURCE_IGNORE_FILES "CPackSourceConfig.cmake")
list(APPEND CPACK_SOURCE_IGNORE_FILES "CPackConfig.cmake")
list(APPEND CPACK_SOURCE_IGNORE_FILES "cmake_install.cmake")
list(APPEND CPACK_SOURCE_IGNORE_FILES "CMakeCache.txt")
include (CPack)