diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2012-10-08 15:02:11 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2012-10-08 15:02:11 +0400 |
commit | 10547d4c67388b909d6def623bca82d19b751880 (patch) | |
tree | 2dd2fced7f859381983502105724a48ab4df7dd3 /build_files/cmake/cmake_qtcreator_project.py | |
parent | ea3db4a71ae8e88635ad042222eb318a2dabc682 (diff) |
Allow user config files in qtcreator project.
The blender.config file used for local #defines in qtcreator projects is rewritten on every project update. To avoid losing user settings these can now be written to an optional blender_custom.config file, which is then merged into the main blender.config on updates.
Diffstat (limited to 'build_files/cmake/cmake_qtcreator_project.py')
-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 32d20489e6a..c0a5b34318f 100755 --- a/build_files/cmake/cmake_qtcreator_project.py +++ b/build_files/cmake/cmake_qtcreator_project.py @@ -105,7 +105,14 @@ 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") + f.write("// ADD PREDEFINED MACROS TO %s_custom.config!\n" % FILE_NAME) + qtc_custom_cfg = os.path.join(PROJECT_DIR, "%s_custom.config" % FILE_NAME) + if os.path.exists(qtc_custom_cfg): + f.write(fc.read()) + fc = open(qtc_custom_cfg, 'r') + f.write(fc.read()) + fc.close() + f.write("\n") defines_final = [("#define %s %s" % (item[0], quote_define(item[1]))) for item in defines] if sys.platform != "win32": defines_final += cmake_compiler_defines() |