diff --git a/cmake/external/protobuf.cmake b/cmake/external/protobuf.cmake index b61833e2687b3cd1ab420b5b4c96348b347b711a..b35e6839cdc2ee062a9066585f0c83948d87e385 100644 --- a/cmake/external/protobuf.cmake +++ b/cmake/external/protobuf.cmake @@ -71,8 +71,6 @@ FUNCTION(build_protobuf TARGET_NAME BUILD_FOR_HOST) -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON ${OPTIONAL_CACHE_ARGS} ) - - LIST(APPEND external_project_dependencies ${TARGET_NAME} PARENT_SCOPE) ENDFUNCTION() SET(PROTOBUF_VERSION 3.1) @@ -88,12 +86,16 @@ IF(NOT CMAKE_CROSSCOMPILING) ENDIF(PROTOBUF_FOUND) ELSE() build_protobuf(protobuf_host TRUE) + LIST(APPEND external_project_dependencies protobuf_host) + SET(PROTOBUF_PROTOC_EXECUTABLE ${protobuf_host_PROTOC_EXECUTABLE} CACHE FILEPATH "protobuf executable." FORCE) ENDIF() IF(NOT PROTOBUF_FOUND) build_protobuf(protobuf FALSE) + LIST(APPEND external_project_dependencies protobuf) + SET(PROTOBUF_INCLUDE_DIR ${protobuf_INCLUDE_DIR} CACHE PATH "protobuf include directory." FORCE) IF(NOT CMAKE_CROSSCOMPILING)