[kdelibs/frameworks] staging/kio/cmake: Fix FindACL not found in staging/kio.
David Faure
faure at kde.org
Wed Nov 28 12:30:33 UTC 2012
Git commit 05976c8b498b845c4a88a83ad9f91d2ea891b243 by David Faure.
Committed on 28/11/2012 at 13:26.
Pushed by dfaure into branch 'frameworks'.
Fix FindACL not found in staging/kio.
Left a copy in cmake/modules for now, since kio itself still uses that.
Should this go into ECM? cmake itself?
CCMAIL: kde-buildsystem at kde.org
A +36 -0 staging/kio/cmake/FindACL.cmake
http://commits.kde.org/kdelibs/05976c8b498b845c4a88a83ad9f91d2ea891b243
diff --git a/staging/kio/cmake/FindACL.cmake b/staging/kio/cmake/FindACL.cmake
new file mode 100644
index 0000000..7d3fa14
--- /dev/null
+++ b/staging/kio/cmake/FindACL.cmake
@@ -0,0 +1,36 @@
+# - Try to find the ACL library
+# Once done this will define
+#
+# ACL_FOUND - system has the ACL library
+# ACL_LIBS - The libraries needed to use ACL
+
+# Copyright (c) 2006, Pino Toscano, <toscano.pino at tiscali.it>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+include(CheckIncludeFiles)
+
+check_include_files(attr/libattr.h HAVE_ATTR_LIBATTR_H)
+check_include_files(sys/xattr.h HAVE_SYS_XATTR_H)
+check_include_files(sys/acl.h HAVE_SYS_ACL_H)
+check_include_files(acl/libacl.h HAVE_ACL_LIBACL_H)
+
+if (HAVE_ATTR_LIBATTR_H AND HAVE_SYS_XATTR_H AND HAVE_SYS_ACL_H AND HAVE_ACL_LIBACL_H)
+ set(ACL_HEADERS_FOUND TRUE)
+endif (HAVE_ATTR_LIBATTR_H AND HAVE_SYS_XATTR_H AND HAVE_SYS_ACL_H AND HAVE_ACL_LIBACL_H)
+
+if (ACL_HEADERS_FOUND)
+ find_library(ACL_LIBS NAMES acl )
+
+ find_library(ATTR_LIBS NAMES attr )
+endif (ACL_HEADERS_FOUND)
+
+if (ACL_HEADERS_FOUND AND ACL_LIBS AND ATTR_LIBS)
+ set(ACL_FOUND TRUE)
+ set(ACL_LIBS ${ACL_LIBS} ${ATTR_LIBS})
+ message(STATUS "Found ACL support: ${ACL_LIBS}")
+endif (ACL_HEADERS_FOUND AND ACL_LIBS AND ATTR_LIBS)
+
+mark_as_advanced(ACL_LIBS ATTR_LIBS)
+
More information about the Kde-buildsystem
mailing list