diff options
Diffstat (limited to 'tools/make_cmakelists.py')
-rwxr-xr-x | tools/make_cmakelists.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tools/make_cmakelists.py b/tools/make_cmakelists.py index 86544cb..e320be4 100755 --- a/tools/make_cmakelists.py +++ b/tools/make_cmakelists.py @@ -11,6 +11,7 @@ from __future__ import print_function import sys import textwrap +import os def StripColons(deps): return map(lambda x: x[1:], deps) @@ -38,12 +39,20 @@ class BuildFileFunctions(object): if kwargs["name"] == "amalgamation" or kwargs["name"] == "upbc_generator": return files = kwargs.get("srcs", []) + kwargs.get("hdrs", []) + found_files = [] + for file in files: + if os.path.isfile(file): + found_files.append(file) + elif os.path.isfile("generated/" + file): + found_files.append("generated/" + file) + else: + print("Warning: no such file: " + file) if filter(IsSourceFile, files): # Has sources, make this a normal library. self.converter.toplevel += "add_library(%s\n %s)\n" % ( kwargs["name"], - "\n ".join(files) + "\n ".join(found_files) ) self._add_deps(kwargs) else: @@ -125,6 +134,9 @@ class BuildFileFunctions(object): def upb_proto_reflection_library(self, **kwargs): pass + def upb_proto_srcs(self, **kwargs): + pass + def genrule(self, **kwargs): pass @@ -140,6 +152,9 @@ class BuildFileFunctions(object): def licenses(self, *args): pass + def filegroup(self, **kwargs): + pass + def map_dep(self, arg): return arg @@ -224,6 +239,7 @@ class Converter(object): endif() include_directories(.) + include_directories(generated_for_cmake) include_directories(${CMAKE_CURRENT_BINARY_DIR}) if(APPLE) |