Skip to content

Instantly share code, notes, and snippets.

@VermeilChan
Last active May 4, 2024 07:38
Show Gist options
  • Star 17 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save VermeilChan/3fd0188afeb8d49f219efb008b612197 to your computer and use it in GitHub Desktop.
Save VermeilChan/3fd0188afeb8d49f219efb008b612197 to your computer and use it in GitHub Desktop.
Compile Aseprite from source code for Windows 11/10 x64

Prerequisites

Download and Set Up Visual Studio Community 2022

Get The Source Code

Download and Set Up CMake

  • Get CMake cmake-3.xx.x-windows-x86_64.msi

  • Choose the option Add CMake To The System PATH For All Users

Download and Set Up Ninja

  • Download Ninja Build System.

  • Extract ninja-win.zip and copy ninja.exe to C:\Program Files\CMake\bin.

Download Skia

  • Download Skia Skia-Windows-Release-x64.zip.

  • In the C:\ directory, create a folder named deps.

  • Inside the deps directory, create another folder named skia.

  • Extract the contents of Skia-Windows-Release-x64.zip into the skia folder.

Compiling

  • In the C:\ directory, create a folder named aseprite.

  • Extract the contents of Aseprite-v1.x-Source.zip into the aseprite folder.

  • Search Command Prompt

  • Execute the following commands:

call "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\VsDevCmd.bat" -arch=x64
cd C:\aseprite
mkdir build
cd build
cmake -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 ..
ninja aseprite
  • The executable will be located at C:\aseprite\build\bin\aseprite.exe.

Tested With Aseprite v1.3.6

Please remember to support the creators of Aseprite. Only use this method to try the program or if you don't have access to funds or a credit card :)

@BubbaNak
Copy link

BubbaNak commented Jan 16, 2024

had to run this prior tothe last line "ninja aseprite"

cmake -G Ninja -DLAF_BACKEND=skia ..

From install.md- https://github.com/aseprite/aseprite/blob/main/INSTALL.md#skia-on-windows

EDIT: Forgot to add, other than that this worked like a charm!!! Thank you so much.

ONE LAST EDIT: i am on Win11 :)

@RaveSplash
Copy link

Successfully to use your guide to build the software, thanks alot

@VermeilChan
Copy link
Author

Successfully to use your guide to build the software, thanks alot

np :D

@VermeilChan
Copy link
Author

had to run this prior tothe last line "ninja aseprite"

cmake -G Ninja -DLAF_BACKEND=skia ..

From install.md- https://github.com/aseprite/aseprite/blob/main/INSTALL.md#skia-on-windows

EDIT: Forgot to add, other than that this worked like a charm!!! Thank you so much.

np :DD

@Broodjekipp
Copy link

Broodjekipp commented Feb 8, 2024

cmake -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 ..

doesn't work. the error message is: 'cmake' is not recognized as an internal or external command,
operable program or batch file.
when visual studio was called i got this message:

The system can't find the specified file

**********************************************************************
** Visual Studio 2022 Developer Command Prompt v17.8.6
** Copyright (c) 2022 Microsoft Corporation
**********************************************************************

showed up though, andthe following commands worked, so i didn't think much of it.
do you know how to fix it?

Edit:
Where do i have to put the source code?

@VermeilChan
Copy link
Author

VermeilChan commented Feb 8, 2024

cmake -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 ..

doesn't work. the error message is: 'cmake' is not recognized as an internal or external command, operable program or batch file. when visual studio was called i got this message:

The system can't find the specified file

**********************************************************************
** Visual Studio 2022 Developer Command Prompt v17.8.6
** Copyright (c) 2022 Microsoft Corporation
**********************************************************************

showed up though, andthe following commands worked, so i didn't think much of it. do you know how to fix it?

Edit: Where do i have to put the source code?

To fix CMake:
Make sure CMake is properly installed, and during the installation, select Add CMake To The System PATH For All Users.

I don't think I can help you with the Visual Studio problem since I don't know what that means. However, you can search for Developer Command Prompt for VS 2022 and use that terminal.

Source code:
Put the Aseprite source code in C:\aseprite.

@ACSantacruz
Copy link

I get many errors like
`CMake Error at third_party/CMakeLists.txt:208 (add_subdirectory):
The source directory

C:/aseprite/third_party/IXWebSocket

does not contain a CMakeLists.txt file.`
when trying to use the cmake command after building. What could cause this issue? Does it have to do with the source code installation somehow?

@VermeilChan
Copy link
Author

I get many errors like `CMake Error at third_party/CMakeLists.txt:208 (add_subdirectory): The source directory

C:/aseprite/third_party/IXWebSocket

does not contain a CMakeLists.txt file.` when trying to use the cmake command after building. What could cause this issue? Does it have to do with the source code installation somehow?

