diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2015-05-02 14:46:12 +0200 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2015-05-02 14:46:12 +0200 |
commit | 5252a0049e0a509508a8f331222543620db0e6d3 (patch) | |
tree | 8d4b6bb20cbbbcfd8881130a6f6c2cbf2a3d6339 /cmake/version.cmake | |
parent | 6d3c61711bfe6524272bbde591e3494e0346a7da (diff) | |
download | ipecamera-5252a0049e0a509508a8f331222543620db0e6d3.tar.gz ipecamera-5252a0049e0a509508a8f331222543620db0e6d3.tar.bz2 ipecamera-5252a0049e0a509508a8f331222543620db0e6d3.tar.xz ipecamera-5252a0049e0a509508a8f331222543620db0e6d3.zip |
Provide version information as required by new pcilib interface
Diffstat (limited to 'cmake/version.cmake')
-rw-r--r-- | cmake/version.cmake | 12 |
1 files changed, 12 insertions, 0 deletions
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) |