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

Cmake: confusion with AUTOMOC

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P4: Low
    • None
    • 5.2.1, 5.5.1
    • Build System: CMake
    • None

    Description

      Hi,

      imagine following situation: a source tree with various files, including

      modulebase/interface.h
      moduleA/implementation.cpp
      moduleA/implementation.h
      moduleB/implementation.cpp
      moduleB/implementation.h

      Now you try to use CMake as described at https://cmake.org/cmake/help/v3.3/manual/cmake-qt.7.html , building a library from these sources.

      Result: in the build directory, a file moc_implementation.cpp is created and then it apparently gets overwritten by another moc call, and eventually you get the obvious linker error with undefined symbols.

      Any anyhow, I am wondering why the automoc stuff goes into the plain build directory. I have a nice source structure with files in subdirectories, and the AUTOMOC stuff spams all over the build directory while normal object files get splitted into <builddir>/subdirectory/projectname.dir/ folders.

      I checked quickly against 5.5 (diffed the *Macros.cmake file ) and saw no related improvements.

      Attachments

        Issue Links

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

          Activity

            People

              krf Kevin Funk
              blade Eduard Bloch
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes