In order for my Qt project to be organized a little (using Qt Creator), I have one .pro file and several .pri files. Most recently, I added a class to one of my .pri files, which has the same file name as the class that already exists in a separate .pri file.
The file structure and make files created by qmake do not appear to address the file name conflict that arises. The generated moc_ * files are all transferred to the same subdirectory (either debugged or debugged, depending), and one of them overwrites the other. When I try to create a project, I get a few warnings that look like this:
Makefile.Release:318: warning: overriding commands for target `release/moc_file.cpp`
And the project is not connected.
Here is a simple example of what I am saying.
Directory structure:
+ project_dir
| + subdir1
| | - file.h
| | - file.cpp
| + subdir2
| | - file.h
| | - file.cpp
| - main.cpp
| - project.pro
| - subdir1.pri
| - subdir2.pri
The contents of project.pro:
TARGET = project TEMPLATE = app include(subdir1.pri) include(subdir2.pri) SOURCES += main.cpp
Contents of subdir1.pri:
HEADERS += subdir1/file.h SOURCES += subdir1/file.cpp
Contents of subdir2.pri:
HEADERS += subdir2/file.h SOURCES += subdir2/file.cpp
Is there any way to tell qmake to create a system that puts moc_ * files from separate .pri files in separate subdirectories?
qt qmake
Stephen
source share