|
|
@ -13,6 +13,10 @@
|
|
|
|
# limitations under the License.
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
|
|
|
|
|
|
INCLUDE(ExternalProject)
|
|
|
|
INCLUDE(ExternalProject)
|
|
|
|
|
|
|
|
# Always invoke `FIND_PACKAGE(Protobuf)` for importing function protobuf_generate_cpp
|
|
|
|
|
|
|
|
FIND_PACKAGE(Protobuf QUIET)
|
|
|
|
|
|
|
|
SET(PROTOBUF_FOUND "OFF")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Print and set the protobuf library information,
|
|
|
|
# Print and set the protobuf library information,
|
|
|
|
# finish this cmake process and exit from this file.
|
|
|
|
# finish this cmake process and exit from this file.
|
|
|
@ -39,12 +43,19 @@ macro(PROMPT_PROTOBUF_LIB)
|
|
|
|
ADD_LIBRARY(protobuf_lite ${protobuf_LIBTYPE} IMPORTED GLOBAL)
|
|
|
|
ADD_LIBRARY(protobuf_lite ${protobuf_LIBTYPE} IMPORTED GLOBAL)
|
|
|
|
SET_PROPERTY(TARGET protobuf_lite PROPERTY IMPORTED_LOCATION ${PROTOBUF_LITE_LIBRARY})
|
|
|
|
SET_PROPERTY(TARGET protobuf_lite PROPERTY IMPORTED_LOCATION ${PROTOBUF_LITE_LIBRARY})
|
|
|
|
|
|
|
|
|
|
|
|
ADD_LIBRARY(protoc ${protobuf_LIBTYPE} IMPORTED GLOBAL)
|
|
|
|
ADD_LIBRARY(libprotoc ${protobuf_LIBTYPE} IMPORTED GLOBAL)
|
|
|
|
SET_PROPERTY(TARGET protoc PROPERTY IMPORTED_LOCATION ${PROTOC_LIBRARY})
|
|
|
|
SET_PROPERTY(TARGET libprotoc PROPERTY IMPORTED_LOCATION ${PROTOC_LIBRARY})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ADD_EXECUTABLE(protoc IMPORTED GLOBAL)
|
|
|
|
|
|
|
|
SET_PROPERTY(TARGET protoc PROPERTY IMPORTED_LOCATION ${PROTOBUF_PROTOC_EXECUTABLE})
|
|
|
|
|
|
|
|
# FIND_Protobuf.cmake uses `Protobuf_PROTOC_EXECUTABLE`.
|
|
|
|
|
|
|
|
# make `protobuf_generate_cpp` happy.
|
|
|
|
|
|
|
|
SET(Protobuf_PROTOC_EXECUTABLE ${PROTOBUF_PROTOC_EXECUTABLE})
|
|
|
|
|
|
|
|
|
|
|
|
FOREACH(dep ${protobuf_DEPS})
|
|
|
|
FOREACH(dep ${protobuf_DEPS})
|
|
|
|
ADD_DEPENDENCIES(protobuf ${dep})
|
|
|
|
ADD_DEPENDENCIES(protobuf ${dep})
|
|
|
|
ADD_DEPENDENCIES(protobuf_lite ${dep})
|
|
|
|
ADD_DEPENDENCIES(protobuf_lite ${dep})
|
|
|
|
|
|
|
|
ADD_DEPENDENCIES(libprotoc ${dep})
|
|
|
|
ADD_DEPENDENCIES(protoc ${dep})
|
|
|
|
ADD_DEPENDENCIES(protoc ${dep})
|
|
|
|
ENDFOREACH()
|
|
|
|
ENDFOREACH()
|
|
|
|
|
|
|
|
|
|
|
|