1 cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
4 set(FUSE_XATTRS_VERSION_MAJOR 0)
5 set(FUSE_XATTRS_VERSION_MINOR 3)
7 set(BINARY_SIDECAR_EXT \".xattr\")
9 set(MAX_METADATA_SIZE "8*1024*1024") # 8 MiB
10 set(XATTR_NAME_MAX 255) # chars in an extended attribute name
11 set(XATTR_SIZE_MAX 65536) # size of an extended attribute value (64k)
12 set(XATTR_LIST_MAX 65536) # size of extended attribute namelist (64k)
15 "${PROJECT_SOURCE_DIR}/fuse_xattrs_config.h.in"
16 "${PROJECT_BINARY_DIR}/fuse_xattrs_config.h"
19 "${PROJECT_BINARY_DIR}"
23 "${PROJECT_SOURCE_DIR}/fuse_xattrs.1.in"
24 "${PROJECT_BINARY_DIR}/fuse_xattrs.1"
28 include (CheckIncludeFile)
29 check_include_file (sys/xattr.h HAVE_SYS_XATTR_H)
30 if(NOT HAVE_SYS_XATTR_H)
31 message(FATAL_ERROR "sys/xattr.h not found")
34 include (CheckCSourceCompiles)
35 check_c_source_compiles ("
36 #include <sys/types.h>
37 #include <attr/xattr.h>
38 int main() { return 1; }
40 if(NOT HAVE_ATTR_XATTR_H)
41 message(FATAL_ERROR "attr/xattr.h not found")
44 # set required definitions
45 add_definitions (-D_FILE_OFFSET_BITS=64)
47 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules/")
49 set(CMAKE_C_FLAGS "-O3")
51 option(ENABLE_CODECOVERAGE "Enable code coverage testing support" )
52 if(ENABLE_CODECOVERAGE)
53 include (CodeCoverage)
54 set(CMAKE_C_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage")
55 setup_target_for_coverage(
60 endif(ENABLE_CODECOVERAGE)
69 add_executable(fuse_xattrs ${SOURCE_FILES})
71 target_link_libraries (
76 install (TARGETS fuse_xattrs DESTINATION bin)
78 FILES ${CMAKE_CURRENT_BINARY_DIR}/fuse_xattrs.1
79 DESTINATION share/man/man1
84 configure_file(run_tests.sh run_tests.sh COPYONLY)
85 configure_file(test/tests.py test/tests.py COPYONLY)
86 add_test(NAME integration