Bläddra i källkod

Add explicit error when golang is not found

Alexey Edelev 5 år sedan
förälder
incheckning
0d04127eb2
2 ändrade filer med 7 tillägg och 1 borttagningar
  1. 4 1
      README.md
  2. 3 0
      src/protobuf/QtProtobufGen.cmake.in

+ 4 - 1
README.md

@@ -6,7 +6,10 @@ gRPC and Protobuf generator and bindings for Qt framework
 
 ## Linux Build
 ### Prerequesties
-Check installation of protobuf and grpc in your system. Minimum required versions are protobuf-3.6.0 and grpc-1.15.0.
+Check installation of following packages in your system:
+- protobuf 3.6.0 or higher
+- grpc 1.15.0 or higher
+- golang 1.10 or higher (Mandatory dependency for any type of build)
 
 **Note:** Older versions could be supported as well but not officially tested.
 

+ 3 - 0
src/protobuf/QtProtobufGen.cmake.in

@@ -27,6 +27,9 @@ function(generate_qtprotobuf)
     endif()
 
     find_program(GO_EXECUTABLE "go")
+    if (GO_EXECUTABLE STREQUAL GO_EXECUTABLE-NOTFOUND)
+        message(FATAL_ERROR "Golang is mandatory dependency for QtProtobuf. Please install it and ensure that it's accessible by PATH environment variable")
+    endif()
     foreach(PROTO_FILE IN LISTS generate_qtprotobuf_PROTO_FILES)
         get_filename_component(BASE_DIR ${PROTO_FILE} DIRECTORY)
         set(PROTO_INCLUDES -I"${BASE_DIR}" ${PROTO_INCUDES})