Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nanopb/nanopb.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobbie Shade <rjshade@google.com>2018-01-08 23:22:41 +0300
committerRobbie Shade <rjshade@google.com>2018-01-08 23:22:41 +0300
commit93da435058518bbf49cc393e1805d483ce160b1b (patch)
treedaad6780ca6f139dea8e7f18ddf8e2f93ad4ea07
parent5866b34d7a364b833d4de96d58a2712a513a17b9 (diff)
Add nanopb_PROTOC_PATH variable to CMakeLists.txt
-rw-r--r--CMakeLists.txt6
1 files changed, 5 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 50fea6f..deb9eec 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,6 +10,10 @@ option(nanopb_BUILD_RUNTIME "Build the headers and libraries needed at runtime"
option(nanopb_BUILD_GENERATOR "Build the protoc plugin for code generation" ON)
option(nanopb_MSVC_STATIC_RUNTIME "Link static runtime libraries" ON)
+if(NOT DEFINED nanopb_PROTOC_PATH)
+ set(nanopb_PROTOC_PATH "protoc")
+endif()
+
if(NOT DEFINED CMAKE_DEBUG_POSTFIX)
set(CMAKE_DEBUG_POSTFIX "d")
endif()
@@ -46,7 +50,7 @@ if(nanopb_BUILD_GENERATOR)
string(REGEX REPLACE "([^;]+)" "\\1_pb2.py" generator_proto_py_file "${generator_proto}")
add_custom_command(
OUTPUT ${generator_proto_py_file}
- COMMAND protoc --python_out=${PROJECT_BINARY_DIR} -I${PROJECT_SOURCE_DIR}/generator/proto ${generator_proto_file}
+ COMMAND ${nanopb_PROTOC_PATH} --python_out=${PROJECT_BINARY_DIR} -I${PROJECT_SOURCE_DIR}/generator/proto ${generator_proto_file}
DEPENDS ${generator_proto_file}
)
add_custom_target("generate_${generator_proto_py_file}" ALL DEPENDS ${generator_proto_py_file})