Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-11-01 06:24:40 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-11-01 06:24:40 +0400
commite4896c999f412ecb05b68b1bffa25e5eec924514 (patch)
tree9b4318852102b7719ac10d524ca118f036fb994f /build_files/cmake/project_info.py
parenta5959e767e1fce78fa1876e8791667a377ac51f1 (diff)
name qtcreator projects based on branch names (if svn is found and its a branch), was too confusing with multiple IDE's open calling all projects 'Blender'.
Diffstat (limited to 'build_files/cmake/project_info.py')
-rwxr-xr-xbuild_files/cmake/project_info.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/build_files/cmake/project_info.py b/build_files/cmake/project_info.py
index 8e813d39b64..da1f2087f4f 100755
--- a/build_files/cmake/project_info.py
+++ b/build_files/cmake/project_info.py
@@ -41,6 +41,7 @@ __all__ = (
"is_py",
"cmake_advanced_info",
"cmake_compiler_defines",
+ "project_name_get"
)
import sys
@@ -215,3 +216,22 @@ def cmake_compiler_defines():
os.remove(temp_c)
os.remove(temp_def)
return lines
+
+
+def project_name_get(path, fallback="Blender", prefix="Blender_"):
+ if not os.path.isdir(os.path.join(path, ".svn")):
+ return fallback
+
+ import subprocess
+ info = subprocess.Popen(["svn", "info", path],
+ stdout=subprocess.PIPE).communicate()[0].decode()
+
+ for l in info.split("\n"):
+ l = l.strip()
+ if l.startswith("URL"):
+ # https://svn.blender.org/svnroot/bf-blender/branches/bmesh/blender
+ # --> bmesh
+ if "/branches/" in l:
+ return prefix + l.rsplit("/branches/", 1)[-1].split("/", 1)[0]
+ return fallback
+