diff options
Diffstat (limited to 'doc/doc.qbs')
-rw-r--r-- | doc/doc.qbs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/doc/doc.qbs b/doc/doc.qbs index 8ba331a61..8d7da8d04 100644 --- a/doc/doc.qbs +++ b/doc/doc.qbs @@ -1,6 +1,7 @@ import qbs 1.0 import qbs.File import qbs.FileInfo +import qbs.Probes Project { references: ["man/man.qbs"] @@ -16,6 +17,12 @@ Project { Depends { name: "qbsbuildconfig" } Depends { name: "qbsversion" } + Probes.BinaryProbe { + id: pythonProbe + names: ["python3", "python"] // on Windows, there's no python3 + } + property string _pythonExe: pythonProbe.found ? pythonProbe.filePath : undefined + files: [ "../README.md", "../CONTRIBUTING.md", @@ -59,9 +66,11 @@ Project { outputFileTags: ["qdoc-html", "qbsdoc.dummy"] // TODO: Hack. Rule injection to the rescue? outputArtifacts: [{filePath: "dummy", fileTags: ["qbsdoc.dummy"]}] prepare: { + if (!product._pythonExe) + throw "Python executable was not found"; var scriptPath = explicitlyDependsOn["qbsdoc.fiximports"][0].filePath; var htmlDir = FileInfo.path(FileInfo.path(inputs["qdoc-png"][0].filePath)); - var fixCmd = new Command("python", [scriptPath, htmlDir]); + var fixCmd = new Command(product._pythonExe, [scriptPath, htmlDir]); fixCmd.description = "fixing bogus QML import statements"; return [fixCmd]; } |