Created
January 29, 2013 15:46
-
-
Save terhechte/4665223 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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