summaryrefslogtreecommitdiffstats
path: root/conanfile.py
diff options
context:
space:
mode:
authorIikka Eklund <iikka.eklund@qt.io>2021-03-23 09:02:47 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-04-13 07:46:53 +0000
commit651b8d3cdad3313fe9e56abad489a3a5ce36e400 (patch)
tree21ea5a35720d071a50e7b5956779efecf7e34873 /conanfile.py
parent2e09f2599f717a75ad9ed3209d2bf4eea28917c9 (diff)
Conan: Use "scm" revision mode when exporting from .git repository
We have two use cases where the conan export is being executed: - Conan export from src tar ball - .git directory is not present - Coin/CI: conan export from git repository The "scm" feature will not work if the ".git" repository does not exist. If this is the case then use the default "hash" mode for the recipe revision. Change-Id: If84835613855afc00c79eab4a382dc256d87cd08 Reviewed-by: Toni Saario <toni.saario@qt.io> (cherry picked from commit 04a3129c52b64d4c53b7a13cc525a38153e3eca1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'conanfile.py')
-rw-r--r--conanfile.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/conanfile.py b/conanfile.py
index 6a6afd3ec..c211ba89d 100644
--- a/conanfile.py
+++ b/conanfile.py
@@ -28,6 +28,7 @@
from conans import ConanFile, tools, CMake
import os
+from pathlib import Path
class QtConanError(Exception):
@@ -48,7 +49,8 @@ class Qt3D(ConanFile):
default_options = {"shared": "default", # default: Use the value of the Qt build
"qt6": None}
exports_sources = "*", "!conan*.*"
- revision_mode = "scm" # use commit ID as the RREV (recipe revision)
+ # use commit ID as the RREV (recipe revision) if this is exported from .git repository
+ revision_mode = "scm" if Path(Path(__file__).parent.resolve() / ".git").exists() else "hash"
def source(self):
# sources are installed next to recipe, no need to clone etc. sources here