if-elseif 匹配字符串
set(INFWRITE "0001")
if (${INFWRITE} MATCHES "^[0-1]*0$")
add_definitions(-DWRITE_0)
message(STATUS "write level 0")
elseif (${INFWRITE} MATCHES "^[0-1]*1$")
add_definitions(-DWRITE_1)
message(STATUS "write level 1")
elseif (${INFWRITE} MATCHES "^[0-1]*1[0-1]$")
add_definitions(-DWRITE_2)
message(STATUS "write level 2")
endif()