Skip to content

Instantly share code, notes, and snippets.

Created January 29, 2013 15:46
What would you like to do?
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):
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)
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.

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