-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Working with CMake
Besides the games/
and examples/
that are built along raylib by default, there's also a sample CMake project at projects/CMake
:
cd projects/CMake # You can also just download the CMakeLists.txt and the core_basic_window.c file separately
mkdir build # Create an out-of-tree build directory. That way build artifacts aren't mixed with source code
cd build # enter it
cmake .. # run cmake on the parent directory
cmake --build . # kick off the build process
The CMakeLists.txt
is self contained and will arrange to probe whether raylib has been installed and if not, it's downloaded, built and linked statically into the core_basic_window
example application.
If you want to conserve bandwidth by not downloading raylib for each project, consider installing raylib systemwide by running cmake --build . --target install
in the raylib build directory.
CMake supports a range of generators, which can be used to generate project files for IDEs/Build-Tools such as Visual Studio, Ninja or Sublime Text 2. e.g. for Xcode you can run cmake -G 'Xcode' ..
to have it generate project files for import into Xcode.
www.raylib.com | itch.io | GitHub | Discord | YouTube
- Architecture
- Syntax analysis
- Data structures
- Enumerated types
- External dependencies
- GLFW dependency
- libc dependency
- Platforms and graphics
- Input system
- Default shader
- Custom shaders
- Coding conventions
- Integration with other libs
- Working on Windows
- Working on macOS
- Working on GNU Linux
- Working on Chrome OS
- Working on FreeBSD
- Working on Raspberry Pi
- Working for Android
- Working for Web (HTML5)
- Creating Discord Activities
- Working anywhere with CMake
- CMake Build Options
- raylib templates: Get started easily
- How To: Quick C/C++ Setup in Visual Studio 2022, GCC or MinGW
- How To: C# Visual Studio Setup
- How To: VSCode
- How To: Eclipse
- How To: Sublime Text
- How To: Code::Blocks