-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
44 lines (37 loc) · 1.43 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
cmake_minimum_required(VERSION 3.11)
include(FetchContent)
project(TrexExamples)
set(CMAKE_CXX_STANDARD 20)
function(add_example_project TARGET_NAME)
add_executable(${TARGET_NAME} ${TARGET_NAME}.cpp)
target_link_libraries(${TARGET_NAME} trex raylib)
endfunction()
add_example_project(Example_1_AtlasGeneration)
add_example_project(Example_2_LoadAllChars)
add_example_project(Example_3_RenderSingleCharacters)
add_example_project(Example_4_FontFromMemory)
add_example_project(Example_5_RenderFontSDF)
add_example_project(Example_6_TextShaping)
add_example_project(Example_7_MeasureText)
add_example_project(Example_8_RenderFontSubpixel)
add_example_project(Example_9_RenderEmoji)
# Add Trex library
add_subdirectory(../ trexlib)
# Add Trex library with its dependencies to a folder
set_target_properties(trex PROPERTIES FOLDER "Trex")
# Get all the dependencies of "trex"
get_target_property(dependencies trex INTERFACE_LINK_LIBRARIES)
# Iterate over the dependencies and put them in "Trex" folder
foreach(dependency ${dependencies})
set_target_properties(${dependency} PROPERTIES FOLDER "Trex")
endforeach()
# Raylib
FetchContent_Declare(
raylib
GIT_REPOSITORY https://github.com/raysan5/raylib.git
GIT_TAG 4.5.0
)
FetchContent_MakeAvailable(raylib)
set_target_properties(raylib PROPERTIES FOLDER "Raylib")
# Copy resources to build directory
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/fonts DESTINATION ${CMAKE_CURRENT_BINARY_DIR})