PDA

View Full Version : MSVC Project generated using qmake - turn off flat structure



Piskvorkar
12th June 2010, 14:52
Hi!
I've spent realy long time lookig for this. I've quit large project and I would like to define source and header files structure as I want have it in MSVC 2005 project. Finally, I've found CONFIG -= flat option, but it isn't enoug. I want to disable dividing to Header files / Source file filters.

Example:
- project structure:
ProjectDir
- Group1Dir

# file1_1.h

# file1_1.cpp

# file1_2.h

# file1_2.cpp
- Group2Dir

# file2_1.h

# file2_1.cpp

# file2_2.h

# file2_2.cpp
- Group3Dir

etc ...
- and currently I get this structure in MSVC project
ProjectName
- GeneratedFiles

...
- ResourceFiles

...
- HeaderFiles

- Group1Dir


# file1_1.h


# file1_2.h

- Group2Dir


...
- SourceFiles

- Group1Dir


# file1_1.cpp


# file1_2.cpp

- Group2Dir


...

I would like to have headers and sources (*.h and *.cpp) together as in real directory structure. Isn't here realy any possibility to turn off automatically creating of Header Files and Source Files filters?

Thanks a lot!

PS: I've some experiences with CMake and there is even possible create SOURCE_GROUPS and then it does filters in MSVC project. Because I haven't found nothing similar here, I'm trying to do this using structured project directories and turning off flat option.

gemmell
4th February 2013, 11:52
Can't you just put them all in SOURCES rather than splitting them into SOURCES and HEADERS?

d_stranz
4th February 2013, 18:39
The "SourceFiles" and "HeaderFiles" filters are simply names. They have nothing to do with the underlying structure of the project on the disk, and in fact the project wizards *do* put both ,cpp and .h files in the same directory when you use the "add class" wizard.

If you don't like the names MSVC chooses for you, change them (right-click on the name in the project tree and rename it). Or just highlight the file names in the tree and drag them to wherever you want them. Nothing is changed on disk when you do this, it just changes the names of the filters or the location of file names within filters in the vcproj file.

amleto
5th February 2013, 00:25
simplest thing to do is to change the project file manually.