[QBS] Do not called custom Rule from custom Module

Denis Shienkov denis.shienkov at gmail.com
Fri Apr 4 16:43:38 CEST 2014


Hi all.

I need for my project use the Windows software tracing feature:

http://msdn.microsoft.com/en-us/library/windows/hardware/ff556204%28v=vs.85%29.aspx

For this purpose need to call the "tracewpp.exe" utility with passing a
list of project's source files (*.cpp) to them,
and then, the "tracewpp.exe" utility will create a set of the (*.tmh)
header files.

So, I trying to create a custom QBS module "wpp/WppModule.qbs":

import qbs 1.0


Module {

    property string wppTraceModuleHeadersDir: ".tmh/" + product.name


    condition: qbs.hostOS.contains('windows') &&
qbs.targetOS.contains('windows') && qbs.toolchain.contains('msvc')


    cpp.includePaths: product.buildDirectory + '/' + wppTraceModuleHeadersDir


    Rule {

        inputs: ["cpp"]


        Artifact {

            fileName: ModUtils.moduleProperty(product,
"wppTraceModuleHeadersDir")

                      + '/' + input.completeBaseName + ".tmh"

            fileTags: ["tmh"]

        }


        prepare: {

            var wpp_exe = "c:/Program Files/Windows
Kits/8.0/bin/x86/tracewpp.exe";

            var wpp_cfg_dir = "c:/Program Files/Windows
Kits/8.0/bin/WppConfig/Rev1";


            var args = input.fileName;

            args.push("-cfgdir:" + wpp_cfg_dir);

            args.push("-odir:" + ModUtils.moduleProperty(product,
"wppTraceModuleHeadersDir"));


            var cmd = new Command(wpp_exe, args);

            cmd.description = "generating WPP " + output.fileName + " file";

            cmd.highlight = "filegen";

            return cmd;

        }


    }

}


and then in my project file I to do:

import qbs.base 1.0


DynamicLibrary {

    name: "foo"


        ...
        ...


    Depends { name: "wpp" }


        ...
        ...


    files: [

        "bar.cpp",

    ]


}


But in my case this does not work, the command do not called.. What I to do
wrong?

Best regards,
Denis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20140404/648a5cd5/attachment.html>


More information about the Qbs mailing list