From 0489a2efa12ff8ae1fad75460f5c7c426f342b47 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EB=B0=95=EC=A2=85=ED=98=84/On-Device=20Lab=28SR=29/Staff?= =?utf8?q?=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Thu, 31 Jan 2019 13:50:59 +0900 Subject: [PATCH] Reset internal variables before use (#2975) This commit revises Protobuf_Generate to reset internal variables before using them. Signed-off-by: Jonghyun Park --- cmake/packages/ProtobufConfig.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/packages/ProtobufConfig.cmake b/cmake/packages/ProtobufConfig.cmake index ddd7c4d..ed38859 100644 --- a/cmake/packages/ProtobufConfig.cmake +++ b/cmake/packages/ProtobufConfig.cmake @@ -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) -- 2.7.4