- Timestamp:
- 10/15/19 16:19:25 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/CMakeLists.txt
r19775 r19777 150 150 ENDIF() 151 151 152 # Replace separators to make the version consistent 153 # (older version might use the '/') 154 STRING(REPLACE "/" "." ROOT_VERSION ${ROOT_VERSION}) 155 152 156 # This happens when root is used from its build directory 157 # Create the version components manually 153 158 IF(ROOT_VERSION AND NOT ROOT_VERSION_MAJOR) 154 # Replace separators (older version might use the '/') 155 STRING(REPLACE "/" "." ROOT_VERSION ${ROOT_VERSION}) 156 STRING(REPLACE "." ";" ROOT_VERSION ${ROOT_VERSION}) 157 # Split version string 158 LIST(GET ROOT_VERSION 0 ROOT_VERSION_MAJOR) 159 LIST(GET ROOT_VERSION 1 ROOT_VERSION_MINOR) 160 LIST(GET ROOT_VERSION 2 ROOT_VERSION_PATCH) 161 # Remove trailing 0's 162 STRING(REGEX REPLACE "0+([0-9]+)" "\\1" ROOT_VERSION_MINOR ${ROOT_VERSION_MINOR}) 163 STRING(REGEX REPLACE "0+([0-9]+)" "\\1" ROOT_VERSION_PATCH ${ROOT_VERSION_PATCH}) 159 # Create a list of components 160 STRING(REPLACE "." ";" ROOT_VERSION_LIST ${ROOT_VERSION}) 161 # Split version string 162 LIST(GET ROOT_VERSION_LIST 0 ROOT_VERSION_MAJOR) 163 LIST(GET ROOT_VERSION_LIST 1 ROOT_VERSION_MINOR) 164 LIST(GET ROOT_VERSION_LIST 2 ROOT_VERSION_PATCH) 165 # Remove trailing 0's 166 STRING(REGEX REPLACE "0+([0-9]+)" "\\1" ROOT_VERSION_MINOR ${ROOT_VERSION_MINOR}) 167 STRING(REGEX REPLACE "0+([0-9]+)" "\\1" ROOT_VERSION_PATCH ${ROOT_VERSION_PATCH}) 164 168 ENDIF() 165 169
Note:
See TracChangeset
for help on using the changeset viewer.