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. Where to store moc_ and qrc_ generated files
QtWS25 Last Chance

Where to store moc_ and qrc_ generated files

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

    I'm currently designing a procedure for automating the moc, uic and rcc steps when building Qt applications with Visual Studio Express (doesn't support the plug-in). I have a simple question: why should the generated moc_ and qrc_ .ccp files have to have separate debug and release versions stored in the 'debug' and 'release' directories when (in my experience) a comparision shows the two version to be identical?

    1 Reply Last reply
    0
    • L Offline
      L Offline
      ludde
      wrote on last edited by
      #2

      I cannot think of a reason to put them in separate directories. I usually add a @MOC_DIR = moc@ line to my .pro file, which makes the moc files end up there, for both debug and release builds. Same goes for qrc, I would assume.

      1 Reply Last reply
      0
      • sierdzioS Offline
        sierdzioS Offline
        sierdzio
        Moderators
        wrote on last edited by
        #3

        It's a Windows thing, where qmake uses separate directories for debug and release builds. On other platforms, all files are stored in the same place (unless, of course, you specify otherwise in .pro file). You can force output dir just as ludde suggested (probably. I'm a Linux person. It definitely workse here).

        (Z(:^

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mikeh
          wrote on last edited by
          #4

          Many thanks for your helpful replies - I shall assume that having two versions in QCreator and the Visual Studio plug-n is just a convenience thing.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mikeh
            wrote on last edited by
            #5

            I have had further thoughts about the conclusion reached above. Qt projects on Windows generated by qmake (or QtCreator) produce two preprocessor DEFINE lists differing by one entry; the 'release' version includes QT_NO_DEBUG and the 'debug' version does not. So theoretically it is possible that the use, or not, of this directive in a header file containing a Q_OBJECT reference could result in two differing moc_xxx.cpp files. Such a case must be extremely rare but clearly must be allowed for in generally available apps like qmake and QtCreator. Maintaining two project source collections is very inconvenient and I intend to ignore the problem.

            As forums are a geat source of trouble shooting info I thought that submitting this new conclusion would be useful. Thank you.

            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