diff options
author | Kevin Fitch <kfitch42@gmail.com> | 2017-07-22 23:13:14 +0300 |
---|---|---|
committer | Kevin Fitch <kfitch42@gmail.com> | 2017-07-22 23:13:14 +0300 |
commit | a00d53dae666296d08c07e8ee20414604efd18d6 (patch) | |
tree | 9bd83ca5d7ffff0d711d886ab8fe8f4e4b2f9cdb | |
parent | bb3a1f6fad09167a57036fa4d519dabb35816494 (diff) |
Add some documentation to FindNanopb.cmake about the new RELPATH option.
-rw-r--r-- | extra/FindNanopb.cmake | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/extra/FindNanopb.cmake b/extra/FindNanopb.cmake index 4aee009..dda63f6 100644 --- a/extra/FindNanopb.cmake +++ b/extra/FindNanopb.cmake @@ -28,11 +28,16 @@ # ==================================================================== # # NANOPB_GENERATE_CPP (public function) -# SRCS = Variable to define with autogenerated -# source files -# HDRS = Variable to define with autogenerated -# header files -# ARGN = proto files +# NANOPB_GENERTAE_CPP(SRCS HDRS [RELPATH <root-path-of-proto-files>] +# <proto-files>...) +# SRCS = Variable to define with autogenerated source files +# HDRS = Variable to define with autogenerated header files +# If you want to use relative paths in your import statements use the RELPATH +# option. The argument to RELPATH should be the directory that all the +# imports will be relative to. +# When RELPATH is not specified then all proto files can be imported without +# a path. +# # # ==================================================================== # Example: @@ -47,6 +52,19 @@ # include_directories(${CMAKE_CURRENT_BINARY_DIR}) # add_executable(bar bar.cc ${PROTO_SRCS} ${PROTO_HDRS}) # +# Example with RELPATH: +# Assume we have a layout like: +# .../CMakeLists.txt +# .../bar.cc +# .../proto/ +# .../proto/foo.proto (Which contains: import "sub/bar.proto"; ) +# .../proto/sub/bar.proto +# Everything would be the same as the previous example, but the call to +# NANOPB_GENERATE_CPP would change to: +# +# NANOPB_GENERATE_CPP(PROTO_SRCS PROTO_HDRS RELPATH proto +# proto/foo.proto proto/sub/bar.proto) +# # ==================================================================== #============================================================================= |