The "Could not run sw_vers" error is output when building on macOS x.y.z
when y is 0 (example: macOS 12.0.1) because CMAKE_MATCH_2 is set to "0",
which when used as a condition evaluates to false.
Use DEFINED instead to know whether CMAKE_MATCH_1 and CMAKE_MATCH_2
are properly set.
https://bugs.mysql.com/bug.php?id=105464#c517341
---
cmake/package_name.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmake/package_name.cmake b/cmake/package_name.cmake
index 058b0bcbd8cb..7983475221c 100644
a
|
b
|
MACRO(GET_PACKAGE_FILE_NAME Var) |
88 | 88 | |
89 | 89 | STRING(REGEX MATCH |
90 | 90 | "ProductVersion:[\n\t ]*([0-9]+)\\.([0-9]+)" UNUSED ${SW_VERS_PRODUCTVERSION}) |
91 | | IF(NOT CMAKE_MATCH_1 OR NOT CMAKE_MATCH_2) |
| 91 | IF(NOT DEFINED CMAKE_MATCH_1 OR NOT DEFINED CMAKE_MATCH_2) |
92 | 92 | MESSAGE(FATAL_ERROR "Could not run sw_vers") |
93 | 93 | ENDIF() |
94 | 94 | |