diff options
Diffstat (limited to 'build_files')
-rwxr-xr-x | build_files/cmake/cmake_qtcreator_project.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/build_files/cmake/cmake_qtcreator_project.py b/build_files/cmake/cmake_qtcreator_project.py index 07ffa659437..8cabc75e426 100755 --- a/build_files/cmake/cmake_qtcreator_project.py +++ b/build_files/cmake/cmake_qtcreator_project.py @@ -47,6 +47,13 @@ import os import sys +def quote_define(define): + if " " in define.strip(): + return '"%s"' % define + else: + return define + + def create_qtc_project_main(): files = list(source_list(SOURCE_DIR, filename_check=is_project_file)) files_rel = [os.path.relpath(f, start=PROJECT_DIR) for f in files] @@ -99,7 +106,7 @@ def create_qtc_project_main(): qtc_cfg = os.path.join(PROJECT_DIR, "%s.config" % FILE_NAME) f = open(qtc_cfg, 'w') f.write("// ADD PREDEFINED MACROS HERE!\n") - defines_final = [("#define %s %s" % item) for item in defines] + defines_final = [("#define %s %s" % (item[0], quote_define(item[1]))) for item in defines] if sys.platform != "win32": defines_final += cmake_compiler_defines() f.write("\n".join(defines_final)) |