diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2022-08-24 19:16:50 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2022-08-24 20:07:24 (GMT) |
commit | bcc396581387582acec736dcfac577f477f60821 (patch) | |
tree | 8f41a092ab04b2574e173539ceaf026ced09e5af /Tests/RunCMake/VS10Project | |
parent | 6fa11ecf033697fc333e4eed39fd3d9551c22929 (diff) | |
download | CMake-bcc396581387582acec736dcfac577f477f60821.zip CMake-bcc396581387582acec736dcfac577f477f60821.tar.gz CMake-bcc396581387582acec736dcfac577f477f60821.tar.bz2 |
Tests: Fix VS10Project SourceGroupTreeCMakeLists check
Fix an `IN LISTS` loop, fix a variable check, and escape backslashes
in the regex used to search for source group names.
Diffstat (limited to 'Tests/RunCMake/VS10Project')
-rw-r--r-- | Tests/RunCMake/VS10Project/SourceGroupHelpers.cmake | 5 | ||||
-rw-r--r-- | Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists-check.cmake | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/Tests/RunCMake/VS10Project/SourceGroupHelpers.cmake b/Tests/RunCMake/VS10Project/SourceGroupHelpers.cmake index c82a66e..3a5d2e7 100644 --- a/Tests/RunCMake/VS10Project/SourceGroupHelpers.cmake +++ b/Tests/RunCMake/VS10Project/SourceGroupHelpers.cmake @@ -1,8 +1,9 @@ function(find_source_group LINES NAME) set(foundFileFilter 0) set(foundFilter 0) + string(REPLACE "\\" "\\\\" regexName "${NAME}") foreach(line IN LISTS LINES) - if(line MATCHES "<Filter>${NAME}</Filter>") + if(line MATCHES "<Filter>${regexName}</Filter>") if(foundFileFilter) set(RunCMake_TEST_FAILED "Multiple files listed with filter for ${NAME}." PARENT_SCOPE) set(FILTER_FOUND 0 PARENT_SCOPE) @@ -10,7 +11,7 @@ function(find_source_group LINES NAME) endif() set(foundFileFilter 1) endif() - if(line MATCHES "<Filter.*Include=\"${NAME}\"") + if(line MATCHES "<Filter.*Include=\"${regexName}\"") if(foundFilter) set(RunCMake_TEST_FAILED "Multiple copies of ${NAME} filter listed." PARENT_SCOPE) set(FILTER_FOUND 0 PARENT_SCOPE) diff --git a/Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists-check.cmake b/Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists-check.cmake index ee0c412..28d0d29 100644 --- a/Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists-check.cmake +++ b/Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists-check.cmake @@ -18,9 +18,9 @@ set(SOURCE_GROUPS_TO_FIND "SourcesPrefix\\PrefixedNested" ) -foreach(GROUP_NAME IN LISTS ${SOURCE_GROUPS_TO_FIND}) +foreach(GROUP_NAME IN LISTS SOURCE_GROUPS_TO_FIND) find_source_group("${lines}" ${GROUP_NAME}) - if(NOT ${FILTER_FOUND}) + if(NOT FILTER_FOUND) return() endif() endforeach() |