File: ClhepParseVersion.cmake

package info (click to toggle)
clhep 2.1.4.1%2Bdfsg-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 10,012 kB
  • sloc: cpp: 50,094; sh: 6,694; makefile: 2,694; perl: 28
file content (14 lines) | stat: -rw-r--r-- 740 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# parse a version string and set the cmake project subversions
#
# parse_version( package version )

macro( parse_version package vers )

  # CLHEP versions have 4 numbers
  STRING( REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+\\.[0-9]+.*" "\\1" ${package}_Major "${vers}" )
  STRING( REGEX REPLACE "^[0-9]+\\.([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" ${package}_SubMajor "${vers}" )
  STRING( REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)\\.[0-9]+.*" "\\1" ${package}_Minor "${vers}" )
  STRING( REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" ${package}_SubMinor "${vers}" )
  ##message(STATUS "version ${vers} parses to ${${package}_Major} ${${package}_SubMajor} ${${package}_Minor} ${${package}_SubMinor}" )

endmacro( parse_version )