Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export PREFERRED_PROTOBUF_EXECUTABLE globally #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if(USE_SYSTEM_PROTOBUF STREQUAL "ON")
message(STATUS "Using system protobuf.")

find_package(Protobuf REQUIRED)
set(PREFERRED_PROTOC_EXECUTABLE ${Protobuf_PROTOC_EXECUTABLE})
set(PREFERRED_PROTOC_EXECUTABLE ${Protobuf_PROTOC_EXECUTABLE} CACHE INTERNAL "")

cs_install()
cs_export(INCLUDE_DIRS ${Protobuf_INCLUDE_DIRS}
Expand All @@ -55,8 +55,8 @@ elseif(USE_SYSTEM_PROTOBUF STREQUAL "GRPC")
# This is actually catkin_grpc: https://github.com/CogRob/catkin_grpc
find_package(grpc REQUIRED)

# TODO(helenol): this is kinda hacky, but catkin_grpc doesn't seem to export this.
set(PREFERRED_PROTOC_EXECUTABLE "/opt/ros/$ENV{ROS_DISTRO}/lib/grpc/protobuf/protoc")
set(PREFERRED_PROTOC_EXECUTABLE "${GRPC_BIN_DIR}/protobuf/protoc" CACHE INTERNAL "")
message(STATUS "using grpc protobuf version from ${PREFERRED_PROTOC_EXECUTABLE}")

cs_install()
cs_export(INCLUDE_DIRS ${GRPC_INCLUDE_DIR}
Expand Down Expand Up @@ -87,7 +87,7 @@ elseif(USE_SYSTEM_PROTOBUF STREQUAL "OFF")
install(FILES ${CATKIN_DEVEL_PREFIX}/bin/protoc
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION})
set(PREFERRED_PROTOC_EXECUTABLE ${CATKIN_DEVEL_PREFIX}/bin/protoc)
set(PREFERRED_PROTOC_EXECUTABLE ${CATKIN_DEVEL_PREFIX}/bin/protoc CACHE INTERNAL "")
cs_export(INCLUDE_DIRS ${CATKIN_DEVEL_PREFIX}/include
LIBRARIES protobuf protobuf-lite protoc
CFG_EXTRAS protobuf-generate-cpp.cmake)
Expand Down