Projects
Multimedia
obs-studio
obs-studio-allow-OBS_VERSION-to-be-set.patch
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File obs-studio-allow-OBS_VERSION-to-be-set.patch of Package obs-studio (Revision 6)
Currently displaying revision
6
,
Show latest
From 0245e3b43ed3c48871522cd7720b78673415ddb8 Mon Sep 17 00:00:00 2001 From: Jimmy Berry <jimmy@boombatower.com> Date: Fri, 30 Jan 2015 14:04:54 -0600 Subject: [PATCH] Allow OBS_VERSION to be set to assist in packaging. --- cmake/Modules/ObsCpack.cmake | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/cmake/Modules/ObsCpack.cmake b/cmake/Modules/ObsCpack.cmake index cb5e85a..6de6019 100644 --- a/cmake/Modules/ObsCpack.cmake +++ b/cmake/Modules/ObsCpack.cmake @@ -14,15 +14,21 @@ 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) -else() - set(OBS_VERSION "${CPACK_PACKAGE_VERSION}") +if(NOT DEFINED OBS_VERSION) + 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) + endif() + + # Fallback to static version when git is either not available or fails. + if("${OBS_VERSION}" STREQUAL "") + set(OBS_VERSION "${CPACK_PACKAGE_VERSION}") + endif() endif() +MESSAGE(STATUS "OBS_VERSION: ${OBS_VERSION}") if(INSTALLER_RUN) set(CPACK_PACKAGE_EXECUTABLES -- 2.1.4
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.