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

qmake generates VS2010 vcxproj files which ignore autogenerated rc-files

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.4.2
    • 5.4.1
    • Build tools: qmake
    • None
    • Windows 7 Pro, x64, Qt 5.4.1 precompiled, Qt 4.8.6 precompiled
    • f90c1860580bcbe6b898ceb86cdd746532470c64

    Description

      qmake auto generates windows rc files if the VERSION variable is set.

      For a simple QtCreator generated .pro file:

      #-------------------------------------------------
      #
      # Project created by QtCreator 2015-03-17T11:49:27
      #
      #-------------------------------------------------
      
      QT       += core
      
      QT       -= gui
      
      TARGET = resource_generation_buggy
      CONFIG   += console
      CONFIG   -= app_bundle
      
      TEMPLATE = app
      
      
      SOURCES += main.cpp
      
      VERSION = 1.2.3.4    # this was added by hand
      

      using

      qmake -tp vc
      

      an vcxproj file for Visual Studio (or msbuild) is generated, that uses the autogenerated file with the windows resource compiler:

      resource_generation_buggy_resource.rc
      

      This works.

      However it does fail, if you use the documented differentiation for the TARGET for release and debug:

      build_pass:CONFIG(debug, debug|release) {
          unix: TARGET = $$join(TARGET,,,_debug)
          else: TARGET = $$join(TARGET,,,d)
      }
      

      Calling qmake again will result in two rc files:

      resource_generation_buggy_resource.rc
      resource_generation_buggyd_resource.rc
      

      But the files are not compiled during the build process in VS2010.

      If you have a closer look at the outcome of the vcxproj file with the renamed debug target you can see the entries:

        <ItemGroup>
          <None Include="C:\temp\Qt_Bugs\ResourcesNotFound\resource_generation_buggy\resource_generation_buggy_resource.rc">
            <ExcludedFromBuild Condition="&apos;$(Configuration)|$(Platform)&apos;==&apos;Debug|Win32&apos;">true</ExcludedFromBuild>
          </None>
          <None Include="C:\temp\Qt_Bugs\ResourcesNotFound\resource_generation_buggy\resource_generation_buggyd_resource.rc">
            <ExcludedFromBuild Condition="&apos;$(Configuration)|$(Platform)&apos;==&apos;Release|Win32&apos;">true</ExcludedFromBuild>
          </None>
        </ItemGroup>
      

      While in the file without the renamed debug target you can see just one resource file:

        <ItemGroup>
          <ResourceCompile Include="C:\temp\Qt_Bugs\ResourcesNotFound\resource_generation_buggy\resource_generation_buggy_resource.rc" />
        </ItemGroup>
      

      The obvious difference is the tag <ResourceCompile> in the non debug differentiation version,
      while in the debug version your have the tag: <None>

      This is a regression against Qt 4.8.6 where the auto-generation of the debug version works

      Please find attached some files to reproduce the problem.

      Attachments

        1. 4_8_6_debug_target__resource_generation_buggy_d.vcxproj
          11 kB
          Michael Möllney
        2. 5_4_1_debug_target__resource_generation_buggy.vcxproj
          10 kB
          Michael Möllney
        3. 5_4_1_only_one_target__resource_generation_buggy.vcxproj
          9 kB
          Michael Möllney
        4. main.cpp
          0.1 kB
          Michael Möllney
        5. resource_generation_buggy.pro
          0.6 kB
          Michael Möllney

        Issue Links

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

          Activity

            People

              jbornema Joerg Bornemann
              moellney Michael Möllney
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes