Skip to content

Commit

Permalink
BETA version on non-master branches
Browse files Browse the repository at this point in the history
  • Loading branch information
TwinFan committed Jan 21, 2024
1 parent e6e3554 commit 5ad241c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
# Let's set all project specific definitions globally
env:
PRJ_NAME: LiveTraffic # The plugin's name, expected to be the .xpl file's name and used as the plugin folder name
version_beta: ${{ github.ref != 'refs/heads/master' && '1' || '0' }} # On non-master branches we build BETA versions

jobs:
#####################################
Expand Down
13 changes: 12 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,26 @@ project(LiveTraffic
VERSION 3.5.0
DESCRIPTION "LiveTraffic X-Plane plugin")

# Building a Beta version can be demanded via ENV variable 'version_beta' being set to 1
set(VERSION_BETA 0)
if(DEFINED ENV{version_beta})
if ($ENV{version_beta} GREATER 0)
set(VERSION_BETA 1)
endif()
endif()

# Provide compile macros from the above project version definition
add_compile_definitions(
LIVETRAFFIC_VERSION_BETA=0
LIVETRAFFIC_VERSION_BETA=${VERSION_BETA}
LIVETRAFFIC_VER_MAJOR=${PROJECT_VERSION_MAJOR}
LIVETRAFFIC_VER_MINOR=${PROJECT_VERSION_MINOR}
LIVETRAFFIC_VER_PATCH=${PROJECT_VERSION_PATCH}
)

message("== Building: ${PROJECT_NAME} ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH} ==")
if (VERSION_BETA)
message(" BETA Version")
endif()

################################################################################
# Target Systems
Expand Down

0 comments on commit 5ad241c

Please sign in to comment.