Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Building Qt 5.15.1 from source in a CMD script fails
Forum Updated to NodeBB v4.3 + New Features

Building Qt 5.15.1 from source in a CMD script fails

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 386 Views 1 Watching
  • 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.
  • B Offline
    B Offline
    Bart_Vandewoestyne
    wrote on 29 Apr 2022, 08:23 last edited by
    #1

    I am trying to write a (Windows 10 CMD) script that builds my Qt 5.15.1 from source. The (unmodified Qt 5.15.1) source code is located in C:\ThirdParty\src\Qt\5.15.1 and I have a build_qt.cmd script inside the C:\ThirdParty\src\Qt directory for doing an out-of-source build and that script looks as follows:

    set qt_install_dir=C:\ThirdParty\install\Qt\5.15.1
    
    mkdir build
    cd build
    ..\5.15.1\configure -prefix "%qt_install_dir%" ^
                 -opensource ^
                 -confirm-license ^
                 -force-debug-info ^
                 -nomake examples ^
                 -nomake tools ^
                 -nomake tests ^
                 -skip qt3d ^
                 -skip qtactiveqt ^
                 -skip qtandroidextras ^
                 -skip qtcharts ^
                 -skip qtconnectivity ^
                 -skip qtdatavis3d ^
                 -skip qtdeclarative ^
                 -skip qtdoc ^
                 -skip qtgamepad ^
                 -skip qtgraphicaleffects ^
                 -skip qtimageformats ^
                 -skip qtlocation ^
                 -skip qtlottie ^
                 -skip qtmacextras ^
                 -skip qtmultimedia ^
                 -skip qtnetworkauth ^
                 -skip qtpurchasing ^
                 -skip qtquickcontrols ^
                 -skip qtquickcontrols2 ^
                 -skip qtremoteobjects ^
                 -skip qtscript ^
                 -skip qtscxml ^
                 -skip qtsensors ^
                 -skip qtserialbus ^
                 -skip qtserialport ^
                 -skip qtspeech ^
                 -skip qtsvg ^
                 -skip qttools ^
                 -skip qttranslations ^
                 -skip qtvirtualkeyboard ^
                 -skip qtwayland ^
                 -skip qtwebchannel ^
                 -skip qtwebengine ^
                 -skip qtwebglplugin ^
                 -skip qtwebsockets ^
                 -skip qtwebview ^
                 -no-openssl ^
                 -no-opengl ^
                 -qt-libpng ^
                 -skip qtx11extras ^
                 -platform win32-msvc ^
                 -debug-and-release ^
                 -mp
    
    @REM Why aren't these executed automatically ???
    nmake
    nmake install
    

    I run this script inside an "x64 Native Tools Command Prompt for VS 2019" from inside the C:\ThirdParty\src\Qt directory:

    C:\ThirdParty\src\Qt>build_qt.cmd
    

    As you can see from the comment at the end of the script, for some reason, the nmake commands do not start, as can be seen from the end of my output (no occurrence of nmake being started):

    ... more configure output ...
    
    Qt Testlib:
      Tester for item models ................. yes
    QtXmlPatterns:
      XML schema support ..................... yes
    
    Qt is now configured for building. Just run 'nmake'.
    Once everything is built, you must run 'nmake install'.
    Qt will be installed into 'C:\ThirdParty\install\Qt\5.15.1'.
    
    Prior to reconfiguration, make sure you remove any leftovers from
    the previous build.
    
    
    C:\ThirdParty\src\Qt\build>
    

    When I comment out the configure command using @REM, they do get started:

    C:\ThirdParty\src\Qt>build_qt.cmd
    
    C:\ThirdParty\src\Qt>set qt_install_dir=C:\ThirdParty\install\Qt\5.15.1
    
    C:\ThirdParty\src\Qt>mkdir build
    
    C:\ThirdParty\src\Qt>cd build
    
    C:\ThirdParty\src\Qt\build>nmake
    
    Microsoft (R) Program Maintenance Utility Version 14.29.30143.0
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    NMAKE : fatal error U1064: MAKEFILE not found and no target specified
    Stop.
    
    C:\ThirdParty\src\Qt\build>nmake install
    
    Microsoft (R) Program Maintenance Utility Version 14.29.30143.0
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    NMAKE : fatal error U1073: don't know how to make 'install'
    Stop.
    
    C:\ThirdParty\src\Qt\build>
    

    so it is most likely the configure command that somehow puts my CMD shell in a weird state so that the nmake commands aren't started. However, I have no idea why and how to fix it.

    Anyone?

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 29 Apr 2022, 08:56 last edited by
      #2

      Basic batch-programming. Since configure is a batch file you have to use call ..\5.15.1\configure -prefix "%qt_install_dir%" ...

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      B 1 Reply Last reply 29 Apr 2022, 09:38
      2
      • C Christian Ehrlicher
        29 Apr 2022, 08:56

        Basic batch-programming. Since configure is a batch file you have to use call ..\5.15.1\configure -prefix "%qt_install_dir%" ...

        B Offline
        B Offline
        Bart_Vandewoestyne
        wrote on 29 Apr 2022, 09:38 last edited by
        #3

        Thanks, @Christian-Ehrlicher, using CALL indeed solved the problem!

        My Windows CMD programming is a bit rusty. I tried using START, but that didn't do what I expected and since the configure script did not end in .bat or .cmd, I didn't immediately think of using CALL...

        1 Reply Last reply
        2

        1/3

        29 Apr 2022, 08:23

        • Login

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