The aseprite docs help with building it from the command line. Here I show how to build it via CLion. It is surprinsingly simple!
First, follow the instrucions in INSTALLATION.md. I will summarize here what I had to follow when building tag v1.3-beta11
:
-
Clone the repo with its submodules;
-
Either stay in the
main
branch or switch to the desired tag. For example, this is how I switched tov1.3-beta11
:git checkout tags/v1.3-beta11 -b v1.3-beta11
-
Installing CMake is probably not necessary as I was able to build it just fine via the CMake bundled with CLion, so I think you can safely skip this;
-
About Ninja, I'm not sure if it's necessary to download it either. I did install it before trying CLion, but it's possible that CLion is using its own, bundled Ninja - I suggest you download it just in case. It's just an EXE file. Move it to some folder and make sure it's in the system PATH variable;
-
Download a pre-compiled version of the Skia library as instructed by the docs. The docs suggest putting it under
C:\deps
, but you can put it anywhere as long as you change the CMake options accordingly (see below); -
You need to download VS Community 2019 even if you're not using VS as an IDE, because the build task will need VS's SDK and etc. Make sure you also use the Visual Studio Installer to download the VS add-ons indicated in the docs.
After you go through the setup phase above, you can just skip the Compilation section for now and just follow the instructions below:
-
Open CLion and point it to the project root folder;
-
File
->Settings
, selectBuild, Execution, Deployment
->CMake
; -
There should already exist a
Debug
profile. In theCMake options
field, paste the options described the in Compilation section. They should be something like this:-DCMAKE_BUILD_TYPE=RelWithDebInfo -DLAF_BACKEND=skia -DSKIA_DIR=C:\deps\skia -DSKIA_LIBRARY_DIR=C:\deps\skia\out\Release-x64 -DSKIA_LIBRARY=C:\deps\skia\out\Release-x64\skia.lib -G Ninja ..
Mind that you may need to replace
C:\deps\skia
with the correct folder where you placed the Skia library; -
Now create a second profile. CLion should automatically name it
Release
and that's exactly what we want. SetCMake options
just like instructed above; -
Now select
Build, Execution, Deployment
->Toolchains
. There should be aVisual Studio
toolchain already configured. Make sure it's poiting to the correct VS version (2019 Community). -
In the
Architecture
field, change it fromx86
tox64
. This is important because the Skia pre-compiled library is built forx64
and the linker will break if you don't match it accordingly.
And that should be it! CLion should have detected that CMake's options were changing and it should be running the recipe right now, both for Debug
and Release
(check the CMake
window, you should see the two tabs there). You will probably see some warnings, but don't worry - that's expected. It should end with something like this:
-- Build files have been written to: C:/path/to/aseprite/cmake-build-release
[Finished]
After that is done, you should finally be able to invoke Ninja to do the linking and start the final executable. For that, select aseprite
in the configurations combo box at the top right corner of CLion. Selecting either Debug
or Release
should work just fine. Click the play button and, if everything goes well, you should see Aseprite starting!