]> git.ipfire.org Git - thirdparty/sarg.git/blob - CMakeLists.txt
Store the entry time in a structure instead of a pointer
[thirdparty/sarg.git] / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
2 PROJECT(sarg C)
3 SET(sarg_VERSION 2)
4 SET(sarg_REVISION "4-pre1")
5 SET(sarg_BUILD "")
6 SET(sarg_BUILDDATE "Jul-19-2012")
7
8 INCLUDE(AddFileDependencies)
9 INCLUDE(CheckIncludeFile)
10 INCLUDE(CheckLibraryExists)
11 INCLUDE(CheckFunctionExists)
12 INCLUDE(CheckTypeSize)
13 INCLUDE(CheckSymbolExists)
14 INCLUDE(CheckCCompilerFlag)
15 INCLUDE(CheckStructHasMember)
16
17 DEFINE_PROPERTY(GLOBAL PROPERTY enable-htmldir BRIEF_DOCS "--enable-htmldir=htmldir"
18 FULL_DOCS "Select htmldir as the root of your WWW documents")
19
20 SET(PACKAGE_NAME "sarg")
21 SET(PACKAGE_VERSION "${sarg_VERSION}.${sarg_REVISION}${sarg_BUILD}")
22
23 MACRO(SET_ABS_SOURCE VAR DOC)
24 IF(${VAR} AND NOT ${VAR}_SOURCE)
25 SET(PATH "${${VAR}}")
26 IF(NOT IS_ABSOLUTE ${PATH})
27 SET(PATH "${CMAKE_INSTALL_PREFIX}/${PATH}")
28 ENDIF(NOT IS_ABSOLUTE ${PATH})
29 GET_FILENAME_COMPONENT(SOURCE_PATH "${PATH}" ABSOLUTE)
30 SET(${VAR}_SOURCE "${SOURCE_PATH}" CACHE PATH "${DOC}")
31 ENDIF(${VAR} AND NOT ${VAR}_SOURCE)
32 ENDMACRO(SET_ABS_SOURCE VAR DOC)
33
34 SET_ABS_SOURCE(SYSCONFDIR "The full path of the configuration directory to be compiled in the program")
35 SET_ABS_SOURCE(FONTDIR "The full path of the fonts directory to be compiled in the program")
36 SET_ABS_SOURCE(IMAGEDIR "The full path of the images directory to be compiled in the program")
37
38 SET(SYSCONFDIR "etc/sarg" CACHE PATH "The configuration directory relative to the install directory")
39 SET(BINDIR "bin" CACHE PATH "The directory to install the exec relative to the install directory")
40 SET(MANDIR "share/man/man1" CACHE PATH "The directory to copy the man page relative to the install directory")
41 SET(FONTDIR "share/sarg/fonts" CACHE PATH "The directory to copy the fonts relative to the install directory")
42 SET(IMAGEDIR "share/sarg/images" CACHE PATH "The directory to copy the images files relative to the install directory")
43 SET(SARGPHPDIR "share/sarg/sarg-php" CACHE PATH "The directory to copy sarg-php relative to the install directory")
44
45 # Sources to compile
46 INCLUDE_DIRECTORIES("${CMAKE_BINARY_DIR}") #Make it find this config.h before the one in src/include
47 INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/include")
48 SET(SRC util.c log.c report.c topuser.c email.c sort.c html.c
49 index.c getconf.c usage.c decomp.c ip2name.c ip2name_dns.c
50 useragent.c exclude.c convlog.c totday.c repday.c datafile.c
51 indexonly.c splitlog.c lastlog.c topsites.c siteuser.c css.c
52 smartfilter.c denied.c authfail.c charset.c dichotomic.c
53 redirector.c auth.c download.c grepday.c ip2name_exec.c
54 dansguardian_log.c dansguardian_report.c realtime.c btree_cache.c
55 usertab.c userinfo.c longline.c url.c readlog.c readlog_squid.c
56 readlog_sarg.c readlog_extlog.c readlog_common.c)
57
58 FOREACH(f ${SRC})
59 ADD_FILE_DEPENDENCIES(${f} ${CMAKE_BINARY_DIR}/config.h ${CMAKE_SOURCE_DIR}/include/conf.h ${CMAKE_SOURCE_DIR}/include/info.h ${CMAKE_SOURCE_DIR}/include/defs.h)
60 ENDFOREACH(f)
61
62 ADD_EXECUTABLE(sarg ${SRC})
63
64 SET_TARGET_PROPERTIES(sarg PROPERTIES VERSION "${sarg_VERSION}.${sarg_REVISION}.${sarg_BUILD}")
65
66 SET_TARGET_PROPERTIES(sarg PROPERTIES COMPILE_FLAGS "$ENV{CFLAGS} -Wall -Wno-sign-compare")
67 SET_TARGET_PROPERTIES(sarg PROPERTIES LINK_FLAGS "$ENV{LDFLAGS}")
68
69 CHECK_C_COMPILER_FLAG("-Wextra" HAVE_WEXTRA)
70 IF(HAVE_WEXTRA)
71 # Not supported by gcc 3.3
72 GET_TARGET_PROPERTY(TMPCFLAGS sarg COMPILE_FLAGS)
73 SET_TARGET_PROPERTIES(sarg PROPERTIES COMPILE_FLAGS "${TMPCFLAGS} -Wextra -Wno-unused-parameter")
74 ENDIF(HAVE_WEXTRA)
75
76 CHECK_C_COMPILER_FLAG("-Werror=implicit-function-declaration" HAVE_WERROR_IMPLICIT_FUNCTION)
77 IF(HAVE_WERROR_IMPLICIT_FUNCTION)
78 GET_TARGET_PROPERTY(TMPCFLAGS sarg COMPILE_FLAGS)
79 SET_TARGET_PROPERTIES(sarg PROPERTIES COMPILE_FLAGS "${TMPCFLAGS} -Werror=implicit-function-declaration")
80 ENDIF(HAVE_WERROR_IMPLICIT_FUNCTION)
81
82 CHECK_C_COMPILER_FLAG("-Werror=format" HAVE_WERROR_FORMAT)
83 IF(HAVE_WERROR_FORMAT)
84 GET_TARGET_PROPERTY(TMPCFLAGS sarg COMPILE_FLAGS)
85 SET_TARGET_PROPERTIES(sarg PROPERTIES COMPILE_FLAGS "${TMPCFLAGS} -Werror=format")
86 ENDIF(HAVE_WERROR_FORMAT)
87
88 # Required header files
89 CHECK_INCLUDE_FILE(stdio.h HAVE_STDIO_H)
90 CHECK_INCLUDE_FILE(stdlib.h HAVE_STDLIB_H)
91 CHECK_INCLUDE_FILE(string.h HAVE_STRING_H)
92 CHECK_INCLUDE_FILE(strings.h HAVE_STRINGS_H)
93 CHECK_INCLUDE_FILE(sys/time.h HAVE_SYS_TIME_H)
94 CHECK_INCLUDE_FILE(time.h HAVE_TIME_H)
95 CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)
96 CHECK_INCLUDE_FILE(sys/dirent.h HAVE_SYS_DIRENT_H)
97 CHECK_INCLUDE_FILE(dirent.h HAVE_DIRENT_H)
98 CHECK_INCLUDE_FILE(sys/types.h HAVE_SYS_TYPES_H)
99 CHECK_INCLUDE_FILE(sys/socket.h HAVE_SYS_SOCKET_H)
100 CHECK_INCLUDE_FILE(netdb.h HAVE_NETDB_H)
101 CHECK_INCLUDE_FILE(arpa/inet.h HAVE_ARPA_INET_H)
102 CHECK_INCLUDE_FILE(netinet/in.h HAVE_NETINET_H)
103 CHECK_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H)
104 CHECK_INCLUDE_FILE(ctype.h HAVE_CTYPE_H)
105 CHECK_INCLUDE_FILE(errno.h HAVE_ERRNO_H)
106 CHECK_INCLUDE_FILE(sys/resource.h HAVE_SYS_RESOURCE_H)
107 CHECK_INCLUDE_FILE(sys/wait.h HAVE_SYS_WAIT_H)
108 CHECK_INCLUDE_FILE(stdarg.h HAVE_STDARG_H)
109 CHECK_INCLUDE_FILE(inttypes.h HAVE_INTTYPES_H)
110 CHECK_INCLUDE_FILE(limits.h HAVE_LIMITS_H)
111 CHECK_INCLUDE_FILE(math.h HAVE_MATH_H)
112 CHECK_INCLUDE_FILE(locale.h HAVE_LOCALE_H)
113 CHECK_INCLUDE_FILE(execinfo.h HAVE_EXECINFO_H)
114 CHECK_INCLUDE_FILE(libintl.h HAVE_LIBINTL_H)
115 CHECK_INCLUDE_FILE(libgen.h HAVE_LIBGEN_H)
116 CHECK_INCLUDE_FILE(stdbool.h HAVE_STDBOOL_H)
117 CHECK_INCLUDE_FILE(getopt.h HAVE_GETOPT_H)
118 CHECK_INCLUDE_FILE(fcntl.h HAVE_FCNTL_H)
119
120 IF(!HAVE_GETOPT_H)
121 MESSAGE(SEND_ERROR "getopt.h is required to compile sarg")
122 ENDIF(!HAVE_GETOPT_H)
123
124 # Windows need lib wsock32 and ws2_32
125 IF(CMAKE_SYSTEM_NAME STREQUAL "Windows")
126 CHECK_INCLUDE_FILE(windows.h HAVE_WINDOWS_H)
127 CHECK_INCLUDE_FILE(winsock.h HAVE_WINSOCK_H)
128 CHECK_INCLUDE_FILE(ws2tcpip.h HAVE_WS2TCPIP_H)
129
130 FIND_LIBRARY(WSOCK_LIB NAMES wsock32 DOC "The winsock library")
131 IF(WSOCK_LIB)
132 TARGET_LINK_LIBRARIES(sarg wsock32)
133 LIST(APPEND CMAKE_REQUIRED_LIBRARIES wsock32)
134 ENDIF(WSOCK_LIB)
135
136 FIND_LIBRARY(WSOCK2_LIB NAMES ws2_32 DOC "The winsock 2 library")
137 IF(WSOCK2_LIB)
138 TARGET_LINK_LIBRARIES(sarg ws2_32)
139 LIST(APPEND CMAKE_REQUIRED_LIBRARIES ws2_32)
140 ENDIF(WSOCK2_LIB)
141
142 ADD_DEFINITIONS(-DWINDOWS)
143 ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Windows")
144
145 CHECK_FUNCTION_EXISTS(bzero HAVE_BZERO)
146 CHECK_FUNCTION_EXISTS(backtrace HAVE_BACKTRACE)
147 CHECK_FUNCTION_EXISTS(symlink HAVE_SYMLINK)
148 CHECK_FUNCTION_EXISTS(lstat HAVE_LSTAT)
149 CHECK_FUNCTION_EXISTS(getnameinfo HAVE_GETNAMEINFO)
150 CHECK_FUNCTION_EXISTS(getaddrinfo HAVE_GETADDRINFO)
151 CHECK_FUNCTION_EXISTS(inet_aton HAVE_INET_ATON)
152
153 CHECK_STRUCT_HAS_MEMBER("struct sockaddr_storage" ss_len sys/socket.h HAVE_SOCKADDR_SA_LEN)
154
155 # Find gd
156 CHECK_INCLUDE_FILE(gd.h HAVE_GD_H)
157 IF(HAVE_GD_H)
158 CHECK_INCLUDE_FILE(gdfontl.h HAVE_GDFONTL_H)
159 CHECK_INCLUDE_FILE(gdfontt.h HAVE_GDFONTT_H)
160 CHECK_INCLUDE_FILE(gdfonts.h HAVE_GDFONTS_H)
161 CHECK_INCLUDE_FILE(gdfontmb.h HAVE_GDFONTMB_H)
162 CHECK_INCLUDE_FILE(gdfontg.h HAVE_GDFONTG_H)
163 FIND_LIBRARY(GD_LIBRARY NAMES gd bgd DOC "The GD library")
164 IF(GD_LIBRARY)
165 #CHECK_LIBRARY_EXISTS(gd gdImagePng "." HAVE_GD_LIB)
166 TARGET_LINK_LIBRARIES(sarg ${GD_LIBRARY})
167 SET(HAVE_GD_LIB GD_LIBRARY CACHE PATH DOC "True IF GD was found")
168 SET(HAVE_GD_LIB CACHE BOOL DOC "True IF must use GD")
169 ENDIF(GD_LIBRARY)
170 ENDIF(HAVE_GD_H)
171
172 # Find iconv
173 OPTION(ENABLE_ICONV "Enable the usage of iconv" ON)
174 IF(ENABLE_ICONV)
175 CHECK_INCLUDE_FILE(iconv.h HAVE_ICONV_H)
176 IF(HAVE_ICONV_H)
177 FIND_PATH(ICONV_INCLUDE_PATH NAMES iconv.h)
178 FIND_LIBRARY(ICONV_LIBRARY NAMES iconv DOC "The ICONV library")
179 IF(ICONV_LIBRARY)
180 TARGET_LINK_LIBRARIES(sarg ${ICONV_LIBRARY})
181 ENDIF(ICONV_LIBRARY)
182 CHECK_FUNCTION_EXISTS(iconv_open HAVE_ICONV)
183
184 IF(NOT USE_CONST_ICONV)
185 SET(ICONV_CONST_FILE ${CMAKE_BINARY_DIR}/consticonv.c)
186 FILE(WRITE ${ICONV_CONST_FILE} "
187 #include <iconv.h>
188 #ifdef __CLASSIC_C__
189 int main(){
190 int ac;
191 char*av[];
192 #else
193 int main(int ac, char*av[]){
194 #endif
195 iconv_t localtoutf=(iconv_t)-1;
196 const char *str=\"\";
197 char *sstr=\"\";
198 size_t slen=0, sslen=0;
199
200 iconv (localtoutf, (const char **)&str, &slen, &sstr, &sslen);
201 if(ac > 1000)
202 {
203 return *av[0];
204 }
205 return 0;
206 }
207 ")
208 TRY_COMPILE(USE_CONST_ICONV ${CMAKE_BINARY_DIR} ${ICONV_CONST_FILE} CMAKE_FLAGS -DLINK_LIBRARIES="iconv")
209 FILE(REMOVE ${ICONV_CONST_FILE})
210 IF(USE_CONST_ICONV)
211 SET(ICONV_CONST "const" CACHE STRING "The type of char to use with iconv")
212 MESSAGE(STATUS "iconv requires const char **")
213 ELSEIF(USE_CONST_ICONV)
214 SET(ICONV_CONST "" CACHE STRING "The type of char to use with iconv")
215 MESSAGE(STATUS "iconv requires char **")
216 ENDIF(USE_CONST_ICONV)
217 SET(USE_CONST_ICONV TRUE CACHE BOOL "Use const char ** with iconv")
218 ENDIF(NOT USE_CONST_ICONV)
219 ENDIF(HAVE_ICONV_H)
220 ENDIF(ENABLE_ICONV)
221
222 # Find ldap
223 CHECK_INCLUDE_FILE(ldap.h HAVE_LDAP_H)
224 IF(HAVE_LDAP_H)
225 FIND_LIBRARY(LDAP_LIBRARY NAMES ldap DOC "The ldap library")
226 IF(LDAP_LIBRARY)
227 TARGET_LINK_LIBRARIES(sarg ${LDAP_LIBRARY})
228 SET(HAVE_LDAP LDAP_LIBRARY CACHE PATH DOC "True if LDAP was found")
229 SET(HAVE_LDAP CACHE BOOL DOC "True if must use LDAP")
230 ENDIF(LDAP_LIBRARY)
231 ENDIF(HAVE_LDAP_H)
232
233 # Find pcre
234 CHECK_INCLUDE_FILE(pcre.h HAVE_PCRE_H)
235 IF(HAVE_PCRE_H)
236 FIND_LIBRARY(PCRE_LIBRARY NAMES pcre DOC "The pcre library")
237 IF(PCRE_LIBRARY)
238 TARGET_LINK_LIBRARIES(sarg ${PCRE_LIBRARY})
239 SET(HAVE_PCRE PCRE_LIBRARY CACHE PATH DOC "True if pcre was found")
240 SET(HAVE_PCRE CACHE BOOL DOC "True if must use pcre")
241 ENDIF(PCRE_LIBRARY)
242 ENDIF(HAVE_PCRE_H)
243
244 # Support for large files
245 OPTION(ENABLE_LARGEFILE "Enable the usage of large files" ON)
246 IF(ENABLE_LARGEFILE)
247 IF(LFS_SEARCHED MATCHES "^LFS_SEARCHED$")
248 SET(SEARCH_LARGEFILE TRUE)
249 ENDIF(LFS_SEARCHED MATCHES "^LFS_SEARCHED$")
250 ENDIF(ENABLE_LARGEFILE)
251
252 IF(SEARCH_LARGEFILE)
253 SET(LFS_SEARCHED TRUE CACHE INTERNAL "LFS has been searched")
254 MESSAGE(STATUS "Looking for large file support")
255 SET(LFS_FILE "${CMAKE_BINARY_DIR}/lfsfopen64.c")
256 FILE(WRITE ${LFS_FILE} "
257 #include <stdio.h>
258 int main(void)
259 {
260 FILE *f = fopen64 (\"/tmp/foo\",\"r\");
261 return(0);
262 }
263 ")
264 TRY_COMPILE(HAVE_FOPEN64 ${CMAKE_BINARY_DIR} ${LFS_FILE} COMPILE_DEFINITIONS "-Wall -Werror")
265 IF(HAVE_FOPEN64)
266 MESSAGE(STATUS "Looking for large file support - found")
267 ELSE(HAVE_FOPEN64)
268 SET(LFS_NEED_DEFINE FALSE CACHE BOOL "Does LFS require _LARGEFILE64_SOURCE ?")
269 MESSAGE(STATUS "Looking for large file support with _LARGEFILE64_SOURCE")
270 FILE(WRITE ${LFS_FILE} "
271 #define _LARGEFILE64_SOURCE
272 #include <stdio.h>
273 int main(void)
274 {
275 FILE *f = fopen64 (\"/tmp/foo\",\"r\");
276 return(0);
277 }
278 ")
279 TRY_COMPILE(HAVE_FOPEN64 ${CMAKE_BINARY_DIR} ${LFS_FILE} OUTPUT_VARIABLE LFS_OUTPUT)
280 IF(HAVE_FOPEN64)
281 MESSAGE(STATUS "Looking for large file support with _LARGEFILE64_SOURCE - found")
282 SET(LFS_NEED_DEFINE TRUE CACHE BOOL "Does LFS require _LARGEFILE64_SOURCE ?" FORCE)
283 ELSE(HAVE_FOPEN64)
284 MESSAGE("Failed with output ${LFS_OUTPUT}")
285 ENDIF(HAVE_FOPEN64)
286 ENDIF(HAVE_FOPEN64)
287 FILE(REMOVE ${LFS_FILE})
288 ENDIF(SEARCH_LARGEFILE)
289
290 IF(LFS_NEED_DEFINE)
291 ADD_DEFINITIONS(-D_LARGEFILE64_SOURCE)
292 ENDIF(LFS_NEED_DEFINE)
293
294 # Find rlim_t
295 IF(HAVE_SYS_RESOURCE_H)
296 SET(CMAKE_EXTRA_INCLUDE_FILES "sys/resource.h")
297 ENDIF(HAVE_SYS_RESOURCE_H)
298 CHECK_TYPE_SIZE(rlim_t RLIM_T)
299 IF(HAVE_RLIM_T)
300 IF(RLIM_T STREQUAL 4)
301 SET(RLIM_STRING "%d")
302 ELSEIF(RLIM_T STREQUAL 8)
303 SET(RLIM_STRING "%lli")
304 ELSE(RLIM_T STREQUAL 4)
305 MESSAGE("Unknown rlim_t size")
306 ENDIF(RLIM_T STREQUAL 4)
307 #ELSE(HAVE_RLIM_T)
308 # MESSAGE("Cannot detect the size of your system's rlim_t type")
309 ENDIF(HAVE_RLIM_T)
310
311 CHECK_FUNCTION_EXISTS(mkstemp HAVE_MKSTEMP)
312 IF(NOT HAVE_MKSTEMP)
313 # MingW provide mkstemps in libiberty but doesn't declare it in any header file
314 FIND_LIBRARY(IBERTY_LIB NAMES iberty DOC "The library of mingw containing mkstemps")
315 IF(IBERTY_LIB)
316 TARGET_LINK_LIBRARIES(sarg iberty)
317 ENDIF(IBERTY_LIB)
318 ENDIF(NOT HAVE_MKSTEMP)
319
320 # Gettext and friends
321 IF(NOT HAVE_LC_MESSAGES)
322 SET(FILES)
323 IF(HAVE_LOCALE_H)
324 LIST(APPEND FILES "locale.h")
325 ENDIF(HAVE_LOCALE_H)
326 IF(HAVE_LIBINTL_H)
327 LIST(APPEND FILES "libintl.h")
328 ENDIF(HAVE_LIBINTL_H)
329 LIST(LENGTH FILES NFILES)
330 IF(NFILES GREATER 0)
331 CHECK_SYMBOL_EXISTS(LC_MESSAGES "${FILES}" HAVE_LC_MESSAGES)
332 ENDIF(NFILES GREATER 0)
333 ENDIF(NOT HAVE_LC_MESSAGES)
334
335 # System particularities
336 IF(CMAKE_SYSTEM_NAME STREQUAL "solaris")
337 TARGET_LINK_LIBRARIES(sarg socket nsl)
338 #SET_TARGET_PROPERTIES(sarg PROPERTIES COMPILE_DEFINITIONS="-DSOLARIS ${COMPILE_DEFINITIONS}")
339 ADD_DEFINITIONS(-DSOLARIS)
340 ENDIF(CMAKE_SYSTEM_NAME STREQUAL "solaris")
341
342 OPTION(ENABLE_EXTRA_PROTECT "Enable compile and runtime extra protections" OFF)
343 IF(ENABLE_EXTRA_PROTECT)
344 GET_TARGET_PROPERTY(TMPCFLAGS sarg COMPILE_FLAGS)
345 SET_TARGET_PROPERTIES(sarg PROPERTIES COMPILE_FLAGS "${TMPCFLAGS} -fstack-protector -D_FORTIFY_SOURCE=2 -Werror")
346
347 CHECK_C_COMPILER_FLAG("-Wformat -Werror=format-security" HAVE_WERROR_FORMAT_SECURITY)
348 IF(HAVE_WERROR_FORMAT_SECURITY)
349 GET_TARGET_PROPERTY(TMPCFLAGS sarg COMPILE_FLAGS)
350 SET_TARGET_PROPERTIES(sarg PROPERTIES COMPILE_FLAGS "${TMPCFLAGS} -Wformat -Werror=format-security")
351 ENDIF(HAVE_WERROR_FORMAT_SECURITY)
352
353 CHECK_C_COMPILER_FLAG("-Wempty-body" HAVE_EMPTY_BODY)
354 IF(HAVE_EMPTY_BODY)
355 GET_TARGET_PROPERTY(TMPCFLAGS sarg COMPILE_FLAGS)
356 SET_TARGET_PROPERTIES(sarg PROPERTIES COMPILE_FLAGS "${TMPCFLAGS} -Wempty-body")
357 ENDIF(HAVE_EMPTY_BODY)
358 ENDIF(ENABLE_EXTRA_PROTECT)
359
360 # Compile sarg for debugging
361 OPTION(ENABLE_DEBUG "Compile sarg with debugging symbols" OFF)
362 IF(ENABLE_DEBUG)
363 GET_TARGET_PROPERTY(TMPCFLAGS sarg COMPILE_FLAGS)
364 SET_TARGET_PROPERTIES(sarg PROPERTIES COMPILE_FLAGS "${TMPCFLAGS} -g")
365 ENDIF(ENABLE_DEBUG)
366
367 # Enable double check of the data written in the reports
368 OPTION(ENABLE_DOUBLE_CHECK_DATA "Make sarg double check the data it manipulates and output a warning if an error is found" OFF)
369
370 # Save the configuration for the project
371 CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/include/config.h.in" "${CMAKE_BINARY_DIR}/config.h" @ONLY)
372
373 # Installation of the project
374 INSTALL(TARGETS sarg DESTINATION "${BINDIR}")
375 INSTALL(FILES sarg.conf DESTINATION "${SYSCONFDIR}" RENAME sarg.conf.exemple)
376 INSTALL(FILES exclude_codes user_limit_block css.tpl DESTINATION "${SYSCONFDIR}")
377 INSTALL(FILES sarg.1 DESTINATION "${MANDIR}")
378 INSTALL(DIRECTORY images/ DESTINATION "${IMAGEDIR}" PATTERN ".svn" EXCLUDE)
379 INSTALL(DIRECTORY fonts/ DESTINATION "${FONTDIR}" FILES_MATCHING PATTERN "*.ttf" PATTERN ".svn" EXCLUDE)
380 INSTALL(DIRECTORY sarg-php/ DESTINATION "${SARGPHPDIR}" PATTERN ".svn" EXCLUDE)
381
382 # Package creation
383 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Squid Analysis Report Generator")
384 SET(CPACK_PACKAGE_VERSION_MAJOR "${sarg_VERSION}")
385 SET(CPACK_PACKAGE_VERSION_MINOR "${sarg_REVISION}")
386 SET(CPACK_PACKAGE_VERSION_PATCH "${sarg_BUILD}")
387 SET(CPACK_GENERATOR TGZ)
388 SET(CPACK_SOURCE_GENERATOR TGZ)
389 SET(CPACK_SOURCE_IGNORE_FILES "/.svn/" "/debian/" "/html/" "Makefile$" "config\\\\.log$" "config\\\\.status$" ".*~$" "\\\\.o$")
390 INCLUDE(CPack)