fix cmake for when BLENDER_VERSION_CHAR is not set.

This commit is contained in:
Campbell Barton 2011-04-03 07:48:33 +00:00
parent 5c8234c81c
commit 744a3b9cb2
1 changed files with 6 additions and 1 deletions

View File

@ -350,7 +350,12 @@ macro(get_blender_version)
message(FATAL_ERROR "Version parsing failed for BLENDER_SUBVERSION")
endif()
if(NOT ${_out_version_char} MATCHES "[a-z]+")
# clumsy regex, only single char are ok but it could be unset
string(LENGTH "${_out_version_char}" _out_version_char_len)
if(NOT _out_version_char_len EQUAL 1)
set(_out_version_char "")
elseif(NOT ${_out_version_char} MATCHES "[a-z]+")
message(FATAL_ERROR "Version parsing failed for BLENDER_VERSION_CHAR")
endif()