-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
49 lines (40 loc) · 1.32 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
45
46
47
48
49
cmake_minimum_required(VERSION 3.29)
project(txb__00)
set(CMAKE_CXX_STANDARD 20)
# Generate compile_commands.json
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# BearLibTerminal: Add path to your prebuilt binaries
set(BEARLIBTERMINAL_DIR "lib/bearlibterminal")
# Include the BearLibTerminal headers and link the dynamic library
include_directories(${BEARLIBTERMINAL_DIR}/include)
link_directories(${BEARLIBTERMINAL_DIR}/lib/Linux64)
include(FetchContent)
set(FLECS_VERSION v4.0.2)
find_package(flecs QUIET) # QUIET or REQUIRED
if(NOT flecs_FOUND) # If there's none, fetch and build flecs
FetchContent_Declare(
flecs
DOWNLOAD_EXTRACT_TIMESTAMP OFF
URL https://github.com/SanderMertens/flecs/archive/refs/tags/${FLECS_VERSION}.tar.gz
)
FetchContent_GetProperties(flecs)
if(NOT flecs_POPULATED) # Have we downloaded flecs yet?
set(FETCHCONTENT_QUIET NO)
FetchContent_MakeAvailable(flecs)
endif()
endif()
# Our own header files
include_directories(include)
# Our Project
add_executable(
${CMAKE_PROJECT_NAME}
src/main.cpp
src/core/Game.cpp
src/utils/AStar.cpp
src/world/Area.cpp
src/world/AreaManager.cpp
src/systems/Movements.cpp
src/systems/Rendering.cpp)
# Linking required libraries
target_link_libraries(${PROJECT_NAME} BearLibTerminal)
target_link_libraries(${CMAKE_PROJECT_NAME} flecs::flecs_static)