Uploaded image for project: 'Qt Visual Studio Tools'
  1. Qt Visual Studio Tools
  2. QTVSADDINBUG-783

Moc doesn't respect the relative path to the project directory

XMLWordPrintable

    • Windows
    • 9a5dde11b957112f1828ca572347e78873dce32c

      Project directory structure

      |---other_project
      |       QtWidgetsClass.h
      |       
      \---project
          \---sub-folder
                  main.cpp
                  MainWindow.h
                  MOC-Issue.vcxproj            
      

      Environment

      • Visual Studio 19 - v16.6
      • Qt 5.15.0 - msvc2019

      Steps to reproduce

      1. Create a Qt Widgets Application project in a two levels nested directory.
      2. Right-Click on the project -> Add -> Existing Item... and select a Qt class that is two levels downwards in the directory hierarchy. 
      3. Right-Click on the project -> Properties -> C/C++ -> General -> and add Additional Include Directories to the location where the Qt class is.
      4. Compile and you will see that Moc generated the class in the wrong location, which will result for compilation failure.

      Desired behavior

      Moc should generate the moced-classes respectively under the $(OutDir)moc directory. 

      Illustration

       

      I attached the project files to reproduce this issue.

      Thanks for the amazing work with MsBuild & Qt-VS-Tools!

      Kind regards,

      Gilad


      See:

      QTVSADDINBUG-756

        For Gerrit Dashboard: QTVSADDINBUG-783
        # Subject Branch Project Status CR V

            mecfc Miguel Costa
            gilad.reich Gilad Reich
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes