mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-01-27 03:35:36 +00:00
Get version number from CMakeLists
This commit is contained in:
parent
b286c06144
commit
ef9abf2f15
21
.github/workflows/issues-closer.yml
vendored
21
.github/workflows/issues-closer.yml
vendored
@ -1,21 +0,0 @@
|
||||
name: Close Added/Fixed Issues
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
close_issues:
|
||||
name: Check Issues / PRs
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Close Issues (added/fixed)
|
||||
uses: actions/stale@v3
|
||||
with:
|
||||
only-issues-labels: 'added,fixed'
|
||||
close-issue-message: >
|
||||
This is now available in the latest release.
|
||||
close-issue-label: 'released'
|
||||
days-before-issue-stale: 0
|
||||
days-before-issue-close: 0
|
||||
ignore-updates: true
|
@ -10,20 +10,24 @@ build:
|
||||
os: ubuntu-20.04
|
||||
tools:
|
||||
python: "3.9"
|
||||
apt_packages:
|
||||
- cmake
|
||||
- ffmpeg
|
||||
- libboost-filesystem-dev
|
||||
- libboost-log-dev
|
||||
- libboost-thread-dev
|
||||
jobs:
|
||||
pre_build:
|
||||
- cmake .
|
||||
|
||||
# Include the submodules, required for cmake
|
||||
submodules:
|
||||
include: all
|
||||
recursive: true
|
||||
## apt packages required packages to run cmake on sunshine, note that additional packages are required
|
||||
# apt_packages:
|
||||
# - cmake
|
||||
# - ffmpeg
|
||||
# - libboost-filesystem-dev
|
||||
# - libboost-log-dev
|
||||
# - libboost-thread-dev
|
||||
|
||||
## run cmake
|
||||
# jobs:
|
||||
# pre_build:
|
||||
# - cmake .
|
||||
|
||||
## Include the submodules, required for cmake
|
||||
#submodules:
|
||||
# include: all
|
||||
# recursive: true
|
||||
|
||||
# Build documentation in the docs/ directory with Sphinx
|
||||
sphinx:
|
||||
|
@ -319,7 +319,6 @@ else()
|
||||
endif()
|
||||
|
||||
configure_file(version.h.in version.h @ONLY)
|
||||
configure_file(docs/source/conf.py.in "${CMAKE_CURRENT_SOURCE_DIR}/docs/source/conf.py" @ONLY)
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
set(SUNSHINE_TARGET_FILES
|
||||
|
@ -6,6 +6,8 @@
|
||||
|
||||
# standard imports
|
||||
from datetime import datetime
|
||||
import os
|
||||
import re
|
||||
|
||||
|
||||
# -- Path setup --------------------------------------------------------------
|
||||
@ -13,8 +15,6 @@ from datetime import datetime
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
import os
|
||||
# import sys
|
||||
|
||||
script_dir = os.path.dirname(os.path.abspath(__file__)) # the directory of this file
|
||||
source_dir = os.path.dirname(script_dir) # the source folder directory
|
||||
@ -26,8 +26,16 @@ copyright = f'{datetime.now ().year}, {project}'
|
||||
author = 'ReenigneArcher'
|
||||
|
||||
# The full version, including alpha/beta/rc tags
|
||||
version = '@PROJECT_VERSION@'
|
||||
|
||||
with open(os.path.join(root_dir, 'CMakeLists.txt'), 'r') as f:
|
||||
version = re.search(r"project\(Sunshine VERSION ((\d+)\.(\d+)\.(\d+))\)", str(f.read())).group(1)
|
||||
"""
|
||||
To use cmake method for obtaining version instead of regex,
|
||||
1. Within CMakeLists.txt add the following line without backticks:
|
||||
``configure_file(docs/source/conf.py.in "${CMAKE_CURRENT_SOURCE_DIR}/docs/source/conf.py" @ONLY)``
|
||||
2. Rename this file to ``conf.py.in``
|
||||
3. Uncomment the next line
|
||||
"""
|
||||
# version = '@PROJECT_VERSION@' # use this for cmake configure_file method
|
||||
|
||||
# -- General configuration ---------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user