/alps/ipecamera

To get this branch, use:
bzr branch http://suren.me/webbzr/alps/ipecamera

« back to all changes in this revision

Viewing changes to cmake/version.cmake

  • Committer: Suren A. Chilingaryan
  • Date: 2015-05-02 12:46:12 UTC
  • Revision ID: csa@suren.me-20150502124612-payy2fjmj1zxqhbq
Provide version information as required by new pcilib interface

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
SET(VERSION_REGEX "[0-9]+\\.[0-9]+\\.[0-9]+")
 
2
 
 
3
MACRO(VERSION_TO_VARS version major minor patch)
 
4
  IF(${version} MATCHES ${VERSION_REGEX})
 
5
    STRING(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" ${major} "${version}")
 
6
    STRING(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+" "\\1" ${minor} "${version}")
 
7
    STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" ${patch} "${version}")
 
8
  ELSE(${version} MATCHES ${VERSION_REGEX})
 
9
    MESSAGE("MACRO(VERSION_TO_VARS ${version} ${major} ${minor} ${patch}")
 
10
    MESSAGE(FATAL_ERROR "Problem parsing version string, I can't parse it properly.")
 
11
  ENDIF(${version} MATCHES ${VERSION_REGEX})
 
12
ENDMACRO(VERSION_TO_VARS)