Index: cmake/BubblewrapSandboxChecks.cmake
===================================================================
--- cmake/BubblewrapSandboxChecks.cmake (nonexistent)
+++ cmake/BubblewrapSandboxChecks.cmake (revision 136)
@@ -0,0 +1,43 @@
+if (ENABLE_BUBBLEWRAP_SANDBOX)
+ find_package(Libseccomp)
+ if (NOT Libseccomp_FOUND)
+ message(FATAL_ERROR "libseccomp is needed for ENABLE_BUBBLEWRAP_SANDBOX")
+ endif ()
+
+ if (NOT DEFINED BWRAP_EXECUTABLE)
+ if (CMAKE_CROSSCOMPILING)
+ message(FATAL_ERROR "bwrap executable version 0.3.1 or newer is needed for ENABLE_BUBBLEWRAP_SANDBOX. Unable to autodetect the path when cross-compiling. "
+ "Please define define the CMake variable BWRAP_EXECUTABLE with the run-time full-path to the 'bwrap' program.")
+ else ()
+ find_program(BWRAP_EXECUTABLE bwrap)
+ if (NOT BWRAP_EXECUTABLE)
+ message(FATAL_ERROR "bwrap executable is needed for ENABLE_BUBBLEWRAP_SANDBOX. "
+ "Either install it or use the CMake variable BWRAP_EXECUTABLE to define the runtime path.")
+ endif ()
+ endif ()
+ endif ()
+
+ if (NOT DEFINED DBUS_PROXY_EXECUTABLE)
+ if (CMAKE_CROSSCOMPILING)
+ message(FATAL_ERROR "xdg-dbus-proxy executable is needed for ENABLE_BUBBLEWRAP_SANDBOX. Unable to autodetect the path when cross-compiling. "
+ "Please define define the CMake variable DBUS_PROXY_EXECUTABLE with the run-time full-path to the 'xdg-dbus-proxy' program.")
+ else ()
+ find_program(DBUS_PROXY_EXECUTABLE xdg-dbus-proxy)
+ if (NOT DBUS_PROXY_EXECUTABLE)
+ message(FATAL_ERROR "xdg-dbus-proxy executable not found and is needed for ENABLE_BUBBLEWRAP_SANDBOX. "
+ "Either install it or use the CMake variable DBUS_PROXY_EXECUTABLE to define the runtime path.")
+ endif ()
+ endif ()
+ endif ()
+
+ # Do some extra sanity checks
+ if (NOT IS_ABSOLUTE "${BWRAP_EXECUTABLE}")
+ message(FATAL_ERROR "The value for BWRAP_EXECUTABLE should be a full path.")
+ endif ()
+ if (NOT IS_ABSOLUTE "${DBUS_PROXY_EXECUTABLE}")
+ message(FATAL_ERROR "The value for DBUS_PROXY_EXECUTABLE should be a full path.")
+ endif ()
+
+ add_definitions(-DBWRAP_EXECUTABLE="${BWRAP_EXECUTABLE}")
+ add_definitions(-DDBUS_PROXY_EXECUTABLE="${DBUS_PROXY_EXECUTABLE}")
+endif ()