[CMake] Protobuf on iOS

Robert Bielik Robert.Bielik at dirac.com
Tue Oct 17 05:12:20 EDT 2017


Hi all,

CMake version: 3.9.4

Trying to build protobuf on iOS via the toolchains @ https://github.com/ruslo/polly (ios-10-2.cmake). With some additional tricks in my wrapper CMakeLists file:

 if (IOS)
    set(CMAKE_MACOSX_BUNDLE OFF)
    find_package(Threads REQUIRED)
endif ()
add_subdirectory(protobuf/cmake)

it works fine up til the point where protoc is compiled. CMake files are generated like so:

cmake -GXcode -DCMAKE_TOOLCHAIN_FILE=$TOOLCHAINS/polly/ios-10-2.cmake <path to my protobuf wrapper>

The error produced is:

target specifies product type 'com.apple.product-type.tool', but there's no such product type for the 'iphoneos' platform

Granted, I won't really need the protoc target during cross building, but I'd rather stay clear of the CMake files of protobuf.

Ideas ?

TIA
/Robert



More information about the CMake mailing list