Skip to content

Commit

Permalink
Finetuning build script
Browse files Browse the repository at this point in the history
  • Loading branch information
ghorwin committed Oct 27, 2024
1 parent 3aeec76 commit ab85c9e
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions build/cmake/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
export PATH=~/Qt/5.11.3/gcc_64/bin:~/Qt/5.11.3/clang_64/bin:$PATH

CMAKELISTSDIR=$(pwd)/../..
BUILDDIR="bb"
BUILDDIR=$(pwd)/bb

# set defaults
CMAKE_BUILD_TYPE=" -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo"
Expand Down Expand Up @@ -143,36 +143,32 @@ if [ ! -d $BUILDDIR ]; then
mkdir -p $BUILDDIR
fi

cd $BUILDDIR &&
cmake $CMAKE_OPTIONS $CMAKE_BUILD_TYPE $CMAKE_COMPILER_OPTIONS $CMAKELISTSDIR &&
make -j$MAKE_CPUCOUNT &&
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 ***" &&
ls -l $BUILDDIR/* &&
if [ -e $BUILDDIR/MasterSimulator/MasterSimulator ]; then
echo "*** Copying MasterSimulator to bin/release ***" &&
cp $BUILDDIR/MasterSimulator/MasterSimulator bin/release/MasterSimulator &&
bin/release/MasterSimulator --man-page > MasterSimulator/doc/MasterSimulator.1
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 ../../bin/release/MasterSimulatorUI
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 > MasterSimulatorUI/doc/MasterSimulatorUI.1
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 bin/release/MasterSimulatorUI.app
rm -rf $CMAKELISTSDIR/bin/release/MasterSimulatorUI.app
fi &&
echo "*** Copying MasterSimulatorUI.app to bin/release ***" &&
cp -r $BUILDDIR/MasterSimulatorUI/MasterSimulatorUI.app bin/release/MasterSimulatorUI.app
cp -r $BUILDDIR/MasterSimulatorUI/MasterSimulatorUI.app $CMAKELISTSDIR/bin/release/MasterSimulatorUI.app
fi &&
cd - &&
cd .. &&
cd $BUILDDIR/.. &&

echo "*** Build MasterSimulator ***" &&
if [[ $SKIP_TESTS = "false" ]]; then
Expand Down

0 comments on commit ab85c9e

Please sign in to comment.