attempt to fix defione for qtcreator project file and cycles define.
authorCampbell Barton <ideasman42@gmail.com>
Tue, 6 Dec 2011 04:53:16 +0000 (04:53 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 6 Dec 2011 04:53:16 +0000 (04:53 +0000)
build_files/cmake/cmake_qtcreator_project.py
release/scripts/modules/bpy_extras/io_utils.py

index 07ffa6594371d6295c19cdba4ba97c4f7401907a..8cabc75e42679b6756f5fd0204f2a41e59e1bfe6 100755 (executable)
@@ -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))
index 3d71feaf79ea919e593e8e86c5d25bbd5769423d..90f0d3f1c1daa4540c349191d82f28dda5468a86 100644 (file)
@@ -269,8 +269,6 @@ def axis_conversion_ensure(operator, forward_attr, up_attr):
 
         return axis_forward, axis_up
 
-    change = False
-
     axis = getattr(operator, forward_attr), getattr(operator, up_attr)
     axis_new = validate(*axis)