From b55bde1b51926c6cf7aafeb3e07ad2d87ad8fed7 Mon Sep 17 00:00:00 2001 From: Liu Yiqun Date: Thu, 4 May 2017 07:36:00 +0000 Subject: [PATCH] Fix bug of setting external_project_dependencies in cmake. --- cmake/external/protobuf.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/external/protobuf.cmake b/cmake/external/protobuf.cmake index b61833e2687..b35e6839cdc 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) -- GitLab