cmake_dependent_option with regex not working in 3.21
In cmake 3.21.0 the following prints MY_OPTION="OFF"
but in previous versions it prints MY_OPTION="ON"
.
project(myproject)
cmake_minimum_required(VERSION 3.20)
include(CMakeDependentOption)
set(CONFIG "myconfig")
cmake_dependent_option(MY_OPTION "" ON "CONFIG MATCHES (myconfig|test)" OFF)
include(CMakePrintHelpers)
cmake_print_variables(MY_OPTION)