[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [51343] trunk/blender/build_files/cmake/ project_source_info.py: add support for using ninja to extract build info for qtcreator/netbeans/ error-checkers.

Campbell Barton ideasman42 at gmail.com
Mon Oct 15 16:11:31 CEST 2012


Revision: 51343
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=51343
Author:   campbellbarton
Date:     2012-10-15 14:11:30 +0000 (Mon, 15 Oct 2012)
Log Message:
-----------
add support for using ninja to extract build info for qtcreator/netbeans/error-checkers.

Modified Paths:
--------------
    trunk/blender/build_files/cmake/project_source_info.py

Modified: trunk/blender/build_files/cmake/project_source_info.py
===================================================================
--- trunk/blender/build_files/cmake/project_source_info.py	2012-10-15 13:02:11 UTC (rev 51342)
+++ trunk/blender/build_files/cmake/project_source_info.py	2012-10-15 14:11:30 UTC (rev 51343)
@@ -82,11 +82,21 @@
     import subprocess
     import time
 
-    print("running make with --dry-run ...")
-    process = subprocess.Popen(["make", "--always-make", "--dry-run", "--keep-going", "VERBOSE=1"],
-                                stdout=subprocess.PIPE,
-                               )
+    # support both make and ninja
+    make_exe = cmake_cache_var("CMAKE_MAKE_PROGRAM")
+    make_exe_basename = os.path.basename(make_exe)
 
+    if make_exe_basename.startswith("make"):
+        print("running 'make' with --dry-run ...")
+        process = subprocess.Popen([make_exe, "--always-make", "--dry-run", "--keep-going", "VERBOSE=1"],
+                                    stdout=subprocess.PIPE,
+                                   )
+    elif make_exe_basename.startswith("ninja"):
+        print("running 'ninja' with -t commands ...")
+        process = subprocess.Popen([make_exe, "-t", "commands"],
+                                    stdout=subprocess.PIPE,
+                                   )
+
     while process.poll():
         time.sleep(1)
 
@@ -145,6 +155,12 @@
 
             source.append((c, inc_dirs, defs))
 
+        # make relative includes absolute
+        # not totally essential but useful
+        for i, f in enumerate(inc_dirs):
+            if not os.path.isabs(f):
+                inc_dirs[i] = os.path.abspath(os.path.join(CMAKE_DIR, f))
+
         # safety check that our includes are ok
         for f in inc_dirs:
             if not os.path.exists(f):




More information about the Bf-blender-cvs mailing list