- #!/bin/bash
- #
- # buildrdecygwin.bash - build ROVEMA RDE using Cygwin
- #
- #
- # Written by Roland Mainz <roland.mainz@rovema.de>
- #
- #
- # Usage:
- #
- # 1. Build RDE
- # mkdir try10_rde_new_rds/
- # cd try10_rde_new_rds
- # git clone https://RovemaDevelopment@dev.azure.com/RovemaDevelopment/RDE-Development/_git/Dependencies
- # git clone --recurse-submodules https://RovemaDevelopment@dev.azure.com/RovemaDevelopment/RDE-Development/_git/RDE-Development
- # cd RDE-Development/
- # mkdir build_windows4
- # cd build_windows4/
- # time nice bash ../scripts/buildrdecygwin.bash buildall 2>&1 | tee -a buildlog.log
- #
- # 2a. Start RDE (manually):
- # $ bash -c 'PATH+=":${qtpath}/5.15.2/mingw81_64/bin" ; ./rde'
- #
- # 2b. Start RDE (via script):
- # $ bash buildrdecygwin.bash run
- #
- #
- # Configuration paths
- #
- function configure_paths
- {
- boost_Version='1_71_0'
- qt_Version='5_15_2'
- #
- # Prebuild RDE build tools (compiler etc)
- # (from $ git clone https://RovemaDevelopment@dev.azure.com/RovemaDevelopment/RDE-Development/_git/Dependencies #)
- #
- #git_rde_dependicies_dir='/cygdrive/h/tmp/winnfstest/hummingbirdnfstest1/rde_windows_developmement/Dependencies/win/'
- #git_rde_dependicies_dir='/home/roland_mainz/work/rde/build_dep/Dependencies/win/'
- git_rde_dependicies_dir="$(realpath "$PWD/../../Dependencies")/win/"
- if [[ ! -d "$git_rde_dependicies_dir" ]] ; then
- printf $"%s: ERROR: %s dir not found\n" "$0" "$git_rde_dependicies_dir" 1>&2
- return 1
- fi
- boostpath="${git_rde_dependicies_dir}/boost/boost_${boost_Version}/"
- qtpath="${git_rde_dependicies_dir}/qt/qt_${qt_Version}/"
- printf $"# building with boost version %s and qt version %s\n" "$boost_Version" "qt_Version"
- # Setting-up PATH
- export PATH="$qtpath/Tools/mingw810_64/bin/:$qtpath/5.15.2/mingw81_64/bin/:$qtpath/Tools/CMake_64/bin/:$boostpath/bin/:$boostpath/lib/:$PATH"
- printf $"# PATH=%s\n# Windows PATH=%s\n" "$PATH" "$(cygpath -p -w "$PATH")"
- return 0
- }
- function probe_paths
- {
- printf $"# Probing PATH for tools ...\n"
- which -a gcc
- which -a g++
- which -a cmake
- which -a make
- return 0
- }
- #
- # Build
- #
- function build_clean
- {
- printf $"# Cleanup old build stuff ...\n"
- rm -Rf CMake* CPack* CTestTestfile.cmake app_translations.qrc cmake_install.cmake nowide tests RDS Makefile *.qm rde.rc rde_autogen tmp versioninfo.cpp
- return 0
- }
- function build_cmake_config
- {
- printf $"# Running build configuration via cmake ...\n"
- # note: Windows/minGW uses '-G "MinGW Makefiles"', while compiling with Cygwin requires '-G "Unix Makefiles"'
- cmake -G "Unix Makefiles" -DBOOST_ROOT="$boostpath" -DBoost_LIB_PREFIX="lib" -DBoost_USE_STATIC_LIBS=TRUE -DBoost_ARCHITECTURE="-x64" -DBUILD_TESTS=ON ".."
- return 0
- }
- function build_cmake_clean
- {
- printf $"# Target clean ...\n"
- cmake --build . -j 1 --target clean
- return 0
- }
- function build_cmake_targets
- {
- printf $"# Building ...\n"
- cmake --build . -j 4
- printf $"%s: Build done.\n" "$0"
- return 0
- }
- #
- # main
- #
- set -o errexit
- set -o nounset
- #set -o xtrace # debug
- printf $"%s: Start ...\n" "$0"
- # Check whether we are really on Cygwin...
- if [[ "$(uname -s)" != *CYGWIN* ]] ; then
- printf $"%s: ERROR: Not a Cygwin environment.\n" "$0" 1>&2
- exit 1
- fi
- typeset boost_Version qt_Version git_rde_dependicies_dir boostpath qtpath
- configure_paths
- case "${1-}" in
- 'buildall')
- probe_paths
- build_clean
- build_cmake_config
- build_cmake_clean
- build_cmake_targets
- ;;
- 'clean')
- build_clean
- ;;
- 'run')
- ./rde
- exit $?
- ;;
- *)
- printf $"%s: Unknown cmd %q\n" "$0" "${1-}" 1>&2
- exit 1
- ;;
- esac
- exit 0
- # EOF.
RDE: buildrdecygwin.bash
Posted by Anonymous on Thu 27th Jul 2023 16:16
raw | new post
view followups (newest first): RDE: buildrdecygwin.bash by Anonymous
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.