CsPaint  1.0.1
Building on Windows (MSVC)

You will need to install the following two libraries.

  • SDL2
  • Vulkan SDK

After you extract the SDL2 zip file you will need to create a file called sdl2-config.cmake and place it in the root directory where SDL2 resides.

set(SDL2_PREFIX "${CMAKE_CURRENT_LIST_DIR}")
set(SDL2_INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}/include")
# Support both 32 and 64 bit builds
if (${CMAKE_SIZEOF_VOID_P} MATCHES 8)
set(SDL2_LIBRARIES "${CMAKE_CURRENT_LIST_DIR}/lib/x64/SDL2.lib;${CMAKE_CURRENT_LIST_DIR}/lib/x64/SDL2main.lib")
else ()
set(SDL2_LIBRARIES "${CMAKE_CURRENT_LIST_DIR}/lib/x86/SDL2.lib;${CMAKE_CURRENT_LIST_DIR}/lib/x86/SDL2main.lib")
endif ()
string(STRIP "${SDL2_LIBRARIES}" SDL2_LIBRARIES)

To build CsPaint and the Graphics Demo run the following command.

ninja

To install CsPaint run the following command in the cs_paint_build directory.

ninja install
Note
With some system configurations the MSVC file locations will need to be modifed. For example /c/cs_paint_lib may need to be entered as c:\cs_paint_lib.

Building with Ninja

The following command line will configure CMake for building CsPaint on MSVC. You will need to adjust the value for SDL2_DIR depending on where you installed it. The exact version of the Vulkan SDK needs to match the one installed on your computer.

set SDL2_DIR=c:\SDL
set VULKAN_SDK=c:\VulkanSDK\1.1.121.2
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/c/cs_paint_lib /c/cs_paint

To build CsPaint and the Graphics Demo run the following command.

ninja

To install CsPaint run the following command in the cs_paint_build directory.

ninja install

Building with a VS Project File

If you would like to configure MSVC for multiple generators you can use the following commands. You will need to adjust the value for SDL2_DIR depending on where you installed it. The exact version of the Vulkan SDK needs to match the one installed on your computer.

set SDL2_DIR=c:\SDL
set VULKAN_SDK=c:\VulkanSDK\1.1.121.2
cmake -G "Visual Studio 15 2017" -A x64 -DCMAKE_INSTALL_PREFIX=/c/cs_paint_lib /c/cs_paint
cmake --build .