summaryrefslogtreecommitdiffstats
path: root/util/cmake/configurejson2cmake.py
diff options
context:
space:
mode:
authorMårten Nordheim <marten.nordheim@qt.io>2020-04-30 13:34:24 +0200
committerMårten Nordheim <marten.nordheim@qt.io>2020-05-05 15:34:15 +0200
commit9c85078dc2bc8e728e9c0c6c797d29491da5d2f7 (patch)
tree79738dd78521c56dbccdebfdce8d12461b6d655d /util/cmake/configurejson2cmake.py
parent1673e66047e22ec4ad7298c9bf38662e3bab5e32 (diff)
Support special casing in configure.cmake
Change-Id: Ib899a5446a81e2604ba3642b9ad37aedc18ca650 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
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: