From 5387063faa68d774e2f586e6d8284520f3cde12f Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Sat, 2 May 2015 14:45:42 +0200 Subject: Include version information in all API descriptions --- cmake/version.cmake | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 cmake/version.cmake (limited to 'cmake') diff --git a/cmake/version.cmake b/cmake/version.cmake new file mode 100644 index 0000000..9023aef --- /dev/null +++ b/cmake/version.cmake @@ -0,0 +1,12 @@ +SET(VERSION_REGEX "[0-9]+\\.[0-9]+\\.[0-9]+") + +MACRO(VERSION_TO_VARS version major minor patch) + IF(${version} MATCHES ${VERSION_REGEX}) + STRING(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" ${major} "${version}") + STRING(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+" "\\1" ${minor} "${version}") + STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" ${patch} "${version}") + ELSE(${version} MATCHES ${VERSION_REGEX}) + MESSAGE("MACRO(VERSION_TO_VARS ${version} ${major} ${minor} ${patch}") + MESSAGE(FATAL_ERROR "Problem parsing version string, I can't parse it properly.") + ENDIF(${version} MATCHES ${VERSION_REGEX}) +ENDMACRO(VERSION_TO_VARS) -- cgit v1.2.3