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