https://github.com/Kitware/CMake/blob/master/Modules/FindProtobuf.cmake
Lines 78-79

On Thursday, February 20, 2020 at 5:08:42 AM UTC+7, Ryan Goodman wrote:
>
> Ok, when I use g++, gcc and build my application I link the protbuf 
> library using this cmake function.
>
> find_package(Protobuf REQUIRED)
>
> function(missionGenerateProtobuf PROTOBUF_TARGET_NAME MSG_FILES)
>   PROTOBUF_GENERATE_CPP(ProtoSources ProtoHeaders ${MSG_FILES})
>   add_library(${PROTOBUF_TARGET_NAME} STATIC ${ProtoSources} 
> ${ProtoHeaders})
>   target_link_libraries(${PROTOBUF_TARGET_NAME} ${PROTOBUF_LIBRARY})
> endfunction(missionGenerateProtobuf PROTOBUF_TARGET_NAME MSG_FILES)
>
> I do not get this fatal error: google/protobuf/port_def.inc: No such file 
> or directory  #include <google/protobuf/port_def.inc> during cross 
> compiling an application message. 
>
> However the application I am building is ultimately going to be run on an 
> arm SBC. I use a cmake toolchain file, and try to compile in a different 
> build directory, and then I get the error. 
>
> How do I set up protobuf in cmake for cross compiling? I have not been 
> able to find anything on the internet, and I know it has to be possible. Do 
> I need to cross-compile the protoc compiler first, and then use that 
> cross-compile the application? 
>
> Thank you for your help.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/00ce971e-410a-4df4-9fee-5496d992d629%40googlegroups.com.

Reply via email to