Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    [QBS] Do not called custom Rule from custom Module

    Tools
    1
    1
    776
    Loading More Posts
    • 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
      kuzulis Qt Champions 2020 last edited by

      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 Reply Quote 0
      • First post
        Last post