-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
50 lines (44 loc) · 1.36 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
cmake_minimum_required(VERSION 3.18.4)
# or use: /opt/devkitpro/portlibs/switch/bin/aarch64-none-elf-cmake
include(/opt/devkitpro/cmake/Switch.cmake)
project(imgui_deko3d_example VERSION 0.0.1 LANGUAGES C CXX)
set(PROJECT_AUTHOR "scturtle")
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug CACHE STRING "" FORCE)
endif()
set(TARGET ${PROJECT_NAME})
set(IMGUI_DIR third_parties/imgui)
add_executable(${TARGET}
src/main.cc
src/imgui_impl_deko3d.cpp
${IMGUI_DIR}/imgui.cpp
${IMGUI_DIR}/imgui_demo.cpp
${IMGUI_DIR}/imgui_draw.cpp
${IMGUI_DIR}/imgui_tables.cpp
${IMGUI_DIR}/imgui_widgets.cpp
)
target_compile_features(${TARGET} PUBLIC cxx_std_17)
target_compile_definitions(${TARGET} PUBLIC
IMGUI_DISABLE_OBSOLETE_KEYIO
IMGUI_DISABLE_OBSOLETE_FUNCTIONS
)
target_link_libraries(${TARGET} PUBLIC
$<IF:$<CONFIG:Debug>,deko3dd,deko3d>
)
target_include_directories(${TARGET} PUBLIC
${DEVKITPRO}/portlibs/switch/include
${IMGUI_DIR})
nx_add_shader_program(imgui_vsh src/imgui_vsh.glsl vert)
nx_add_shader_program(imgui_fsh src/imgui_fsh.glsl frag)
dkp_add_asset_target(${TARGET}_romfs ${CMAKE_CURRENT_BINARY_DIR}/romfs)
dkp_install_assets(${TARGET}_romfs
DESTINATION shaders
TARGETS imgui_vsh imgui_fsh)
nx_generate_nacp(${TARGET}.nacp
NAME ${TARGET}
AUTHOR ${PROJECT_AUTHOR}
)
nx_create_nro(${TARGET}
NACP ${TARGET}.nacp
ROMFS ${TARGET}_romfs
)