Skip to content

Instantly share code, notes, and snippets.

@orgads
Created September 7, 2015 08:32
Show Gist options
  • Save orgads/ea7b2b463119a5e36a06 to your computer and use it in GitHub Desktop.
Save orgads/ea7b2b463119a5e36a06 to your computer and use it in GitHub Desktop.
import qbs
import qbs.FileInfo
StaticLibrary {
name: "Params"
Depends { name: "cpp" }
Group {
files: [
"ExcelGenerators/**/*.csv",
project.tp + "/ExcelGenerators/**/*.csv",
]
fileTags: ["csv"]
}
Rule {
id: params
inputs: ["csv"]
multiplex: true
outputFileTags: ["hpp", "cpp"]
outputArtifacts: {
var artifacts = []
inputs.csv.map(function (input) {
artifacts.push({fileTags: "hpp", filePath: input.baseName + ".h"});
artifacts.push({fileTags: "cpp", filePath: input.baseName + ".cpp"});
});
return artifacts
}
prepare: {
var cmd;
if (qbs.hostOS.contains("windows")) {
cmd = new Command("Utils/csvgen.bat", "D:/ISIPPC-new", product.buildDirectory)
} else {
cmd = new Command("Utils/csvgen-linux.sh", product.buildDirectory)
}
cmd.description = 'generating params';
cmd.highlight = 'compiler';
return cmd;
}
}
Export {
Depends { name: "cpp" }
cpp.includePaths: FileInfo.joinPaths(product.buildDirectory, "TPApp/ParameterHandler/Include")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment