Commit: 60f60ed49641fbe1950460b89fcd2b5c494f1437
Author: Campbell Barton
Date:   Sun May 17 16:05:38 2015 +1000
Branches: master
https://developer.blender.org/rB60f60ed49641fbe1950460b89fcd2b5c494f1437

CMake: fixes for own checking script

don't error if generated files are missing.

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

M       build_files/cmake/cmake_consistency_check.py
M       build_files/cmake/cmake_consistency_check_config.py

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

diff --git a/build_files/cmake/cmake_consistency_check.py 
b/build_files/cmake/cmake_consistency_check.py
index 0883bdb..1a366880 100755
--- a/build_files/cmake/cmake_consistency_check.py
+++ b/build_files/cmake/cmake_consistency_check.py
@@ -28,7 +28,13 @@ if not sys.version.startswith("3"):
           sys.version.partition(" ")[0])
     sys.exit(1)
 
-from cmake_consistency_check_config import IGNORE, UTF8_CHECK, SOURCE_DIR
+from cmake_consistency_check_config import (
+        IGNORE,
+        UTF8_CHECK,
+        SOURCE_DIR,
+        BUILD_DIR,
+        )
+
 
 import os
 from os.path import join, dirname, normpath, splitext
@@ -134,6 +140,7 @@ def cmake_get_src(f):
 
         if found:
             cmake_base = dirname(f)
+            cmake_base_bin = os.path.join(BUILD_DIR, 
os.path.relpath(cmake_base, SOURCE_DIR))
 
             while it is not None:
                 i += 1
@@ -154,6 +161,8 @@ def cmake_get_src(f):
 
                     # replace dirs
                     l = l.replace("${CMAKE_CURRENT_SOURCE_DIR}", cmake_base)
+                    l = l.replace("${CMAKE_CURRENT_BINARY_DIR}", 
cmake_base_bin)
+                    l = l.strip('"')
 
                     if not l:
                         pass
@@ -193,7 +202,10 @@ def cmake_get_src(f):
                                 raise Exception("unknown file type - not c or 
h %s -> %s" % (f, new_file))
 
                         elif context_name == "INC":
-                            if os.path.isdir(new_file):
+                            if new_file.startswith(BUILD_DIR):
+                                # assume generated path
+                                pass
+                            elif os.path.isdir(new_file):
                                 new_path_rel = os.path.relpath(new_file, 
cmake_base)
 
                                 if new_path_rel != l:
@@ -246,7 +258,7 @@ print("\nChecking for missing references:")
 is_err = False
 errs = []
 for f in (global_h | global_c):
-    if f.endswith("dna.c"):
+    if f.startswith(BUILD_DIR):
         continue
 
     if not os.path.exists(f):
diff --git a/build_files/cmake/cmake_consistency_check_config.py 
b/build_files/cmake/cmake_consistency_check_config.py
index 729eecc..1f75b98 100644
--- a/build_files/cmake/cmake_consistency_check_config.py
+++ b/build_files/cmake/cmake_consistency_check_config.py
@@ -74,3 +74,6 @@ IGNORE = (
 UTF8_CHECK = True
 
 SOURCE_DIR = 
os.path.normpath(os.path.abspath(os.path.normpath(os.path.join(os.path.dirname(__file__),
 "..", ".."))))
+
+# doesn't have to exist, just use as reference
+BUILD_DIR = 
os.path.normpath(os.path.abspath(os.path.normpath(os.path.join(SOURCE_DIR, 
"..", "build"))))

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to