Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. [QBS] Do not called custom Rule from custom Module
QtWS25 Last Chance

[QBS] Do not called custom Rule from custom Module

Scheduled Pinned Locked Moved Qt Creator and other tools
1 Posts 1 Posters 834 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kuzulis
    Qt Champions 2020
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved