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. Qmake

Qmake

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 4.5k 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.
  • R Offline
    R Offline
    redlars
    wrote on last edited by
    #1

    I am trying to understand what happens when executing qmake.

    In a console application, I edited the .pro file and added the line "message(test)" at the bottom of the file. Then executed qmake on that project and the output was;

    @
    Project MESSAGE: test
    Project MESSAGE: test
    Project MESSAGE: test
    @

    Why does qmake process the project file (.pro file) three times?

    To investigate more we modifed the previous change to "message(CONFIG=$${CONFIG})" which produced this output;

    @
    Project MESSAGE: CONFIG=lex yacc warn_on debug uic resources rtti_off exceptions_off stl_off incremental_off thread_off windows qt warn_on release incremental flat link_prl precompile_header autogen_precompile_source copy_dir_files debug_and_release debug_and_release_target embed_manifest_dll embed_manifest_exe debug shared stl exceptions rtti mmx 3dnow sse sse2 qt console

    Project MESSAGE: CONFIG=lex yacc warn_on debug uic resources rtti_off exceptions_off stl_off incremental_off thread_off windows debug DebugBuild Debug
    build_pass qt warn_on release incremental flat link_prl precompile_header autogen_precompile_source copy_dir_files debug_and_release debug_and_release_target embed_manifest_dll embed_manifest_exe debug shared stl exceptions rtti mmx 3dnow sse sse2 debug DebugBuild Debug build_pass qt console

    Project MESSAGE: CONFIG=lex yacc warn_on debug uic resources rtti_off exceptions_off stl_off incremental_off thread_off windows release ReleaseBuild Release build_pass qt warn_on release incremental flat link_prl precompile_header autogen_precompile_source copy_dir_files debug_and_release debug_and_release_target embed_manifest_dll embed_manifest_exe debug shared stl exceptions rtti mmx 3dnow sse sse2 release ReleaseBuild Release build_pass qt console
    @
    It appears that config variable is different for each time qmake processes the project file. The first 12 strings are identical for all three times and appear to be set by;
    C:\Qt_r\4.7.1-vs2005\mkspecs\features\default_pre.prf
    C:\Qt_r\4.7.1-vs2005\mkspecs\features\win32\default_pre.prf

    The last two string "qt console" are also identical for all three and is set by the project file.

    What is the purpose for each iteration \ processing of the project file? Why is the config variable different each time? What files are involved in setting the config variable?

    I thought that keyword debug and release used within CONFIG referred to whether a debug version or release version of the project was being built. Why is then both keywords used atleast once in all three iterations? Does this mean we that project is setup to always built both debug and release?

    Appreciate some feedback.

    1 Reply Last reply
    0
    • R Offline
      R Offline
      redlars
      wrote on last edited by
      #2

      It appears that the file
      C:\Qt_r\4.7.1-vs2005\mkspecs\win32-msvc2005\qmake.conf
      is also involved when executing qmake for each iteration.

      Is the config variable case-sensitive? I noticed that both debug and Debug was used.

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dbzhang800
        wrote on last edited by
        #3

        You know that, qmake is used to parse your .pro file and generate makefile files.

        Normal, it will generate 3 makefiles:

        @
        Makefile
        Makefile.Debug
        Makefile.Release
        @

        So, it run three times.


        BTY, normally, variables in CONFIG will stand for feature files, such as qt.prf/console.prf/...

        1 Reply Last reply
        0
        • R Offline
          R Offline
          redlars
          wrote on last edited by
          #4

          Thank you for the reply.

          My understanding is building a debug version of the project will cause nmake to use Makefile.Debug and building release version will cause nmake to use Makefile.Release file. When is Makefile used?

          I came across this text after posting;

          bq. When qmake [doc.qt.nokia.com] processes a pro file it could process it up to three times depending on what the configuration is set to. Usually it will do it three times. Once for debug, once for release and one final one for debug_and_release. "[Source]":http://qt-project.org/faq/answer/what_does_the_syntax_configdebugdebugrelease_mean_what_does_the_1st_argumen

          What configuration governs how qmake processes a project file?

          1 Reply Last reply
          0
          • L Offline
            L Offline
            lgeyer
            wrote on last edited by
            #5

            You are always using Makefile, which contains a debug and release target and invokes Makefile.Debug and Makefile.Release respectively.

            Depending on the selected mkspec (either using the -spec parameter or QMAKESPEC environment variable) the configuration (from $QTDIR/mkspecs/<mkspec>/qmake.conf) is read, and the QMAKE_ variables are set.

            1 Reply Last reply
            0

            • Login

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