Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/bareos/bareos.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorPhilipp Storz <philipp.storz@bareos.com>2021-10-26 19:07:49 +0300
committerAndreas Rogge <andreas.rogge@bareos.com>2021-11-11 17:06:17 +0300
commitaa216dcc16ac6f542b3c50b8aeb008590eb874d1 (patch)
treed12c178d069540ebfdf39fd8fbdd26a4330e51e6 /cmake
parente6e942accec19e437a57728f60c217d42bcd65ed (diff)
systemtests: add system:chflags test
Diffstat (limited to 'cmake')
-rw-r--r--cmake/BareosCheckChflags.cmake35
1 files changed, 35 insertions, 0 deletions
diff --git a/cmake/BareosCheckChflags.cmake b/cmake/BareosCheckChflags.cmake
new file mode 100644
index 000000000..55f56f66d
--- /dev/null
+++ b/cmake/BareosCheckChflags.cmake
@@ -0,0 +1,35 @@
+# BAREOSĀ® - Backup Archiving REcovery Open Sourced
+#
+# Copyright (C) 2020-2021 Bareos GmbH & Co. KG
+#
+# This program is Free Software; you can redistribute it and/or modify it under
+# the terms of version three of the GNU Affero General Public License as
+# published by the Free Software Foundation and included in the file LICENSE.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Affero General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc., 51
+# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# Extract version information and commit timestamp if run in a git checkout
+
+find_program(CHFLAGS_PROG chflags)
+
+set(CHFLAGS_WORKS NO)
+if(CHFLAGS_PROG)
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/chflags-test-file.txt"
+ "Just a testfile"
+ )
+ exec_program(
+ ${CHFLAGS_PROG} ${CMAKE_CURRENT_BINARY_DIR}
+ ARGS "nosunlink chflags-test-file.txt"
+ RETURN_VALUE CHFLAGS_RETURN
+ )
+ if(CHFLAGS_RETURN EQUAL 0)
+ set(CHFLAGS_WORKS YES)
+ endif()
+endif()