[Qbs] Qbs Rule for a tool like syncqt.pl

Christian Gudrian christian.gudrian at aucos.de
Mon Jan 21 08:45:30 CET 2019


I'm struggling with writing a Rule for a tool like Qt's syncqt.pl script 
which automatically generates a set of API headers from the source code 
with the source itself already referencing these generated headers (that 
basically implies that the Rule needs to execute before compilation 

The naïve attempt would be to write Rule that consumes files tagged 
"hpp" and outputs files tagged "hpp". For obvious reasons that's not 
going to work.

So instead of outputting files tagged "hpp" I tried to output files 
tagged "api_hpp". But with no other Rule consuming files tagged 
"api_hpp" this Rule did not execute. (Can I declare additional input 
dependencies for the compilation step?)

The next attempt was to consume files tagged "src_hpp" and output files 
tagged "hpp". That implies that one has to put all header files in a 
special group to override the built-in "hpp" tag which is kind of hacky. 
Furthermore with the "real" header files now tagged "src_hpp" instead of 
"hpp" QtCreator's code model seemed to get confused, as some of the 
header files did not belong to any project anymore.

Is there a clean Qbs way? How has this problem been addressed in the 
days when Qbs was supposed to be the Next Build Tool for Qt?


Christian Gudrian
AUCOS AG, Matthiashofstraße 47–49, 52064 Aachen, Germany

More information about the Qbs mailing list