[Bf-blender-cvs] [ccbac78] master: CMake: use project name when generating project files

Campbell Barton noreply at git.blender.org
Sun May 11 08:22:56 CEST 2014


Commit: ccbac7862fad74bff7d507ea5cd96430202a589e
Author: Campbell Barton
Date:   Sun May 11 16:21:38 2014 +1000
https://developer.blender.org/rBccbac7862fad74bff7d507ea5cd96430202a589e

CMake: use project name when generating project files

===================================================================

M	build_files/cmake/cmake_netbeans_project.py
M	build_files/cmake/cmake_qtcreator_project.py
M	build_files/cmake/project_info.py

===================================================================

diff --git a/build_files/cmake/cmake_netbeans_project.py b/build_files/cmake/cmake_netbeans_project.py
index 17490e3..17668f1 100755
--- a/build_files/cmake/cmake_netbeans_project.py
+++ b/build_files/cmake/cmake_netbeans_project.py
@@ -68,7 +68,7 @@ def create_nb_project_main():
             PROJECT_NAME = "Blender"
         else:
             # be tricky, get the project name from SVN if we can!
-            PROJECT_NAME = project_name_get(SOURCE_DIR)
+            PROJECT_NAME = project_name_get()
 
         # --------------- NB spesific
         defines = [("%s=%s" % cdef) if cdef[1] else cdef[0] for cdef in defines]
diff --git a/build_files/cmake/cmake_qtcreator_project.py b/build_files/cmake/cmake_qtcreator_project.py
index 4cf854a..76f1efa 100755
--- a/build_files/cmake/cmake_qtcreator_project.py
+++ b/build_files/cmake/cmake_qtcreator_project.py
@@ -92,8 +92,8 @@ def create_qtc_project_main():
         if 0:
             PROJECT_NAME = "Blender"
         else:
-            # be tricky, get the project name from SVN if we can!
-            PROJECT_NAME = project_name_get(SOURCE_DIR)
+            # be tricky, get the project name from CMake if we can!
+            PROJECT_NAME = project_name_get()
 
         FILE_NAME = PROJECT_NAME.lower()
         f = open(os.path.join(PROJECT_DIR, "%s.files" % FILE_NAME), 'w')
@@ -134,7 +134,7 @@ def create_qtc_project_python():
         PROJECT_NAME = "Blender_Python"
     else:
         # be tricky, get the project name from SVN if we can!
-        PROJECT_NAME = project_name_get(SOURCE_DIR) + "_Python"
+        PROJECT_NAME = project_name_get() + "_Python"
 
     FILE_NAME = PROJECT_NAME.lower()
     f = open(os.path.join(PROJECT_DIR, "%s.files" % FILE_NAME), 'w')
diff --git a/build_files/cmake/project_info.py b/build_files/cmake/project_info.py
index 5d756a6..fcd4501 100755
--- a/build_files/cmake/project_info.py
+++ b/build_files/cmake/project_info.py
@@ -239,26 +239,5 @@ def cmake_compiler_defines():
     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
-    try:
-        info = subprocess.Popen(["svn", "info", path],
-                                stdout=subprocess.PIPE).communicate()[0]
-    except:
-        # possibly 'svn' isnt found/installed
-        return fallback
-
-    # string version, we only want the URL
-    info = info.decode(encoding="utf-8", errors="ignore")
-
-    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
+def project_name_get():
+    return cmake_cache_var("CMAKE_PROJECT_NAME")




More information about the Bf-blender-cvs mailing list