Changeset 19758


Ignore:
Timestamp:
10/11/19 10:35:01 (5 years ago)
Author:
tbretz
Message:
Produce root version number of not already available.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/CMakeLists.txt

    r19756 r19758  
    148148   SET(CMAKE_C_FLAGS       "${CMAKE_C_FLAGS} ${ROOT_C_FLAGS}")
    149149   SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${ROOT_fortran_FLAGS}")
     150ENDIF()
     151
     152# This happens when root is used from its build directory
     153IF(ROOT_VERSION AND NOT ROOT_VERSION_MAJOR)
     154# Replace separators (older version might use the '/')
     155STRING(REPLACE "/" "." ROOT_VERSION ${ROOT_VERSION})
     156STRING(REPLACE "." ";" ROOT_VERSION ${ROOT_VERSION})
     157# Split version string
     158LIST(GET ROOT_VERSION 0 ROOT_VERSION_MAJOR)
     159LIST(GET ROOT_VERSION 1 ROOT_VERSION_MINOR)
     160LIST(GET ROOT_VERSION 2 ROOT_VERSION_PATCH)
     161# Remove trailing 0's
     162STRING(REGEX REPLACE "0+([0-9]+)" "\\1" ROOT_VERSION_MINOR ${ROOT_VERSION_MINOR})
     163STRING(REGEX REPLACE "0+([0-9]+)" "\\1" ROOT_VERSION_PATCH ${ROOT_VERSION_PATCH})
    150164ENDIF()
    151165
Note: See TracChangeset for help on using the changeset viewer.