These are instructions for building Pencil2D on a Mac. If you are using Windows go here, and Linux please go here.
This guide is primarily targeted towards developers. If you just want to use the latest version, download it from our nightly builds. This tutorial was made with macOS Sierra (10.12) in mind, however this will probably work with all versions Yosemite (10.10) and up.
There are 4 steps in total:
If you are an experienced Qt developer, compiling Pencil2D would be extremely easy for you. Just open up pencil2d.pro
in Qt Creator and compile, that's it.
install
button in your App Store application and wait for the installation to complete. At the moment Xcode 8's package size is 4.3GB, so it normally takes quite a while to install./Applications/Xcode.app
.If you prefer to install Xcode by command-line, run the following command in Terminal:
xcode-select --install
A dialog should pop up asking if you want to install the command line developer tools. Click Install and wait for the installation to complete.
Qt 5.15.x -> macOS
.Done
and it will launch Qt Creator for you.If you have Homebrew
installed, you can install Qt 5 framework via Homebrew as well. To install Qt 5, run this command:
brew install qt5
And also run the following commands to install Qt Creator:
brew tap caskroom/cask brew cask install qt-creator
Now it's time to build the application.
pencil2d.pro
file.Command+r
. A small progress bar will show up on the bottom right and console output will appear in the bottom section.If there is an error, the issues tab will open up at the bottom and display error messages. Please search the Pencil2D Issue tracker or create an issue If you can't find anything. Be sure to include as much detail as you can in your report!
If you do not have or do not want to use Qt Creator for some reason then you can follow this two step process. First you have to use QMake to let Qt do its preprocessing and generate the Makefiles. Make sure that the qmake executable that came with Qt is in your PATH. Then cd to the root git directory for Pencil2d and run:
qmake pencil2d.pro -spec macx-clang CONFIG+=debug CONFIG+=x86_64 CONFIG+=qml_debug && /usr/bin/make qmake_all
Next you have to use GNU Make to actually compile the source code (this tool comes with XCode Developer Tools so you should already have it). Run the command:
make
You can then open Pencil2D by opening Pencil2D.app in app or by running:
./app/Pencil2D.app/Contents/MacOS/Pencil2D
Now that you can build Pencil2D, the next step is to learn about navigating the source code.