2011-06-05 14:45:39 +00:00
|
|
|
|
|
|
|
|
SET(SRC_FILES
|
|
|
|
|
main.cpp
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# For Apple set the icns file containing icons
|
|
|
|
|
IF(APPLE AND BUILD_AS_BUNDLE)
|
|
|
|
|
# set how it shows up in the Info.plist file
|
|
|
|
|
SET(MACOSX_BUNDLE_ICON_FILE ${PROJECT_NAME}.icns)
|
|
|
|
|
# set where in the bundle to put the icns file
|
|
|
|
|
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
|
|
|
|
|
# include the icns file in the target
|
|
|
|
|
SET(SRC_FILES ${SRC_FILES} ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.icns)
|
|
|
|
|
ENDIF(APPLE AND BUILD_AS_BUNDLE)
|
|
|
|
|
|
|
|
|
|
# Add exe icon resource
|
|
|
|
|
IF(WIN32)
|
|
|
|
|
IF( MINGW )
|
|
|
|
|
# resource compilation for MinGW
|
|
|
|
|
ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/AppIco.o
|
|
|
|
|
COMMAND windres.exe -I${CMAKE_CURRENT_SOURCE_DIR} -i${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.rc
|
|
|
|
|
-o ${CMAKE_CURRENT_BINARY_DIR}/AppIco.o )
|
|
|
|
|
SET(SRC_FILES ${SRC_FILES} ${CMAKE_CURRENT_BINARY_DIR}/AppIco.o)
|
|
|
|
|
ELSE( MINGW )
|
|
|
|
|
SET(SRC_FILES ${SRC_FILES} ${PROJECT_NAME}.rc)
|
|
|
|
|
ENDIF( MINGW )
|
2023-03-25 22:41:28 -07:00
|
|
|
ENDIF(WIN32)
|
|
|
|
|
|
|
|
|
|
IF(BUILD_AS_BUNDLE)
|
|
|
|
|
ADD_DEFINITIONS("-DBUILD_AS_BUNDLE")
|
|
|
|
|
ENDIF()
|
2011-06-05 14:45:39 +00:00
|
|
|
|
|
|
|
|
# Add binary
|
|
|
|
|
IF(APPLE AND BUILD_AS_BUNDLE)
|
2023-02-12 16:18:01 -08:00
|
|
|
ADD_EXECUTABLE(rtabmap_app MACOSX_BUNDLE ${SRC_FILES})
|
2023-03-13 03:10:16 -07:00
|
|
|
ELSEIF(WIN32 AND BUILD_AS_BUNDLE)
|
2025-10-07 10:22:16 -07:00
|
|
|
ADD_EXECUTABLE(rtabmap_app ${SRC_FILES})
|
2011-06-05 14:45:39 +00:00
|
|
|
ELSE()
|
2023-02-12 16:18:01 -08:00
|
|
|
ADD_EXECUTABLE(rtabmap_app ${SRC_FILES})
|
2011-06-05 14:45:39 +00:00
|
|
|
ENDIF()
|
2023-02-12 16:18:01 -08:00
|
|
|
TARGET_LINK_LIBRARIES(rtabmap_app rtabmap_gui)
|
2011-06-05 14:45:39 +00:00
|
|
|
|
|
|
|
|
IF(APPLE AND BUILD_AS_BUNDLE)
|
2023-02-12 16:18:01 -08:00
|
|
|
SET_TARGET_PROPERTIES(rtabmap_app PROPERTIES
|
2011-06-05 14:45:39 +00:00
|
|
|
OUTPUT_NAME ${CMAKE_BUNDLE_NAME})
|
|
|
|
|
ELSEIF(WIN32)
|
2023-02-12 16:18:01 -08:00
|
|
|
SET_TARGET_PROPERTIES(rtabmap_app PROPERTIES
|
2011-06-05 14:45:39 +00:00
|
|
|
OUTPUT_NAME ${PROJECT_NAME})
|
|
|
|
|
ELSE()
|
2023-02-12 16:18:01 -08:00
|
|
|
SET_TARGET_PROPERTIES(rtabmap_app PROPERTIES
|
2011-06-05 14:45:39 +00:00
|
|
|
OUTPUT_NAME ${PROJECT_PREFIX})
|
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
#---------------------------
|
|
|
|
|
# Installation stuff
|
|
|
|
|
#---------------------------
|
2023-02-12 16:18:01 -08:00
|
|
|
INSTALL(TARGETS rtabmap_app
|
2014-12-17 17:28:21 +01:00
|
|
|
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT runtime
|
2011-06-05 14:45:39 +00:00
|
|
|
BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}" COMPONENT runtime)
|
|
|
|
|
|
|
|
|
|
IF(APPLE AND BUILD_AS_BUNDLE)
|
|
|
|
|
INSTALL(CODE "execute_process(COMMAND ln -s \"../MacOS/${CMAKE_BUNDLE_NAME}\" ${PROJECT_NAME}
|
|
|
|
|
WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin)")
|
|
|
|
|
ENDIF(APPLE AND BUILD_AS_BUNDLE)
|
|
|
|
|
|
2018-09-04 15:44:37 -04:00
|
|
|
IF(BUILD_AS_BUNDLE AND (APPLE OR WIN32))
|
2014-06-16 22:00:10 +00:00
|
|
|
SET(APPS "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin/${PROJECT_NAME}${CMAKE_EXECUTABLE_SUFFIX}")
|
2024-01-15 23:53:27 -08:00
|
|
|
SET(plugin_dest_dir bin/plugins)
|
2011-06-05 14:45:39 +00:00
|
|
|
SET(qtconf_dest_dir bin)
|
2024-01-15 20:51:12 -08:00
|
|
|
SET(thirdparty_dest_dir bin)
|
2014-06-16 22:00:10 +00:00
|
|
|
|
2011-06-05 14:45:39 +00:00
|
|
|
IF(APPLE)
|
2024-01-15 20:51:12 -08:00
|
|
|
SET(plugin_dest_dir MacOS/plugins)
|
|
|
|
|
IF(Qt6_FOUND)
|
|
|
|
|
SET(plugin_dest_dir PlugIns)
|
|
|
|
|
ENDIF()
|
2011-06-05 14:45:39 +00:00
|
|
|
SET(qtconf_dest_dir Resources)
|
2024-01-15 20:51:12 -08:00
|
|
|
SET(thirdparty_dest_dir MacOS)
|
|
|
|
|
SET(APPS "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/MacOS/${CMAKE_BUNDLE_NAME}")
|
2011-06-05 14:45:39 +00:00
|
|
|
ENDIF(APPLE)
|
|
|
|
|
|
2014-06-16 22:00:10 +00:00
|
|
|
IF(OpenNI2_FOUND)
|
|
|
|
|
# Install needed OpenNI sensor dll by copying directories from the OpenNI2 installation
|
|
|
|
|
IF(WIN32)
|
|
|
|
|
find_path(OpenNI2_BIN_DIR NAMES OpenNI2.dll)
|
|
|
|
|
IF(NOT OpenNI2_BIN_DIR)
|
|
|
|
|
MESSAGE(FATAL_ERROR "OpenNI2.dll not found! Verify your PATH.")
|
|
|
|
|
ENDIF(NOT OpenNI2_BIN_DIR)
|
2014-06-17 01:45:52 +00:00
|
|
|
ELSE()
|
|
|
|
|
# Mac OS X
|
|
|
|
|
get_filename_component(OpenNI2_BIN_DIR "${OpenNI2_LIBRARY}" PATH)
|
|
|
|
|
ENDIF()
|
|
|
|
|
|
2014-06-16 22:00:10 +00:00
|
|
|
INSTALL(DIRECTORY "${OpenNI2_BIN_DIR}/OpenNI2"
|
2024-01-15 23:39:41 -08:00
|
|
|
DESTINATION ${thirdparty_dest_dir}
|
2014-06-16 22:00:10 +00:00
|
|
|
COMPONENT runtime
|
|
|
|
|
REGEX ".*pdb" EXCLUDE)
|
2026-03-15 14:57:27 -07:00
|
|
|
IF(NOT WIN32)
|
|
|
|
|
INSTALL(FILES "${OpenNI2_BIN_DIR}/OpenNI.ini"
|
2024-01-15 20:51:12 -08:00
|
|
|
DESTINATION ${thirdparty_dest_dir}
|
2014-06-17 01:45:52 +00:00
|
|
|
COMPONENT runtime)
|
2026-03-15 14:57:27 -07:00
|
|
|
ENDIF()
|
2014-06-16 22:00:10 +00:00
|
|
|
ENDIF(OpenNI2_FOUND)
|
2020-07-01 14:46:37 -04:00
|
|
|
|
|
|
|
|
IF(k4a_FOUND)
|
|
|
|
|
# Install needed depthengine_2_0.dll
|
|
|
|
|
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"
|
2024-01-15 20:51:12 -08:00
|
|
|
DESTINATION ${thirdparty_dest_dir}
|
2020-07-01 14:46:37 -04:00
|
|
|
COMPONENT runtime)
|
|
|
|
|
ENDIF(WIN32)
|
|
|
|
|
ENDIF(k4a_FOUND)
|
2021-12-29 15:13:13 -05:00
|
|
|
|
2025-07-13 16:56:55 -07:00
|
|
|
IF(ZED_FOUND)
|
|
|
|
|
# Install needed zlibwapi.dll
|
|
|
|
|
IF(WIN32)
|
|
|
|
|
file(TO_CMAKE_PATH "$ENV{ZED_SDK_ROOT_DIR}" ENV_ZED_SDK_ROOT_DIR)
|
|
|
|
|
INSTALL(FILES "${ENV_ZED_SDK_ROOT_DIR}/bin/zlibwapi.dll"
|
|
|
|
|
DESTINATION ${thirdparty_dest_dir}
|
|
|
|
|
COMPONENT runtime)
|
|
|
|
|
ENDIF(WIN32)
|
|
|
|
|
ENDIF(ZED_FOUND)
|
2025-10-12 16:54:05 -07:00
|
|
|
|
|
|
|
|
IF(OrbbecSDK_FOUND)
|
|
|
|
|
# Install needed "extensions" folder
|
|
|
|
|
IF(WIN32)
|
|
|
|
|
find_path(OrbbecSDK_BIN_DIR NAMES OrbbecSDK.dll)
|
|
|
|
|
IF(NOT OrbbecSDK_BIN_DIR)
|
|
|
|
|
MESSAGE(FATAL_ERROR "OrbbecSDK.dll not found! Verify your PATH.")
|
|
|
|
|
ENDIF(NOT OrbbecSDK_BIN_DIR)
|
|
|
|
|
MESSAGE(FATAL "OrbbecSDK_BIN_DIR=${OrbbecSDK_BIN_DIR}")
|
|
|
|
|
INSTALL(DIRECTORY "${OrbbecSDK_BIN_DIR}/extensions"
|
|
|
|
|
DESTINATION ${thirdparty_dest_dir}
|
|
|
|
|
COMPONENT runtime
|
|
|
|
|
FILES_MATCHING
|
|
|
|
|
PATTERN "*.lib" EXCLUDE
|
|
|
|
|
PATTERN "*")
|
|
|
|
|
ENDIF(WIN32)
|
|
|
|
|
ENDIF(OrbbecSDK_FOUND)
|
2025-07-13 16:56:55 -07:00
|
|
|
|
2021-12-29 15:13:13 -05:00
|
|
|
IF(Torch_FOUND)
|
2026-03-15 14:57:27 -07:00
|
|
|
# Install needed cudnn dlls
|
2021-12-29 15:13:13 -05:00
|
|
|
IF(WIN32 AND CUDA_FOUND)
|
2026-03-15 14:57:27 -07:00
|
|
|
find_path(cuDNN_BIN_DIR NAMES cudnn.dll cudnn64.dll cudnn64_9.dll)
|
|
|
|
|
IF(NOT cuDNN_BIN_DIR)
|
|
|
|
|
MESSAGE(FATAL_ERROR "cudnn dlls not found! Make sure the dlls are in a directory on your PATH.")
|
|
|
|
|
ENDIF(NOT cuDNN_BIN_DIR)
|
|
|
|
|
MESSAGE(STATUS "cuDNN_BIN_DIR = ${cuDNN_BIN_DIR}")
|
|
|
|
|
file(GLOB CUDNN_DLLS "${cuDNN_BIN_DIR}/cudnn*.dll")
|
|
|
|
|
IF(CUDNN_DLLS)
|
|
|
|
|
MESSAGE(STATUS "Found cuDNN DLLs: ${CUDNN_DLLS}")
|
|
|
|
|
INSTALL(FILES ${CUDNN_DLLS}
|
|
|
|
|
DESTINATION ${thirdparty_dest_dir}
|
|
|
|
|
COMPONENT runtime)
|
2021-12-29 15:13:13 -05:00
|
|
|
ENDIF()
|
|
|
|
|
ENDIF(WIN32 AND CUDA_FOUND)
|
|
|
|
|
ENDIF(Torch_FOUND)
|
2026-03-15 14:57:27 -07:00
|
|
|
|
|
|
|
|
set(python_pyd_dir "")
|
|
|
|
|
IF(Python3_FOUND)
|
|
|
|
|
# bundle python3
|
|
|
|
|
IF(WIN32)
|
|
|
|
|
set(python_pyd_dir "bin/Lib/site-packages")
|
|
|
|
|
set(PYTHON_ZIP_NAME "python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}.zip")
|
|
|
|
|
get_filename_component(PYTHON_ROOT "${Python3_EXECUTABLE}" DIRECTORY)
|
|
|
|
|
file(TO_CMAKE_PATH "${Python3_STDLIB}" SANITIZED_STDLIB)
|
2014-06-16 22:00:10 +00:00
|
|
|
|
2026-03-15 14:57:27 -07:00
|
|
|
MESSAGE(STATUS "Python3_EXECUTABLE=${Python3_EXECUTABLE}")
|
|
|
|
|
MESSAGE(STATUS "Python3_STDLIB=${SANITIZED_STDLIB}")
|
|
|
|
|
|
|
|
|
|
install(FILES "${Python3_EXECUTABLE}" DESTINATION bin COMPONENT runtime)
|
|
|
|
|
|
|
|
|
|
# when using python-opencv, it expects python3.dll, not python312.dll
|
|
|
|
|
get_filename_component(VCPKG_TRIPLET_ROOT "${PYTHON_TOOLS_DIR}/../../" ABSOLUTE)
|
|
|
|
|
set(VCPKG_BIN_DIR "${VCPKG_TRIPLET_ROOT}/bin")
|
|
|
|
|
find_file(PYTHON3_STABLE_DLL
|
|
|
|
|
NAMES python3.dll
|
|
|
|
|
PATHS "${VCPKG_BIN_DIR}"
|
|
|
|
|
NO_DEFAULT_PATH
|
|
|
|
|
)
|
|
|
|
|
if(PYTHON3_STABLE_DLL)
|
|
|
|
|
message(STATUS "Found python3.dll at: ${PYTHON3_STABLE_DLL}")
|
|
|
|
|
install(FILES "${PYTHON3_STABLE_DLL}" DESTINATION bin COMPONENT runtime)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
# install python Lib in python312.zip (without site-packages, which is installed separatly afterwards)
|
|
|
|
|
file(TO_CMAKE_PATH "${Python3_STDLIB}" SANITIZED_STDLIB)
|
|
|
|
|
file(GLOB LIB_CONTENTS RELATIVE "${SANITIZED_STDLIB}" "${SANITIZED_STDLIB}/*")
|
|
|
|
|
list(REMOVE_ITEM LIB_CONTENTS "site-packages")
|
|
|
|
|
install(CODE "
|
|
|
|
|
execute_process(
|
|
|
|
|
COMMAND \"${CMAKE_COMMAND}\" -E tar cf \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin/${PYTHON_ZIP_NAME}\" --format=zip -- ${LIB_CONTENTS}
|
|
|
|
|
WORKING_DIRECTORY \"${SANITIZED_STDLIB}\"
|
|
|
|
|
)
|
|
|
|
|
" COMPONENT runtime)
|
|
|
|
|
set(PYTHON_SITE_PACKAGES "${SANITIZED_STDLIB}/site-packages")
|
|
|
|
|
|
|
|
|
|
install(DIRECTORY "${PYTHON_SITE_PACKAGES}/"
|
|
|
|
|
DESTINATION "${thirdparty_dest_dir}/Lib/site-packages"
|
|
|
|
|
COMPONENT runtime
|
|
|
|
|
PATTERN "*.exe" EXCLUDE
|
|
|
|
|
PATTERN "*.lib" EXCLUDE
|
|
|
|
|
PATTERN "*.hpp" EXCLUDE
|
|
|
|
|
PATTERN "*.h" EXCLUDE
|
|
|
|
|
PATTERN "*/torch/*" EXCLUDE
|
|
|
|
|
)
|
|
|
|
|
if(EXISTS "${PYTHON_SITE_PACKAGES}/torch")
|
|
|
|
|
install(DIRECTORY "${PYTHON_SITE_PACKAGES}/torch"
|
|
|
|
|
DESTINATION "${thirdparty_dest_dir}/Lib/site-packages/"
|
|
|
|
|
COMPONENT runtime
|
|
|
|
|
PATTERN "*.exe" EXCLUDE
|
|
|
|
|
PATTERN "*.lib" EXCLUDE
|
|
|
|
|
PATTERN "*.hpp" EXCLUDE
|
|
|
|
|
PATTERN "*.h" EXCLUDE
|
|
|
|
|
PATTERN "*.dll" EXCLUDE
|
|
|
|
|
)
|
|
|
|
|
file(GLOB_RECURSE PY_DLL_FILES "${PYTHON_SITE_PACKAGES}/torch/*.dll")
|
|
|
|
|
if(PY_DLL_FILES)
|
|
|
|
|
install(FILES ${PY_DLL_FILES} DESTINATION bin COMPONENT runtime)
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
# install python DDLs
|
|
|
|
|
file(GLOB_RECURSE PY_DLL_FILES \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${python_pyd_dir}/*.dll\")
|
|
|
|
|
install(DIRECTORY "${PYTHON_ROOT}/DLLs"
|
|
|
|
|
DESTINATION "${thirdparty_dest_dir}/"
|
|
|
|
|
COMPONENT runtime
|
|
|
|
|
FILES_MATCHING
|
|
|
|
|
PATTERN "*.dll"
|
|
|
|
|
PATTERN "*.pyd"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# install our python scripts in share for convenience
|
|
|
|
|
install(DIRECTORY "${PROJECT_SOURCE_DIR}/corelib/src/python/"
|
|
|
|
|
DESTINATION share
|
|
|
|
|
COMPONENT runtime
|
|
|
|
|
FILES_MATCHING
|
|
|
|
|
PATTERN "*.py"
|
|
|
|
|
)
|
|
|
|
|
ENDIF(WIN32)
|
|
|
|
|
ENDIF(Python3_FOUND)
|
|
|
|
|
|
2023-03-16 23:07:13 -07:00
|
|
|
IF(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()
|
2024-01-15 20:51:12 -08:00
|
|
|
include(\"${QT_DEPLOY_SUPPORT}\")
|
2023-03-16 23:07:13 -07:00
|
|
|
qt_deploy_runtime_dependencies(
|
|
|
|
|
EXECUTABLE \"${APPS}\"
|
2024-01-15 20:51:12 -08:00
|
|
|
PLUGINS_DIR ${plugin_dest_dir}
|
|
|
|
|
GENERATE_QT_CONF
|
|
|
|
|
NO_TRANSLATIONS
|
|
|
|
|
VERBOSE
|
2023-03-16 23:07:13 -07:00
|
|
|
)")
|
2024-01-15 20:51:12 -08:00
|
|
|
IF("${CMAKE_BUILD_TYPE}" STREQUAL "" OR "${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
|
|
|
|
install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/deploy_appDebug.cmake"
|
2024-01-15 20:41:18 -08:00
|
|
|
CONFIGURATIONS Debug
|
|
|
|
|
COMPONENT runtime)
|
2024-01-15 20:51:12 -08:00
|
|
|
ENDIF()
|
|
|
|
|
IF("${CMAKE_BUILD_TYPE}" STREQUAL "" OR "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
|
2024-01-15 20:41:18 -08:00
|
|
|
install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/deploy_appRelease.cmake"
|
|
|
|
|
CONFIGURATIONS Release
|
|
|
|
|
COMPONENT runtime)
|
2024-01-15 20:51:12 -08:00
|
|
|
ENDIF()
|
|
|
|
|
IF("${CMAKE_BUILD_TYPE}" STREQUAL "" OR "${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
|
2024-01-15 20:41:18 -08:00
|
|
|
install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/deploy_appRelWithDebInfo.cmake"
|
|
|
|
|
CONFIGURATIONS RelWithDebInfo
|
|
|
|
|
COMPONENT runtime)
|
2024-01-15 20:51:12 -08:00
|
|
|
ENDIF()
|
|
|
|
|
IF("${CMAKE_BUILD_TYPE}" STREQUAL "" OR "${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel")
|
2024-01-15 20:41:18 -08:00
|
|
|
install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/deploy_appMinSizeRel.cmake"
|
|
|
|
|
CONFIGURATIONS MinSizeRel
|
|
|
|
|
COMPONENT runtime)
|
2024-01-15 20:51:12 -08:00
|
|
|
ENDIF()
|
2023-03-16 23:07:13 -07:00
|
|
|
ELSEIF(Qt5_FOUND)
|
2024-01-15 20:41:18 -08:00
|
|
|
#Qt5
|
|
|
|
|
foreach(plugin ${Qt5Gui_PLUGINS})
|
|
|
|
|
get_target_property(plugin_loc ${plugin} LOCATION)
|
|
|
|
|
get_filename_component(plugin_dir ${plugin_loc} DIRECTORY)
|
|
|
|
|
string(REPLACE "plugins" ";" loc_list ${plugin_dir})
|
|
|
|
|
list(GET loc_list 1 plugin_type)
|
|
|
|
|
IF(NOT plugin_root)
|
|
|
|
|
get_filename_component(plugin_root ${plugin_dir} DIRECTORY)
|
|
|
|
|
ENDIF(NOT plugin_root)
|
2024-01-15 20:51:12 -08:00
|
|
|
#MESSAGE(STATUS "Qt5 plugin \"${plugin_loc}\" installed in \"${plugin_dest_dir}${plugin_type}\"")
|
2024-01-15 20:41:18 -08:00
|
|
|
INSTALL(FILES ${plugin_loc}
|
2024-01-15 20:51:12 -08:00
|
|
|
DESTINATION ${plugin_dest_dir}${plugin_type}
|
2024-01-15 20:41:18 -08:00
|
|
|
COMPONENT runtime)
|
|
|
|
|
endforeach()
|
|
|
|
|
IF(NOT Qt5Widgets_VERSION VERSION_LESS 5.10.0)
|
|
|
|
|
IF(WIN32)
|
|
|
|
|
SET(plugin_loc "${plugin_root}/styles/qwindowsvistastyle.dll")
|
|
|
|
|
ELSEIF(APPLE)
|
|
|
|
|
SET(plugin_loc "${plugin_root}/styles/libqmacstyle.dylib")
|
|
|
|
|
ENDIF()
|
|
|
|
|
IF(EXISTS ${plugin_loc})
|
|
|
|
|
get_filename_component(plugin_dir ${plugin_loc} DIRECTORY)
|
|
|
|
|
string(REPLACE "plugins" ";" loc_list ${plugin_dir})
|
|
|
|
|
list(GET loc_list 1 plugin_type)
|
|
|
|
|
INSTALL(FILES ${plugin_loc}
|
|
|
|
|
DESTINATION ${plugin_dest_dir}/plugins${plugin_type}
|
|
|
|
|
COMPONENT runtime)
|
2024-01-15 20:51:12 -08:00
|
|
|
#MESSAGE(STATUS "Qt5 plugin \"${plugin_loc}\" installed in \"${plugin_dest_dir}${plugin_type}\"")
|
2024-01-15 20:41:18 -08:00
|
|
|
ENDIF(EXISTS ${plugin_loc})
|
|
|
|
|
ENDIF(NOT Qt5Widgets_VERSION VERSION_LESS 5.10.0)
|
2023-03-16 23:07:13 -07:00
|
|
|
ELSEIF(QT_PLUGINS_DIR) # Qt4
|
|
|
|
|
# Install needed Qt plugins by copying directories from the qt installation
|
2024-01-15 20:41:18 -08:00
|
|
|
# One can cull what gets copied by using 'REGEX "..." EXCLUDE'
|
|
|
|
|
# Exclude debug libraries
|
|
|
|
|
INSTALL(DIRECTORY "${QT_PLUGINS_DIR}/imageformats"
|
2024-01-15 20:51:12 -08:00
|
|
|
DESTINATION ${plugin_dest_dir}
|
2024-01-15 20:41:18 -08:00
|
|
|
COMPONENT runtime
|
|
|
|
|
REGEX ".*d4.dll" EXCLUDE
|
|
|
|
|
REGEX ".*d4.a" EXCLUDE)
|
2016-06-04 15:17:13 -04:00
|
|
|
ENDIF()
|
2023-03-16 23:07:13 -07:00
|
|
|
|
2024-01-15 20:41:18 -08:00
|
|
|
IF(Qt5_FOUND OR QT4_FOUND)
|
|
|
|
|
# install a qt.conf file
|
|
|
|
|
# this inserts some cmake code into the install script to write the file
|
|
|
|
|
SET(QT_CONF_FILE [Paths]\nPlugins=plugins)
|
|
|
|
|
IF(APPLE)
|
|
|
|
|
SET(QT_CONF_FILE [Paths]\nPlugins=MacOS/plugins)
|
|
|
|
|
ENDIF(APPLE)
|
|
|
|
|
INSTALL(CODE "
|
|
|
|
|
file(WRITE \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${qtconf_dest_dir}/qt.conf\" \"${QT_CONF_FILE}\")
|
|
|
|
|
" COMPONENT runtime)
|
2024-01-15 20:51:12 -08:00
|
|
|
ENDIF()
|
|
|
|
|
|
2024-01-15 20:45:58 -08:00
|
|
|
# directories to look for dependencies
|
2024-01-15 20:51:12 -08:00
|
|
|
SET(DIRS "${QT_LIBRARY_DIRS}" "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/lib")
|
2024-01-15 20:45:58 -08:00
|
|
|
IF(APPLE)
|
|
|
|
|
SET(DIRS ${DIRS} /usr/local /usr/local/lib /opt/homebrew /opt/homebrew/lib /opt/homebrew/lib/gcc/current)
|
2026-03-15 14:57:27 -07:00
|
|
|
ENDIF(APPLE)
|
|
|
|
|
|
2011-06-05 14:45:39 +00:00
|
|
|
# Now the work of copying dependencies into the bundle/package
|
|
|
|
|
# The quotes are escaped and variables to use at install time have their $ escaped
|
|
|
|
|
# An alternative is the do a configure_file() on a script and use install(SCRIPT ...).
|
|
|
|
|
# Note that the image plugins depend on QtSvg and QtXml, and it got those copied
|
|
|
|
|
# over.
|
|
|
|
|
# To find dependencies, cmake use "otool" on Apple and "dumpbin" on Windows (make sure you have one of them).
|
|
|
|
|
install(CODE "
|
2026-03-15 14:57:27 -07:00
|
|
|
# Glob Qt Plugins
|
|
|
|
|
file(GLOB_RECURSE ALL_LIBS \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
|
|
|
|
|
|
|
|
|
|
if(NOT \"${python_pyd_dir}\" STREQUAL \"\")
|
|
|
|
|
file(GLOB_RECURSE PYD_FILES \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${python_pyd_dir}/*.pyd\")
|
|
|
|
|
if(PYD_FILES)
|
|
|
|
|
list(APPEND ALL_LIBS \${PYD_FILES})
|
|
|
|
|
endif()
|
|
|
|
|
if(WIN32)
|
|
|
|
|
file(GLOB_RECURSE DLL_FILES \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${python_pyd_dir}/torch/*.dll\")
|
|
|
|
|
if(DLL_FILES)
|
|
|
|
|
list(APPEND ALL_LIBS \${DLL_FILES})
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
|
2015-04-25 17:50:24 -04:00
|
|
|
set(BU_CHMOD_BUNDLE_ITEMS ON)
|
2011-06-05 14:45:39 +00:00
|
|
|
include(\"BundleUtilities\")
|
2026-03-15 14:57:27 -07:00
|
|
|
fixup_bundle(\"${APPS}\" \"\${ALL_LIBS}\" \"${DIRS}\")
|
|
|
|
|
" COMPONENT runtime)
|
|
|
|
|
|
2018-09-04 19:01:43 -04:00
|
|
|
ENDIF(BUILD_AS_BUNDLE AND (APPLE OR WIN32))
|
2011-06-05 14:45:39 +00:00
|
|
|
|