Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2020-05-29 19:05:04 +0300
committerBrecht Van Lommel <brecht@blender.org>2020-05-29 19:05:04 +0300
commitc93a88413d1499d43265af9580e993bf8963726d (patch)
tree3f2e7121d2c6cd62701c2d286e461874acc867b5 /build_files/cmake/macros.cmake
parent43853d0528a7a705f1022ad37b95e3b0d8927efd (diff)
parenta86b5df005d0c474de973215b112f404902b2607 (diff)
Merge branch 'blender-v2.83-release'
Diffstat (limited to 'build_files/cmake/macros.cmake')
-rw-r--r--build_files/cmake/macros.cmake33
1 files changed, 5 insertions, 28 deletions
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index d99e46ce76e..a906dbc0bf4 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -756,8 +756,7 @@ function(get_blender_version)
# - BLENDER_VERSION (major.minor)
# - BLENDER_VERSION_MAJOR
# - BLENDER_VERSION_MINOR
- # - BLENDER_SUBVERSION (used for internal versioning mainly)
- # - BLENDER_VERSION_CHAR (a, b, c, ...or empty string)
+ # - BLENDER_VERSION_PATCH
# - BLENDER_VERSION_CYCLE (alpha, beta, rc, release)
# So cmake depends on BKE_blender.h, beware of inf-loops!
@@ -767,25 +766,15 @@ function(get_blender_version)
file(STRINGS ${CMAKE_SOURCE_DIR}/source/blender/blenkernel/BKE_blender_version.h _contents REGEX "^#define[ \t]+BLENDER_.*$")
string(REGEX REPLACE ".*#define[ \t]+BLENDER_VERSION[ \t]+([0-9]+).*" "\\1" _out_version "${_contents}")
- string(REGEX REPLACE ".*#define[ \t]+BLENDER_SUBVERSION[ \t]+([0-9]+).*" "\\1" _out_subversion "${_contents}")
- string(REGEX REPLACE ".*#define[ \t]+BLENDER_VERSION_CHAR[ \t]+([a-z]+).*" "\\1" _out_version_char "${_contents}")
+ string(REGEX REPLACE ".*#define[ \t]+BLENDER_VERSION_PATCH[ \t]+([0-9]+).*" "\\1" _out_version_patch "${_contents}")
string(REGEX REPLACE ".*#define[ \t]+BLENDER_VERSION_CYCLE[ \t]+([a-z]+).*" "\\1" _out_version_cycle "${_contents}")
if(NOT ${_out_version} MATCHES "[0-9]+")
message(FATAL_ERROR "Version parsing failed for BLENDER_VERSION")
endif()
- if(NOT ${_out_subversion} MATCHES "[0-9]+")
- message(FATAL_ERROR "Version parsing failed for BLENDER_SUBVERSION")
- endif()
-
- # 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")
+ if(NOT ${_out_version_patch} MATCHES "[0-9]+")
+ message(FATAL_ERROR "Version parsing failed for BLENDER_VERSION_PATCH")
endif()
if(NOT ${_out_version_cycle} MATCHES "[a-z]+")
@@ -795,23 +784,11 @@ function(get_blender_version)
math(EXPR _out_version_major "${_out_version} / 100")
math(EXPR _out_version_minor "${_out_version} % 100")
- # for packaging, alpha to numbers
- string(COMPARE EQUAL "${_out_version_char}" "" _out_version_char_empty)
- if(${_out_version_char_empty})
- set(_out_version_char_index "0")
- else()
- 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)
- list(FIND _char_ls ${_out_version_char} _out_version_char_index)
- math(EXPR _out_version_char_index "${_out_version_char_index} + 1")
- endif()
-
# output vars
set(BLENDER_VERSION "${_out_version_major}.${_out_version_minor}" PARENT_SCOPE)
set(BLENDER_VERSION_MAJOR "${_out_version_major}" PARENT_SCOPE)
set(BLENDER_VERSION_MINOR "${_out_version_minor}" PARENT_SCOPE)
- set(BLENDER_SUBVERSION "${_out_subversion}" PARENT_SCOPE)
- set(BLENDER_VERSION_CHAR "${_out_version_char}" PARENT_SCOPE)
- set(BLENDER_VERSION_CHAR_INDEX "${_out_version_char_index}" PARENT_SCOPE)
+ set(BLENDER_VERSION_PATCH "${_out_version_patch}" PARENT_SCOPE)
set(BLENDER_VERSION_CYCLE "${_out_version_cycle}" PARENT_SCOPE)
endfunction()