summaryrefslogtreecommitdiffstats
path: root/util/cmake/configurejson2cmake.py
diff options
context:
space:
mode:
Diffstat (limited to 'util/cmake/configurejson2cmake.py')
-rwxr-xr-xutil/cmake/configurejson2cmake.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py
index d85cd7e4f2..f1bbcaca3e 100755
--- a/util/cmake/configurejson2cmake.py
+++ b/util/cmake/configurejson2cmake.py
@@ -33,7 +33,9 @@ import re
import sys
from typing import Optional, Set
from textwrap import dedent
+import os
+from special_case_helper import SpecialCaseHandler
from helper import (
map_qt_library,
featureName,
@@ -1359,7 +1361,9 @@ def processJson(path, ctx, data):
ctx = processFiles(ctx, data)
- with open(posixpath.join(path, "configure.cmake"), "w") as cm_fh:
+ destination = posixpath.join(path, "configure.cmake")
+ generated_file = destination + '.gen'
+ with open(generated_file, "w") as cm_fh:
cm_fh.write("\n\n#### Inputs\n\n")
processInputs(ctx, data, cm_fh)
@@ -1389,6 +1393,16 @@ def processJson(path, ctx, data):
# do this late:
processSubconfigs(path, ctx, data)
+ handler = SpecialCaseHandler(
+ os.path.abspath(destination),
+ os.path.abspath(generated_file),
+ os.path.abspath(path),
+ convertingProFiles=False,
+ debug=False,
+ )
+ if handler.handle_special_cases():
+ os.replace(generated_file, destination)
+
def main():
if len(sys.argv) != 2: