Ensure generator files are updated when cached

When bumping Nanopb, while having the previous version cached, the
generator files are not correctly copied during build.

CMake copy_directory does not seem to copy the content if the directory
does already exist.

By specifying that we want to copy the content of the directory
we can avoid this issue.

Review: Add comment
diff --git a/extra/FindNanopb.cmake b/extra/FindNanopb.cmake
index d2ca7d2..928c012 100644
--- a/extra/FindNanopb.cmake
+++ b/extra/FindNanopb.cmake
@@ -172,10 +172,13 @@
   # same build directory with different python/protobuf versions
   # as the binary build directory is discarded across builds.
   #
+  # Notice: copy_directory does not copy the content if the directory already exists.
+  # We therefore append '/' to specify that we want to copy the content of the folder. See #847
+  #
   add_custom_command(
       OUTPUT ${NANOPB_GENERATOR_EXECUTABLE} ${GENERATOR_CORE_SRC}
       COMMAND ${CMAKE_COMMAND} -E copy_directory
-      ARGS ${NANOPB_GENERATOR_SOURCE_DIR} ${GENERATOR_PATH}
+      ARGS ${NANOPB_GENERATOR_SOURCE_DIR}/ ${GENERATOR_PATH}
       VERBATIM)
 
   set(GENERATOR_CORE_PYTHON_SRC)