Add new utility setup scripts

This commit is contained in:
Dan Paulat 2025-05-25 13:45:00 -05:00
parent 9c486d5018
commit 102650e936
26 changed files with 281 additions and 143 deletions

View file

@ -0,0 +1 @@
@set qt_version=6.8.3

View file

@ -0,0 +1,2 @@
#!/bin/bash
export qt_version=6.8.3

View file

@ -0,0 +1,19 @@
@echo off
set script_dir=%~dp0
set cmake_args=-B "%build_dir%" -S "%script_dir%\..\.." ^
-G "%generator%" ^
-DCMAKE_PREFIX_PATH="%qt_base%/%qt_version%/%qt_arch%" ^
-DCMAKE_PROJECT_TOP_LEVEL_INCLUDES="%script_dir%\..\..\external\cmake-conan\conan_provider.cmake" ^
-DCONAN_HOST_PROFILE=%conan_profile% ^
-DCONAN_BUILD_PROFILE=%conan_profile%
if defined build_type (
set cmake_args=%cmake_args% ^
-DCMAKE_BUILD_TYPE=%build_type% ^
-DCMAKE_CONFIGURATION_TYPES=%build_type%
)
@echo on
mkdir "%build_dir%"
cmake %cmake_args%

View file

@ -0,0 +1,23 @@
#!/bin/bash
script_dir="$(dirname "$(readlink -f "$0")")"
cmake_args=(
-B "${build_dir}"
-S "${script_dir}/../.."
-G "${generator}"
-DCMAKE_PREFIX_PATH="${qt_base}/${qt_version}/${qt_arch}"
-DCMAKE_PROJECT_TOP_LEVEL_INCLUDES="${script_dir}/../../external/cmake-conan/conan_provider.cmake"
-DCONAN_HOST_PROFILE="${conan_profile}"
-DCONAN_BUILD_PROFILE="${conan_profile}"
)
if [[ -n "${build_type}" ]]; then
cmake_args+=(
-DCMAKE_BUILD_TYPE="${build_type}"
-DCMAKE_CONFIGURATION_TYPES="${build_type}"
-DCMAKE_INSTALL_PREFIX="${build_dir}/${build_type}/supercell-wx"
)
fi
mkdir -p "${build_dir}"
cmake "${cmake_args[@]}"

View file

@ -0,0 +1,26 @@
@set script_dir=%~dp0
:: Import common paths
@call lib\common-paths.bat
:: Install Python packages
pip install --upgrade -r "%script_dir%\..\..\requirements.txt"
@if defined build_type (
:: Install Conan profile and packages
call lib\setup-conan.bat
) else (
:: Install Conan profile and debug packages
set build_type=Debug
call lib\setup-conan.bat
:: Install Conan profile and release packages
set build_type=Release
call lib\setup-conan.bat
:: Unset build_type
set build_type=
)
:: Run CMake Configure
@call lib\run-cmake-configure.bat

27
tools/lib/setup-common.sh Normal file
View file

@ -0,0 +1,27 @@
#!/bin/bash
script_dir="$(dirname "$(readlink -f "$0")")"
# Import common paths
source ./common-paths.sh
# Install Python packages
pip install --upgrade --user ${script_dir}/../../requirements.txt
if [[ -n "${build_type}" ]]; then
# Install Conan profile and packages
./setup-conan.sh
else
# Install Conan profile and debug packages
export build_type=Debug
./setup-conan.sh
# Install Conan profile and release packages
export build_type=Release
./setup-conan.sh
# Unset build_type
unset build_type
fi
# Run CMake Configure
./run-cmake-configure.sh

15
tools/lib/setup-conan.bat Normal file
View file

@ -0,0 +1,15 @@
@set script_dir=%~dp0
:: Configure default Conan profile
conan profile detect -e
:: Install selected Conan profile
conan config install "%script_dir%\..\conan\profiles\%conan_profile%" -tf profiles
:: Install Conan packages
conan install "%script_dir%\..\.." ^
--remote conancenter ^
--build missing ^
--profile:all %conan_profile% ^
--settings:all build_type=%build_type% ^
--output-folder "%build_dir%\conan"

16
tools/lib/setup-conan.sh Normal file
View file

@ -0,0 +1,16 @@
#!/bin/bash
script_dir="$(dirname "$(readlink -f "$0")")"
# Configure default Conan profile
conan profile detect -e
# Install selected Conan profile
conan config install "${script_dir}/../conan/profiles/${conan_profile}" -tf profiles
# Install Conan packages
conan install "${script_dir}/../.." \
--remote conancenter \
--build missing \
--profile:all ${conan_profile} \
--settings:all build_type=${build_type} \
--output-folder "${build_dir}/conan"