2019-01-07 14:26:31 +00:00
|
|
|
|
2019-05-13 10:42:40 +00:00
|
|
|
# Building PrusaSlicer on Mac OS
|
2019-01-07 14:26:31 +00:00
|
|
|
|
2019-07-22 14:00:52 +00:00
|
|
|
To build PrusaSlicer on Mac OS, you will need the following software:
|
|
|
|
|
|
|
|
- XCode
|
|
|
|
- CMake
|
|
|
|
- git
|
|
|
|
- gettext
|
|
|
|
|
|
|
|
XCode is available through Apple's App Store, the other three tools are available on
|
|
|
|
[brew](https://brew.sh/) (use `brew install cmake git gettext` to install them).
|
2019-01-07 14:26:31 +00:00
|
|
|
|
|
|
|
### Dependencies
|
|
|
|
|
2019-05-13 10:42:40 +00:00
|
|
|
PrusaSlicer comes with a set of CMake scripts to build its dependencies, it lives in the `deps` directory.
|
|
|
|
Open a terminal window and navigate to PrusaSlicer sources directory and then to `deps`.
|
2019-01-07 14:26:31 +00:00
|
|
|
Use the following commands to build the dependencies:
|
|
|
|
|
|
|
|
mkdir build
|
|
|
|
cd build
|
2019-01-10 12:49:06 +00:00
|
|
|
cmake ..
|
|
|
|
make
|
2019-01-07 14:26:31 +00:00
|
|
|
|
|
|
|
This will create a dependencies bundle inside the `build/destdir` directory.
|
|
|
|
You can also customize the bundle output path using the `-DDESTDIR=<some path>` option passed to `cmake`.
|
|
|
|
|
2019-01-10 12:49:06 +00:00
|
|
|
**Warning**: Once the dependency bundle is installed in a destdir, the destdir cannot be moved elsewhere.
|
2019-03-07 07:07:07 +00:00
|
|
|
(This is because wxWidgets hardcodes the installation path.)
|
2019-01-10 12:49:06 +00:00
|
|
|
|
2019-07-05 09:42:36 +00:00
|
|
|
FIXME The Cereal serialization library needs a tiny patch on some old OSX clang installations
|
|
|
|
https://github.com/USCiLab/cereal/issues/339#issuecomment-246166717
|
|
|
|
|
2019-01-10 12:49:06 +00:00
|
|
|
|
2019-05-13 10:42:40 +00:00
|
|
|
### Building PrusaSlicer
|
2019-01-07 14:26:31 +00:00
|
|
|
|
2019-05-13 10:42:40 +00:00
|
|
|
If dependencies are built without errors, you can proceed to build PrusaSlicer itself.
|
|
|
|
Go back to top level PrusaSlicer sources directory and use these commands:
|
2019-01-07 14:26:31 +00:00
|
|
|
|
|
|
|
mkdir build
|
|
|
|
cd build
|
2019-01-10 12:49:06 +00:00
|
|
|
cmake .. -DCMAKE_PREFIX_PATH="$PWD/../deps/build/destdir/usr/local"
|
2019-01-07 14:26:31 +00:00
|
|
|
|
|
|
|
The `CMAKE_PREFIX_PATH` is the path to the dependencies bundle but with `/usr/local` appended - if you set a custom path
|
|
|
|
using the `DESTDIR` option, you will need to change this accordingly. **Warning:** the `CMAKE_PREFIX_PATH` needs to be an absolute path.
|
|
|
|
|
2019-05-13 10:42:40 +00:00
|
|
|
The CMake command above prepares PrusaSlicer for building from the command line.
|
2019-01-07 14:26:31 +00:00
|
|
|
To start the build, use
|
|
|
|
|
|
|
|
make -jN
|
|
|
|
|
|
|
|
where `N` is the number of CPU cores, so, for example `make -j4` for a 4-core machine.
|
|
|
|
|
|
|
|
Alternatively, if you would like to use XCode GUI, modify the `cmake` command to include the `-GXcode` option:
|
|
|
|
|
2019-01-10 12:49:06 +00:00
|
|
|
cmake .. -GXcode -DCMAKE_PREFIX_PATH="$PWD/../deps/build/destdir/usr/local"
|
2019-01-07 14:26:31 +00:00
|
|
|
|
2019-05-13 13:47:33 +00:00
|
|
|
and then open the `PrusaSlicer.xcodeproj` file.
|
2019-01-07 14:26:31 +00:00
|
|
|
This should open up XCode where you can perform build using the GUI or perform other tasks.
|
2019-01-10 12:49:06 +00:00
|
|
|
|
|
|
|
### Note on Mac OS X SDKs
|
|
|
|
|
2019-05-13 10:42:40 +00:00
|
|
|
By default PrusaSlicer builds against whichever SDK is the default on the current system.
|
2019-01-10 12:49:06 +00:00
|
|
|
|
|
|
|
This can be customized. The `CMAKE_OSX_SYSROOT` option sets the path to the SDK directory location
|
|
|
|
and the `CMAKE_OSX_DEPLOYMENT_TARGET` option sets the target OS X system version (eg. `10.14` or similar).
|
|
|
|
Note you can set just one value and the other will be guessed automatically.
|
|
|
|
In case you set both, the two settings need to agree with each other. (Building with a lower deployment target
|
|
|
|
is currently unsupported because some of the dependencies don't support this, most notably wxWidgets.)
|
|
|
|
|
|
|
|
Please note that the `CMAKE_OSX_DEPLOYMENT_TARGET` and `CMAKE_OSX_SYSROOT` options need to be set the same
|
2019-05-13 10:42:40 +00:00
|
|
|
on both the dependencies bundle as well as PrusaSlicer itself.
|
2019-01-10 12:49:06 +00:00
|
|
|
|
2019-05-13 10:42:40 +00:00
|
|
|
Official Mac PrusaSlicer builds are currently built against SDK 10.9 to ensure compatibility with older Macs.
|
2019-04-15 09:57:49 +00:00
|
|
|
|
|
|
|
_Warning:_ XCode may be set such that it rejects SDKs bellow some version (silently, more or less).
|
|
|
|
This is set in the property list file
|
|
|
|
|
|
|
|
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Info.plist
|
|
|
|
|
|
|
|
To remove the limitation, simply delete the key `MinimumSDKVersion` from that file.
|
2020-08-14 12:44:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
# TL; DR
|
|
|
|
|
|
|
|
Works on a fresh installation of MacOS Catalina 10.15.6
|
|
|
|
|
|
|
|
- Install [brew](https://brew.sh/):
|
|
|
|
- Open Terminal
|
|
|
|
|
|
|
|
- Enter:
|
|
|
|
|
|
|
|
```brew install cmake git gettext
|
|
|
|
brew update
|
|
|
|
brew upgrade
|
|
|
|
git clone https://github.com/prusa3d/PrusaSlicer/
|
|
|
|
cd PrusaSlicer/deps
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
cmake ..
|
|
|
|
make
|
|
|
|
cd ../..
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
cmake .. -DCMAKE_PREFIX_PATH="$PWD/../deps/build/destdir/usr/local"
|
|
|
|
make
|
|
|
|
src/prusa-slicer
|