2019-02-12 16:31:17 +00:00
|
|
|
function(set_project_version)
|
2019-02-20 14:18:32 +00:00
|
|
|
if(NOT ${PROJECT_VERSION_PATCH} MATCHES "([0-9]+)")
|
|
|
|
message(FATAL_ERROR "Please set project version in X.Y.Z format")
|
2019-02-12 16:31:17 +00:00
|
|
|
endif()
|
|
|
|
|
2019-10-07 10:52:50 +00:00
|
|
|
math(
|
2019-12-03 16:23:14 +00:00
|
|
|
EXPR
|
|
|
|
_version_int
|
|
|
|
"(${PROJECT_VERSION_MAJOR} << 16) + (${PROJECT_VERSION_MINOR} << 8) + ${PROJECT_VERSION_PATCH}"
|
|
|
|
)
|
2019-02-20 14:18:32 +00:00
|
|
|
set_property(GLOBAL PROPERTY PROJECT_VERSION_INT ${_version_int})
|
2019-02-12 16:31:17 +00:00
|
|
|
endfunction()
|