| 1 | # TextEditor - A syntax highlighting text editor for ImGui |
| 2 | # Copyright (c) 2024-2026 Johan A. Goossens. All rights reserved. |
| 3 | # |
| 4 | # This work is licensed under the terms of the MIT license. |
| 5 | # For a copy, see <https://opensource.org/licenses/MIT>. |
| 6 | |
| 7 | FetchContent_Populate(imgui QUIET GIT_REPOSITORY "https://github.com/ocornut/imgui" GIT_TAG "v1.92.7") |
| 8 | |
| 9 | set(IMGUI_SOURCES |
| 10 | ${imgui_SOURCE_DIR}/imgui.h |
| 11 | ${imgui_SOURCE_DIR}/imgui.cpp |
| 12 | ${imgui_SOURCE_DIR}/imgui_draw.cpp |
| 13 | ${imgui_SOURCE_DIR}/imgui_tables.cpp |
| 14 | ${imgui_SOURCE_DIR}/imgui_widgets.cpp |
| 15 | ${imgui_SOURCE_DIR}/imgui_demo.cpp |
| 16 | ${imgui_SOURCE_DIR}/imgui_internal.h |
| 17 | ${imgui_SOURCE_DIR}/imstb_rectpack.h |
| 18 | ${imgui_SOURCE_DIR}/imstb_textedit.h |
| 19 | ${imgui_SOURCE_DIR}/imstb_truetype.h |
| 20 | ${imgui_SOURCE_DIR}/backends/imgui_impl_sdl3.cpp |
| 21 | ${imgui_SOURCE_DIR}/backends/imgui_impl_sdlgpu3.cpp |
| 22 | ${imgui_SOURCE_DIR}/backends/imgui_impl_sdl3.h |
| 23 | ${imgui_SOURCE_DIR}/backends/imgui_impl_sdlgpu3.h) |
| 24 | |
| 25 | add_library(imgui STATIC ${IMGUI_SOURCES}) |
| 26 | # target_compile_definitions(imgui PUBLIC "IMGUI_USE_WCHAR32") |
| 27 | target_compile_definitions(imgui PUBLIC "IMGUI_DEFINE_MATH_OPERATORS") |
| 28 | target_compile_definitions(imgui PUBLIC "IMGUI_DISABLE_OBSOLETE_FUNCTIONS") |
| 29 | target_compile_definitions(imgui PUBLIC "IMGUI_DISABLE_OBSOLETE_KEYIO") |
| 30 | target_include_directories(imgui PUBLIC ${imgui_SOURCE_DIR} ${imgui_SOURCE_DIR}/backends) |
| 31 | |
| 32 | target_link_libraries(imgui SDL3_Headers) |