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>2014-05-11 10:21:38 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-05-11 10:21:38 +0400
commitccbac7862fad74bff7d507ea5cd96430202a589e (patch)
tree3f16a3813ed13e6f52873750f53824d7ca6521a3 /build_files/cmake
parentda644a9b5845bf367241eb6730fbf639c8abea4d (diff)
CMake: use project name when generating project files
Diffstat (limited to 'build_files/cmake')
-rwxr-xr-xbuild_files/cmake/cmake_netbeans_project.py2
-rwxr-xr-xbuild_files/cmake/cmake_qtcreator_project.py6
-rwxr-xr-xbuild_files/cmake/project_info.py25
3 files changed, 6 insertions, 27 deletions
diff --git a/build_files/cmake/cmake_netbeans_project.py b/build_files/cmake/cmake_netbeans_project.py
index 17490e36bb3..17668f10c0c 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 4cf854aad77..76f1efa6ccb 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 5d756a6320f..fcd4501f231 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")