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
path: root/extra
diff options
context:
space:
mode:
authorleabut <leabut@users.noreply.github.com>2020-10-01 12:05:21 +0300
committerGitHub <noreply@github.com>2020-10-01 12:05:21 +0300
commit2879d1bd41300f23578743e4ce2b3ef6e3e5ff2a (patch)
tree97adc6776a701360628dd158de6803b2e2ce92c7 /extra
parentf3aacf3287e1aa2be1a82712232d379a81835767 (diff)
Allow multiple targets to be created by calling NANOPB_GENERATE_CPP() (#596)
The changes introduced will allow to copy generator relevant files (like shown above, nanopb_pb2.py) to the build directory, where NANOPB_GENERATE_CPP() was called from and not to the same directory for all callers (which caused that issue). The problem kind of still remains if calling NANOPB_GENERATE_CPP() cmake function multiple times from same CMakeLists.txt context. For general use cases one should have different binary directories for different sw modules as they should be split up in seperate CMakeLists.txt in the first place. Therefore calling that cmake function again and again, will get pretty unlikely to run into the same issue.
Diffstat (limited to 'extra')
-rw-r--r--extra/FindNanopb.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/extra/FindNanopb.cmake b/extra/FindNanopb.cmake
index 5a29f3e..a6c34fa 100644
--- a/extra/FindNanopb.cmake
+++ b/extra/FindNanopb.cmake
@@ -149,7 +149,7 @@ function(NANOPB_GENERATE_CPP SRCS HDRS)
list(REMOVE_DUPLICATES _nanopb_include_path)
- set(GENERATOR_PATH ${CMAKE_BINARY_DIR}/nanopb/generator)
+ set(GENERATOR_PATH ${CMAKE_CURRENT_BINARY_DIR}/nanopb/generator)
set(NANOPB_GENERATOR_EXECUTABLE ${GENERATOR_PATH}/nanopb_generator.py)
if (CMAKE_HOST_WIN32)