Skip to content
Snippets Groups Projects
Commit 70cb1583 authored by Elizabeth's avatar Elizabeth
Browse files

Added code to ignore / if -I flag exists

parent e2309d39
No related branches found
No related tags found
No related merge requests found
......@@ -41,7 +41,8 @@ def generate_cmakelists_setup(cmakelists_file):
elif line.startswith("#"):
continue
elif line.find("/") != -1: #line.find("../") != -1 or line.find("./") != -1:
# Special case: ignore / if -I flag exists
elif line.find("/") != -1 and line.find("-I") == -1:
dot_dot_slash_ind = line.find("../")
dot_slash_ind = line.find("./")
if dot_dot_slash_ind != -1:
......@@ -66,30 +67,9 @@ def generate_cmakelists_setup(cmakelists_file):
new_path = os.path.join(BASE_CMAKELISTS_PATH, old_rel_path)
cmakelists_file.write(line.replace(old_rel_path, new_path))
continue
'''
elif line.startswith("include_directories"):
old_rel_path = line[line.find("(") + 1: line.find(")")]
# Not actually a rel path
if old_rel_path.find(".") == -1 and old_rel_path.find("..") == -1:
cmakelists_file.write(line)
else:
new_path = os.path.join(BASE_CMAKELISTS_PATH, old_rel_path)
cmakelists_file.write(line.replace(old_rel_path, new_path))
continue
elif line.startswith("find_library"):
find_lib_line += line
if line.endswith(")"):
find_lib_line = ""
else:
continue
'''
cmakelists_file.write(line)
base_cmakelists_file.close()
# include_directoryes
# find_library
def generate_cmakelists_file(cmakelists_file, source_file_dirs):
generate_cmakelists_setup(cmakelists_file)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment