forked from cvmfs/cvmfs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
489 lines (436 loc) · 18.3 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
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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
#
# CMake build script to configure and build CernVM-FS and all it's
# external dependencies, if they are statically linked into the binaries
#
# See externals/CMake-Register_External_Lib.txt for details on external inclusion
#
cmake_minimum_required (VERSION 2.6.2)
set (PROJECT_NAME "CernVM-FS")
project (${PROJECT_NAME})
message ("Running CMake version ${CMAKE_VERSION}")
#
# The version numbers
#
# DON'T DELETE
## CVMFS_VERSION 2.2.0
#---------------------
set (CernVM-FS_VERSION_MAJOR 2)
set (CernVM-FS_VERSION_MINOR 2)
set (CernVM-FS_VERSION_PATCH 0)
set (CernVM-FS_VERSION_STRING "${CernVM-FS_VERSION_MAJOR}.${CernVM-FS_VERSION_MINOR}.${CernVM-FS_VERSION_PATCH}")
#
# set the path where cmake looks for additional modules
#
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
#
# Set install prefix to /usr. Cvmfs is not relocatable.
#
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
SET(CMAKE_INSTALL_PREFIX
"/usr" CACHE PATH "/usr install prefix" FORCE
)
else (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
if (NOT ${CMAKE_INSTALL_PREFIX} STREQUAL "/usr")
Message("Warning: CernVM-FS is not relotable and expects to be installed under /usr")
endif ()
endif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
#
# detect the operating system and the distribution we are compiling on
#
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set (MACOSX TRUE)
else (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set (MACOSX FALSE)
endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set (LINUX TRUE)
if (EXISTS /etc/debian_version)
set (DEBIAN TRUE)
endif (EXISTS /etc/debian_version)
else (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set (LINUX FALSE)
set (DEBIAN FALSE)
endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
#
# check if we use Clang
#
if (CMAKE_CXX_COMPILER MATCHES ".*clang")
set(USING_CLANG 1)
endif (CMAKE_CXX_COMPILER MATCHES ".*clang")
#
# figure out if we are on a 64bit system
#
if (CMAKE_SIZEOF_VOID_P EQUAL 4)
set (IS_64_BIT FALSE)
else (CMAKE_SIZEOF_VOID_P EQUAL 4)
set (IS_64_BIT TRUE)
endif (CMAKE_SIZEOF_VOID_P EQUAL 4)
#
# check if we are compiling on ARM
#
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm.*$")
set (ARM TRUE)
else (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm.*$")
set (ARM FALSE)
endif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm.*$")
#
# define the installation location of the shared library files
# Note: We do not support multi-arch on Debian systems for the time being and
# hence cannot use GNUInstallDirs as this would assume multi-arch.
# (https://wiki.debian.org/Multiarch)
#
if (MACOSX)
set (CMAKE_INSTALL_LIBDIR "lib")
else (MACOSX) # --> Linux
if (DEBIAN)
set (CMAKE_INSTALL_LIBDIR "lib")
else (DEBIAN) # --> RedHat, Fedora, CentOS, SuSE
if (IS_64_BIT)
set (CMAKE_INSTALL_LIBDIR "lib64")
else (IS_64_BIT) # --> 32 Bit
set (CMAKE_INSTALL_LIBDIR "lib")
endif (IS_64_BIT)
endif (DEBIAN)
endif (MACOSX)
message ("Installing shared libraries to: ${CMAKE_INSTALL_LIBDIR}")
#
# Workaround for Debian packaging debhelper trying to pass -D_FORTIFY_SOURCE=2
# through CPPFLAGS that is not officially supported by CMake. Hence, debhelper
# appends CPPFLAGS to CFLAGS which breaks the build of the c-ares external.
# This filters out flags that scares c-ares's ./configure script.
#
set (TMP_C_FLAGS "${CFLAGS} ${CMAKE_C_FLAGS}")
set (CFLAGS "") # this should better be `unset()` but CMake 2.6.2 doesn't
set (ENV{CFLAGS} "") # support it. Should be changed as soon as SLES 11 brings
set (CMAKE_C_FLAGS "") # an update for CMake or we drop support for the platform
set (LDFLAGS $ENV{LDFLAGS})
separate_arguments (TMP_C_FLAGS)
foreach (CMPLR_FLAG ${TMP_C_FLAGS})
if (${CMPLR_FLAG} MATCHES ^-[DIU].*)
message ("Moving ${CMPLR_FLAG} from CFLAGS into CPPFLAGS")
set (CPPFLAGS "${CPPFLAGS} ${CMPLR_FLAG}")
elseif (${CMPLR_FLAG} MATCHES ^-[Ll].*)
message ("Moving ${CMPLR_FLAG} from CFLAGS into LDFLAGS")
set (LDFLAGS "${LDFLAGS} ${CMPLR_FLAG}")
set (CMAKE_LD_FLAGS "${CMAKE_LD_FLAGS} ${CMPLR_FLAG}")
else (${CMPLR_FLAG} MATCHES ^-[DUILl].*)
set (CFLAGS "${CFLAGS} ${CMPLR_FLAG}")
endif (${CMPLR_FLAG} MATCHES ^-[DIU].*)
endforeach (CMPLR_FLAG)
set (ENV{CPPFLAGS} "${CPPFLAGS}")
set (CMAKE_C_FLAGS "${CFLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CPPFLAGS}")
set (ENV{CFLAGS} "${CFLAGS}")
set (ENV{LDFLAGS} "${LDFLAGS}")
#
# set name of fuse library (-losxfuse for osxfuse)
#
if (MACOSX)
set(LIBFUSE osxfuse)
else (MACOSX)
set(LIBFUSE fuse)
endif(MACOSX)
#
# provide some options to the user
#
option (BUILD_CVMFS "Build the CernVM-FS FUSE module" ON)
if (MACOSX)
option (BUILD_LIBCVMFS "Build the CernVM-FS client library" OFF)
option (BUILD_SERVER "Build writer's end programs" OFF)
else (MACOSX)
option (BUILD_LIBCVMFS "Build the CernVM-FS client library" ON)
option (BUILD_SERVER "Build writer's end programs" ON)
endif(MACOSX)
option (BUILD_SERVER_DEBUG "Build writer's end programs with debug symbols and debug outputs" OFF)
option (BUILD_UNITTESTS "Build the CernVM-FS unit test set" OFF)
option (BUILD_UNITTESTS_DEBUG "Build the CernVM-FS unit test set with verbose output and -g" OFF)
option (BUILD_DOCUMENTATION "Build the CerVM-FS documentation using Doxygen" OFF)
option (INSTALL_UNITTESTS "Install the unit test binary (mainly for packaging)" OFF)
option (INSTALL_UNITTESTS_DEBUG "Install the unit test debug binary" OFF)
option (INSTALL_MOUNT_SCRIPTS "Install CernVM-FS mount tools in /etc and /sbin" ON)
option (INSTALL_PUBLIC_KEYS "Install public key chain for CERN, EGI, and OSG" ON)
option (INSTALL_BASH_COMPLETION "Install bash completion rules for cvmfs* commands in /etc" ON)
option (SQLITE3_BUILTIN "Don't use system SQLite3" ON)
option (LIBCURL_BUILTIN "Don't use system libcurl" ON)
option (PACPARSER_BUILTIN "Don't use system installation of pacparser" ON)
option (ZLIB_BUILTIN "Don't use system zlib" ON)
option (SPARSEHASH_BUILTIN "Don't use system installation of google sparse hash" ON)
option (LEVELDB_BUILTIN "Don't use system leveldb" ON)
option (GOOGLETEST_BUILTIN "Don't use system installation of google test" ON)
option (GEOIP_BUILTIN "Don't use system GeoIP library and python-GeoIP" ON)
option (TBB_PRIVATE_LIB "Compile our own TBB shared libraries" ON)
#
# define where to find the external dependencies
#
# for the external libraries there should be a CVMFS-CMakeLists.txt file provided
# in the given directory, in order to configure and compile them properly
#
set (EXTERNALS_LIB_LOCATION "${CMAKE_SOURCE_DIR}/externals")
set (EXTERNALS_BUILD_LOCATION "${CMAKE_BINARY_DIR}/externals")
set (SQLITE3_BUILTIN_LOCATION "${EXTERNALS_BUILD_LOCATION}/build_sqlite3")
set (CARES_BUILTIN_LOCATION "${EXTERNALS_BUILD_LOCATION}/build_c-ares")
set (LIBCURL_BUILTIN_LOCATION "${EXTERNALS_BUILD_LOCATION}/build_libcurl")
set (PACPARSER_BUILTIN_LOCATION "${EXTERNALS_BUILD_LOCATION}/build_pacparser")
set (ZLIB_BUILTIN_LOCATION "${EXTERNALS_BUILD_LOCATION}/build_zlib")
set (SPARSEHASH_BUILTIN_LOCATION "${EXTERNALS_BUILD_LOCATION}/build_sparsehash")
set (LEVELDB_BUILTIN_LOCATION "${EXTERNALS_BUILD_LOCATION}/build_leveldb")
set (VJSON_BUILTIN_LOCATION "${EXTERNALS_BUILD_LOCATION}/build_vjson")
set (GOOGLETEST_BUILTIN_LOCATION "${EXTERNALS_BUILD_LOCATION}/build_googletest")
set (LIBGEOIP_BUILTIN_LOCATION "${EXTERNALS_BUILD_LOCATION}/build_libgeoip")
set (PYTHON_GEOIP_BUILTIN_LOCATION "${EXTERNALS_BUILD_LOCATION}/build_python-geoip")
set (TBB_BUILD_LOCATION "${EXTERNALS_BUILD_LOCATION}/build_tbb")
# create the directory for controlled out of source building of external stuff
file (MAKE_DIRECTORY ${EXTERNALS_BUILD_LOCATION})
#
# run the bootstrap shellscript (not needed in the distributed version of the source)
#
if (EXISTS "${CMAKE_SOURCE_DIR}/bootstrap.sh")
message (STATUS "running bootstrap.sh ...")
execute_process (
COMMAND sh ${CMAKE_SOURCE_DIR}/bootstrap.sh ${EXTERNALS_BUILD_LOCATION}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE BOOTSTRAPPING_RESULT
)
if (BOOTSTRAPPING_RESULT GREATER 0)
message (FATAL_ERROR "bootstrapping failed")
endif (BOOTSTRAPPING_RESULT GREATER 0)
endif (EXISTS "${CMAKE_SOURCE_DIR}/bootstrap.sh")
#
# include some common functionality
#
include (FindPythonModule)
#
# set some default flags
#
# flags in CMAKE_C**_FLAGS are always passed to the compiler
#
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -fno-exceptions -fno-strict-aliasing -fasynchronous-unwind-tables -fno-omit-frame-pointer -fvisibility=hidden -Wall -D_REENTRANT -D__EXTENSIONS__ -D_LARGEFILE64_SOURCE -D__LARGE64_FILES")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -fno-strict-aliasing -fasynchronous-unwind-tables -fno-omit-frame-pointer -fvisibility=hidden -Wall -D_REENTRANT -D__EXTENSIONS__ -D_LARGEFILE64_SOURCE -D__LARGE64_FILES")
if (NOT USING_CLANG)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-optimize-sibling-calls")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-optimize-sibling-calls")
endif (NOT USING_CLANG)
if (NOT ARM AND NOT IS_64_BIT)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=i686")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=i686")
endif (NOT ARM AND NOT IS_64_BIT)
set (INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES})
#
# check existence of include files
#
include (CheckIncludeFile)
macro (pedantic_include_check HEADERFILE VARIABLENAME)
check_include_file (${HEADERFILE} ${VARIABLENAME})
if (NOT ${VARIABLENAME})
message (FATAL_ERROR "${HEADERFILE} is missing on your system")
endif (NOT ${VARIABLENAME})
endmacro (pedantic_include_check)
macro (look_for_include_files)
foreach (HEADER ${ARGV})
string (REGEX REPLACE "/|\\." "_" HEADER_VAR_LOWER ${HEADER})
string (TOUPPER "have_${HEADER_VAR_LOWER}" HEADER_VAR)
pedantic_include_check (${HEADER} ${HEADER_VAR})
endforeach (HEADER IN ITEMS ${ARGV})
endmacro (look_for_include_files)
set (REQUIRED_HEADERS sys/xattr.h zlib.h netinet/in.h arpa/inet.h sys/socket.h
sys/un.h sys/time.h sys/uio.h sys/stat.h sys/types.h
sys/wait.h sys/select.h pthread.h termios.h utime.h
signal.h errno.h dirent.h unistd.h fcntl.h netdb.h
syslog.h sys/resource.h execinfo.h poll.h pwd.h grp.h)
if (NOT MACOSX)
# Unfortunately, attr/xattr.h fails to compile without including sys/types.h
# before including attr/xattr.h (it uses size_t and ssize_t).
# CMake searches for include files by compiling a minimal *.c file like:
# #include <${SEARCHED_HEADER_FILE}>
# int main(int argc, char **argv) { return 0; }
#
# We pre-define the include guard of attr/xattr.h and thus still check, if the
# file is found by the compiler but mitigating the compiler errors caused by
# a standalone inclusion of attr/xattr.h
set (CMAKE_REQUIRED_DEFINITIONS "-D__XATTR_H__")
set (REQUIRED_HEADERS ${REQUIRED_HEADERS}
sys/statfs.h
attr/xattr.h)
endif (NOT MACOSX)
look_for_include_files (${REQUIRED_HEADERS})
#
# configure the config.h.in file
#
configure_file (
"${CMAKE_SOURCE_DIR}/config_cmake.h.in"
"${CMAKE_BINARY_DIR}/cvmfs_config.h"
)
set (INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} ${CMAKE_BINARY_DIR})
#
# set properties for configurable libraries
#
# some libraries are statically linked and has to be compiled from source
# therefore we have to include the specific CVMFS-CMakeLists.txt from the
# different 3rd-party locations.
# If dynamic linking is desired we have to look for the presence of the libs
# in the system and set the LIBRARY and INCLUDE variables properly
#
# either ***_LIBRARIES or ***_ARCHIVE has to be defined for all externals
# in order to successfully link the targets.
#
# required libraries for all builds
if (LIBCURL_BUILTIN)
include (${CARES_BUILTIN_LOCATION}/CVMFS-CMakeLists.txt)
include (${LIBCURL_BUILTIN_LOCATION}/CVMFS-CMakeLists.txt)
set (CURL_LIBRARIES "")
else (LIBCURL_BUILTIN)
find_package (CURL REQUIRED)
set (INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} ${CURL_INCLUDE_DIRS})
if (CURL_INCLUDE_DIRS)
find_program(CURL_CONFIG_EXEC NAMES curl-config)
if (CURL_CONFIG_EXEC)
execute_process(
COMMAND ${CURL_CONFIG_EXEC} --features
OUTPUT_VARIABLE _libcurl_features
ERROR_VARIABLE _libcurl_features_error
)
if (NOT ${_libcurl_features} MATCHES AsynchDNS)
message(FATAL_ERROR "libcurl was not compiled with c-ares")
endif (NOT ${_libcurl_features} MATCHES AsynchDNS)
else (CURL_CONFIG_EXEC)
message(SEND_ERROR "Command \"${CURL_CONFIG_EXEC} --features\" failed with output:\n${_libcurl_features_error}")
endif (CURL_CONFIG_EXEC)
endif(CURL_INCLUDE_DIRS)
endif (LIBCURL_BUILTIN)
if (SQLITE3_BUILTIN)
include (${SQLITE3_BUILTIN_LOCATION}/CVMFS-CMakeLists.txt)
set (SQLITE3_LIBRARY "")
else (SQLITE3_BUILTIN)
find_package (SQLite3 REQUIRED)
set (INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} ${SQLITE3_INCLUDE_DIR})
endif (SQLITE3_BUILTIN)
if (ZLIB_BUILTIN)
include (${ZLIB_BUILTIN_LOCATION}/CVMFS-CMakeLists.txt)
set (ZLIB_LIBRARIES "")
else (ZLIB_BUILTIN)
find_package (ZLIB REQUIRED)
set (INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} ${ZLIB_INCLUDE_DIRS})
endif (ZLIB_BUILTIN)
if (NOT MACOSX)
set (HAVE_LIB_RT TRUE)
set (RT_LIBRARY "rt")
else (NOT MACOSX)
set (HAVE_LIB_RT FALSE)
set (RT_LIBRARY "")
endif (NOT MACOSX)
find_package (OpenSSL REQUIRED)
find_package (UUID REQUIRED)
set (INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} ${OPENSSL_INCLUDE_DIR})
if (GOOGLETEST_BUILTIN)
include (${GOOGLETEST_BUILTIN_LOCATION}/CVMFS-CMakeLists.txt)
set (INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} ${GOOGLETEST_BUILTIN_LOCATION}/include)
else (GOOGLETEST_BUILTIN)
find_package (GTest REQUIRED)
set (INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} ${GTEST_INCLUDE_DIRS})
endif (GOOGLETEST_BUILTIN)
# required libraries for client and libcvmfs
if (BUILD_CVMFS OR BUILD_LIBCVMFS)
if (PACPARSER_BUILTIN)
include (${PACPARSER_BUILTIN_LOCATION}/CVMFS-CMakeLists.txt)
set (PACPARSER_LIBRARIES "")
else (PACPARSER_BUILTIN)
find_package (pacparser REQUIRED)
set (INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} ${PACPARSER_INCLUDE_DIR})
endif (PACPARSER_BUILTIN)
if (SPARSEHASH_BUILTIN)
include (${SPARSEHASH_BUILTIN_LOCATION}/CVMFS-CMakeLists.txt)
set (INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} ${SPARSEHASH_BUILTIN_LOCATION}/src)
else (SPARSEHASH_BUILTIN)
find_package(Sparsehash)
set (INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} ${SPARSEHASH_INCLUDE_DIR})
endif (SPARSEHASH_BUILTIN)
endif (BUILD_CVMFS OR BUILD_LIBCVMFS)
# required library for fuse client only
if (BUILD_CVMFS)
if (MACOSX)
find_package (OSXFuse REQUIRED)
set (INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} ${OSXFUSE_INCLUDE_DIR})
set (FUSE_LIBRARIES ${OSXFUSE_LIBRARIES}) # just abstract the difference here... they are compatible
else (MACOSX)
find_package (FUSE REQUIRED)
set (INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} ${FUSE_INCLUDE_DIR})
endif (MACOSX)
if (LEVELDB_BUILTIN)
include (${LEVELDB_BUILTIN_LOCATION}/CVMFS-CMakeLists.txt)
set (INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} ${LEVELDB_BUILTIN_LOCATION}/src)
else (LEVELDB_BUILTIN)
find_package(leveldb)
set (INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} ${LEVELDB_INCLUDE_DIR})
endif (LEVELDB_BUILTIN)
endif (BUILD_CVMFS)
if (BUILD_SERVER OR BUILD_UNITTESTS)
if (GEOIP_BUILTIN)
include (${LIBGEOIP_BUILTIN_LOCATION}/CVMFS-CMakeLists.txt)
include (${PYTHON_GEOIP_BUILTIN_LOCATION}/CVMFS-CMakeLists.txt)
add_dependencies (python-geoip libgeoip)
else (GEOIP_BUILTIN)
find_package (LibGeoIP REQUIRED)
find_python_module (GeoIP REQUIRED)
endif (GEOIP_BUILTIN)
if (TBB_PRIVATE_LIB)
include (${TBB_BUILD_LOCATION}/CVMFS-CMakeLists.txt)
set (INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} ${TBB_BUILD_LOCATION}/include)
else (TBB_PRIVATE_LIB)
find_package(TBB REQUIRED)
set (INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} ${TBB_INCLUDE_DIRS})
endif (TBB_PRIVATE_LIB)
endif (BUILD_SERVER OR BUILD_UNITTESTS)
if (BUILD_SERVER OR BUILD_SERVER_DEBUG)
find_package(PythonLibs REQUIRED)
find_program(UNZIP_EXE NAMES unzip)
if (${UNZIP_EXE} STREQUAL "UNZIP_EXE-NOTFOUND")
message(FATAL_ERROR "unzip utility missing. Please install unzip...")
endif (${UNZIP_EXE} STREQUAL "UNZIP_EXE-NOTFOUND")
endif (BUILD_SERVER OR BUILD_SERVER_DEBUG)
include_directories (${INCLUDE_DIRECTORIES})
#
# go for the actual compilation
#
add_subdirectory (cvmfs)
if (INSTALL_MOUNT_SCRIPTS)
add_subdirectory (mount)
endif (INSTALL_MOUNT_SCRIPTS)
#
# compile the unit tests
#
if (BUILD_UNITTESTS OR BUILD_UNITTESTS_DEBUG)
enable_testing ()
add_subdirectory (test/unittests)
endif (BUILD_UNITTESTS OR BUILD_UNITTESTS_DEBUG)
#
# Documentation
#
install (
FILES README AUTHORS ChangeLog COPYING
DESTINATION share/doc/cvmfs-${CernVM-FS_VERSION_STRING}
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ
)
#
# configure the packaging stuff
#
include (CPackLists.txt)
#
# Generate the documentation using doxygen
#
if (BUILD_DOCUMENTATION)
message (STATUS "Generating Doxygen configuration ...")
set (CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
set (DOXYFILE_SOURCE_DIR "${CMAKE_SOURCE_DIR}/cvmfs")
set (DOXYFILE_OUTPUT_DIR "${CMAKE_BINARY_DIR}/")
set (DOXYFILE_LATEX "OFF")
execute_process (
COMMAND sh -c "cp ${CMAKE_SOURCE_DIR}/doc/Doxyfile.in ${CMAKE_BINARY_DIR}/Doxyfile.in"
)
execute_process (
COMMAND sh -c "/bin/sed -i -e 's/@VERSION@/${CernVM-FS_VERSION_STRING}/g' ${CMAKE_BINARY_DIR}/Doxyfile.in"
)
execute_process (
COMMAND sh -c "/bin/sed -i -e 's,@SRC_DIR@,${CMAKE_SOURCE_DIR},g' ${CMAKE_BINARY_DIR}/Doxyfile.in"
)
include (cmake/Modules/UseDoxygen)
endif (BUILD_DOCUMENTATION)