pxmlw6n2f/ign-math/cmake/DissectVersion.cmake

6 lines
436 B
CMake

# Find version components
STRING (REGEX REPLACE "^([0-9]+).*" "\\1" PROJECT_MAJOR_VERSION "${PROJECT_VERSION_FULL}")
STRING (REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" PROJECT_MINOR_VERSION "${PROJECT_VERSION_FULL}")
STRING (REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" PROJECT_REVISION_VERSION ${PROJECT_VERSION_FULL})
STRING (REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+(.*)" "\\1" PROJECT_CANDIDATE_VERSION ${PROJECT_VERSION_FULL})