@@ -756,8 +756,7 @@ function(get_blender_version)
756
756
# - BLENDER_VERSION (major.minor)
757
757
# - BLENDER_VERSION_MAJOR
758
758
# - BLENDER_VERSION_MINOR
759
- # - BLENDER_SUBVERSION (used for internal versioning mainly)
760
- # - BLENDER_VERSION_CHAR (a, b, c, ...or empty string)
759
+ # - BLENDER_VERSION_PATCH
761
760
# - BLENDER_VERSION_CYCLE (alpha, beta, rc, release)
762
761
763
762
# So cmake depends on BKE_blender.h, beware of inf-loops!
@@ -767,25 +766,15 @@ function(get_blender_version)
767
766
file (STRINGS ${CMAKE_SOURCE_DIR} /source /blender/blenkernel/BKE_blender_version.h _contents REGEX "^#define[ \t ]+BLENDER_.*$" )
768
767
769
768
string (REGEX REPLACE ".*#define[ \t ]+BLENDER_VERSION[ \t ]+([0-9]+).*" "\\ 1" _out_version "${_contents} " )
770
- string (REGEX REPLACE ".*#define[ \t ]+BLENDER_SUBVERSION[ \t ]+([0-9]+).*" "\\ 1" _out_subversion "${_contents} " )
771
- string (REGEX REPLACE ".*#define[ \t ]+BLENDER_VERSION_CHAR[ \t ]+([a-z]+).*" "\\ 1" _out_version_char "${_contents} " )
769
+ string (REGEX REPLACE ".*#define[ \t ]+BLENDER_VERSION_PATCH[ \t ]+([0-9]+).*" "\\ 1" _out_version_patch "${_contents} " )
772
770
string (REGEX REPLACE ".*#define[ \t ]+BLENDER_VERSION_CYCLE[ \t ]+([a-z]+).*" "\\ 1" _out_version_cycle "${_contents} " )
773
771
774
772
if (NOT ${_out_version} MATCHES "[0-9]+" )
775
773
message (FATAL_ERROR "Version parsing failed for BLENDER_VERSION" )
776
774
endif ()
777
775
778
- if (NOT ${_out_subversion} MATCHES "[0-9]+" )
779
- message (FATAL_ERROR "Version parsing failed for BLENDER_SUBVERSION" )
780
- endif ()
781
-
782
- # clumsy regex, only single char are ok but it could be unset
783
-
784
- string (LENGTH "${_out_version_char} " _out_version_char_len)
785
- if (NOT _out_version_char_len EQUAL 1)
786
- set (_out_version_char "" )
787
- elseif (NOT ${_out_version_char} MATCHES "[a-z]+" )
788
- message (FATAL_ERROR "Version parsing failed for BLENDER_VERSION_CHAR" )
776
+ if (NOT ${_out_version_patch} MATCHES "[0-9]+" )
777
+ message (FATAL_ERROR "Version parsing failed for BLENDER_VERSION_PATCH" )
789
778
endif ()
790
779
791
780
if (NOT ${_out_version_cycle} MATCHES "[a-z]+" )
@@ -795,23 +784,11 @@ function(get_blender_version)
795
784
math (EXPR _out_version_major "${_out_version} / 100" )
796
785
math (EXPR _out_version_minor "${_out_version} % 100" )
797
786
798
- # for packaging, alpha to numbers
799
- string (COMPARE EQUAL "${_out_version_char} " "" _out_version_char_empty)
800
- if (${_out_version_char_empty} )
801
- set (_out_version_char_index "0" )
802
- else ()
803
- set (_char_ls a b c d e f g h i j k l m n o p q r s t u v w x y z)
804
- list (FIND _char_ls ${_out_version_char} _out_version_char_index)
805
- math (EXPR _out_version_char_index "${_out_version_char_index} + 1" )
806
- endif ()
807
-
808
787
# output vars
809
788
set (BLENDER_VERSION "${_out_version_major} .${_out_version_minor} " PARENT_SCOPE)
810
789
set (BLENDER_VERSION_MAJOR "${_out_version_major} " PARENT_SCOPE)
811
790
set (BLENDER_VERSION_MINOR "${_out_version_minor} " PARENT_SCOPE)
812
- set (BLENDER_SUBVERSION "${_out_subversion} " PARENT_SCOPE)
813
- set (BLENDER_VERSION_CHAR "${_out_version_char} " PARENT_SCOPE)
814
- set (BLENDER_VERSION_CHAR_INDEX "${_out_version_char_index} " PARENT_SCOPE)
791
+ set (BLENDER_VERSION_PATCH "${_out_version_patch} " PARENT_SCOPE)
815
792
set (BLENDER_VERSION_CYCLE "${_out_version_cycle} " PARENT_SCOPE)
816
793
817
794
endfunction ()
0 commit comments