-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
73 lines (60 loc) · 1.83 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
cmake_minimum_required(VERSION 3.20)
project(SotN_Editor)
# Locate dependencies
find_package(OpenGL REQUIRED)
find_package(glfw3 REQUIRED)
find_package(GLEW REQUIRED)
include_directories(${GLEW_INCLUDE_DIRS})
link_libraries(${GLEW_LIBRARIES})
# Utilize include directories
include_directories(include imgui imgui/backends)
# Add NFD
add_subdirectory(external/nativefiledialog-extended)
# Set target executable
add_executable(${PROJECT_NAME})
# Populate target sources
target_sources(
${PROJECT_NAME}
PRIVATE
# ImGui sources
imgui/imgui.cpp imgui/imgui_draw.cpp imgui/imgui_tables.cpp imgui/imgui_widgets.cpp
# ImGui backends
imgui/backends/imgui_impl_glfw.cpp imgui/backends/imgui_impl_opengl3.cpp
# Main files
src/main.cpp
src/gte.cpp
src/mips.cpp
src/compression.cpp
src/map.cpp
src/sprites.cpp
src/utils.cpp
src/log.cpp
src/entities.cpp
)
# Set icon for Windows builds
if(MSVC)
set(APP_ICON_RESOURCE_WINDOWS "${CMAKE_CURRENT_SOURCE_DIR}/resources/icon.rc")
target_sources(${PROJECT_NAME} PRIVATE ${APP_ICON_RESOURCE_WINDOWS})
endif()
# Set icon for macOS
if(APPLE)
set_target_properties(${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE ON)
set(MACOSX_BUNDLE_ICON_FILE icon.icns)
set(SOTN_ICON ${CMAKE_CURRENT_SOURCE_DIR}/resources/icon.icns)
set_source_files_properties(${SOTN_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
target_sources(${PROJECT_NAME} PRIVATE ${SOTN_ICON})
endif()
# Set standard to C++17
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17)
# Link the imported libraries
target_link_libraries(
${PROJECT_NAME}
PRIVATE
nfd
glfw
GLEW::GLEW
)
# Include GL for Linux targets
if(UNIX AND NOT APPLE)
target_link_libraries(${PROJECT_NAME} PUBLIC GL)
endif()