Results 1 to 2 of 2

Thread: Deployment Error in Qt deployment script when using CPack

  1. #1
    Join Date
    Aug 2024
    Posts
    2
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default 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:

    Qt Code:
    1. mkdir build
    2. cd build
    3. ~/Qt/Tools/CMake/bin/cmake -DCMAKE_PREFIX_PATH=~/Qt/6.7.2/gcc_64/ ..
    4. make
    5. make package
    To copy to clipboard, switch view to plain text mode 

    The error is the following:
    Qt Code:
    1. CMake Error at <HOME>/Qt/6.7.2/gcc_64/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake:139 (file):
    2. file RPATH_SET given FILE
    3. "/usr/plugins/egldeviceintegrations/libqeglfs-emu-integration.so" that does
    4. not exist.
    To copy to clipboard, switch view to plain text mode 

    main.cpp
    Qt Code:
    1. #include <QDebug>
    2. #include <QApplication>
    3.  
    4. int main(int argc, char *argv[]) {
    5. QApplication app(argc, argv);
    6. qDebug() << "Hello World";
    7. }
    To copy to clipboard, switch view to plain text mode 

    CMakeLists.txt
    Qt Code:
    1. cmake_minimum_required(VERSION 3.29.3)
    2.  
    3. project(helloworld VERSION 0.1 LANGUAGES CXX)
    4.  
    5. set(CMAKE_CXX_STANDARD 17)
    6. set(CMAKE_CXX_STANDARD_REQUIRED ON)
    7.  
    8. find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
    9.  
    10. qt_standard_project_setup()
    11.  
    12. qt_add_executable(helloworld main.cpp)
    13.  
    14. target_link_libraries(helloworld PRIVATE Qt6::Core Qt6::Gui Qt6::Widgets)
    15.  
    16. install(TARGETS helloworld)
    17.  
    18. qt_generate_deploy_app_script(
    19. TARGET helloworld
    20. OUTPUT_SCRIPT deploy_script
    21. NO_TRANSLATIONS
    22. NO_COMPILER_RUNTIME
    23. NO_UNSUPPORTED_PLATFORM_ERROR
    24. )
    25. install(SCRIPT ${deploy_script})
    26.  
    27. set(CPACK_GENERATOR RPM)
    28. include(CPack)
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Feb 2025
    Posts
    2
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Deployment Error in Qt deployment script when using CPack

    Quote Originally Posted by Ralf_G View Post
    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:

    Qt Code:
    1. mkdir build
    2. cd build
    3. ~/Qt/Tools/CMake/bin/cmake -DCMAKE_PREFIX_PATH=~/Qt/6.7.2/gcc_64/ ..
    4. make
    5. make package
    To copy to clipboard, switch view to plain text mode 

    The error is the following:
    Qt Code:
    1. CMake Error at <HOME>/Qt/6.7.2/gcc_64/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake:139 (file):
    2. file RPATH_SET given FILE
    3. "/usr/plugins/egldeviceintegrations/libqeglfs-emu-integration.so" that does
    4. not exist.
    To copy to clipboard, switch view to plain text mode 

    main.cpp
    Qt Code:
    1. #include <QDebug>
    2. #include <QApplication>
    3.  
    4. int main(int argc, char *argv[]) {
    5. QApplication app(argc, argv);
    6. qDebug() << "Hello World";
    7. }
    To copy to clipboard, switch view to plain text mode 

    CMakeLists.txt
    Qt Code:
    1. cmake_minimum_required(VERSION 3.29.3)
    2.  
    3. project(helloworld VERSION 0.1 LANGUAGES CXX)
    4.  
    5. set(CMAKE_CXX_STANDARD 17)
    6. set(CMAKE_CXX_STANDARD_REQUIRED ON)
    7.  
    8. find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
    9.  
    10. qt_standard_project_setup()
    11.  
    12. qt_add_executable(helloworld main.cpp)
    13.  
    14. target_link_libraries(helloworld PRIVATE Qt6::Core Qt6::Gui Qt6::Widgets)
    15.  
    16. install(TARGETS helloworld)
    17.  
    18. qt_generate_deploy_app_script(
    19. TARGET helloworld
    20. OUTPUT_SCRIPT deploy_script
    21. NO_TRANSLATIONS
    22. NO_COMPILER_RUNTIME
    23. NO_UNSUPPORTED_PLATFORM_ERROR
    24. )
    25. install(SCRIPT ${deploy_script})
    26.  
    27. set(CPACK_GENERATOR RPM)
    28. include(CPack)
    To copy to clipboard, switch view to plain text mode 
    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?
    Who wants to play Doodle Jump with me?

Similar Threads

  1. dll deployment
    By freiza in forum Newbie
    Replies: 11
    Last Post: 2nd March 2015, 21:11
  2. copy deployment folder error
    By hema in forum Installation and Deployment
    Replies: 9
    Last Post: 25th August 2011, 20:48
  3. dll error in deployment
    By ldynasa in forum Installation and Deployment
    Replies: 3
    Last Post: 2nd March 2011, 14:38
  4. xp deployment error
    By ahmdsd_ostora in forum Qt Programming
    Replies: 2
    Last Post: 11th August 2010, 17:00
  5. A different deployment technique QT. Is it the right way of deployment?
    By Tarun in forum Installation and Deployment
    Replies: 1
    Last Post: 15th February 2010, 15:45

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.