[Qt-interest] qmake: Nested function call in .pro files

Antonio L. Rodriguez nefarita at gmail.com
Tue Jan 20 09:58:37 CET 2009


The following code contained in a qmake project file:

             QWT_LIB_BINARY=/usr/lib/libqwt-qt4.so
             TEMP1 = $$basename(QWT_LIB_BINARY)
             TEMP2 = $$replace(TEMP1, .so, )
             QWT_LIB_NAME = $$replace(TEMP2, lib, )
             message(QWT library name = $$QWT_LIB_NAME)

Eliminates the path, the 'lib' prefix and the '.so' subfix of the string
contained in the QWT_LIB_BINARY variable. When compiling, the 'make' command
outputs the following line:

              Project MESSAGE: QWT library name = qwt-qt4

When the temporary variable assignations are eliminated, like this:

             QWT_LIB_BINARY=/usr/lib/libqwt-qt4.so
             QWT_LIB_NAME = $$replace($$replace($$basename(QWT_LIB_BINARY),
.so, ), lib, )
             message(QWT library name = $$QWT_LIB_NAME)

The 'make' command outputs the message:

               Project MESSAGE: QWT library name =

Indicating that the last code is not working correctly. Is it possible to
nest function calls in '.pro' files in some other way, so it can work?

Thanks in advance, Antonio.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090120/7e96c675/attachment.html 


More information about the Qt-interest-old mailing list