add error check for qtcreator&netbeans project file generators to quit early if cmake...
authorCampbell Barton <ideasman42@gmail.com>
Mon, 7 Jan 2013 14:25:26 +0000 (14:25 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 7 Jan 2013 14:25:26 +0000 (14:25 +0000)
build_files/cmake/cmake_netbeans_project.py
build_files/cmake/cmake_qtcreator_project.py
build_files/cmake/project_info.py

index 2f36cad4d242ca94c53e290746b705ecc1ad33da..17490e36bb3a41b3e7042ba656f93ef636240898 100755 (executable)
@@ -56,6 +56,10 @@ def create_nb_project_main():
         pass
     else:
         includes, defines = cmake_advanced_info()
+
+        if (includes, defines) == (None, None):
+            return
+
         # for some reason it doesnt give all internal includes
         includes = list(set(includes) | set(dirname(f) for f in files if is_c_header(f)))
         includes.sort()
index 86201da23decc66739d1c3ff18328327e486106a..4cf854aad77a8c540501527a4a8b97e09e8d5e5f 100755 (executable)
@@ -81,6 +81,9 @@ def create_qtc_project_main():
     else:
         includes, defines = cmake_advanced_info()
 
+        if (includes, defines) == (None, None):
+            return
+
         # for some reason it doesnt give all internal includes
         includes = list(set(includes) | set(os.path.dirname(f)
                         for f in files_rel if is_c_header(f)))
index 495ca71263e1c21b1db43b1259517cd7a7dc001f..e73b94a7051e22a55516a64b3ba07ac4fce6b459 100755 (executable)
@@ -149,14 +149,20 @@ def cmake_advanced_info():
                 raise Exception("Unknown make program %r" % make_exe)
 
         os.system(cmd)
+        return join(CMAKE_DIR, ".cproject")
+        
 
     includes = []
     defines = []
 
-    create_eclipse_project()
+    project_path = create_eclipse_project()
+
+    if not exists(project_path):
+        print("Generating Eclipse Prokect File Failed: %r not found" % project_path)
+        return None, None
 
     from xml.dom.minidom import parse
-    tree = parse(join(CMAKE_DIR, ".cproject"))
+    tree = parse(project_path)
 
     # to check on nicer xml
     # f = open(".cproject_pretty", 'w')