-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
48 lines (39 loc) · 1.5 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
cmake_minimum_required(VERSION 3.28)
set(CMAKE_CXX_STANDARD 23)
project(mellohi)
file(GLOB_RECURSE PUBLIC_SRC_FILES src/public/*.hpp src/public/*.cpp)
file(GLOB_RECURSE PRIVATE_SRC_FILES src/private/*.hpp src/private/*.cpp)
add_library(mellohi STATIC ${PUBLIC_SRC_FILES} ${PRIVATE_SRC_FILES})
target_include_directories(mellohi PUBLIC src/public)
add_custom_target(remove_mellohi_assets ALL
COMMAND ${CMAKE_COMMAND} -E remove_directory
${CMAKE_BINARY_DIR}/assets/mellohi
)
add_custom_target(copy_mellohi_assets ALL
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_CURRENT_SOURCE_DIR}/assets/mellohi
${CMAKE_BINARY_DIR}/assets/mellohi
)
add_dependencies(copy_mellohi_assets remove_mellohi_assets)
add_dependencies(mellohi copy_mellohi_assets)
if (NOT EMSCRIPTEN)
add_subdirectory(vendor/glfw)
else()
# Emscripten has built-in support for GLFW but requires the `-sUSE_GLFW=3` link option:
add_library(glfw INTERFACE)
target_link_options(glfw INTERFACE -sUSE_GLFW=3)
endif()
add_subdirectory(vendor/glfw3webgpu)
add_subdirectory(vendor/webgpu)
add_subdirectory(vendor/flecs)
add_subdirectory(vendor/glm)
add_subdirectory(vendor/imgui)
add_subdirectory(vendor/tinyobjloader)
add_subdirectory(vendor/stb)
target_link_libraries(mellohi PUBLIC glfw glfw3webgpu webgpu flecs glm imgui tinyobjloader stb)
target_compile_definitions(mellohi PUBLIC
GLM_FORCE_DEPTH_ZERO_TO_ONE
GLM_FORCE_LEFT_HANDED
GLM_ENABLE_EXPERIMENTAL
)
add_subdirectory(examples)