File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,3 +56,27 @@ target_include_directories(sshfs_server
5656install (TARGETS sshfs_server
5757 DESTINATION bin
5858 COMPONENT multipassd)
59+
60+ get_target_property (QT_FEATURES Qt6::Core QT_ENABLED_PUBLIC_FEATURES )
61+
62+ if (LINUX AND DEFINED VCPKG_INSTALLED_DIR AND "dbus" IN_LIST QT_FEATURES)
63+ set_target_properties (sshfs_server PROPERTIES BUILD_RPATH "\$ ORIGIN/../lib" )
64+
65+ if (NOT TARGET dbus-1)
66+ find_package (DBus1 REQUIRED CONFIG )
67+ endif ()
68+
69+ get_target_property (DBUS1_LIB dbus-1 IMPORTED_LOCATION )
70+ get_filename_component (DBUS1_LIB_REAL "${DBUS1_LIB} " REALPATH )
71+ set (DBUS1_LIB_COPY "${CMAKE_BINARY_DIR} /lib/libdbus-1.so.3" )
72+
73+ add_custom_command (
74+ OUTPUT "${DBUS1_LIB_COPY} "
75+ COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR} /lib"
76+ COMMAND ${CMAKE_COMMAND} -E copy_if_different "${DBUS1_LIB_REAL} " "${DBUS1_LIB_COPY} "
77+ DEPENDS "${DBUS1_LIB_REAL} "
78+ COMMENT "Copy libdbus-1.so.3 to build/lib to fix AppArmor permissions issue with VCPKG_INSTALLED_DIR"
79+ )
80+ add_custom_target (copy_dbus1 DEPENDS "${DBUS1_LIB_COPY} " )
81+ add_dependencies (sshfs_server copy_dbus1 )
82+ endif ()
You can’t perform that action at this time.
0 commit comments