mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +08:00
MacOS and Windows binaries update (0.23.8) (#1726)
* Windows CI: more sensor drivers + Windows/macOS bundle scripts * added opengv to mac build * windows bundle fixes * zed extra neural ddl in separate package * OpenGV macos eigen version error * opengv macos build issues
This commit is contained in:
@@ -24,17 +24,25 @@ IF(WIN32)
|
||||
ELSE( MINGW )
|
||||
SET(SRC_FILES ${SRC_FILES} ${PROJECT_NAME}.rc)
|
||||
ENDIF( MINGW )
|
||||
ENDIF(WIN32)
|
||||
|
||||
IF(BUILD_AS_BUNDLE)
|
||||
ADD_DEFINITIONS("-DBUILD_AS_BUNDLE")
|
||||
ENDIF(WIN32)
|
||||
|
||||
IF(BUILD_AS_BUNDLE)
|
||||
ADD_DEFINITIONS("-DBUILD_AS_BUNDLE")
|
||||
ENDIF()
|
||||
|
||||
# Add binary
|
||||
IF(APPLE AND BUILD_AS_BUNDLE)
|
||||
ADD_EXECUTABLE(rtabmap_app MACOSX_BUNDLE ${SRC_FILES})
|
||||
# Custom Info.plist providing NSCameraUsageDescription, required by macOS to
|
||||
# grant the app access to USB/UVC cameras (e.g. Orbbec, RealSense). A bundle
|
||||
# identifier is also set: macOS ties the camera (TCC) permission to it, so it
|
||||
# must be non-empty for the permission to be granted/persisted.
|
||||
SET_TARGET_PROPERTIES(rtabmap_app PROPERTIES
|
||||
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in
|
||||
MACOSX_BUNDLE_GUI_IDENTIFIER "com.introlab.rtabmap"
|
||||
MACOSX_BUNDLE_BUNDLE_NAME "${CMAKE_BUNDLE_NAME}")
|
||||
ELSEIF(WIN32 AND BUILD_AS_BUNDLE)
|
||||
ADD_EXECUTABLE(rtabmap_app ${SRC_FILES})
|
||||
ADD_EXECUTABLE(rtabmap_app WIN32 ${SRC_FILES})
|
||||
ELSE()
|
||||
ADD_EXECUTABLE(rtabmap_app ${SRC_FILES})
|
||||
ENDIF()
|
||||
@@ -70,13 +78,13 @@ IF(BUILD_AS_BUNDLE AND (APPLE OR WIN32))
|
||||
SET(thirdparty_dest_dir bin)
|
||||
|
||||
IF(APPLE)
|
||||
SET(plugin_dest_dir MacOS/plugins)
|
||||
IF(Qt6_FOUND)
|
||||
SET(plugin_dest_dir PlugIns)
|
||||
SET(plugin_dest_dir MacOS/plugins)
|
||||
IF(Qt6_FOUND)
|
||||
SET(plugin_dest_dir PlugIns)
|
||||
ENDIF()
|
||||
SET(qtconf_dest_dir Resources)
|
||||
SET(thirdparty_dest_dir MacOS)
|
||||
SET(APPS "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/MacOS/${CMAKE_BUNDLE_NAME}")
|
||||
SET(APPS "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/MacOS/${CMAKE_BUNDLE_NAME}")
|
||||
ENDIF(APPLE)
|
||||
|
||||
IF(OpenNI2_FOUND)
|
||||
@@ -103,12 +111,26 @@ IF(BUILD_AS_BUNDLE AND (APPLE OR WIN32))
|
||||
ENDIF(OpenNI2_FOUND)
|
||||
|
||||
IF(k4a_FOUND)
|
||||
# Install needed depthengine_2_0.dll
|
||||
# Install needed depthengine_2_0.dll. Its location varies by K4A SDK version:
|
||||
# v1.4.1 ships it under sdk/windows-desktop/amd64/release/bin, or fallback in tools/.
|
||||
IF(WIN32)
|
||||
file(TO_CMAKE_PATH "$ENV{K4A_ROOT_DIR}" ENV_K4A_ROOT_DIR)
|
||||
INSTALL(FILES "${ENV_K4A_ROOT_DIR}/tools/depthengine_2_0.dll"
|
||||
DESTINATION ${thirdparty_dest_dir}
|
||||
COMPONENT runtime)
|
||||
set(DEPTHENGINE_DLL "")
|
||||
foreach(_depthengine_dir
|
||||
"${ENV_K4A_ROOT_DIR}/sdk/windows-desktop/amd64/release/bin"
|
||||
"${ENV_K4A_ROOT_DIR}/tools")
|
||||
if(EXISTS "${_depthengine_dir}/depthengine_2_0.dll")
|
||||
set(DEPTHENGINE_DLL "${_depthengine_dir}/depthengine_2_0.dll")
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
IF(DEPTHENGINE_DLL)
|
||||
INSTALL(FILES "${DEPTHENGINE_DLL}"
|
||||
DESTINATION ${thirdparty_dest_dir}
|
||||
COMPONENT runtime)
|
||||
ELSE()
|
||||
MESSAGE(WARNING "depthengine_2_0.dll not found under $ENV{K4A_ROOT_DIR} (sdk/windows-desktop/amd64/release/bin or tools); Kinect for Azure depth may not work at runtime.")
|
||||
ENDIF()
|
||||
ENDIF(WIN32)
|
||||
ENDIF(k4a_FOUND)
|
||||
|
||||
@@ -241,14 +263,49 @@ IF(BUILD_AS_BUNDLE AND (APPLE OR WIN32))
|
||||
ENDIF(WIN32)
|
||||
ENDIF(Python3_FOUND)
|
||||
|
||||
IF(Qt6_FOUND)
|
||||
IF(Qt6_FOUND AND APPLE)
|
||||
# On macOS we do NOT use qt_deploy_runtime_dependencies (macdeployqt):
|
||||
# macdeployqt cannot deploy VTK 9.6+, whose libraries reference each other
|
||||
# via @rpath relative to "@loader_path/../lib". Instead we install the Qt plugins
|
||||
# manually and let fixup_bundle() below deploy all libraries.
|
||||
IF(TARGET Qt6::QCocoaIntegrationPlugin)
|
||||
get_target_property(_qt_plugin_loc Qt6::QCocoaIntegrationPlugin LOCATION)
|
||||
get_filename_component(_qt_plugins_dir "${_qt_plugin_loc}" DIRECTORY) # .../plugins/platforms
|
||||
get_filename_component(_qt_plugins_dir "${_qt_plugins_dir}" DIRECTORY) # .../plugins
|
||||
FOREACH(_qt_plugin_type platforms styles imageformats iconengines)
|
||||
IF(EXISTS "${_qt_plugins_dir}/${_qt_plugin_type}")
|
||||
# Homebrew Qt plugins are symlinks into the Cellar; resolve them to the
|
||||
# real files so they aren't installed as dangling symlinks (which would
|
||||
# break fixup_bundle and codesign).
|
||||
FILE(GLOB _qt_plugin_files "${_qt_plugins_dir}/${_qt_plugin_type}/*${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
SET(_qt_plugin_real "")
|
||||
FOREACH(_qt_plugin_file ${_qt_plugin_files})
|
||||
GET_FILENAME_COMPONENT(_qt_plugin_file "${_qt_plugin_file}" REALPATH)
|
||||
LIST(APPEND _qt_plugin_real "${_qt_plugin_file}")
|
||||
ENDFOREACH()
|
||||
IF(_qt_plugin_real)
|
||||
INSTALL(FILES ${_qt_plugin_real}
|
||||
DESTINATION ${plugin_dest_dir}/${_qt_plugin_type}
|
||||
COMPONENT runtime)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
ELSE()
|
||||
MESSAGE(WARNING "Qt6::QCocoaIntegrationPlugin target not found: Qt plugins may be missing from the bundle")
|
||||
ENDIF()
|
||||
# qt.conf so Qt finds the bundled plugins (path is relative to Contents/)
|
||||
SET(QT_CONF_FILE [Paths]\nPlugins=${plugin_dest_dir})
|
||||
INSTALL(CODE "
|
||||
file(WRITE \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${qtconf_dest_dir}/qt.conf\" \"${QT_CONF_FILE}\")
|
||||
" COMPONENT runtime)
|
||||
ELSEIF(Qt6_FOUND)
|
||||
# Reference: https://doc-snapshots.qt.io/qt6-6.4/qt-deploy-runtime-dependencies.html
|
||||
# The following script must only be executed at install time
|
||||
set(deploy_script "${CMAKE_CURRENT_BINARY_DIR}/deploy_app$<CONFIG>.cmake")
|
||||
file(GENERATE OUTPUT ${deploy_script} CONTENT "
|
||||
# Including the file pointed to by QT_DEPLOY_SUPPORT ensures the generated
|
||||
# deployment script has access to qt_deploy_runtime_dependencies()
|
||||
include(\"${QT_DEPLOY_SUPPORT}\")
|
||||
include(\"${QT_DEPLOY_SUPPORT}\")
|
||||
qt_deploy_runtime_dependencies(
|
||||
EXECUTABLE \"${APPS}\"
|
||||
PLUGINS_DIR ${plugin_dest_dir}
|
||||
@@ -328,10 +385,13 @@ IF(BUILD_AS_BUNDLE AND (APPLE OR WIN32))
|
||||
INSTALL(CODE "
|
||||
file(WRITE \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${qtconf_dest_dir}/qt.conf\" \"${QT_CONF_FILE}\")
|
||||
" COMPONENT runtime)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# directories to look for dependencies
|
||||
SET(DIRS "${QT_LIBRARY_DIRS}" "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/lib")
|
||||
# CMAKE_LIBRARY_OUTPUT_DIRECTORY is where rtabmap's own libraries (e.g.
|
||||
# librtabmap_core) are built; fixup_bundle needs it to resolve the app's
|
||||
# @rpath references to them (macdeployqt used to handle this via rpath).
|
||||
SET(DIRS "${QT_LIBRARY_DIRS}" "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}" "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/lib")
|
||||
IF(APPLE)
|
||||
SET(DIRS ${DIRS} /usr/local /usr/local/lib /opt/homebrew /opt/homebrew/lib /opt/homebrew/lib/gcc/current)
|
||||
ENDIF(APPLE)
|
||||
@@ -363,6 +423,25 @@ IF(BUILD_AS_BUNDLE AND (APPLE OR WIN32))
|
||||
include(\"BundleUtilities\")
|
||||
fixup_bundle(\"${APPS}\" \"\${ALL_LIBS}\" \"${DIRS}\")
|
||||
" COMPONENT runtime)
|
||||
|
||||
|
||||
IF(APPLE)
|
||||
# Re-sign ad-hoc AFTER fixup_bundle has finished all its install_name_tool
|
||||
# edits.
|
||||
install(CODE "
|
||||
set(_contents \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}\")
|
||||
get_filename_component(_app \"\${_contents}\" DIRECTORY)
|
||||
file(GLOB_RECURSE _nested \"\${_contents}/*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
|
||||
foreach(_f \${_nested})
|
||||
execute_process(COMMAND codesign --force --sign - --timestamp=none \"\${_f}\")
|
||||
endforeach()
|
||||
file(GLOB _frameworks \"\${_contents}/Frameworks/*.framework\")
|
||||
foreach(_f \${_frameworks})
|
||||
execute_process(COMMAND codesign --force --sign - --timestamp=none \"\${_f}\")
|
||||
endforeach()
|
||||
message(STATUS \"Ad-hoc re-signing bundle: \${_app}\")
|
||||
execute_process(COMMAND codesign --force --sign - --timestamp=none \"\${_app}\")
|
||||
" COMPONENT runtime)
|
||||
ENDIF(APPLE)
|
||||
|
||||
ENDIF(BUILD_AS_BUNDLE AND (APPLE OR WIN32))
|
||||
|
||||
|
||||
40
app/src/Info.plist.in
Normal file
40
app/src/Info.plist.in
Normal file
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>NSHighResolutionCapable</key>
|
||||
<string>True</string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>${MACOSX_BUNDLE_INFO_STRING}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleLongVersionString</key>
|
||||
<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
|
||||
<key>CSResourcesFileMapped</key>
|
||||
<true/>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
|
||||
<key>NSCameraUsageDescription</key>
|
||||
<string>RTAB-Map needs access to the camera to capture images from connected RGB-D/stereo cameras (e.g. Orbbec, RealSense).</string>
|
||||
</dict>
|
||||
</plist>
|
||||
Reference in New Issue
Block a user