Image missing.
Swift and the Cute 2d game framework: Setting up a project with CMake

created: June 6, 2025, 11:15 a.m. | updated: June 7, 2025, 12:53 a.m.

Swift and Cute Framework: Setting up a project with CMakeCute Framework is a simple, yet powerful C/C++ framework for building 2D games using the modern GPU pipeline. In this post, we will explore how to set up a project using Cute Framework with CMake, enabling you to write your game logic in Swift while leveraging the performance of C/C++ for rendering and other performance-critical tasks. Open it in your favorite text editor and add the following content:cmake_minimum_required ( VERSION 4.0 ) # Set the project name and languages project ( MyCuteGame LANGUAGES C CXX Swift # Ensure we include C, C++, and Swift ) # Set our game sources file ( GLOB_RECURSE SOURCES CONFIGURE_DEPENDS src/*.swift ) # Set our executable target add_executable ( MyCuteGame ${ SOURCES } ) # Include FetchContent to download Cute Framework include ( FetchContent ) # Define cute as our Cute Framework dependency FetchContent_Declare ( cute GIT_REPOSITORY https://github.com/RandyGaul/cute_framework ) # Fetch the Cute Framework FetchContent_MakeAvailable ( cute ) # Add the Cute Framework as a dependency target_include_directories ( MyCuteGame PUBLIC $<BUILD_INTERFACE: ${ CMAKE_CURRENT_SOURCE_DIR } /include> ) target_link_libraries ( MyCuteGame cute )The CMakeLists.txt file defines few key components:It sets the project name and specifies that we will be using C, C++, and Swift. You have successfully set up a Cute Framework project using CMake and Swift. There is also a Discord server where you can ask questions and share your projects: Cute Framework Discord.

1 day, 16 hours ago: Hacker News