[QBS] Do not called custom Rule from custom Module



  • Hi all.

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

    http://msdn.microsoft.com/en-us/library/windows/hardware/ff556204(v=vs.85).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 "modules/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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.