0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 04:42:18 +02:00

Allow OBS_VERSION_OVERRIDE to assist in packaging.

If OBS_VERSION_OVERRIDE is set, it will set the main OBS_VERSION
variable to its value.

(modified by Jim)
This commit is contained in:
Jimmy Berry 2015-01-30 14:04:54 -06:00 committed by jp9000
parent 74042fff96
commit 6158a7418e

View File

@ -14,15 +14,20 @@ set(CPACK_PACKAGE_VERSION_MINOR "0")
set(CPACK_PACKAGE_VERSION_PATCH "1")
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
execute_process(COMMAND git describe --always --tags --dirty=-modified
OUTPUT_VARIABLE OBS_VERSION
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT DEFINED OBS_VERSION_OVERRIDE)
if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
execute_process(COMMAND git describe --always --tags --dirty=-modified
OUTPUT_VARIABLE OBS_VERSION
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_STRIP_TRAILING_WHITESPACE)
else()
set(OBS_VERSION "${CPACK_PACKAGE_VERSION}")
endif()
else()
set(OBS_VERSION "${CPACK_PACKAGE_VERSION}")
set(OBS_VERSION "${OBS_VERSION_OVERRIDE}")
endif()
MESSAGE(STATUS "OBS_VERSION: ${OBS_VERSION}")
if(INSTALLER_RUN)
set(CPACK_PACKAGE_EXECUTABLES