fix cmake for when BLENDER_VERSION_CHAR is not set.
authorCampbell Barton <ideasman42@gmail.com>
Sun, 3 Apr 2011 07:48:33 +0000 (07:48 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 3 Apr 2011 07:48:33 +0000 (07:48 +0000)
build_files/cmake/macros.cmake

index 4a9c55d81cdeaacf0141f5aa043e137e3e39edc2..24dc058c4b0924d6c5c1007e704ff8aeb1092bf2 100644 (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()