0

How can one organize their Visual Studio and Qt project such that we have a folder structure similar to this:

project/
  src/
    main.h
    main.cpp
    project.pro
  vs/
    debug/
      debug stuff...
    release/
      release stuff...
    project.sln
    project.vcxproj
    project.vcxproj.filters

When I first create a project, I make the Qt project file using:

qmake -project

And then I create the Visual Studio project:

qmake -tp vc project.pro

But this creates everything in the same directory, and that's just really nasty. I'm open to better organization suggestions as well.

Update: More details why I need help. When I try to compile the project using this structure, Visual Studio complains that the MOC can't find the project headers.

Build output:

1>  MOC main.h
1>  moc: main.h: No such file
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(170,5): error MSB6006: "cmd.exe" exited with code 1.
James
  • 2,488
  • 2
  • 28
  • 45
  • [This answer](https://stackoverflow.com/questions/3440387/how-to-put-generated-files-e-g-object-files-into-a-separate-folder-when-using/23007090#23007090) links to a Qt help page about pro-commands which lets you specify some of the directory settings you want to achieve – Bowdzone Feb 23 '15 at 07:21
  • This would be relatively easy to do with CMake. – Nicolas Holthaus Feb 23 '15 at 12:00

0 Answers0