Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Qt-6.2.0: You need to set QT_HOST_PATH to cross compile Qt.
QtWS25 Last Chance

Qt-6.2.0: You need to set QT_HOST_PATH to cross compile Qt.

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
8 Posts 3 Posters 8.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    debian
    wrote on 4 Oct 2021, 11:52 last edited by
    #1

    Hello!
    According to https://www.qt.io/blog/qt-6-build-system I can use QT_BUILD_TOOLS_WHEN_CROSS_COMPILING for build host tools during cross-compile, I try this and unfortunately this is not work

    ./configure .... \
        -- \
        -DCMAKE_TOOLCHAIN_FILE=$(BUILD_DIR)/toolchain.cmake \
        -DQT_BUILD_TOOLS_WHEN_CROSSCOMPILING=ON
    

    Follow console output

    -- Detecting C compiler ABI info - done
    -- Check for working C compiler: /tmp/firmware/toolchain/gcc-linaro-11.0.1-2021.03-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc - skipped
    -- Detecting C compile features
    -- Detecting C compile features - done
    CMake Error at cmake/QtSetup.cmake:196 (message):
      You need to set QT_HOST_PATH to cross compile Qt.
    Call Stack (most recent call first):
      cmake/QtBuildInternals/QtBuildInternalsConfig.cmake:229 (include)
      cmake/QtBuildInternals/QtBuildInternalsConfig.cmake:372 (qt_build_internals_set_up_private_api)
      CMakeLists.txt:91 (qt_build_repo_begin)
    
    
    -- Configuring incomplete, errors occurred!
    

    Why and how can I fix this?
    Thank you.

    J 1 Reply Last reply 4 Oct 2021, 11:57
    0
    • D debian
      4 Oct 2021, 11:52

      Hello!
      According to https://www.qt.io/blog/qt-6-build-system I can use QT_BUILD_TOOLS_WHEN_CROSS_COMPILING for build host tools during cross-compile, I try this and unfortunately this is not work

      ./configure .... \
          -- \
          -DCMAKE_TOOLCHAIN_FILE=$(BUILD_DIR)/toolchain.cmake \
          -DQT_BUILD_TOOLS_WHEN_CROSSCOMPILING=ON
      

      Follow console output

      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: /tmp/firmware/toolchain/gcc-linaro-11.0.1-2021.03-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      CMake Error at cmake/QtSetup.cmake:196 (message):
        You need to set QT_HOST_PATH to cross compile Qt.
      Call Stack (most recent call first):
        cmake/QtBuildInternals/QtBuildInternalsConfig.cmake:229 (include)
        cmake/QtBuildInternals/QtBuildInternalsConfig.cmake:372 (qt_build_internals_set_up_private_api)
        CMakeLists.txt:91 (qt_build_repo_begin)
      
      
      -- Configuring incomplete, errors occurred!
      

      Why and how can I fix this?
      Thank you.

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 4 Oct 2021, 11:57 last edited by
      #2

      @debian said in Qt-6.2.0: You need to set QT_HOST_PATH to cross compile Qt.:

      Why and how can I fix this?

      You need to do what the error message suggests.
      See https://doc.qt.io/qt-6/cmake-variable-qt-host-path.html

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • D Offline
        D Offline
        debian
        wrote on 4 Oct 2021, 12:03 last edited by
        #3

        @jsulm , you mean what https://www.qt.io/blog/qt-6-build-system incorrect and QT_BUILD_TOOLS_WHEN_CROSS_COMPILING is not work? QT_BUILD_TOOLS_WHEN_CROSS_COMPILING is a useless if I have prebuilded host-Qt, this is mean what I should buld of Qt two time.

        J 1 Reply Last reply 4 Oct 2021, 12:23
        0
        • D debian
          4 Oct 2021, 12:03

          @jsulm , you mean what https://www.qt.io/blog/qt-6-build-system incorrect and QT_BUILD_TOOLS_WHEN_CROSS_COMPILING is not work? QT_BUILD_TOOLS_WHEN_CROSS_COMPILING is a useless if I have prebuilded host-Qt, this is mean what I should buld of Qt two time.

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 4 Oct 2021, 12:23 last edited by
          #4

          @debian said in Qt-6.2.0: You need to set QT_HOST_PATH to cross compile Qt.:

          you mean

          No, that's not what I mean. I think you need to set QT_HOST_PATH in addition to QT_BUILD_TOOLS_WHEN_CROSS_COMPILING.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • D Offline
            D Offline
            debian
            wrote on 4 Oct 2021, 12:30 last edited by
            #5

            I was try use -qt-host-path, but this is now work at this is case

            ...............
            CMake Error at cmake/QtSetup.cmake:201 (find_package):
              Could not find a package configuration file provided by "Qt6HostInfo" with
              any of the following names:
            
                Qt6HostInfoConfig.cmake
                qt6hostinfo-config.cmake
            
              Add the installation prefix of "Qt6HostInfo" to CMAKE_PREFIX_PATH or set
              "Qt6HostInfo_DIR" to a directory containing one of the above files.  If
              "Qt6HostInfo" provides a separate development package or SDK, be sure it
              has been installed.
            Call Stack (most recent call first):
              cmake/QtBuildInternals/QtBuildInternalsConfig.cmake:229 (include)
              cmake/QtBuildInternals/QtBuildInternalsConfig.cmake:372 (qt_build_internals_set_up_private_api)
              CMakeLists.txt:91 (qt_build_repo_begin)
            
            
            -- Configuring incomplete, errors occurred!
            

            configure check this is directory to several files, so this is variable is a directory with early installed Qt, not path fo install host tools.

            1 Reply Last reply
            0
            • D Offline
              D Offline
              debian
              wrote on 4 Oct 2021, 12:42 last edited by
              #6

              Look like what this is now work
              cmake/QtSetup.cmake

              .................
              ## Find host tools (if non native):
              set(QT_HOST_PATH "" CACHE PATH "Installed Qt host directory path, used for cross compiling.")
              
              if (CMAKE_CROSSCOMPILING)
                  if(NOT IS_DIRECTORY "${QT_HOST_PATH}")
                      message(FATAL_ERROR "You need to set QT_HOST_PATH to cross compile Qt.")
                  endif()
              endif()
              
              if(NOT "${QT_HOST_PATH}" STREQUAL "")
                  find_package(${INSTALL_CMAKE_NAMESPACE}HostInfo
                               CONFIG
                               REQUIRED
                               PATHS "${QT_HOST_PATH}"
                                     "${QT_HOST_PATH_CMAKE_DIR}"
                               NO_CMAKE_FIND_ROOT_PATH
                               NO_DEFAULT_PATH)
              endif()
              

              So configure always check host-files, this bug or I'm incorrect understand https://www.qt.io/blog/qt-6-build-system ?

              The cross-built Qt does not build the host tools for the target platform, unless you set the CMake variable QT_BUILD_TOOLS_WHEN_CROSS_COMPILING to ON. Doing so is useful in embedded Linux environments

              1 Reply Last reply
              0
              • D Offline
                D Offline
                debian
                wrote on 4 Oct 2021, 12:50 last edited by debian 10 Apr 2021, 12:51
                #7

                https://doc-snapshots.qt.io/qt6-6.2/configure-linux-device.html describe same parameters

                1 Reply Last reply
                0
                • ad1170A Offline
                  ad1170A Offline
                  ad1170
                  wrote on 15 Jan 2022, 10:29 last edited by
                  #8

                  Just if anyone interested in. I have used the configure option -qt-host-path /home/[user]/Qt/6.2.2/gcc_64 when building e.g. qt for android on ubuntu.

                  1 Reply Last reply
                  2

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved