diff --git a/CMakeLists.txt b/CMakeLists.txt index 35e9ede4d..9c25e51a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -153,9 +153,15 @@ if(AIMRT_BUILD_WITH_PROTOBUF) include(ProtobufGenCode) if(AIMRT_USE_LOCAL_PROTOC_COMPILER) + find_program(PROTOC_EXECUTABLE protoc) + if(NOT PROTOC_EXECUTABLE) + message(FATAL_ERROR "AIMRT_USE_LOCAL_PROTOC_COMPILER is ON, but can not find protoc compiler, " # + "please install protoc and make it available in your PATH.") + endif() + message(STATUS "Found local protoc compiler: ${PROTOC_EXECUTABLE}") set(Protobuf_PROTOC_EXECUTABLE - "protoc" - CACHE STRING "Path to protoc compiler.") + ${PROTOC_EXECUTABLE} + CACHE STRING "Path to local protoc compiler.") add_executable(aimrt::protoc IMPORTED GLOBAL) set_target_properties(aimrt::protoc PROPERTIES IMPORTED_LOCATION ${Protobuf_PROTOC_EXECUTABLE}) set_property(GLOBAL PROPERTY PROTOC_NAMESPACE_PROPERTY "aimrt") @@ -172,11 +178,8 @@ if(AIMRT_BUILD_WITH_ROS2) cmake_policy(SET CMP0148 OLD) endif() - # fix gflag - set(BUILD_TESTING - OFF - CACHE BOOL "") include(GetJsonCpp) + include(GetYamlCpp) find_package(rclcpp REQUIRED) find_package(Python3 REQUIRED) endif()