Skip to content

Instantly share code, notes, and snippets.

@terhechte
Created January 29, 2013 15:46
Show Gist options
  • Save terhechte/4665223 to your computer and use it in GitHub Desktop.
Save terhechte/4665223 to your computer and use it in GitHub Desktop.
import os
# go through the whole folder, and add all directories, that contain sourcecode
# Which directories to scan
directories = ("MyFantasticProject", "External", "libs")
def find_all_source_directories(parentDir):
def directories_contains_source(files):
for f in files:
if f.split(".")[-1] in ("h", "m", "mm", "c"):
return True
return False
returnList = []
for (path, dirs, files) in os.walk(parentDir):
if directories_contains_source(files):
returnList.append(path)
return returnList
def format_directories(directories):
return "\n".join(['-I"%s"' % (p,) for p in directories])
if __name__ == "__main__":
codeDirs = []
for dir in directories:
codeDirs = codeDirs + find_all_source_directories(dir)
print format_directories(codeDirs)
@yoyokko
Copy link

yoyokko commented Jan 6, 2014

Thanks for your blog to config vim for iOS development. And I wrote a script to generate the .clang_complete file here.
https://github.com/yoyokko/Tools/blob/master/clang_complete/clang_complete.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment