18 lines
540 B
CMake
18 lines
540 B
CMake
|
include_guard(GLOBAL)
|
||
|
|
||
|
function(myx_is_semantic_project_version)
|
||
|
if(NOT ${PROJECT_VERSION_PATCH} MATCHES "([0-9]+)")
|
||
|
myx_message_error("Myx: Please set project version in X.Y.Z format")
|
||
|
endif()
|
||
|
endfunction()
|
||
|
|
||
|
function(myx_project_version_int)
|
||
|
# cmake-format: off
|
||
|
myx_is_semantic_project_version()
|
||
|
math(EXPR v "(${PROJECT_VERSION_MAJOR} << 32) + (${PROJECT_VERSION_MINOR} << 16) + ${PROJECT_VERSION_PATCH}")
|
||
|
set_property(GLOBAL PROPERTY PROJECT_VERSION_INT ${v})
|
||
|
# cmake-format: on
|
||
|
endfunction()
|
||
|
|
||
|
myx_project_version_int()
|