Created
March 25, 2023 20:02
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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