summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorBernd Schubert <bernd.schubert@fastmail.fm>2011-02-20 21:51:52 +0100
committerBernd Schubert <bernd.schubert@fastmail.fm>2011-02-20 21:51:52 +0100
commitc21823a78c3a28957b527f4df97966584830a47c (patch)
tree28d525f129df4588ab42cd8d0d5939aede72d2cc /CMakeLists.txt
parent878232aa2d314f8b9b626456bae268f72fcd8135 (diff)
downloadunionfs-fuse-git-c21823a78c3a28957b527f4df97966584830a47c.tar.gz
xattr: Let CMake check if xattrs are really available
Also renames the compiler option -DHAVE_SETXATTR into -DHAVE_XATTR
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt16
1 files changed, 12 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4991462..54b13d0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,7 @@
project(unionfs-fuse)
cmake_minimum_required(VERSION 2.0)
+INCLUDE (CheckIncludeFiles)
# Set a default build type for single-configuration
# CMake generators if no build type is set.
@@ -16,10 +17,17 @@ SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -DDEBUG")
add_definitions(-D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=26)
-option(WITH_XATTR "Enable support for extended attributes")
-if(WITH_XATTR)
- add_definitions(-DHAVE_SETXATTR)
-endif(WITH_XATTR)
+option(WITH_XATTR "Enable support for extended attributes" OFF)
+
+# .h include files
+if (WITH_XATTR)
+ CHECK_INCLUDE_FILES("sys/xattr.h" HAVE_XATTR)
+ IF (HAVE_XATTR)
+ add_definitions(-DHAVE_XATTR)
+ ENDIF(HAVE_XATTR)
+ENDIF (WITH_XATTR)
+
+
add_subdirectory(src)
add_subdirectory(man)