-
Notifications
You must be signed in to change notification settings - Fork 35
/
ImGui.cmake
62 lines (53 loc) · 1.66 KB
/
ImGui.cmake
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
add_library(ImGui STATIC
vendor/imgui/imgui.cpp
vendor/imgui/imgui.h
vendor/imgui/imgui_draw.cpp
vendor/imgui/imgui_tables.cpp
vendor/imgui/imgui_widgets.cpp
vendor/imgui/backends/imgui_impl_sdl2.cpp
vendor/imgui/backends/imgui_impl_sdl2.h
vendor/imgui/backends/imgui_impl_opengl3.cpp
vendor/imgui/backends/imgui_impl_opengl3.h
vendor/imgui/backends/imgui_impl_opengl3_loader.h
)
target_link_libraries(ImGui
PUBLIC
SDL2::SDL2$<$<STREQUAL:${SDL2_LINKAGE},static>:-static>
)
if(ENABLE_FREETYPE AND Freetype_FOUND)
target_sources(ImGui
PRIVATE
vendor/imgui/misc/freetype/imgui_freetype.cpp
vendor/imgui/misc/freetype/imgui_freetype.h
)
target_compile_definitions(ImGui
PUBLIC
IMGUI_ENABLE_FREETYPE
)
target_link_libraries(ImGui
PUBLIC
Freetype::Freetype
)
endif()
target_include_directories(ImGui
PUBLIC
${CMAKE_SOURCE_DIR}/vendor/imgui
${CMAKE_SOURCE_DIR}/vendor/imgui/backends
${SDL2_INCLUDE_DIRS}
)
# Build font embedding tool
add_executable(ImGuiBinaryToCompressedC EXCLUDE_FROM_ALL
vendor/imgui/misc/fonts/binary_to_compressed_c.cpp
)
# Add SDL2/OpenGL 3 Dear ImGui example application target for testing
add_executable(ImGuiDemo EXCLUDE_FROM_ALL
vendor/imgui/imgui_demo.cpp
vendor/imgui/examples/example_sdl2_opengl3/main.cpp
)
target_link_libraries(ImGuiDemo
PRIVATE
ImGui
SDL2::SDL2
SDL2::SDL2main
OpenGL::GL
)