diff options
| -rw-r--r-- | CMakeModules/GenerateSCMRev.cmake | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/CMakeModules/GenerateSCMRev.cmake b/CMakeModules/GenerateSCMRev.cmake index 83e4e9df2..787e30df1 100644 --- a/CMakeModules/GenerateSCMRev.cmake +++ b/CMakeModules/GenerateSCMRev.cmake | |||
| @@ -48,6 +48,25 @@ if (BUILD_REPOSITORY) | |||
| 48 | endif() | 48 | endif() |
| 49 | endif() | 49 | endif() |
| 50 | 50 | ||
| 51 | # "Hack": Generate BUILD_FULLNAME from the Git desc | ||
| 52 | if (GIT_DESC) | ||
| 53 | # regex capture the characters before the first "-" into CMAKE_MATCH_1 | ||
| 54 | string(REGEX MATCH "^([a-z]*)-.*" OUTVAR ${GIT_DESC}) | ||
| 55 | if ("${CMAKE_MATCH_COUNT}" GREATER 0) | ||
| 56 | # capitalize the first letter of the repo name. | ||
| 57 | string(SUBSTRING ${CMAKE_MATCH_1} 0 1 FIRST_LETTER) | ||
| 58 | string(SUBSTRING ${CMAKE_MATCH_1} 1 -1 REMAINDER) | ||
| 59 | string(TOUPPER ${FIRST_LETTER} FIRST_LETTER) | ||
| 60 | set(REPO_NAME "${FIRST_LETTER}${REMAINDER}") | ||
| 61 | |||
| 62 | # If GIT_DESC has been parsed correctly, build the BUILD_FULLNAME from the repo name and the | ||
| 63 | # build version | ||
| 64 | if(REPO_NAME) | ||
| 65 | set(BUILD_FULLNAME "${REPO_NAME} ${BUILD_ID} ") | ||
| 66 | endif() | ||
| 67 | endif() | ||
| 68 | endif() | ||
| 69 | |||
| 51 | # The variable SRC_DIR must be passed into the script (since it uses the current build directory for all values of CMAKE_*_DIR) | 70 | # The variable SRC_DIR must be passed into the script (since it uses the current build directory for all values of CMAKE_*_DIR) |
| 52 | set(VIDEO_CORE "${SRC_DIR}/src/video_core") | 71 | set(VIDEO_CORE "${SRC_DIR}/src/video_core") |
| 53 | set(HASH_FILES | 72 | set(HASH_FILES |