Reputation: 45685
I have two projects in QtCreator, which both include two .pri files in another directory:
[common]
* common.pri
* database.pri
* ...
[projects]
[project1]
* project1.pro
* ...
[project2]
* project2.pro
* ...
Let's concentrate on one .pro file. It contains the two includes:
COMMONPATH = ../../common
# INCLUDE COMMON FILES
!include($${COMMONPATH}/common.pri) {
error(Failed to include common/common.pri)
}
# INCLUDE DATABASE FILES
!include($${COMMONPATH}/database.pri) {
error(Failed to include common/database.pri)
}
After saving my .pro file, QtCreator didn't notice the two .pri files in the project manager.
After some time (and I can't remember what I did to do so) QtCreator showed one of the two .pri files as shown in the screenshot:
I'm now stuck since I can't tell why QtCreator doesn't show the second .pri file the same way it shows the first one, neither why it showed the first one only after some time...
I tried to replace the $${COMMONPATH} variable by its value, removed the error handling, restarted QtCreator multiple times, run qmake from the menu multiple times, ...
Upvotes: 2
Views: 2042
Reputation: 45685
Ok this is weird. I just figured out why Project Manager doesn't display the second included .pri file:
The file contains an error(...)
statement, which itself contains a '
character, which is correctly interpreted by qmake
, but incorrectly by the Project Manager! The latter obviously interprets '
as a string enclosure token or something similar.
From common/database.pri:
!include(<anotherPriFile>) {
error(Can't find file for inclusion!)
}
Correct version (removed '
):
!include(<anotherPriFile>) {
error(Cannot find file for inclusion!)
}
I'm using this QtCreator version:
Qt Creator 2.1.0 based on Qt 4.7.2
Upvotes: 1
Reputation: 29886
Qt Creator uses another project configuration file with the extension .pro.user
, move it somewhere else and then try to open the project again.
Upvotes: 0