-
Notifications
You must be signed in to change notification settings - Fork 28
Home
simonlynen edited this page Nov 10, 2014
·
5 revisions
We use the PROTOBUF_EXPORT_PATH
global cmake variable to pass include directories for the proto compiler. Thus, add a cmake-extras file to your catkin package as follows:
Create a file cmake/<package name>-extras.cmake.in
with:
list(APPEND PROTOBUF_EXPORT_PATH @CMAKE_CURRENT_SOURCE_DIR@/proto/)
To export this, you need to complete the cs_export
command in your CMakeLists.txt
:
cs_export(INCLUDE_DIRS include ${CMAKE_CURRENT_BINARY_DIR}
CFG_EXTRAS multiagent_mapping_common-extras.cmake)
In the depending package, you can import the proto definitions by adding
import "your-exported-proto-file.proto";
in the proto file. If you defined a namespace in your exporter proto file, e.g.:
package common.proto;
you need to use this namespace when referring to the message types, i.e.:
optional common.proto.YourMessageType position = 2;