Skip to content

Commit

Permalink
Extract CMake version
Browse files Browse the repository at this point in the history
  • Loading branch information
Varg committed Sep 19, 2024
1 parent a6202ac commit ed5f20e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.21 FATAL_ERROR)

set(APP_VERSION CACHE STRING "latest")
set(APP_VERSION CACHE STRING "0.0.0")

project(qspgui VERSION ${APP_VERSION} HOMEPAGE_URL "https://qsp.org")

Expand Down
2 changes: 1 addition & 1 deletion build_release.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

export QSP_RELEASE_VER="${1:-latest}"
export QSP_RELEASE_VER="${1:-0.0.0}"

mkdir -p dist

Expand Down
4 changes: 3 additions & 1 deletion cross_build/pack_linux64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ set -e
[ ! -d "./cross_build" ] && echo "Run this script from the project root directory" && exit
[ -z "$QSP_RELEASE_VER" ] && echo "QSP_RELEASE_VER isn't specified" && exit

CMAKE_VER=$(echo "$QSP_RELEASE_VER" | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+')

# Build
mkdir -p ./cross_build/linux64

Expand All @@ -15,7 +17,7 @@ SCRIPT=cross_build/build_linux64.sh
SSH_DIR="$HOME/.ssh"
HOST_VOLUMES="-v $SSH_DIR:/home/$(id -un)/.ssh"
USER_IDS="-e BUILDER_UID=$( id -u ) -e BUILDER_GID=$( id -g ) -e BUILDER_USER=$( id -un ) -e BUILDER_GROUP=$( id -gn )"
APP_ARGS="-e APP_VERSION=$QSP_RELEASE_VER"
APP_ARGS="-e APP_VERSION=$CMAKE_VER"
tty -s && TTY_ARGS="-ti" || TTY_ARGS=""

docker run --rm \
Expand Down
4 changes: 3 additions & 1 deletion cross_build/pack_linux64_AppImage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ set -e
[ ! -d "./cross_build" ] && echo "Run this script from the project root directory" && exit
[ -z "$QSP_RELEASE_VER" ] && echo "QSP_RELEASE_VER isn't specified" && exit

CMAKE_VER=$(echo "$QSP_RELEASE_VER" | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+')

# Build
mkdir -p ./cross_build/linux64_AppImage

Expand All @@ -15,7 +17,7 @@ SCRIPT=cross_build/build_AppImage.sh
SSH_DIR="$HOME/.ssh"
HOST_VOLUMES="-v $SSH_DIR:/home/$(id -un)/.ssh"
USER_IDS="-e BUILDER_UID=$( id -u ) -e BUILDER_GID=$( id -g ) -e BUILDER_USER=$( id -un ) -e BUILDER_GROUP=$( id -gn )"
APP_ARGS="-e APP_VERSION=$QSP_RELEASE_VER"
APP_ARGS="-e APP_VERSION=$CMAKE_VER"
# Allow usage of fuse
DOCKER_OPTS="--cap-add SYS_ADMIN --device /dev/fuse --security-opt apparmor:unconfined"
tty -s && TTY_ARGS="-ti" || TTY_ARGS=""
Expand Down
4 changes: 3 additions & 1 deletion cross_build/pack_win32.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ set -e
[ ! -d "./cross_build" ] && echo "Run this script from the project root directory" && exit
[ -z "$QSP_RELEASE_VER" ] && echo "QSP_RELEASE_VER isn't specified" && exit

CMAKE_VER=$(echo "$QSP_RELEASE_VER" | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+')

# Build
mkdir -p ./cross_build/win32

REL_BUILD_DIR=./cross_build/win32

./cross_build/dockcross-windows-static-x86 cmake -S . -B $REL_BUILD_DIR -GNinja \
-DAPP_VERSION="$QSP_RELEASE_VER" \
-DAPP_VERSION="$CMAKE_VER" \
-DCPACK_OUTPUT_FILE_PREFIX=$REL_BUILD_DIR/packages \
-DCPACK_GENERATOR="ZIP;NSIS" \
-DCMAKE_INSTALL_PREFIX=/usr/local \
Expand Down

0 comments on commit ed5f20e

Please sign in to comment.