mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 13:23:59 +00:00
[build] Check for python protobuf module
Signed-off-by: eisa01 <eisa01@gmail.com>
This commit is contained in:
@@ -225,6 +225,26 @@ endif()
|
|||||||
# Used in qt/ and shaders/
|
# Used in qt/ and shaders/
|
||||||
find_package(Python3 REQUIRED COMPONENTS Interpreter)
|
find_package(Python3 REQUIRED COMPONENTS Interpreter)
|
||||||
|
|
||||||
|
execute_process(
|
||||||
|
COMMAND ${Python3_EXECUTABLE} -c "import google.protobuf;
|
||||||
|
print(google.protobuf.__version__)"
|
||||||
|
RESULT_VARIABLE PROTOBUF_CHECK
|
||||||
|
OUTPUT_VARIABLE PROTOBUF_VERSION
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
ERROR_QUIET
|
||||||
|
)
|
||||||
|
|
||||||
|
if(PROTOBUF_CHECK EQUAL 0)
|
||||||
|
if(PROTOBUF_VERSION VERSION_LESS "4.0.0")
|
||||||
|
message(STATUS "Python protobuf ${PROTOBUF_VERSION} found (< 4.0)")
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Python protobuf ${PROTOBUF_VERSION} found, but version < 4.0 required")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Python protobuf not found. Install version <4.0")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
add_subdirectory(libs)
|
add_subdirectory(libs)
|
||||||
|
|
||||||
if (PLATFORM_DESKTOP)
|
if (PLATFORM_DESKTOP)
|
||||||
|
|||||||
Reference in New Issue
Block a user