In short sources don't appear in qt creator but project can build.
This is my qmake
QT += core gui
TARGET = Disigner
TEMPLATE = app
!include( ../Common.pri)::warning(Fail to include Common.pri)
sourcesPath = #Sources
headersPath = #Sources
tempSources += main.cpp
tempSources += Designer.cpp
tempHeaders += Designer.h
compliteSources += $$ApendPath(sourcesPath,tempSources)
compliteHeaders += $$ApendPath(headersPath,tempHeaders)
finalSources += $$compliteSources
finalHeaders += $$compliteHeaders
message($$finalSources)
message($$finalHeaders)
SOURCES += $$finalSources
HEADERS += $$finalHeaders
QT += core gui
TARGET = Disigner
TEMPLATE = app
!include( ../Common.pri)::warning(Fail to include Common.pri)
sourcesPath = #Sources
headersPath = #Sources
tempSources += main.cpp
tempSources += Designer.cpp
tempHeaders += Designer.h
compliteSources += $$ApendPath(sourcesPath,tempSources)
compliteHeaders += $$ApendPath(headersPath,tempHeaders)
finalSources += $$compliteSources
finalHeaders += $$compliteHeaders
message($$finalSources)
message($$finalHeaders)
SOURCES += $$finalSources
HEADERS += $$finalHeaders
To copy to clipboard, switch view to plain text mode
This is my Common.pri
defineReplace(ApendPath){
Path = $$eval($$1)
FileNames = $$eval($$2)
FullNames =
if(Path){
for(FileName,FileNames){
FullName = $${Path}/$${FileName}
FullNames += $$FullName
}
} else {
for(FileName,FileNames){
FullName = $${FileName}
FullNames += $$FullName
}
}
return ($$FullNames)
}
defineReplace(ApendPath){
Path = $$eval($$1)
FileNames = $$eval($$2)
FullNames =
if(Path){
for(FileName,FileNames){
FullName = $${Path}/$${FileName}
FullNames += $$FullName
}
} else {
for(FileName,FileNames){
FullName = $${FileName}
FullNames += $$FullName
}
}
return ($$FullNames)
}
To copy to clipboard, switch view to plain text mode
If i comment "SOURCES += $$finalSources" and add "SOURCES += main.cpp Designer.cpp" sources appear again in qt creator again.
Bookmarks