Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-114796

Cpack fail for library depending on qtmqtt COMPONENT on windows

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.5.0
    • MQTT
    • None
    • Github action windows runner latest
    • Windows

    Description

      I have a cmake project that build a library that depends on Qt Components like Qt6::WebSockets and Qt6::Mqtt .

       

      find_package(Qt6 COMPONENTS Core OPTIONAL_COMPONENTS WebSockets Mqtt)
      
      
      if (Qt6_FOUND)
      	qt_standard_project_setup()
      	if(NOT TARGET Qt6::WebSockets)
      		FetchContent_Declare(
      			qtwebsockets
      			GIT_REPOSITORY git://code.qt.io/qt/qtwebsockets.git
      			GIT_TAG 6.5.0
      			)
      		FetchContent_MakeAvailable(qtwebsockets)
      	endif()
      	if(NOT TARGET Qt6::Mqtt)
      		FetchContent_Declare(
      			qtmqtt
      			GIT_REPOSITORY git://code.qt.io/qt/qtmqtt.git
      			GIT_TAG 6.5.0
      			)
      		FetchContent_MakeAvailable(qtmqtt)
      	endif()
      
      endif(Qt6_FOUND)
      
      add_library(qclientMQTT include/client/qclientMQTT.hpp qclientMQTT.cpp src/qwebsocketiodevice.cpp include/client/qwebsocketiodevice.hpp)
      
      ... 

      So if it does not find the OPTIONAL_COMPONENTS WebSockets Mqtt, it will download them and built them.

      The library compiles well for Windows, Macos and Linux.
      I also create packages of the library by using CPack like:

      cpack -B package --config CPackConfig.cmake 

      This works well for macos and linux returning(for linux):

      CPack: Create package using STGZ
      CPack: Install projects
      CPack: - Install project: QtIotaClient []
      CPack: Create package
      CPack: - package: /home/runner/work/_temp/build/package/QtIotaClient-v0.1.1-Linux_5.15.0-1039-azure-x86_64-GNU.sh generated.
      CPack: Create package using TGZ
      CPack: Install projects
      CPack: - Install project: QtIotaClient []
      CPack: Create package
      CPack: - package: /home/runner/work/_temp/build/package/QtIotaClient-v0.1.1-Linux_5.15.0-1039-azure-x86_64-GNU.tar.gz generated.
      CPack: Create package using TZ
      CPack: Install projects
      CPack: - Install project: QtIotaClient []
      CPack: Create package
      CPack: - package: /home/runner/work/_temp/build/package/QtIotaClient-v0.1.1-Linux_5.15.0-1039-azure-x86_64-GNU.tar.Z generated. 

      but for windows it returns:

      CPack: Create package using NSIS
      CPack: Install projects
      CPack: - Install project: QtIotaClient []
      CPack: -   Install component: Devel
      CPack: -   Install component: Unspecified
      CPack: -   Install component: _install_html_docs_Mqtt
      CMake Error at D:/a/_temp/build/_deps/qtmqtt-build/src/mqtt/cmake_install.cmake:118 (file):
        file INSTALL cannot find "D:/a/_temp/build/./doc/qtmqtt": File exists.
      Call Stack (most recent call first):
        D:/a/_temp/build/_deps/qtmqtt-build/src/cmake_install.cmake:42 (include)
        D:/a/_temp/build/_deps/qtmqtt-build/cmake_install.cmake:42 (include)
        D:/a/_temp/build/cmake_install.cmake:81 (include)
      
      
      CPack Error: Error when generating package: QtIotaClient
       

      So for windows it is trying to install the documentation of the COMPONENT and other things and fails. The later described behavior happens when cmake do not find the Mqtt COMPONENT and try to package the compiled COMPONENT source.

       

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtbuildsystem Qt Build System Team
            mesrine Eduardo Gonzalez
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes