diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-10-25 23:36:45 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-10-25 23:36:45 (GMT) |
commit | 16f401a90436a0f86af887c5e0fe212820cd5e3c (patch) | |
tree | 1699c118b959d52c15acadb7c059d3c9c52dab79 /contrib | |
parent | 1ddbeb522842009b40a9404f15a4e56ae4c6dda4 (diff) | |
download | uscxml-16f401a90436a0f86af887c5e0fe212820cd5e3c.zip uscxml-16f401a90436a0f86af887c5e0fe212820cd5e3c.tar.gz uscxml-16f401a90436a0f86af887c5e0fe212820cd5e3c.tar.bz2 |
Support two part version strings as in 10.9
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/cmake/USCXMLMacros.cmake | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/contrib/cmake/USCXMLMacros.cmake b/contrib/cmake/USCXMLMacros.cmake index 76e1121..082caa0 100644 --- a/contrib/cmake/USCXMLMacros.cmake +++ b/contrib/cmake/USCXMLMacros.cmake @@ -59,15 +59,20 @@ endfunction() # see http://www.cmake.org/Wiki/CMakeCompareVersionStrings SET(THREE_PART_VERSION_REGEX "[0-9]+\\.[0-9]+\\.[0-9]+") +SET(TWO_PART_VERSION_REGEX "[0-9]+\\.[0-9]+") # Breaks up a string in the form n1.n2.n3 into three parts and stores # them in major, minor, and patch. version should be a value, not a # variable, while major, minor and patch should be variables. + MACRO(THREE_PART_VERSION_TO_VARS version major minor patch) IF(${version} MATCHES ${THREE_PART_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}") + ELSEIF(${version} MATCHES ${TWO_PART_VERSION_REGEX}) + STRING(REGEX REPLACE "^([0-9]+)\\.[0-9]+" "\\1" ${major} "${version}") + STRING(REGEX REPLACE "^[0-9]+\\.([0-9])+" "\\1" ${minor} "${version}") ELSE(${version} MATCHES ${THREE_PART_VERSION_REGEX}) MESSAGE("MACRO(THREE_PART_VERSION_TO_VARS ${version} ${major} ${minor} ${patch}") MESSAGE(FATAL_ERROR "Problem parsing version string, I can't parse it properly.") |