Reset internal variables before use (#2975)
author박종현/On-Device Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Thu, 31 Jan 2019 04:50:59 +0000 (13:50 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Thu, 31 Jan 2019 04:50:59 +0000 (13:50 +0900)
This commit revises Protobuf_Generate to reset internal variables before
using them.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
cmake/packages/ProtobufConfig.cmake

index ddd7c4d..ed38859 100644 (file)
@@ -110,6 +110,11 @@ if(Protobuf_FOUND)
     get_filename_component(abs_output_dir ${OUTPUT_DIR} ABSOLUTE)
     get_filename_component(abs_proto_dir ${PROTO_DIR} ABSOLUTE)
 
+    # Let's reset variables before using them
+    # NOTE This DOES NOT AFFECT variables in the parent scope
+    unset(PROTO_FILES)
+    unset(OUTPUT_FILES)
+
     foreach(proto ${ARGN})
       get_filename_component(fil "${proto}" NAME)
       get_filename_component(dir "${proto}" DIRECTORY)