mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-11 17:59:02 +00:00
Changed: Allow to put a "revision" file in root directory if .hg directory is not present
This commit is contained in:
parent
7e75970499
commit
2b3026f51a
1 changed files with 10 additions and 0 deletions
|
@ -19,6 +19,7 @@ IF(SOURCE_DIR)
|
||||||
SET(SOURCE_DIR ${ROOT_DIR})
|
SET(SOURCE_DIR ${ROOT_DIR})
|
||||||
ENDIF(NOT SOURCE_DIR AND ROOT_DIR)
|
ENDIF(NOT SOURCE_DIR AND ROOT_DIR)
|
||||||
ELSE(SOURCE_DIR)
|
ELSE(SOURCE_DIR)
|
||||||
|
SET(SOURCE_DIR ${CMAKE_SOURCE_DIR})
|
||||||
SET(ROOT_DIR ${CMAKE_SOURCE_DIR})
|
SET(ROOT_DIR ${CMAKE_SOURCE_DIR})
|
||||||
ENDIF(SOURCE_DIR)
|
ENDIF(SOURCE_DIR)
|
||||||
|
|
||||||
|
@ -57,6 +58,15 @@ IF(EXISTS "${ROOT_DIR}/.hg/")
|
||||||
ENDIF(MERCURIAL_FOUND)
|
ENDIF(MERCURIAL_FOUND)
|
||||||
ENDIF(EXISTS "${ROOT_DIR}/.hg/")
|
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(SOURCE_DIR AND DEFINED REVISION)
|
||||||
IF(EXISTS ${SOURCE_DIR}/revision.h.in)
|
IF(EXISTS ${SOURCE_DIR}/revision.h.in)
|
||||||
MESSAGE(STATUS "Revision: ${REVISION}")
|
MESSAGE(STATUS "Revision: ${REVISION}")
|
||||||
|
|
Loading…
Reference in a new issue