-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
75 lines (61 loc) · 1.91 KB
/
Copy pathCMakeLists.txt
File metadata and controls
75 lines (61 loc) · 1.91 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
cmake_minimum_required(VERSION 3.25)
project(sim)
option(BUILD_DOCS_ONLY "Only configure documentation target" OFF)
# FetchContent
include(FetchContent)
# Doxygen
find_package(Doxygen REQUIRED)
if (DOXYGEN_FOUND)
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
# Doxygen theme
FetchContent_Declare(
doxygen-awesome-css
GIT_REPOSITORY https://github.com/jothepro/doxygen-awesome-css.git
GIT_TAG v2.3.4 # or another stable tag
)
FetchContent_MakeAvailable(doxygen-awesome-css)
set(DOXYGEN_AWESOME_DIR ${doxygen-awesome-css_SOURCE_DIR})
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
add_custom_target(doc
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen"
VERBATIM
)
endif ()
# Skip the rest if docs only
if (BUILD_DOCS_ONLY)
return()
endif ()
## Build the executable
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON)
# Library target
add_library(SimFramework)
target_include_directories(SimFramework PUBLIC include)
# Subdirectories
add_subdirectory(src)
add_subdirectory(examples)
# Options
target_compile_options(SimFramework PUBLIC
-Wall -Wextra -Wpedantic #-Werror
)
# Raylib
FetchContent_Declare(
raylib
GIT_REPOSITORY https://github.com/raysan5/raylib.git
GIT_TAG 5.5
)
FetchContent_MakeAvailable(raylib)
# Raylib-cpp
FetchContent_Declare(
raylib-cpp
GIT_REPOSITORY https://github.com/RobLoach/raylib-cpp
GIT_TAG v5.5.0
)
FetchContent_MakeAvailable(raylib-cpp)
add_library(raylib-cpp INTERFACE)
target_include_directories(raylib-cpp INTERFACE ${raylib-cpp_SOURCE_DIR}/include)
target_link_libraries(raylib-cpp INTERFACE raylib)