X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=CMakeLists.txt;h=1343d3ff514a9dc9c981888274ee4e8304f847cf;hb=c72ca71f145cb1b11e26f6ea3c45872ff733fff2;hp=fa26eb935d46ccdef41f17c633578449d462ef55;hpb=0cd59294fd145d834cf0f5f02f0e060bf43aa85b;p=rrq%2Ffuse_xattrs.git diff --git a/CMakeLists.txt b/CMakeLists.txt index fa26eb9..1343d3f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,19 +1,38 @@ cmake_minimum_required(VERSION 2.8) -project(fuse_xattrs) - -include (CheckIncludeFileCXX) -check_include_file_cxx (attr/xattr.h HAVE_ATTR_XATTR_H) -check_include_file_cxx (sys/xattr.h HAVE_SYS_XATTR_H) - -# Check if xattr functions take extra argument. -include (CheckCXXSourceCompiles) -CHECK_CXX_SOURCE_COMPILES ("#include - #include - int main() { getxattr(0,0,0,0,0,0); return 1; } " XATTR_ADD_OPT) - +project(fuse_xattrs C) + +# Check xattr headers +include (CheckIncludeFile) +check_include_file (sys/xattr.h HAVE_SYS_XATTR_H) +if(NOT HAVE_SYS_XATTR_H) + message(FATAL_ERROR "sys/xattr.h not found") +endif() + +include (CheckCSourceCompiles) +check_c_source_compiles (" + #include + #include + int main() { return 1; } + " HAVE_ATTR_XATTR_H) +if(NOT HAVE_ATTR_XATTR_H) + message(FATAL_ERROR "attr/xattr.h not found") +endif() + +# set required definitions add_definitions (-D_FILE_OFFSET_BITS=64) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules/") + +option(ENABLE_CODECOVERAGE "Enable code coverage testing support" ) +if(ENABLE_CODECOVERAGE) + include (CodeCoverage) + set(CMAKE_C_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage") + setup_target_for_coverage( + fuse_xattrs_coverage + ./run_tests.sh + coverage + ) +endif(ENABLE_CODECOVERAGE) set(SOURCE_FILES compat/fuse_opt.c