[SOLVED]Write QMAKE replace function
-
Well, as I mentioned somewhere...I have got function:
@defineReplace(getLibraryTarget) { NAME = $$1 return(quote($${PROJECT}.$$NAME)) }@
But it returns just $$NAME (not $$PROJECT), when I tested this variable, shows correct message, but when I compiled this code, it returns just $$NAME as target...I really don't know where could be a problem...So the correct name of that library should be:
@Project.LibraryName.dll@
But it is just:
@LibraryName.dll@how to rewrite this function?...
-
@defineReplace(getLibraryName) {
NAME = $$1
return ($$quote(${PROJECT}.$$NAME))
}@works fine. The problem mainly is that PROJECT isn't something qmake sets. What do you expect PROJECT to return? The project name? If I have the following:
@PROJECT = gnarl
defineReplace(getLibraryName) {
NAME = $$1
return ($$quote(${PROJECT}.$$NAME))
}message($$getLibraryName(huuhaa.dll))@
I get
@Project MESSAGE: gnarl.huuhaa.dll@
as output.If I don't set PROJECT, I get
@Project MESSAGE: .huuhaa.dll@
which indicates qmake doesn't do anything with the variable. -
Used in Library project:
@include(../../../Project.pri)
QT += xml xmlpatternsTARGET = $$setLibraryTarget(Configuration)
@Defined in project include file ( .pri )
@defineReplace(setLibraryTarget){ NAME = $$1 return($$quote(${SYDNEYSTUDIO_PROJECT_NAME}.$$NAME)) }@Well, when I removed Makefile and wrote is on multi-lines, it works...thanks for help.
So solution is, do not write QMAKE function as inline :D :D
But, there is another problem with my QMAKE (new thread?)