e4254d66ff5e06f8d96bac2d492ccdcb476c24f4
[rrq/fuse_xattrs.git] / CMakeLists.txt
1 cmake_minimum_required(VERSION 3.6)
2 project(fuse_xattrs)
3
4 include (CheckIncludeFileCXX)
5 check_include_file_cxx (attr/xattr.h HAVE_ATTR_XATTR_H)
6 check_include_file_cxx (sys/xattr.h HAVE_SYS_XATTR_H)
7
8 # Check if xattr functions take extra argument.
9 include (CheckCXXSourceCompiles)
10 CHECK_CXX_SOURCE_COMPILES ("#include <sys/types.h>
11   #include <sys/xattr.h>
12   int main() { getxattr(0,0,0,0,0,0); return 1; } " XATTR_ADD_OPT)
13
14 add_definitions (-D_FILE_OFFSET_BITS=64)
15
16 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
17
18 set(SOURCE_FILES
19         compat/fuse_opt.c
20         compat/fuse_opt.h
21         fuse_xattrs.c
22         passthrough.c
23         passthrough.h
24         binary_storage.c
25         binary_storage.h
26         utils.c
27         utils.h
28         const.h
29 )
30
31 add_executable(fuse_xattrs ${SOURCE_FILES})
32
33 target_link_libraries (
34         fuse_xattrs
35         fuse
36 )
37
38 install (TARGETS fuse_xattrs DESTINATION bin)
39
40 enable_testing()
41 configure_file(run_tests.sh run_tests.sh COPYONLY)
42 configure_file(test/tests.py test/tests.py COPYONLY)
43 add_test(NAME integration
44         COMMAND run_tests.sh)