Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. CMake does not work with Qt 6.7.0
QtWS25 Last Chance

CMake does not work with Qt 6.7.0

Scheduled Pinned Locked Moved Solved Installation and Deployment
14 Posts 5 Posters 2.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.
  • O Offline
    O Offline
    odelaune
    wrote on last edited by
    #1

    Hi, I installed Qt 6.7.0 using Qt Maintenance and tried compiling my project. Unlike Qt 6.6.3, CMake fails with Qt 6.7.0. I use Ubuntu 22.04.01.

    Here is the CMake error:

    CMake Error: File /Qt6CoreConfigureFileTemplate.in does not exist.
    CMake Error at /home/user/Qt/online/6.7.0/gcc_64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:2277 (configure_file):
      configure_file Problem configuring file
    Call Stack (most recent call first):
      /home/user/Qt/online/6.7.0/gcc_64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:337 (_qt_internal_process_resource)
      /home/user/Qt/online/6.7.0/gcc_64/lib/cmake/Qt6LinguistTools/Qt6LinguistToolsMacros.cmake:738 (qt6_add_resources)
      /home/user/Qt/online/6.7.0/gcc_64/lib/cmake/Qt6LinguistTools/Qt6LinguistToolsMacros.cmake:689:EVAL:1 (qt6_add_translations)
      CMakeLists.txt:DEFERRED
    
    
    -- Configuring incomplete, errors occurred!
    See also "/home/user/my_project/build-Qt6/CMakeFiles/CMakeOutput.log"
    

    Do you have any ideas on how to solve this problem?

    jsulmJ JonBJ 2 Replies Last reply
    0
    • O Offline
      O Offline
      odelaune
      wrote on last edited by odelaune
      #14

      Someone has the same problem as me here. So there is indeed an issue with Qt 6.7.x. It will be fixed in the 6.7.3 release.

      Meanwhile, I fixed the problem moving

      find_package(Qt6 COMPONENTS LinguistTools Widgets REQUIRED)
      

      to the root directory's CMakeLists.txt.

      1 Reply Last reply
      0
      • O odelaune

        Hi, I installed Qt 6.7.0 using Qt Maintenance and tried compiling my project. Unlike Qt 6.6.3, CMake fails with Qt 6.7.0. I use Ubuntu 22.04.01.

        Here is the CMake error:

        CMake Error: File /Qt6CoreConfigureFileTemplate.in does not exist.
        CMake Error at /home/user/Qt/online/6.7.0/gcc_64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:2277 (configure_file):
          configure_file Problem configuring file
        Call Stack (most recent call first):
          /home/user/Qt/online/6.7.0/gcc_64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:337 (_qt_internal_process_resource)
          /home/user/Qt/online/6.7.0/gcc_64/lib/cmake/Qt6LinguistTools/Qt6LinguistToolsMacros.cmake:738 (qt6_add_resources)
          /home/user/Qt/online/6.7.0/gcc_64/lib/cmake/Qt6LinguistTools/Qt6LinguistToolsMacros.cmake:689:EVAL:1 (qt6_add_translations)
          CMakeLists.txt:DEFERRED
        
        
        -- Configuring incomplete, errors occurred!
        See also "/home/user/my_project/build-Qt6/CMakeFiles/CMakeOutput.log"
        

        Do you have any ideas on how to solve this problem?

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #2

        @odelaune Do you call CMake in a clean (empty) build folder?

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

        1 Reply Last reply
        0
        • O odelaune

          Hi, I installed Qt 6.7.0 using Qt Maintenance and tried compiling my project. Unlike Qt 6.6.3, CMake fails with Qt 6.7.0. I use Ubuntu 22.04.01.

          Here is the CMake error:

          CMake Error: File /Qt6CoreConfigureFileTemplate.in does not exist.
          CMake Error at /home/user/Qt/online/6.7.0/gcc_64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:2277 (configure_file):
            configure_file Problem configuring file
          Call Stack (most recent call first):
            /home/user/Qt/online/6.7.0/gcc_64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:337 (_qt_internal_process_resource)
            /home/user/Qt/online/6.7.0/gcc_64/lib/cmake/Qt6LinguistTools/Qt6LinguistToolsMacros.cmake:738 (qt6_add_resources)
            /home/user/Qt/online/6.7.0/gcc_64/lib/cmake/Qt6LinguistTools/Qt6LinguistToolsMacros.cmake:689:EVAL:1 (qt6_add_translations)
            CMakeLists.txt:DEFERRED
          
          
          -- Configuring incomplete, errors occurred!
          See also "/home/user/my_project/build-Qt6/CMakeFiles/CMakeOutput.log"
          

          Do you have any ideas on how to solve this problem?

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #3

          @odelaune said in CMake does not work with Qt 6.7.0:

          CMake Error: File /Qt6CoreConfigureFileTemplate.in does not exist.

          This path is clearly wrong, it is missing a "prefix". It comes from https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/Qt6CoreMacros.cmake#n2331

          set(template_file "${__qt_core_macros_module_base_dir}/Qt6CoreConfigureFileTemplate.in")

          So clearly your ${__qt_core_macros_module_base_dir} is empty when it should not be. I don't know how or what you do about it, but should give you a clue if @jsulm's suggestion (try that first) does not resolve.

          O 1 Reply Last reply
          0
          • JonBJ JonB

            @odelaune said in CMake does not work with Qt 6.7.0:

            CMake Error: File /Qt6CoreConfigureFileTemplate.in does not exist.

            This path is clearly wrong, it is missing a "prefix". It comes from https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/Qt6CoreMacros.cmake#n2331

            set(template_file "${__qt_core_macros_module_base_dir}/Qt6CoreConfigureFileTemplate.in")

            So clearly your ${__qt_core_macros_module_base_dir} is empty when it should not be. I don't know how or what you do about it, but should give you a clue if @jsulm's suggestion (try that first) does not resolve.

            O Offline
            O Offline
            odelaune
            wrote on last edited by odelaune
            #4

            Yes, I deleted the build directory and created a new one. So the directory is completely empty, but I get this CMake error.

            JoeCFDJ 1 Reply Last reply
            0
            • O odelaune

              Yes, I deleted the build directory and created a new one. So the directory is completely empty, but I get this CMake error.

              JoeCFDJ Offline
              JoeCFDJ Offline
              JoeCFD
              wrote on last edited by
              #5

              @odelaune run command
              locate Qt6CoreConfigureFileTemplate.in
              to check where it is. It is located under
              /home/user/Qt/online/6.7.0/gcc_64/lib/cmake/Qt6Core
              Check your path and lib settings for 6.7.0 since you have a local installation.

              I just tested a cmake build with Qt 6.7.0 and did not see any issue.

              O 1 Reply Last reply
              0
              • JoeCFDJ JoeCFD

                @odelaune run command
                locate Qt6CoreConfigureFileTemplate.in
                to check where it is. It is located under
                /home/user/Qt/online/6.7.0/gcc_64/lib/cmake/Qt6Core
                Check your path and lib settings for 6.7.0 since you have a local installation.

                I just tested a cmake build with Qt 6.7.0 and did not see any issue.

                O Offline
                O Offline
                odelaune
                wrote on last edited by
                #6

                The locate command tells me that the file is located in /home/user/Qt/online/6.7.0/gcc_64/lib/cmake/Qt6Core (as expected). I also checked my $PATH and my $LD_LIBRARY_PATH. I did not see anything weird (everything is similar with Qt 6.6.3 that works fine).

                1 Reply Last reply
                0
                • O Offline
                  O Offline
                  odelaune
                  wrote on last edited by
                  #7

                  I installed a fresh Ubuntu 22.04.4 LTS and then installed QT 6.7.1 from Qt Maintenance. Qt is installed in my home and I added this location to the $PATH environment variable. Yet, I get exactly the same error

                  CMake Error: File /Qt6CoreConfigureFileTemplate.in does not exist.

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #8

                    Hi,

                    You should not alter your PATH environnement variable.

                    What if you use the qt-cmake wrapper from your Qt installation ?

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • O Offline
                      O Offline
                      odelaune
                      wrote on last edited by odelaune
                      #9

                      Here is my .bash_aliases

                      export QT=$HOME/Qt/6.7.1/gcc_64
                      export LD_LIBRARY_PATH=$QT/lib:$LD_LIBRARY_PATH
                      

                      And, then I simply try to run cmake like this (in the build directory as a subdirectory of the folder where sources are located):

                      ~/Qt/6.7.1/gcc_64/bin/qt-cmake ..
                      

                      Yet, still the same CMake error.
                      Same result with the "system" cmake.

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #10

                        Can you try with 6.7.0 ?

                        Beside that, don't change LD_LIBRARY_PATH like that. You don't want your system to try and load your development Qt libraries in place of the ones provided by your distribution.

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        O 1 Reply Last reply
                        1
                        • SGaistS SGaist

                          Can you try with 6.7.0 ?

                          Beside that, don't change LD_LIBRARY_PATH like that. You don't want your system to try and load your development Qt libraries in place of the ones provided by your distribution.

                          O Offline
                          O Offline
                          odelaune
                          wrote on last edited by
                          #11

                          @SGaist said in CMake does not work with Qt 6.7.0:

                          Can you try with 6.7.0 ?

                          I get the same error with Qt 6.7.0, but not with Qt 6.6.x...

                          Beside that, don't change LD_LIBRARY_PATH like that. You don't want your system to try and load your development Qt libraries in place of the ones provided by your distribution.

                          How should I change the LD_LIBRARY_PATH? Is there a better way to inform the system where to find the Qt libraries?

                          jsulmJ 1 Reply Last reply
                          0
                          • O odelaune

                            @SGaist said in CMake does not work with Qt 6.7.0:

                            Can you try with 6.7.0 ?

                            I get the same error with Qt 6.7.0, but not with Qt 6.6.x...

                            Beside that, don't change LD_LIBRARY_PATH like that. You don't want your system to try and load your development Qt libraries in place of the ones provided by your distribution.

                            How should I change the LD_LIBRARY_PATH? Is there a better way to inform the system where to find the Qt libraries?

                            jsulmJ Offline
                            jsulmJ Offline
                            jsulm
                            Lifetime Qt Champion
                            wrote on last edited by
                            #12

                            @odelaune said in CMake does not work with Qt 6.7.0:

                            Is there a better way to inform the system where to find the Qt libraries?

                            There is no need for that, You executable contains the information where the Qt libs are, as long as they are still there your application will work. See https://en.wikipedia.org/wiki/Rpath

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

                            O 1 Reply Last reply
                            0
                            • jsulmJ jsulm

                              @odelaune said in CMake does not work with Qt 6.7.0:

                              Is there a better way to inform the system where to find the Qt libraries?

                              There is no need for that, You executable contains the information where the Qt libs are, as long as they are still there your application will work. See https://en.wikipedia.org/wiki/Rpath

                              O Offline
                              O Offline
                              odelaune
                              wrote on last edited by
                              #13
                              This post is deleted!
                              1 Reply Last reply
                              0
                              • O Offline
                                O Offline
                                odelaune
                                wrote on last edited by odelaune
                                #14

                                Someone has the same problem as me here. So there is indeed an issue with Qt 6.7.x. It will be fixed in the 6.7.3 release.

                                Meanwhile, I fixed the problem moving

                                find_package(Qt6 COMPONENTS LinguistTools Widgets REQUIRED)
                                

                                to the root directory's CMakeLists.txt.

                                1 Reply Last reply
                                0
                                • O odelaune has marked this topic as solved on

                                • Login

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