How to use the haros.cmake_parser.BuildTarget.new_target function in haros

To help you get started, we’ve selected a few haros examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github git-afsantos / haros / haros / cmake_parser.py View on Github external
def _process_catkin_install_python(self, args):
        n = len(args)
        assert n > 1

        files = list(itertools.chain.from_iterable(
            self.variables.get(arg, arg).split()
            for arg in args[1:-2]
        ))
        names = map(os.path.basename, files)
        targets = {
            name: BuildTarget.new_target(name, [file], self.directory, True)
            for name, file in zip(names, files)
        }
        self.executables.update(targets)
github git-afsantos / haros / haros / cmake_parser.py View on Github external
if not os.path.isdir(tdir):
                self.log.warning(
                    "CMake install() directory does not exist: %s", tdir)
                continue
            try:
                for filename in os.listdir(tdir):
                    in_directories.append(os.path.join(dirname, filename))
            except OSError:
                self.log.warning(
                    "Could not read directory %s", tdir)
        sources = (in_directories
                   + self._get_option_args(args, 'FILES')
                   + self._get_option_args(args, 'PROGRAMS'))
        names = map(os.path.basename, sources)
        targets = {
            name: BuildTarget.new_target(name, [filename], self.directory, True)
            for name, filename in zip(names, sources)
        }
        self.executables.update(targets)
github git-afsantos / haros / haros / cmake_parser.py View on Github external
def _process_library(self, args):
        n = len(args)
        assert n > 1
        name = args[0]
        i = 1
        flags = ("STATIC", "SHARED", "MODULE", "UNKNOWN", "EXCLUDE_FROM_ALL")
        while args[i] in flags:
            i += 1
            if i >= n:
                return
        if args[i] in ("IMPORTED", "ALIAS", "OBJECT", "INTERFACE"):
            return # TODO
        target = BuildTarget.new_target(name, args[i:], self.directory, False)
        self.libraries[name] = target
github git-afsantos / haros / haros / cmake_parser.py View on Github external
def _process_executable(self, args):
        n = len(args)
        assert n > 1
        name = args[0]
        if args[1] == "IMPORTED" or args[1] == "ALIAS":
            return # TODO
        i = 1
        while args[i] == "WIN32" or args[i] == "MACOSX_BUNDLE" \
                                 or args[i] == "EXCLUDE_FROM_ALL":
            i += 1
        target = BuildTarget.new_target(name, args[i:], self.directory, True)
        self.executables[name] = target