If you used Git to get the Aseprite source code, ensure you included --recursive to fetch all submodules.

Other than that, I don't think I can help much further.

@SargentToaster
Copy link

Hey I just tried to do this I reviewed the steps but I'm getting this

C:\deps\skia\out\Release-x64 -DSKIA_LIBRARY=C:\deps\skia\out\Release-x64\skia.lib -G Ninja CMake Warning: No source or binary directory provided. Both will be assumed to be the same as the current working directory, but note that this warning will become a fatal error in future CMake releases.

this is in the Dev prompt for VS 2022
how do I fix this? Thanks.

@VermeilChan
Copy link
Author

VermeilChan commented Feb 18, 2024

Hey I just tried to do this I reviewed the steps but I'm getting this

C:\deps\skia\out\Release-x64 -DSKIA_LIBRARY=C:\deps\skia\out\Release-x64\skia.lib -G Ninja CMake Warning: No source or binary directory provided. Both will be assumed to be the same as the current working directory, but note that this warning will become a fatal error in future CMake releases.

this is in the Dev prompt for VS 2022 how do I fix this? Thanks.

  • Go to C:\aseprite\build directory.
cd C:\aseprite\build
  • Run the CMake.
cmake -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 ..
  • Build Aseprite
ninja aseprite

@SargentToaster
Copy link

im sorry im still confused, did i miss a step

`C:\aseprite\build>cmake -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 ..
CMake Warning:
Ignoring extra path from command line:

".."

CMake Error: The source directory "C:/aseprite" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.`

@KilkankB
Copy link

This is something I got after using the below statement
cmake -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 ..
This is what i got
`-- Could NOT find CCache (missing: CCache_EXECUTABLE)
CMake Deprecation Warning at third_party/zlib/CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.

Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.

CMake Deprecation Warning at third_party/libpng/CMakeLists.txt:33 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.

Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.

CMake Deprecation Warning at third_party/libpng/CMakeLists.txt:34 (cmake_policy):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.

Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.

-- curl version=[7.79.1-DEV]
-- Could NOT find Perl (missing: PERL_EXECUTABLE)
-- Enabled features: SSL IPv6 unixsockets libz AsynchDNS Largefile SSPI alt-svc HSTS SPNEGO Kerberos NTLM
-- Enabled protocols: DICT FILE FTP FTPS GOPHER GOPHERS HTTP HTTPS IMAP IMAPS LDAP MQTT POP3 POP3S RTSP SMB SMBS SMTP SMTPS TELNET TFTP
-- Enabled SSL backends: Schannel
-- Version: 10.0.0
-- Build type: RelWithDebInfo
CMake Deprecation Warning at third_party/cmark/CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.

Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.

CMake Deprecation Warning at third_party/json11/CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.

Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.

CMake Deprecation Warning at third_party/libarchive/CMakeLists.txt:2 (CMAKE_MINIMUM_REQUIRED):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.

Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.

-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR)
CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.29/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
The package name passed to find_package_handle_standard_args (LIBGCC)
does not match the name of the calling package (LibGCC). This can lead to
problems in calling code that expects find_package result variables
(e.g., _FOUND) to follow a certain pattern.
Call Stack (most recent call first):
third_party/libarchive/build/cmake/FindLibGCC.cmake:17 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
third_party/libarchive/CMakeLists.txt:1258 (FIND_PACKAGE)
This warning is for project developers. Use -Wno-dev to suppress it.

-- Could NOT find LIBGCC (missing: LIBGCC_LIBRARY)
-- Could NOT find PCREPOSIX (missing: PCREPOSIX_LIBRARY PCRE_INCLUDE_DIR)
CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.29/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
The package name passed to find_package_handle_standard_args (PCRE) does
not match the name of the calling package (PCREPOSIX). This can lead to
problems in calling code that expects find_package result variables
(e.g., _FOUND) to follow a certain pattern.
Call Stack (most recent call first):
third_party/libarchive/build/cmake/FindPCREPOSIX.cmake:23 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
third_party/libarchive/CMakeLists.txt:1263 (FIND_PACKAGE)
This warning is for project developers. Use -Wno-dev to suppress it.

-- Could NOT find PCRE (missing: PCRE_LIBRARY)
-- Extended attributes support: none
-- ACL support: none
-- laf backend: skia
-- laf zlib: zlibstatic
-- laf pixman: pixman
-- laf freetype: FREETYPE_LIBRARY-NOTFOUND
-- laf harfbuzz: HARFBUZZ_LIBRARY-NOTFOUND
-- skia dir: C:/deps/skia
-- skia library: C:/deps/skia/out/Release-x64/skia.lib
-- skia library dir: C:/deps/skia/out/Release-x64
-- aseprite libwebp: WEBP_LIBRARIES-NOTFOUND
CMake Deprecation Warning at src/observable/CMakeLists.txt:4 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.

Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.

CMake Deprecation Warning at src/clip/CMakeLists.txt:4 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.

Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.

CMake Deprecation Warning at src/undo/CMakeLists.txt:4 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.

Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.

-- Configuring done (4.1s)
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
WEBP_LIBRARIES
linked by target "app-lib" in directory C:/aseprite/src/app

-- Generating done (0.4s)
CMake Generate step failed. Build files cannot be regenerated correctly.`

