Skip to content

Commit

Permalink
streamline mac build script
Browse files Browse the repository at this point in the history
Signed-off-by: SoftFever <[email protected]>
  • Loading branch information
SoftFever committed Jan 1, 2023
1 parent 2c4455f commit 4803c35
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
19 changes: 13 additions & 6 deletions build_release_macos.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
#!/bin/sh

WD="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd $WD/deps
mkdir -p build
cd build
DEPS=$PWD/BambuStudio_dep
mkdir -p $DEPS
cmake ../ -DDESTDIR="$DEPS" -DOPENSSL_ARCH="darwin64-$(uname -m)-cc" -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release --target ALL_BUILD
cmake --build . --config Release --target all

cd $WD
mkdir -p build
cd build
cmake .. -GXcode -DBBL_RELEASE_TO_PUBLIC=1 -DCMAKE_PREFIX_PATH="$DEPS/usr/local" -DCMAKE_INSTALL_PREFIX="$PWD/BambuStudio-SoftFever" -DCMAKE_BUILD_TYPE=Release -DCMAKE_MACOSX_RPATH=ON -DCMAKE_INSTALL_RPATH="$DEPS/usr/local" -DCMAKE_MACOSX_BUNDLE=ON
cmake --build . --config Release --target ALL_BUILD
# cmake --build . --target install --config Release
# cd BambuStudio-SoftFever
# cp -r bin/BambuStudio.app/Contents/MacOS BambuStudio.app/Contents
# cp -r bin/BambuStudio.app/Contents/Info.plist BambuStudio.app/Contents/
mkdir -p BambuStudio-SoftFever
cd BambuStudio-SoftFever
rm -r ./BambuStudio-SoftFever.app
cp -pR ../src/Release/BambuStudio.app ./BambuStudio-SoftFever.app
resources_path=$(readlink ./BambuStudio-SoftFever.app/Contents/Resources)
rm ./BambuStudio-SoftFever.app/Contents/Resources
cp -R $resources_path ./BambuStudio-SoftFever.app/Contents/Resources
# extract version
ver=$(grep '^#define SoftFever_VERSION' ../src/libslic3r/libslic3r_version.h | cut -d ' ' -f3)
ver="${ver//\"}"
zip -FSr BambuStudio-SoftFever_V${ver}_Mac_$(uname -m).zip BambuStudio-SoftFever.app

2 changes: 1 addition & 1 deletion deps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ if (MSVC)
endif ()
elseif (APPLE)
message("OS X SDK Path: ${CMAKE_OSX_SYSROOT}")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version" FORCE)
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.3" CACHE STRING "Minimum OS X deployment version" FORCE)
if (CMAKE_OSX_DEPLOYMENT_TARGET)
set(DEP_OSX_TARGET "${CMAKE_OSX_DEPLOYMENT_TARGET}")
message("OS X Deployment Target: ${DEP_OSX_TARGET}")
Expand Down

0 comments on commit 4803c35

Please sign in to comment.