Micawber
15th April 2008, 15:56
Hello,
I am trying to include in my project file for qmake, support for extra build targets that will run lint on my source and create lint output that is tied to the source file name.
Snippet from my project file...
SOURCES += fileone.cpp \
filetwo.cpp \
filethree.cpp
INCLUDEPATH += /usr/include/somepath \
/home/user/somepath
MYSOURCES = SOURCES
for( name, $$MYSOURCES ) {
exists( $$name ) {
tmp_source = name
name ~= s/\.cpp//
lint_targets += $${name}.lint
sub.target = $${name}.lint
sub.commands = flint -os $${name}.lint -i $$INCLUDEPATH $${tmp_source}
QMAKE_EXTRA_TARGETS += sub
unset( sub )
}
}
linttarget.target = lint
linttarget.depends = $$lint_targets
QMAKE_EXTRA_TARGETS += linttarget
When I run qmake on it, it generates the following Makefile snippet...
filethree.lint:
flint -os filethree.lint -i /usr/include/somepath /home/usr/somepath name
filethree.lint:
flint -os filethree.lint -i /usr/include/somepath /home/usr/somepath name
filethree.lint:
flint -os filethree.lint -i /usr/include/somepath /home/usr/somepath name
lint: fileone.lint filetwo.lint filethree.lint
I think I just figured out the reason "name" is on the end of each of the commands for the lint targets.
I can't figure out why the QMAKE_EXTRA_TARGETS doesn't generate the expected targets with the proper command line.
Any help would be appreciated.
Oh, BTW, I using Qt 4.3.1 on Linux
-Mic
I am trying to include in my project file for qmake, support for extra build targets that will run lint on my source and create lint output that is tied to the source file name.
Snippet from my project file...
SOURCES += fileone.cpp \
filetwo.cpp \
filethree.cpp
INCLUDEPATH += /usr/include/somepath \
/home/user/somepath
MYSOURCES = SOURCES
for( name, $$MYSOURCES ) {
exists( $$name ) {
tmp_source = name
name ~= s/\.cpp//
lint_targets += $${name}.lint
sub.target = $${name}.lint
sub.commands = flint -os $${name}.lint -i $$INCLUDEPATH $${tmp_source}
QMAKE_EXTRA_TARGETS += sub
unset( sub )
}
}
linttarget.target = lint
linttarget.depends = $$lint_targets
QMAKE_EXTRA_TARGETS += linttarget
When I run qmake on it, it generates the following Makefile snippet...
filethree.lint:
flint -os filethree.lint -i /usr/include/somepath /home/usr/somepath name
filethree.lint:
flint -os filethree.lint -i /usr/include/somepath /home/usr/somepath name
filethree.lint:
flint -os filethree.lint -i /usr/include/somepath /home/usr/somepath name
lint: fileone.lint filetwo.lint filethree.lint
I think I just figured out the reason "name" is on the end of each of the commands for the lint targets.
I can't figure out why the QMAKE_EXTRA_TARGETS doesn't generate the expected targets with the proper command line.
Any help would be appreciated.
Oh, BTW, I using Qt 4.3.1 on Linux
-Mic