Posted by
xanderdin on
Sep 07, 2019; 3:02pm
URL: https://forum.librecad.org/Help-wanted-to-build-on-Windows-tp5717272p5717718.html
I built successfully on Windows Server 2019. It was a virtual machine running in the cloud. The full list of preinstalled tools on that virtual machine is available
here.
The build process was scripted. No access to GUI. No manual interaction. Because of this I didn't find a way to create NSIS setup after successful LibreCAD build. Just a 7z archive that can be extracted and run LibreCAD afterwards.
Qt = 5.13.1, MinGW = 7.3.0 64-bit, Boost = 1.60.0
My steps to run in bash (inside cloned LibreCAD directory):
# Variables (versions, urls, etc.)
QT_VERSION="5.13.1"
BOOST_VERSION="1.60.0"
BOOST_ZIP="boost_$(echo $BOOST_VERSION | sed 's|\.|_|g').7z"
BOOST_DIR="/boost/boost_$(echo $BOOST_VERSION | sed 's|\.|_|g')"
BOOST_URL="https://sourceforge.net/projects/boost/files/boost"
BOOST_URL="$BOOST_URL/$BOOST_VERSION/$BOOST_ZIP/download"
# Prepare custom-windows.bat as described in LibreCAD wiki
echo "set Qt_DIR=C:\Qt\Qt$QT_VERSION\\$QT_VERSION" > ./scripts/custom-windows.bat
echo 'set NSIS_DIR=C:\Program Files (x86)\NSIS' >> ./scripts/custom-windows.bat
echo 'set MINGW_VER=mingw73_64' >> ./scripts/custom-windows.bat
# Prepare custom.pro as described in LibreCAD wiki
echo "BOOST_DIR = C:$BOOST_DIR/" >> ./librecad/src/custom.pro
echo "BOOST_LIBDIR = C:$BOOST_DIR/" >> ./librecad/src/custom.pro
# Erase contents of build-win-setup.bat to prevent attempts to build NSIS setup
echo '' > ./scripts/build-win-setup.bat
# Install Qt non-interactively and Boost
mkdir /c/Qt /c/boost
pip install 'aqtinstall==0.4.1'
python -m aqt install -O /c/Qt $QT_VERSION windows desktop win64_mingw73
cd /c/boost
curl -L -o ./$BOOST_ZIP "$BOOST_URL"
7z x ./$BOOST_ZIP
Then in PowerShell (inside cloned LibreCAD directory):
cd .\scripts
build-windows.bat
And this builds OK. Brave people are needed to test my cloud-built binaries on Windows (I don't have Windows on my PC)

. The archive is available here:
https://dev.azure.com/xanderdin/PlayWithAzure/_build/results?buildId=118&view=artifacts (Artifacts button -> WindowsPackage).
If you are interested in all my LibreCAD build experiments, how they progressed from the beginning so far (for Windows, MacOS and Linux) please see git history of my commits here:
https://github.com/xanderdin/LibreCAD/commits/play_with_azure And resulting cloud builds with logs are available here:
https://dev.azure.com/xanderdin/PlayWithAzure/_build?definitionId=1&_a=summary Please note, the build history and logs are available for no more than 30 days and then will be automatically deleted by cloud provider.
Hope this piece of info is helpful in one way or another.