-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
31 lines (27 loc) · 925 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
cmake_minimum_required(VERSION 3.11)
project(nbody)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_STANDARD 23)
set(RAYLIB_VERSION 5.5)
find_package(raylib ${RAYLIB_VERSION} QUIET)
if (NOT raylib_FOUND)
include(FetchContent)
FetchContent_Declare(
raylib
DOWNLOAD_EXTRACT_TIMESTAMP OFF
URL https://github.com/raysan5/raylib/archive/refs/tags/${RAYLIB_VERSION}.tar.gz
)
FetchContent_GetProperties(raylib)
if (NOT raylib_POPULATED)
set(FETCHCONTENT_QUIET NO)
FetchContent_MakeAvailable(raylib)
set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
endif()
endif()
add_compile_options(
-Wall -Wpedantic -Wextra "$<$<CONFIG:DEBUG>:-O0;-g3;-ggdb>"
)
add_executable(${PROJECT_NAME} main.cpp)
set(raylib_VERBOSE 1)
target_link_libraries(${PROJECT_NAME} PRIVATE raylib "-lstdc++exp")
target_include_directories(${PROJECT_NAME} SYSTEM PRIVATE ${raylib_INCLUDE_DIRS})