diff --git a/Working-with-CMake.md b/Working-with-CMake.md index 369cf4b..5bc158c 100644 --- a/Working-with-CMake.md +++ b/Working-with-CMake.md @@ -4,13 +4,20 @@ If you installed raylib with a package manager, or used `make install`, a simple cmake_minimum_required(VERSION 3.15) project(my_project) -find_package(raylib 2.5.0 REQUIRED) # Requires at least version 2.5.0 +find_package(raylib 3.0 REQUIRED) # Requires at least version 3.0 -set(CMAKE_C_STANDARD 11) +set(CMAKE_C_STANDARD 11) # Requires C11 standard -add_executable(my_project main.c) +add_executable(${PROJECT_NAME} main.c) -target_link_libraries(my_project raylib) +target_link_libraries(${PROJECT_NAME} raylib) + +# Checks if OSX and links appropriate frameworks (Only required on MacOS) +if (APPLE) + target_link_libraries(${PROJECT_NAME} "-framework IOKit") + target_link_libraries(${PROJECT_NAME} "-framework Cocoa") + target_link_libraries(${PROJECT_NAME} "-framework OpenGL") +endif() ``` To build, use these commands: ```cmake