From fdb8fc8f1f8099c5a3c40157cd55d1e47c83a890 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 24 Feb 2023 15:32:32 +0200 Subject: [PATCH] Fix issue with FileInfo.executableSuffix(). --- qbs/imports/conan/ConanfileProbe.qbs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/qbs/imports/conan/ConanfileProbe.qbs b/qbs/imports/conan/ConanfileProbe.qbs index 9cffd51bf..e5b11ca7e 100644 --- a/qbs/imports/conan/ConanfileProbe.qbs +++ b/qbs/imports/conan/ConanfileProbe.qbs @@ -28,6 +28,7 @@ ** ****************************************************************************/ +import qbs import qbs.Process import qbs.File import qbs.FileInfo @@ -39,7 +40,7 @@ Probe { property stringList additionalArguments: [] property path conanfilePath property path packageReference - property path executable: "conan" + FileInfo.executableSuffix() + property path executable: "conan" property stringList generators: [] property var options property var settings @@ -56,7 +57,13 @@ Probe { property int _conanfileLastModified: conanfilePath ? File.lastModified(conanfilePath) : 0 property path _projectBuildDirectory: project.buildDirectory + // TODO: If minimal qbs version is 1.23 replace with FileInfo.executableSuffix() + readonly property string executableSuffix: project.qbs.targetOS.contains("windows") ? ".exe" : "" + configure: { + if (executable === "conan") + executable = executable + executableSuffix; + if (conanfilePath && packageReference) throw("conanfilePath and packageReference must not be defined at the same time.");