mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-10 00:28:20 +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,16 +1,17 @@
|
|||||||
|
if (EXISTS ${PROJECT_TOP}/VERSION)
|
||||||
|
file(READ ${PROJECT_TOP}/VERSION GIT_REV)
|
||||||
|
else()
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND git describe --always --abbrev=10 --dirty=+ --tags
|
COMMAND git describe --always --abbrev=10 --dirty=+ --tags
|
||||||
WORKING_DIRECTORY "${PROJECT_TOP}"
|
WORKING_DIRECTORY "${PROJECT_TOP}"
|
||||||
OUTPUT_VARIABLE GIT_REV
|
OUTPUT_VARIABLE GIT_REV
|
||||||
ERROR_QUIET)
|
ERROR_QUIET)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if ("${GIT_REV}" STREQUAL "")
|
if ("${GIT_REV}" STREQUAL "")
|
||||||
if (EXISTS ${PROJECT_TOP}/VERSION)
|
|
||||||
file(READ ${PROJECT_TOP}/VERSION GIT_REV)
|
|
||||||
else()
|
|
||||||
set(GIT_REV "UNKNOWN")
|
set(GIT_REV "UNKNOWN")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
|
||||||
|
|
||||||
string(STRIP "${GIT_REV}" GIT_VERSION)
|
string(STRIP "${GIT_REV}" GIT_VERSION)
|
||||||
set(BUILD_VERSION "const char * BUILD_VERSION = \"${GIT_VERSION}\";")
|
set(BUILD_VERSION "const char * BUILD_VERSION = \"${GIT_VERSION}\";")
|
||||||
|
Loading…
Reference in New Issue
Block a user