@Azertyyys
Copy link

after i run ninja aseprite
ninja: error: 'src/clone_strings', needed by 'src/CMakeFiles/copy_data', missing and no known rule to make it

@Azertyyys
Copy link

after i run ninja aseprite ninja: error: 'src/clone_strings', needed by 'src/CMakeFiles/copy_data', missing and no known rule to make it

I downgraded from aseprite 1.3.4 to 1.3.3 and it worked
i also downgraded cmake to 3.28.3 though im not sure if thats required

@VermeilChan
Copy link
Author

after i run ninja aseprite ninja: error: 'src/clone_strings', needed by 'src/CMakeFiles/copy_data', missing and no known rule to make it

I downgraded from aseprite 1.3.4 to 1.3.3 and it worked i also downgraded cmake to 3.28.3 though im not sure if thats required

i tested it with both aseprite 1.3.4 to 1.3.3 and both of them work with cmake 3.29.0-rc2

@Dcyyr
Copy link

Dcyyr commented Mar 1, 2024

1
Why am i got this,I've never used CMake.

@StarFang208
Copy link

StarFang208 commented Mar 11, 2024

I'm getting errors when I follow the instructions.
C:\aseprite\build>cmake -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 ..
CMake Error at C:/Program Files/CMake/share/cmake-3.28/Modules/CMakeDetermineCXXCompiler.cmake:48 (message):
Could not find compiler set in environment variable CXX:

set(CMAKE_CXX_COMPILER "C:/Program Files/Microsoft Visual
Studio/2022/Community/VC/Tools/MSVC/14.30.30705/bin/Hostx64/x64/cl.exe").

Call Stack (most recent call first):
CMakeLists.txt:23 (project)

CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

How can I fix it?

I'm on Win 10 anyway.

@mrstakan1
Copy link

Hi. Im getting this error with any compiler im trying to use. Maybe you can help me. I`m on Windows 11.

C:\aseprite\build>cmake -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 ..
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.29/Modules/CMakeTestCCompiler.cmake:67 (message):
The C compiler

"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: 'C:/aseprite/build/CMakeFiles/CMakeScratch/TryCompile-7uvaq3'

Run Build Command(s): C:/PROGRA~1/MIB055~1/2022/COMMUN~1/Common7/IDE/COMMON~1/MICROS~1/CMake/Ninja/ninja.exe -v cmTC_7395d
[1/2] C:\PROGRA~1\MIB055~1\2022\COMMUN~1\VC\Tools\MSVC\1439~1.335\bin\Hostx64\x64\cl.exe    -o CMakeFiles\cmTC_7395d.dir\testCCompiler.c.obj -c C:\aseprite\build\CMakeFiles\CMakeScratch\TryCompile-7uvaq3\testCCompiler.c
FAILED: CMakeFiles/cmTC_7395d.dir/testCCompiler.c.obj
C:\PROGRA~1\MIB055~1\2022\COMMUN~1\VC\Tools\MSVC\1439~1.335\bin\Hostx64\x64\cl.exe    -o CMakeFiles\cmTC_7395d.dir\testCCompiler.c.obj -c C:\aseprite\build\CMakeFiles\CMakeScratch\TryCompile-7uvaq3\testCCompiler.c
ninja: build stopped: subcommand failed.

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:23 (project)

-- Configuring incomplete, errors occurred!

@YagamiD3v
Copy link

Thanks !

@thekaz
Copy link

thekaz commented Apr 7, 2024

This might be a dumb or obvious prereq, but I think this process also requires git to be installed. Otherwise the error "error: could not find git for clone..." appears. If this is someone's first time trying to compile something, or if they're a starving artist with no dev experience, they may not know how to parse the error message.

@thekaz
Copy link

thekaz commented Apr 7, 2024

@KilkankB I figured out how to fix your error if you're still having it. From https://community.aseprite.org/t/cmake-error-webp-libraries-notfound/17305, double check your skia install directory, and where it is in your filesystem matches -DSKIA_DIR=C:\deps\skia. If it doesn't, either move the directory or update the flag to match where it actually is

@VermeilChan
Copy link
Author

sorry guys if i dont reply to ur problems
im not that smart 😭

@Dotsz-Vic-FLP
Copy link

Appreciate this guide. This is way easier to understand than the install.md included. Thank you for this.

@VermeilChan
Copy link
Author

Appreciate this guide. This is way easier to understand than the install.md included. Thank you for this.

thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment