From 6a6abf9e168b71b4791414aa97c58520323d5c9f Mon Sep 17 00:00:00 2001 From: Andreas Nicolai Date: Thu, 16 Jan 2025 09:42:18 +0100 Subject: [PATCH] Build scripts cleaned up and improved, also fixed invalid paths. --- build/cmake/build.sh | 21 +++++++++++---------- build/cmake/build_only_solver.sh | 27 +++++---------------------- 2 files changed, 16 insertions(+), 32 deletions(-) diff --git a/build/cmake/build.sh b/build/cmake/build.sh index 51888598..9e73fa34 100755 --- a/build/cmake/build.sh +++ b/build/cmake/build.sh @@ -112,7 +112,6 @@ do done - # override compiler options for var in "$@" do @@ -148,21 +147,23 @@ cd $BUILDDIR && cmake $CMAKE_OPTIONS $CMAKE_BUILD_TYPE $CMAKE_COMPILER_OPTIONS $ # back to top-level cd $CMAKELISTSDIR && # create top-level dir -mkdir -p bin/release && -echo "*** Copying executables to bin/release ***" && -if [ -e $BUILDDIR/MasterSimulator/mastersim ]; then - echo "*** Copying mastersim to bin/release ***" && - cp $BUILDDIR/MasterSimulator/mastersim $CMAKELISTSDIR/bin/release/mastersim && - bin/release/mastersim --man-page > $CMAKELISTSDIR/MasterSimulator/doc/mastersim.1 -fi && +mkdir -p $CMAKELISTSDIR/bin/release && +echo "*** Copying mastersim to bin/release ***" && +cp $BUILDDIR/MasterSimulator/mastersim $CMAKELISTSDIR/bin/release/mastersim && +$CMAKELISTSDIR/bin/release/mastersim --man-page > $CMAKELISTSDIR/MasterSimulator/doc/mastersim.1 && + +# UI only exists when Qt is enabled if [ -e $BUILDDIR/MasterSimulatorUI/mastersim-gui ]; then echo "*** Copying mastersim-gui to bin/release ***" && cp $BUILDDIR/MasterSimulatorUI/mastersim-gui $CMAKELISTSDIR/bin/release/mastersim-gui && # next call may fail on GitHub actions, so we do not require this to succeed - bin/release/mastersim-gui --man-page > $CMAKELISTSDIR/MasterSimulatorUI/doc/mastersim-gui.1 + $CMAKELISTSDIR/bin/release/mastersim-gui --man-page > $CMAKELISTSDIR/MasterSimulatorUI/doc/mastersim-gui.1 fi + +# UI on Mac only exists when Qt is enabled and buiding on Mac if [ -e $BUILDDIR/MasterSimulatorUI/mastersim-gui.app ]; then - if [ -e bin/release/MasterSim.app ]; then + # remove potentially existing app bundle + if [ -e $CMAKELISTSDIR/bin/release/MasterSim.app ]; then rm -rf $CMAKELISTSDIR/bin/release/MasterSim.app fi && echo "*** Copying MasterSimulatorUI.app to bin/release ***" && diff --git a/build/cmake/build_only_solver.sh b/build/cmake/build_only_solver.sh index 29ecfea9..656e6974 100755 --- a/build/cmake/build_only_solver.sh +++ b/build/cmake/build_only_solver.sh @@ -144,35 +144,18 @@ done BUILDDIR=$BUILDDIR-$BUILD_DIR_SUFFIX if [ ! -d $BUILDDIR ]; then mkdir -p $BUILDDIR -fi +fi && cd $BUILDDIR && cmake $CMAKE_OPTIONS $CMAKE_BUILD_TYPE $CMAKE_COMPILER_OPTIONS $CMAKELISTSDIR && make -j$MAKE_CPUCOUNT && # back to top-level cd $CMAKELISTSDIR && # create top-level dir -mkdir -p bin/release && -echo "*** Copying executables to bin/release ***" && -if [ -e $BUILDDIR/MasterSimulator/MasterSimulator ]; then - echo "*** Copying MasterSimulator to bin/release ***" && - cp $BUILDDIR/MasterSimulator/MasterSimulator $CMAKELISTSDIR/bin/release/MasterSimulator && - bin/release/MasterSimulator --man-page > $CMAKELISTSDIR/MasterSimulator/doc/MasterSimulator.1 -fi && -if [ -e $BUILDDIR/MasterSimulatorUI/MasterSimulatorUI ]; then - echo "*** Copying MasterSimulatorUI to bin/release ***" && - cp $BUILDDIR/MasterSimulatorUI/MasterSimulatorUI $CMAKELISTSDIR/bin/release/MasterSimulatorUI - # next call may fail on GitHub actions, so we do not require this to succeed - bin/release/MasterSimulatorUI --man-page > $CMAKELISTSDIR/MasterSimulatorUI/doc/MasterSimulatorUI.1 -fi -if [ -e $BUILDDIR/MasterSimulatorUI/MasterSimulatorUI.app ]; then - if [ -e bin/release/MasterSimulatorUI.app ]; then - rm -rf $CMAKELISTSDIR/bin/release/MasterSimulatorUI.app - fi && - echo "*** Copying MasterSimulatorUI.app to bin/release ***" && - cp -r $BUILDDIR/MasterSimulatorUI/MasterSimulatorUI.app $CMAKELISTSDIR/bin/release/MasterSimulatorUI.app -fi && +mkdir -p $CMAKELISTSDIR/bin/release && +echo "*** Copying mastersim to bin/release ***" && +cp $BUILDDIR/MasterSimulator/mastersim $CMAKELISTSDIR/bin/release/mastersim && +$CMAKELISTSDIR/bin/release/mastersim --man-page > $CMAKELISTSDIR/MasterSimulator/doc/mastersim.1 && cd $BUILDDIR/.. && - echo "*** Build MasterSimulator ***" && if [[ $SKIP_TESTS = "false" ]]; then ./run_tests.sh