Skip to content

Instantly share code, notes, and snippets.

@jpcofr
Created March 25, 2023 20:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpcofr/62e833a4aba3200b3060b342e0c204bc to your computer and use it in GitHub Desktop.
Save jpcofr/62e833a4aba3200b3060b342e0c204bc to your computer and use it in GitHub Desktop.
CMakeLists.txt for Building a raylib based Project on macOS 13.2.1
cmake_minimum_required(VERSION 3.25)
set(CMAKE_CXX_STANDARD 17)
project(my_project)
set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g")
set(RAYLIB_LIB raylib/src/libraylib.a)
set(RAYLIB_INCLUDE raylib/src)
include_directories(${RAYLIB_INCLUDE})
add_executable(my_project main.cpp)
if(APPLE)
find_library(COCOA_LIBRARY Cocoa)
find_library(GLUT_LIBRARY GLUT)
find_library(OpenGL_LIBRARY OpenGL)
find_library(IOKit_LIBRARY IOKit)
find_library(CoreVideo_LIBRARY CoreVideo)
target_link_libraries(pong ${RAYLIB_LIB} ${COCOA_LIBRARY} ${GLUT_LIBRARY} ${OpenGL_LIBRARY} ${IOKit_LIBRARY} ${CoreVideo_LIBRARY})
else()
target_link_libraries(pong ${RAYLIB_LIB})
endif()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment