diff --git a/Packaging/CMakeLists.txt b/Packaging/CMakeLists.txt
index 13d7dcfba5cf11f8dd35c5c90065bc8b92e68e9b..c7f84df71f56992b37adc50a57eafbc1a7a4997d 100644
--- a/Packaging/CMakeLists.txt
+++ b/Packaging/CMakeLists.txt
@@ -198,7 +198,7 @@ prepare_search_dirs(PKG_SEARCHDIRS)
 set(PKG_PEFILES)
 prepare_file_list(PKG_PEFILES)
 foreach(pfile ${PKG_PEFILES})
-  process_file_recurse(${pfile_name})
+  process_file_recurse(${pfile})
 endforeach()
 
 install_include_dirs()
diff --git a/Packaging/prepare_file_list.cmake b/Packaging/prepare_file_list.cmake
index 20fd97489b4720811f6e02cf1ca590abe483b9b3..8ba085b74570773bfd99c5a7c067c72b978f63f4 100644
--- a/Packaging/prepare_file_list.cmake
+++ b/Packaging/prepare_file_list.cmake
@@ -36,7 +36,7 @@ function(prepare_file_list file_list_result)
   set(_IMPORT_PREFIX ${SUPERBUILD_INSTALL_DIR})
   foreach(f ${_targets_config_files})
     file(STRINGS ${f} _f_content REGEX " IMPORTED_LOCATION_[A-Z]+ ")
-    string(REGEX REPLACE " +IMPORTED_LOCATION_[A-Z]+ (\"[^\"]+\")" "\\1;" _filtered ${_f_content})
+    string(REGEX REPLACE " +IMPORTED_LOCATION_[A-Z]+ \"([^\"]+)\"" "\\1;" _filtered ${_f_content})
     string(CONFIGURE "${_filtered}" _configured)
     list(APPEND file_list "${_configured}")
   endforeach()