diff options
author | Kevin Fitch <kfitch42@gmail.com> | 2017-06-29 02:08:28 +0300 |
---|---|---|
committer | Kevin Fitch <kfitch42@gmail.com> | 2017-06-29 02:08:28 +0300 |
commit | f19b22c04e6626f50f013fe0dc788ac5903f1fd4 (patch) | |
tree | 9fe4584d44e254ac0460c28175cff04322251964 | |
parent | e2a1bdb086038f17aaeb36e7f8e4afa682f49c8e (diff) |
In extra/FindNanopb.cmake, make the generated .pb.c and. pb.h files depend on
the .options file (if it exists), so that editing the .options file will
trigger a rebuild.
-rw-r--r-- | extra/FindNanopb.cmake | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/extra/FindNanopb.cmake b/extra/FindNanopb.cmake index 9afb21d..749999d 100644 --- a/extra/FindNanopb.cmake +++ b/extra/FindNanopb.cmake @@ -170,6 +170,8 @@ function(NANOPB_GENERATE_CPP SRCS HDRS) set(NANOPB_OPTIONS) if(EXISTS ${NANOPB_OPTIONS_FILE}) set(NANOPB_OPTIONS -f ${NANOPB_OPTIONS_FILE}) + else() + set(NANOPB_OPTIONS_FILE) endif() list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.c") @@ -190,7 +192,7 @@ function(NANOPB_GENERATE_CPP SRCS HDRS) "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h" COMMAND ${PYTHON_EXECUTABLE} ARGS ${NANOPB_GENERATOR_EXECUTABLE} ${FIL_WE}.pb ${NANOPB_OPTIONS} - DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb" ${NANOPB_OPTIONS_FILE} COMMENT "Running nanopb generator on ${FIL_WE}.pb" VERBATIM ) endforeach() |