-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
84 lines (65 loc) · 2.52 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
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
76
77
78
79
80
81
82
83
84
# This file is part of MRVN-Explorer under the MIT license
# Source code & license avalible at https://github.com/MRVN-Radiant/MRVN-Explorer
cmake_minimum_required( VERSION 3.12 )
project( explorer )
set( CMAKE_CXX_STANDARD 20 )
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build )
if(WIN32)
add_compile_definitions(WIN32)
endif()
# Executable
add_executable( explorer )
target_sources( explorer
PRIVATE
explorer/main.cpp
explorer/ui/cmainwindow.cpp
explorer/utils/logging.cpp
explorer/core/cscene.cpp
explorer/core/bsp/ibsp.cpp
explorer/core/bsp/apex_legends/apexlegends.cpp
explorer/core/bsp/apex_legends/apexlegends_render.cpp
explorer/core/bsp/apex_legends/apexlegends_windows.cpp
explorer/core/bsp/titanfall/titanfall.cpp
explorer/core/bsp/titanfall/titanfall_render.cpp
explorer/core/bsp/titanfall/titanfall_windows.cpp
explorer/renderer/crenderer.cpp
explorer/renderer/ccamera.cpp
)
# ImGui
set(IMGUI_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libs/imgui)
target_sources( explorer
PRIVATE
${IMGUI_DIR}/imgui_demo.cpp
${IMGUI_DIR}/imgui_draw.cpp
${IMGUI_DIR}/imgui_tables.cpp
${IMGUI_DIR}/imgui_widgets.cpp
${IMGUI_DIR}/imgui.cpp
PRIVATE
${IMGUI_DIR}/backends/imgui_impl_opengl3.cpp
${IMGUI_DIR}/backends/imgui_impl_glfw.cpp
)
target_include_directories( explorer
PUBLIC ${IMGUI_DIR}
PUBLIC ${IMGUI_DIR}/backends
)
if(WIN32)
target_link_libraries( explorer -static -lpthread )
endif()
# GLFW
find_package( glfw3 3.3 REQUIRED )
target_link_libraries( explorer glfw )
# OpenGL
find_package( OpenGL REQUIRED )
target_link_libraries( explorer ${OPENGL_LIBRARIES} )
#include(FindGLEW)
find_package( GLEW REQUIRED )
target_link_libraries( explorer ${GLEW_LIBRARIES} )
add_library(GLEW STATIC IMPORTED ${GLEW_LIBRARIES})
# Spdlog
find_package( spdlog REQUIRED )
target_link_libraries( explorer spdlog::spdlog_header_only)
# Copy shaders to build dir
add_custom_target(shaders ALL
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/shaders ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/shaders
)