mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-22 14:56:13 +00:00
Changed: Allow to put a "revision" file in root directory if .hg directory is not present
This commit is contained in:
parent
ff444f42fa
commit
3c3e25d523
1 changed files with 10 additions and 0 deletions
|
@ -19,6 +19,7 @@ IF(SOURCE_DIR)
|
|||
SET(SOURCE_DIR ${ROOT_DIR})
|
||||
ENDIF(NOT SOURCE_DIR AND ROOT_DIR)
|
||||
ELSE(SOURCE_DIR)
|
||||
SET(SOURCE_DIR ${CMAKE_SOURCE_DIR})
|
||||
SET(ROOT_DIR ${CMAKE_SOURCE_DIR})
|
||||
ENDIF(SOURCE_DIR)
|
||||
|
||||
|
@ -57,6 +58,15 @@ IF(EXISTS "${ROOT_DIR}/.hg/")
|
|||
ENDIF(MERCURIAL_FOUND)
|
||||
ENDIF(EXISTS "${ROOT_DIR}/.hg/")
|
||||
|
||||
# if processing exported sources, use "revision" file if exists
|
||||
IF(SOURCE_DIR AND NOT DEFINED REVISION)
|
||||
SET(REVISION_FILE ${SOURCE_DIR}/revision)
|
||||
IF(EXISTS ${REVISION_FILE})
|
||||
FILE(STRINGS ${REVISION_FILE} REVISION LIMIT_COUNT 1)
|
||||
MESSAGE(STATUS "Read revision ${REVISION} from file")
|
||||
ENDIF(EXISTS ${REVISION_FILE})
|
||||
ENDIF(SOURCE_DIR AND NOT DEFINED REVISION)
|
||||
|
||||
IF(SOURCE_DIR AND DEFINED REVISION)
|
||||
IF(EXISTS ${SOURCE_DIR}/revision.h.in)
|
||||
MESSAGE(STATUS "Revision: ${REVISION}")
|
||||
|
|
Loading…
Reference in a new issue