diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-05-17 09:05:38 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-05-17 09:05:38 +0300 |
commit | 60f60ed49641fbe1950460b89fcd2b5c494f1437 (patch) | |
tree | 6e710f89865222e7de4dc0e105caa21b876bc1e9 | |
parent | 6c15f3044be138d025b2ae5d6be56103a65b4fa0 (diff) |
CMake: fixes for own checking script
don't error if generated files are missing.
-rwxr-xr-x | build_files/cmake/cmake_consistency_check.py | 18 | ||||
-rw-r--r-- | build_files/cmake/cmake_consistency_check_config.py | 3 |
2 files changed, 18 insertions, 3 deletions
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): diff --git a/build_files/cmake/cmake_consistency_check_config.py b/build_files/cmake/cmake_consistency_check_config.py index 729eecce233..1f75b9884bc 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")))) |