Maybe fix regex issue

This commit is contained in:
Ashcon Partovi
2024-12-06 15:56:50 -08:00
parent 55aad5b813
commit 77a8f7b1c3

View File

@@ -87,11 +87,12 @@ macro(optionx variable type description)
endif()
endif()
if(DEFINED ${variable}_REGEX AND NOT "^(${${variable}_REGEX})$" MATCHES "${${variable}}")
message(FATAL_ERROR "Invalid ${${variable}_SOURCE}: ${${variable}_PREVIEW}=\"${${variable}}\", please use ${${variable}_PREVIEW}=<${${variable}_REGEX}>")
if(DEFINED ${variable}_REGEX)
if(NOT "^(${${variable}_REGEX})$" MATCHES "${${variable}}")
message(FATAL_ERROR "Invalid ${${variable}_SOURCE}: ${${variable}_PREVIEW}=\"${${variable}}\", please use ${${variable}_PREVIEW}=<${${variable}_REGEX}>")
endif()
endif()
if(NOT ${variable}_VALUE STREQUAL ${variable})
message(STATUS "Set ${variable}: ${${variable}}")
endif()