mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-06-26 15:12:51 +00:00
Fix when an old version of Protocol Buffers is present
This commit is contained in:
parent
b499983526
commit
d6d85aabd5
@ -1791,6 +1791,7 @@ endif()
|
|||||||
################################################################################
|
################################################################################
|
||||||
option(ENABLE_PROTOBUF "Enable Protocol Buffers" ON)
|
option(ENABLE_PROTOBUF "Enable Protocol Buffers" ON)
|
||||||
if(ENABLE_PROTOBUF)
|
if(ENABLE_PROTOBUF)
|
||||||
|
set(Protobuf_VERSION "0.0.0")
|
||||||
find_package(Protobuf)
|
find_package(Protobuf)
|
||||||
set_package_properties(Protobuf PROPERTIES
|
set_package_properties(Protobuf PROPERTIES
|
||||||
URL "https://developers.google.com/protocol-buffers/"
|
URL "https://developers.google.com/protocol-buffers/"
|
||||||
@ -1813,6 +1814,7 @@ if(ENABLE_PROTOBUF)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if((NOT Protobuf_FOUND) OR (NOT Protobuf_PROTOC_EXECUTABLE) OR (${Protobuf_VERSION} VERSION_LESS ${GNSSSDR_PROTOBUF_MIN_VERSION}))
|
if((NOT Protobuf_FOUND) OR (NOT Protobuf_PROTOC_EXECUTABLE) OR (${Protobuf_VERSION} VERSION_LESS ${GNSSSDR_PROTOBUF_MIN_VERSION}))
|
||||||
|
unset(Protobuf_PROTOC_EXECUTABLE)
|
||||||
if(CMAKE_CROSSCOMPILING)
|
if(CMAKE_CROSSCOMPILING)
|
||||||
set(PROTOBUF_CROSSCOMPILE "--host=$ENV{OECORE_TARGET_ARCH} --with-protoc=/usr/local/bin/protoc")
|
set(PROTOBUF_CROSSCOMPILE "--host=$ENV{OECORE_TARGET_ARCH} --with-protoc=/usr/local/bin/protoc")
|
||||||
ExternalProject_Add(protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}
|
ExternalProject_Add(protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}
|
||||||
@ -1861,6 +1863,8 @@ if(ENABLE_PROTOBUF)
|
|||||||
add_executable(protobuf::protoc IMPORTED)
|
add_executable(protobuf::protoc IMPORTED)
|
||||||
add_dependencies(protobuf::protoc protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION})
|
add_dependencies(protobuf::protoc protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION})
|
||||||
endif()
|
endif()
|
||||||
|
unset(Protobuf_PROTOC_EXECUTABLE)
|
||||||
|
set(PROTOBUF_PROTOC_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/bin/protoc")
|
||||||
set_target_properties(protobuf::protoc PROPERTIES
|
set_target_properties(protobuf::protoc PROPERTIES
|
||||||
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
|
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
|
||||||
IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/bin/protoc"
|
IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/bin/protoc"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user