mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-28 02:39:07 +08:00
0e914ba681
* [scripts-audit] vcpkg_acquire_msys (#17687) * [vcpkg.cmake] Change find_package function -> macro in order to shorten trace (#17997) switch from function to macro * [scripts-audit] z_vcpkg_apply_patches (#18013) * [scripts-audit] z_vcpkg_escape_regex_control_characters (#18013) * [scripts-audit] vcpkg_fail_port_install (#18054) Note that this change allows existing failures; it changes MATCHES to STREQUAL, meaning that vcpkg_fail_port_install(ON_ARCH "arm") now succeeds on arm64; this change in behavior is fine (IMO) since it strictly succeeds when it used to fail.
9 lines
475 B
CMake
9 lines
475 B
CMake
function(z_vcpkg_escape_regex_control_characters out_var string)
|
|
if(ARGC GREATER "2")
|
|
message(FATAL_ERROR "z_vcpkg_escape_regex_control_characters passed extra arguments: ${ARGN}")
|
|
endif()
|
|
# uses | instead of [] to avoid confusion; additionally, CMake doesn't support `]` in a `[]`
|
|
string(REGEX REPLACE [[\[|\]|\(|\)|\.|\+|\*|\^|\\|\$|\?|\|]] [[\\\0]] escaped_content "${string}")
|
|
set("${out_var}" "${escaped_content}" PARENT_SCOPE)
|
|
endfunction()
|