Skip to content

Commit

Permalink
add recipe
Browse files Browse the repository at this point in the history
Signed-off-by: Zahra Boroujeni <[email protected]>
  • Loading branch information
zboroujeni committed Sep 12, 2024
1 parent f3ee114 commit 9967c6b
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# autoware_msgs

Before contributing, review [the message guidelines](https://autowarefoundation.github.io/autoware-documentation/main/contributing/coding-guidelines/ros-nodes/message-guidelines/).

## Add as conan packages

```sh
pip install conan2
mkdir ~/.conan2/profiles
touch ~/.conan2/profiles/default
cp profiles/gcc_pf ~/.conan2/profiles/default
conan install .
conan build .
conan create .
```
51 changes: 51 additions & 0 deletions autoware_perception_msgs/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
from conan import ConanFile, tools
from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout
from conan.tools.files import copy
import os

class App(ConanFile):
name = "autoware_perception_msgs"
version = "0.0.0"
# Optional metadata
license = " " # Todo
topics = ("Base")
requires = []
# Binary configuration
settings = "os", "compiler", "build_type", "arch"
options = {
"shared": [True, False],
"fPIC": [True, False],
"enable_test": ["ON", "OFF"],
"enable_coverage": ["ON", "OFF"]
}
default_options = {
"shared": True,
"fPIC": True,
"enable_test": "ON",
"enable_coverage": "ON"
}

generators = "CMakeToolchain", "CMakeDeps"

def layout(self):
build_f = self.settings.get_safe("compiler")
cmake_layout(self, src_folder="." , build_folder= "build/"+build_f)
self.graph_root = os.getcwd()
self.install_folder = self.graph_root +"/build/"
self.install_folder = self.install_folder +build_f + "/"+ self.settings.get_safe("build_type")

def build(self):
self.run('export CC="/usr/lib/ccache/gcc"')
self.run('export CXX="/usr/lib/ccache/g++"')
self.run(
'VERBOSE=1 colcon build --continue-on-error --event-handlers console_cohesion+ --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DBUILD_SHARED_LIBS=ON --paths="../../../../autoware_perception_msgs"')

def package(self):
# Define the source path where the headers are located after the build
install_path = os.path.join(self.install_folder, "install", "autoware_perception_msgs")

# copying headers from build_folder
copy(self, "*", install_path, self.package_folder)

def package_info(self):
self.cpp_info.includedirs = ["include/autoware_perception_msgs"]
12 changes: 12 additions & 0 deletions profiles/arm_gcc_pf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[settings]
os=Linux
arch=armv8
compiler=gcc
compiler.version=11.4
compiler.libcxx=libstdc++11
build_type=Debug
[options]
&:enable_test=ON
[buildenv]
CC=gcc
CXX=g++
12 changes: 12 additions & 0 deletions profiles/clang_pf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[settings]
os=Linux
arch=x86_64
compiler=clang
compiler.version=18
compiler.libcxx=libstdc++11
build_type=Debug
[options]
&:enable_test=ON
[buildenv]
CC=clang
CXX=clang++
12 changes: 12 additions & 0 deletions profiles/gcc_pf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[settings]
os=Linux
arch=x86_64
compiler=gcc
compiler.version=11.4
compiler.libcxx=libstdc++11
build_type=Debug
[options]
&:enable_test=ON
[buildenv]
CC=gcc
CXX=g++

0 comments on commit 9967c6b

Please sign in to comment.