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

using target-renaming breaks dependencies in msvc-projects

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Out of scope
    • Icon: P3: Somewhat important P3: Somewhat important
    • 4.8.x
    • 4.7.3, 4.7.4, 4.8.0
    • Build tools: qmake
    • None
    • Windows XP/Visual Studio 2005/Qt 4.7.3|4.7.4
      Windows 7/Visual Studio 2010 prof/Qt 4.7.3|4.7.4|4.8.0

      using target-renaming between debug and release like this

      !debug_and_release|build_pass {
      CONFIG(debug, debug|release)

      { TARGET = $$member(TARGET, 0)d }

      }

      breaks project-dependencies for msvc-projects

      a small test-project is appended

      for fixing this i use the following patch:

      patch msvc_vcproj.cpp (4.8.0)
      --- d:\qt\4.8.0.org\qmake\generators\win32\msvc_vcproj.cpp	2011-12-08 07:06:02.000000000 +0100
      +++ d:\qt\4.8.0\qmake\generators\win32\msvc_vcproj.cpp	2012-01-09 22:34:38.000000000 +0100
      @@ -431,11 +431,30 @@
                       QString profile = tmp;
                       if(!profile.endsWith(Option::dir_sep))
                           profile += Option::dir_sep;
                       profile += fi.baseName() + Option::pro_ext;
                       subdirs.append(profile);
                   } else {
      -                QMakeProject tmp_proj;
      +                //initialize the base
      +                QString build = "Release";
      +                QMap<QString, QStringList> basevars;
      +                if(!project->isEmpty(build + ".CONFIG"))
      +                    basevars["CONFIG"] += project->values(build + ".CONFIG");
      +                basevars["CONFIG"] += build;
      +                basevars["CONFIG"] += "build_pass";
      +                basevars["BUILD_PASS"] = QStringList(build);
      +                QStringList buildname = project->values(build + ".name");
      +                basevars["BUILD_NAME"] = (buildname.isEmpty() ? QStringList(build) : buildname);
       
       
      +                QMakeProject tmp_proj(project->properties(), basevars);
       
      +                const QStringList old_after_user_config = Option::after_user_configs;
      +                const QStringList old_user_config = Option::user_configs;
      +                Option::after_user_configs += basevars["CONFIG"];
      +                Option::user_configs += basevars["CONFIG"];
       
       
                       QString dir = fi.path(), fn = fi.fileName();
                       if(!dir.isEmpty()) {
                           if(!qmake_setpwd(dir))
                               fprintf(stderr, "Cannot find directory: %s\n", dir.toLatin1().constData());
      

        1. QMakeTest.zip
          4 kB
          Gerhard Kokerbeck
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            andysh Andy Shaw
            gerd Gerhard Kokerbeck
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes