Skip to content

Commit

Permalink
fix build dir output for mac g2o
Browse files Browse the repository at this point in the history
  • Loading branch information
luc committed Jan 22, 2024
1 parent 1e7b499 commit 8df9259
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 60 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-dep-g2o.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: prebuilt-g2o-mac64
path: ${{ github.workspace }}/externals/prebuilt/mac64_g2o
path: ${{ github.workspace }}/externals/prebuilt/mac64_g2o_20170730

#- name: Archive prebuilt g2o arm
# uses: actions/upload-artifact@v3
Expand Down
61 changes: 32 additions & 29 deletions externals/prebuild_scripts/build_g2o_for_mac64.sh
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
#!/bin/sh

# ####################################################
# Build script for g2o for mac64
# ####################################################

ARCH=mac64
ZIPFILE="$ARCH"_g2o
ZIPFOLDER=build/$ZIPFILE
VERSION="20170730_git"
ZIPFOLDER="$ARCH"_g2o_20170730
BUILD_D=build/"$ARCH"_debug
BUILD_R=build/"$ARCH"_release
VERSION="20170730_git"
clear
echo "Building g2o using the sources in the thirdparty directory"
if [ ! -d ../g2o ]
then
echo "g2o directory doesn't exists"
git clone https://github.com/RainerKuemmerle/g2o.git ../g2o
fi

echo "Building g2o using the sources in the thirdparty directory"
cd ../g2o

git checkout $VERSION

# Make build folder for debug version
mkdir build
rm -rf $BUILD_D
mkdir $BUILD_D
cd $BUILD_D

# Run cmake to configure and generate the make files
cmake \
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
Expand All @@ -39,19 +39,19 @@ cmake \
-DCMAKE_DEBUG_POSTFIX="" \
-DEIGEN3_INCLUDE_DIR=../eigen \
../..

# finally build it
make -j8

# copy all into install folder
make install
cd ../.. # back to g2o

# Make build folder for release version
rm -rf $BUILD_R
mkdir $BUILD_R
cd $BUILD_R

# Run cmake to configure and generate the make files
cmake \
-DCMAKE_INSTALL_PREFIX=install \
Expand All @@ -60,25 +60,28 @@ cmake \
-DCMAKE_BUILD_TYPE=Release \
-DEIGEN3_INCLUDE_DIR=../eigen \
../..

# finally build it
make -j8

# copy all into install folder
make install
cd ../.. # back to g2o

# Create zip folder for debug and release version
rm -rf $ZIPFOLDER
mkdir $ZIPFOLDER
cp -R $BUILD_R/install/include $ZIPFOLDER/include
cp -R $BUILD_R/install/lib $ZIPFOLDER/Release
cp -R $BUILD_D/install/lib $ZIPFOLDER/Debug
cp doc/license* $ZIPFOLDER
cp README.md $ZIPFOLDER

if [ -d "../prebuilt/$ZIPFILE" ]; then
rm -rf ../prebuilt/$ZIPFILE
fi

mv $ZIPFOLDER ../prebuilt
rm -rf ../prebuilt/$ZIPFOLDER
mkdir ../prebuilt/$ZIPFOLDER
echo $BUILD_R
echo $(pwd)
echo ../prebuilt/$ZIPFOLDER
cp -R $BUILD_R/install/include ../prebuilt/$ZIPFOLDER/include
cp -R $BUILD_R/install/lib ../prebuilt/$ZIPFOLDER/Release
cp -R $BUILD_D/install/lib ../prebuilt/$ZIPFOLDER/Debug
cp doc/license* ../prebuilt/$ZIPFOLDER
cp README.md ../prebuilt/$ZIPFOLDER

#if [ -d "../prebuilt/$ZIPFILE" ]; then
# rm -rf ../prebuilt/$ZIPFILE
#fi

#mv $ZIPFOLDER ../prebuilt
61 changes: 31 additions & 30 deletions externals/prebuild_scripts/build_g2o_for_macArm64.sh
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
#!/bin/sh

# ####################################################
# Build script for g2o for macArm64
# ####################################################

ARCH="macArm64"
ZIPFILE="$ARCH"_g2o
ZIPFOLDER=build/$ZIPFILE
VERSION="20170730_git"
ZIPFOLDER="$ARCH"_g2o_20170730
BUILD_D=build/"$ARCH"_debug
BUILD_R=build/"$ARCH"_release
VERSION="20170730_git"
clear
echo "Building g2o using the sources in the thirdparty directory"
if [ ! -d ../g2o ]
then
echo "g2o directory doesn't exists"
git clone https://github.com/RainerKuemmerle/g2o.git ../g2o
fi

echo "Building g2o using the sources in the thirdparty directory"
cd ../g2o

git checkout $VERSION

# Make build folder for debug version
mkdir build
rm -rf $BUILD_D
mkdir $BUILD_D
cd $BUILD_D

# Run cmake to configure and generate the make files
cmake \
-DCMAKE_OSX_ARCHITECTURES=arm64 \
Expand All @@ -39,47 +38,49 @@ cmake \
-DCMAKE_DEBUG_POSTFIX="" \
-DEIGEN3_INCLUDE_DIR=../eigen \
../..

# finally build it
make -j8

# copy all into install folder
make install
cd ../.. # back to g2o

# Make build folder for release version
rm -rf $BUILD_R
mkdir $BUILD_R
cd $BUILD_R

# Run cmake to configure and generate the make files
cmake \
-DCMAKE_OSX_ARCHITECTURES=arm64 \
-DCMAKE_INSTALL_PREFIX=install \
-DG2O_BUILD_APPS=off \
-DG2O_BUILD_EXAMPLES=off \
-DCMAKE_BUILD_TYPE=Release \
-DEIGEN3_INCLUDE_DIR=../eigen \
../..

# finally build it
make -j8

# copy all into install folder
make install
cd ../.. # back to g2o

# Create zip folder for debug and release version
rm -rf $ZIPFOLDER
mkdir $ZIPFOLDER
echo "dst is $ZIPFOLDER/"
cp -R $BUILD_R/install/include $ZIPFOLDER/include
cp -R $BUILD_R/install/lib $ZIPFOLDER/Release
cp -R $BUILD_D/install/lib $ZIPFOLDER/Debug
cp doc/license* $ZIPFOLDER
cp README.md $ZIPFOLDER

if [ -d "../prebuilt/$ZIPFILE" ]; then
rm -rf ../prebuilt/$ZIPFILE
fi

mv $ZIPFOLDER ../prebuilt
rm -rf ../prebuilt/$ZIPFOLDER
mkdir ../prebuilt/$ZIPFOLDER
echo "dst is ../prebuilt/$ZIPFOLDER/"
cp -R $BUILD_R/install/include ../prebuilt/$ZIPFOLDER/include
cp -R $BUILD_R/install/lib ../prebuilt/$ZIPFOLDER/Release
cp -R $BUILD_D/install/lib ../prebuilt/$ZIPFOLDER/Debug
cp doc/license* ../prebuilt/$ZIPFOLDER
cp README.md ../prebuilt/$ZIPFOLDER

#if [ -d "../prebuilt/$ZIPFILE" ]; then
# rm -rf ../prebuilt/$ZIPFILE
#fi

#mv $ZIPFOLDER ../prebuilt

0 comments on commit 8df9259

Please sign in to comment.