QtWebEngineCore deployment issue
-
I have a program using QtWebEngine built on ArchLinux. When I do cmake --install, I have an error:
CMake Error at /usr/lib/cmake/Qt6WebEngineCore/Qt6WebEngineCoreDeploySupport.cmake:165 (file): file INSTALL cannot find "/usr/share/qt6/resources/icudtl.dat": No such file or directory. Call Stack (most recent call first): /usr/lib/cmake/Qt6WebEngineCore/Qt6WebEngineCoreDeploySupport.cmake:53 (_qt_internal_deploy_webenginecore_data) /usr/lib/cmake/Qt6WebEngineCore/Qt6WebEngineCoreDeploySupport.cmake:48 (_qt_internal_deploy_webenginecore) /usr/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake:174 (_qt_internal_webenginecore_deploy_hook) /usr/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake:174 (cmake_language) /usr/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake:315 (_qt_internal_run_deployment_hooks) /usr/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake:514 (_qt_internal_generic_deployqt) .qt/deploy_fuldon_e9f90ced5a.cmake:5 (qt6_deploy_runtime_dependencies) cmake_install.cmake:76 (include)
I've check the directory /usr/share/qt6/resources/, and there is no icudtl.dat file.
I've check the ArchLinux package content and there is no icudtl.dat file.
But in the /usr/lib/cmake/Qt6WebEngineCore/Qt6WebEngineCoreDeploySupport.cmake file, it looks for this file.
Do I need to add manually an icudtl.dat to /usr/share/qt6/resources? Because if I comment this file in searched in the list, cmake --install works. But doing this, at the next update of the package, I will lost my comment. -
I've found an icudtl.dat in /usr/local/resources. I suppose it's the system one.
I've made a small fix in my CMakeLists by doing:
if(LINUX) # Check if icudtl.dat exists for Qt6WebEngine deployment if(EXISTS "/usr/share/qt6/resources/icudtl.dat") message(STATUS "Found icudtl.dat in /usr/share/qt6/resources") else() # Check if icudtl.dat is in /usr/local/resources if(EXISTS "/usr/local/resources/icudtl.dat") message(STATUS "Found icudtl.dat in /usr/local/resources") # Generate a symlink from /usr/local/resources/icudtl.dat to /usr/share/qt6/resources install(CODE " message(STATUS \"Creating symlink for icudtl.dat\") execute_process( COMMAND ${CMAKE_COMMAND} -E create_symlink /usr/local/resources/icudtl.dat /usr/share/qt6/resources/icudtl.dat ) ") else() message(FATAL_ERROR "icudtl.dat not found in /usr/share/qt6/resources or /usr/local/resources") endif() endif() endif()
But I'm not sure that it's the best way to do it.