Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cmake] use a CMake variable for MULTIPASS_UPSTREAM #1377

Merged
merged 1 commit into from
Feb 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,9 @@ jobs:
- sg lxd -c '/snap/bin/lxc profile device add default ccache disk source=${HOME}/.ccache/ path=/root/.ccache'
- ccache --zero-stats

# inject build identifier
# inject build identifier and upstream
- sed -i "/configflags:/a \ - -DMULTIPASS_BUILD_LABEL=${MULTIPASS_BUILD_LABEL}" snap/snapcraft.yaml
- sed -i "/configflags:/a \ - -DMULTIPASS_UPSTREAM=${MULTIPASS_UPSTREAM}" snap/snapcraft.yaml

script:
- sg lxd -c '/snap/bin/snapcraft --use-lxd'
Expand Down
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ find_package(Qt5 COMPONENTS Core Network Widgets REQUIRED)

function(determine_version OUTPUT_VARIABLE)
# use upstream repo as the authoritative reference when checking for release status
# set MULTIPASS_UPSTREAM="*" to use the local repository
set(MULTIPASS_UPSTREAM $ENV{MULTIPASS_UPSTREAM})
# set -DMULTIPASS_UPSTREAM="" to use the local repository
if(MULTIPASS_UPSTREAM)
set(MULTIPASS_UPSTREAM "${MULTIPASS_UPSTREAM}/")
endif()
Expand All @@ -83,7 +82,7 @@ function(determine_version OUTPUT_VARIABLE)
# only use -rc tags on release/* branches
string(REGEX MATCH "release/[0-9]+.[0-9]+" GIT_RELEASE_MATCH "${GIT_RELEASE_BRANCH}")
if(GIT_RELEASE_MATCH)
if(NOT DEFINED ENV{MULTIPASS_UPSTREAM})
if(NOT DEFINED MULTIPASS_UPSTREAM)
message(FATAL_ERROR "You need to set MULTIPASS_UPSTREAM for a release build.\
\nUse an empty string to make local the authoritative repository.")
endif()
Expand Down