From 60f60ed49641fbe1950460b89fcd2b5c494f1437 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 17 May 2015 16:05:38 +1000 Subject: CMake: fixes for own checking script don't error if generated files are missing. --- build_files/cmake/cmake_consistency_check.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'build_files/cmake/cmake_consistency_check.py') diff --git a/build_files/cmake/cmake_consistency_check.py b/build_files/cmake/cmake_consistency_check.py index 0883bdbf2d7..1a366880315 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): -- cgit v1.2.3