Deployment Error in Qt deployment script when using CPack
Hello Community.
I repost my issue here, which I have also posted in the official Qt Forum without success.
I am trying to deploy a Qt program using the qt_generate_deploy_app_script command and pack it up as RPM according to the instructions here: https://www.qt.io/blog/deploying-to-linux-with-cmake.
It seems to me, that the Qt deployment script does not work with the changed destination for installing, that is set by cpack.
I added a minimal program that illustrates the problem below. I am using Qt 6.7.2 on RHEL 9.2.
Thanks for any help,
Ralf
Steps to reproduce:
Code:
mkdir build
cd build
~/Qt/Tools/CMake/bin/cmake -DCMAKE_PREFIX_PATH=~/Qt/6.7.2/gcc_64/ ..
make
make package
The error is the following:
Code:
CMake Error at <HOME>/Qt/6.7.2/gcc_64/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake:139 (file):
file RPATH_SET given FILE
"/usr/plugins/egldeviceintegrations/libqeglfs-emu-integration.so" that does
not exist.
main.cpp
Code:
#include <QDebug>
#include <QApplication>
int main(int argc, char *argv[]) {
qDebug() << "Hello World";
}
CMakeLists.txt
Code:
cmake_minimum_required(VERSION 3.29.3)
project(helloworld VERSION 0.1 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_standard_project_setup()
qt_add_executable(helloworld main.cpp)
target_link_libraries(helloworld PRIVATE Qt6::Core Qt6::Gui Qt6::Widgets)
install(TARGETS helloworld)
qt_generate_deploy_app_script(
TARGET helloworld
OUTPUT_SCRIPT deploy_script
NO_TRANSLATIONS
NO_COMPILER_RUNTIME
NO_UNSUPPORTED_PLATFORM_ERROR
)
install(SCRIPT ${deploy_script})
set(CPACK_GENERATOR RPM)
include(CPack)
Re: Deployment Error in Qt deployment script when using CPack
Quote:
Originally Posted by
Ralf_G
Hello Community.
I repost my issue here, which I have also posted in the official Qt Forum without success.
I am trying to deploy a Qt program using the qt_generate_deploy_app_script command and pack it up as RPM according to the instructions here:
https://www.qt.io/blog/deploying-to-linux-with-cmake.
It seems to me, that the Qt deployment script does not work with the changed destination for installing, that is set by cpack.
I added a minimal program that illustrates the problem below. I am using Qt 6.7.2 on RHEL 9.2.
Thanks for any help,
Ralf
Steps to reproduce:
Code:
mkdir build
cd build
~/Qt/Tools/CMake/bin/cmake -DCMAKE_PREFIX_PATH=~/Qt/6.7.2/gcc_64/ ..
make
make package
The error is the following:
Code:
CMake Error at <HOME>/Qt/6.7.2/gcc_64/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake:139 (file):
file RPATH_SET given FILE
"/usr/plugins/egldeviceintegrations/libqeglfs-emu-integration.so" that does
not exist.
main.cpp
Code:
#include <QDebug>
#include <QApplication>
int main(int argc, char *argv[]) {
qDebug() << "Hello World";
}
CMakeLists.txt
Code:
cmake_minimum_required(VERSION 3.29.3)
project(helloworld VERSION 0.1 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_standard_project_setup()
qt_add_executable(helloworld main.cpp)
target_link_libraries(helloworld PRIVATE Qt6::Core Qt6::Gui Qt6::Widgets)
install(TARGETS helloworld)
qt_generate_deploy_app_script(
TARGET helloworld
OUTPUT_SCRIPT deploy_script
NO_TRANSLATIONS
NO_COMPILER_RUNTIME
NO_UNSUPPORTED_PLATFORM_ERROR
)
install(SCRIPT ${deploy_script})
set(CPACK_GENERATOR RPM)
include(CPack)
This might be due to the script expecting the original installation directory, and when it's modified, the paths within the deployment process break. Have you tried modifying the Qt deployment script to accommodate the custom install paths or using a different approach for packaging?