mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-08-05 02:04:15 +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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user