def _build_catkin_packages(self): # Nothing to do if no packages were specified if self.catkin_packages is not None and len(self.catkin_packages) == 0: return # Call catkin build. catkincmd = ["catkin", "build"] # Prevent notification that the build is complete. catkincmd.append("--no-notify") # Use the newly created default profile. catkincmd.extend(["--profile", "default"]) if self.catkin_packages: catkincmd.extend(self.catkin_packages) compilers = Compilers( self._compilers_path, self.PLUGIN_STAGE_SOURCES, self.PLUGIN_STAGE_KEYRINGS, self.project, ) # This command must run in bash due to a bug in Catkin that causes it # to explode if there are spaces in the cmake args (which there are). self._run_in_bash(catkincmd, env=compilers.environment)
def _configure_catkin_profile(self): # Use catkin config to set all configurations before running build. catkincmd = ["catkin", "config"] # Use the newly created default profile. catkincmd.extend(["--profile", "default"]) # Configure catkin tools to use the snapcraft source, build, and # install directories. catkincmd.extend(["--build-space", self.builddir]) catkincmd.extend([ "--source-space", os.path.join(self.builddir, self.options.source_space) ]) catkincmd.extend(["--install", "--install-space", self.rosdir]) # Add any cmake-args requested from the plugin options. compilers = Compilers( self._compilers_path, self.PLUGIN_STAGE_SOURCES, self.PLUGIN_STAGE_KEYRINGS, self.project, ) catkincmd.append("--cmake-args") build_type = "Release" if "debug" in self.options.build_attributes: build_type = "Debug" catkincmd.extend([ '-DCMAKE_C_FLAGS="$CFLAGS {}"'.format(compilers.cflags), '-DCMAKE_CXX_FLAGS="$CPPFLAGS {}"'.format(compilers.cxxflags), '-DCMAKE_LD_FLAGS="$LDFLAGS {}"'.format(compilers.ldflags), "-DCMAKE_C_COMPILER={}".format(compilers.c_compiler_path), "-DCMAKE_CXX_COMPILER={}".format(compilers.cxx_compiler_path), "-DCMAKE_BUILD_TYPE={}".format(build_type), ]) catkincmd.extend(self.options.catkin_cmake_args) self._run_in_bash(catkincmd)
def _build_catkin_packages(self): # Nothing to do if no packages were specified if not self.catkin_packages: return # Call catkin build. catkincmd = ['catkin', 'build'] # Prevent notification that the build is complete. catkincmd.append('--no-notify') # Use the newly created default profile. catkincmd.extend(['--profile', 'default']) catkincmd.extend(self.catkin_packages) compilers = Compilers(self._compilers_path, self.PLUGIN_STAGE_SOURCES, self.project) # This command must run in bash due to a bug in Catkin that causes it # to explode if there are spaces in the cmake args (which there are). self._run_in_bash(catkincmd, env=compilers.environment)