myx/lib/SemanticProjectVersion.cmake
2022-09-29 02:46:29 +03:00

19 lines
572 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}")
myx_message_notice(aaaa ${v})
set_property(GLOBAL PROPERTY PROJECT_VERSION_INT ${v})
# cmake-format: on
endfunction()
myx_project_version_int()