For additional context, cross-compiling on x64_64 works fine as the protoc binary do run on the host platform but when cross-compiling for other archs doesn't. Here is an example for armv7:
/bin/sh: 1: /bin/sh: 1: /bin/sh: 1: ../../protobuf/runtime_output_directory/protoc-3.11.4: Exec format error/bin/sh: 1:
../../protobuf/runtime_output_directory/protoc-3.11.4: Exec format error../../protobuf/runtime_output_directory/protoc-3.11.4: Exec format error
I've tried many variations based on
https://cmake.org/cmake/help/latest/module/FindProtobuf.html but they all get discarded
-DPROTOBUF_INCLUDE_DIR=$(STAGING_INSTALL_PREFIX)/include
-DProtobuf_INCLUDE_DIRS=$(STAGING_INSTALL_PREFIX)/include
-DPROTOBUF_INCLUDE_DIR=$(STAGING_INSTALL_PREFIX)/include/google/protobuf
-Dprotobuf_PROTOC_EXECUTABLE=$(WORK_DIR)/../../../native/protoc/work--Dprotobuf_INCLUDE_DIRS=$(STAGING_INSTALL_PREFIX)/include/google/protobuf
-Dprotobuf_LIBRARIES=$(STAGING_INSTALL_PREFIX)/lib
But they all get discarded:
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
CROSS_COMPILE_ARM
protobuf_INCLUDE_DIRS
protobuf_LIBRARIES
protobuf_PROTOC_EXECUTABLE
Really, at first glance, having options for WITH_PROTOBUF (and others) would be best unless there is a way to avoid it differently?
Again, much thnx in advance.