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

Generated moc and ui files don't respect object_parallel_to_source.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.10.1
    • Build tools: qmake
    • None
    • Linux/X11

    Description

      Our project has a directory structure that separates portions of our library into folders based on namespace. Some namespaces may contain classes with the same names, thus the .h and .cpp files for those classes are also expected to have the same names in each subfolder. Using object_parallel_to_source, we are able to use qmake to properly process the subdirectories.

      However, this ceases to work once we add the Q_OBJECT macro into these classes. After such a change, we begin seeing the "overriding recipe for target `moc_foo.cpp'" and "ignoring old recipe for target `moc_foo.cpp'" messages, and compilation fails due to not having all definitions available (since only 1 of the duplicate classes' moc files is actually getting generated). Instead of replicating the source hierarchy for the generated moc files as is done for the generated .o files, the moc files are all placed in the same directory, and only 1 moc file ends up getting generated by the build.

      The same problem seems to occur with the UI header files generated by uic. Having .ui files with the same name in different subdirectories will result in the generation of .h files with the same name, causing only 1 to be generated.

      The attached project is a minimal example of both uic- and moc-generated files failing to have the proper naming for a pair of trivial widgets with associated .ui files with the same name in different namespaces and subfolders. We would like to be able to use such a structure in our projects, but currently we are forced to use workarounds such as enforcing unique file naming and/or having a flat directory structure.

      Attachments

        Issue Links

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

          Activity

            People

              qtbuildsystem Qt Build System Team
              msiegrist Michael Siegrist
              Votes:
              6 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes