added support for windows/mingw
authorCampbell Barton <ideasman42@gmail.com>
Thu, 3 Mar 2011 15:38:29 +0000 (15:38 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 3 Mar 2011 15:38:29 +0000 (15:38 +0000)
build_files/cmake/cmake_qtcreator_project.py

index 8b5a0a8754cd906f913cec63aa074d99f6097b01..9adc14455f79c0040f5878b49d45f734c29c6c2b 100644 (file)
 
 # <pep8 compliant>
 
 
 # <pep8 compliant>
 
+"""
+Exampel Win32 usage:
+ c:\Python32\python.exe c:\blender_dev\blender\build_files\cmake\cmake_qtcreator_project.py c:\blender_dev\cmake_build
+"""
+
 import os
 from os.path import join, dirname, normpath, abspath, splitext, relpath, exists
 
 import os
 from os.path import join, dirname, normpath, abspath, splitext, relpath, exists
 
@@ -81,7 +86,12 @@ def cmake_advanced_info():
     """
 
     def create_eclipse_project(cmake_dir):
     """
 
     def create_eclipse_project(cmake_dir):
-        cmd = 'cmake %r -G"Eclipse CDT4 - Unix Makefiles"' % cmake_dir
+        import sys
+        if sys.platform == "win32":
+            cmd = 'cmake %r -G"Eclipse CDT4 - MinGW Makefiles"' % cmake_dir
+        else:
+            cmd = 'cmake %r -G"Eclipse CDT4 - Unix Makefiles"' % cmake_dir
+
         os.system(cmd)
 
     includes = []
         os.system(cmd)
 
     includes = []
@@ -98,7 +108,7 @@ def cmake_advanced_info():
         print("CMakeCache.txt not found in %r or %r\n    Pass CMake build dir as an argument, or run from that dir, abording" % (cmake_dir, os.getcwd()))
         sys.exit(1)
 
         print("CMakeCache.txt not found in %r or %r\n    Pass CMake build dir as an argument, or run from that dir, abording" % (cmake_dir, os.getcwd()))
         sys.exit(1)
 
-    create_eclipse_project(cmake_dir)
+    create_eclipse_project(cmake_dir)
 
     from xml.dom.minidom import parse
     tree = parse(os.path.join(cmake_dir, ".cproject"))
 
     from xml.dom.minidom import parse
     tree = parse(os.path.join(cmake_dir, ".cproject"))