From 9c5f4659bb6fa209e8d38ff0ca8a12c3d54fad0f Mon Sep 17 00:00:00 2001 From: reuk Date: Thu, 31 Mar 2022 12:46:42 +0100 Subject: [PATCH] CMake: Handle tabs properly in module metadata blocks --- extras/Build/CMake/JUCEModuleSupport.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/extras/Build/CMake/JUCEModuleSupport.cmake b/extras/Build/CMake/JUCEModuleSupport.cmake index 5f5f1de8cd..b9756617ee 100644 --- a/extras/Build/CMake/JUCEModuleSupport.cmake +++ b/extras/Build/CMake/JUCEModuleSupport.cmake @@ -120,23 +120,23 @@ function(_juce_extract_metadata_block delim_str file_with_block out_dict) foreach(line IN LISTS module_header_contents) if(NOT append) - if(line MATCHES " *BEGIN_${delim_str} *") + if(line MATCHES "[\t ]*BEGIN_${delim_str}[\t ]*") set(append YES) endif() continue() endif() - if(append AND (line MATCHES " *END_${delim_str} *")) + if(append AND (line MATCHES "[\t ]*END_${delim_str}[\t ]*")) break() endif() - if(line MATCHES "^ *([a-zA-Z]+):") + if(line MATCHES "^[\t ]*([a-zA-Z]+):") set(last_written_key "${CMAKE_MATCH_1}") endif() - string(REGEX REPLACE "^ *${last_written_key}: *" "" line "${line}") - string(REGEX REPLACE "[ ,]+" ";" line "${line}") + string(REGEX REPLACE "^[\t ]*${last_written_key}:[\t ]*" "" line "${line}") + string(REGEX REPLACE "[\t ,]+" ";" line "${line}") set_property(TARGET ${target_name} APPEND PROPERTY "INTERFACE_JUCE_${last_written_key}" "${line}")