Skip to content

Commit

Permalink
Build scripts cleaned up and improved, also fixed invalid paths.
Browse files Browse the repository at this point in the history
  • Loading branch information
ghorwin committed Jan 16, 2025
1 parent 24a63b2 commit 6a6abf9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 32 deletions.
21 changes: 11 additions & 10 deletions build/cmake/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ do

done


# override compiler options
for var in "$@"
do
Expand Down Expand Up @@ -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 ***" &&
Expand Down
27 changes: 5 additions & 22 deletions build/cmake/build_only_solver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6a6abf9

Please sign in to comment.