mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-10 11:17:54 +00:00
[all] cmake: check for VERSION
file before using git describe
In order to make it easier for package maintainers that manage LG inside their own git repository we should use the version file if it exists over calling git describe.
This commit is contained in:
parent
7c1e8a85cd
commit
6c545806ab
1 changed files with 11 additions and 10 deletions
|
@ -1,15 +1,16 @@
|
|||
execute_process(
|
||||
COMMAND git describe --always --abbrev=10 --dirty=+ --tags
|
||||
WORKING_DIRECTORY "${PROJECT_TOP}"
|
||||
OUTPUT_VARIABLE GIT_REV
|
||||
ERROR_QUIET)
|
||||
if (EXISTS ${PROJECT_TOP}/VERSION)
|
||||
file(READ ${PROJECT_TOP}/VERSION GIT_REV)
|
||||
else()
|
||||
execute_process(
|
||||
COMMAND git describe --always --abbrev=10 --dirty=+ --tags
|
||||
WORKING_DIRECTORY "${PROJECT_TOP}"
|
||||
OUTPUT_VARIABLE GIT_REV
|
||||
ERROR_QUIET)
|
||||
endif()
|
||||
|
||||
|
||||
if ("${GIT_REV}" STREQUAL "")
|
||||
if (EXISTS ${PROJECT_TOP}/VERSION)
|
||||
file(READ ${PROJECT_TOP}/VERSION GIT_REV)
|
||||
else()
|
||||
set(GIT_REV "UNKNOWN")
|
||||
endif()
|
||||
set(GIT_REV "UNKNOWN")
|
||||
endif()
|
||||
|
||||
string(STRIP "${GIT_REV}" GIT_VERSION)
|
||||
|
|
Loading…
Reference in a new issue