From d596acb68f82bffbac5e528523b48783cf802547 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Tue, 30 Jan 2024 11:01:20 -0800 Subject: [PATCH] Copy all CMake files needed for out of tree builds --- tools/make-module.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tools/make-module.py b/tools/make-module.py index 9c662ffb32..38cdf06859 100755 --- a/tools/make-module.py +++ b/tools/make-module.py @@ -17,9 +17,13 @@ def fix_string(input, modname): .replace("SCRATCH", modname.upper()) -def copy_dir(source, dest, modname): +def copy_dir(source, dest, modname, top=True): for x in os.listdir(source): - if x == ".svn" or x == 'CMakeLists.txt': + if x == ".svn" or x == 'ModuleBuild.cmake': + continue + # We only want the top-level cmake file (for out of tree modules); + # the rest are auto-generated + if x == "CMakeLists.txt" and not top: continue if x.endswith(".pyc"): continue @@ -29,14 +33,15 @@ def copy_dir(source, dest, modname): if os.path.isdir(xspath): xdpath = os.path.join(dest, x) os.mkdir(xdpath) - copy_dir(xspath, xdpath, modname) + copy_dir(xspath, xdpath, modname, top=False) else: xdpath = os.path.join(dest, fix_string(x, modname)) with open(xspath, 'r') as fh: input = fh.read() if xspath.endswith(".cpp") or xspath.endswith(".h") \ or xspath.endswith(".i-in") or xspath.endswith(".py") \ - or xspath.endswith(".md"): + or xspath.endswith(".md") \ + or xspath.endswith("CMakeLists.txt"): output = fix_string(input, modname) else: output = input