warfactoryracine/CMakeLists.txt
StillHammer 959a2e4101 Complete Phase 3: Revolutionary UI interface system with hybrid sizing
🎯 **PRODUCTION-READY UI ARCHITECTURE**
- Data-agnostic IUI interface with type-safe enums for performance
- Revolutionary hybrid sizing: percentage targets + absolute pixel constraints
- Hierarchical windowing: Parent → Dock → Split → Tab → Window structure
- Complete ImGuiUI implementation with all DataType content renderers

🔧 **DEVELOPMENT INFRASTRUCTURE**
- AddressSanitizer + GDB debugging workflow for instant crash detection
- Cross-platform pipeline: Linux development → Windows .exe automation
- Debug mode default with comprehensive sanitizer coverage

📊 **TECHNICAL ACHIEVEMENTS**
- Fixed JSON type mixing and buffer overflow crashes with precise debugging
- Mathematical hybrid sizing formula: clamp(percentage_target, min_px, max_px)
- Professional layout system: economic topbar + companies panel + strategic map
- Interactive callback system with request/response architecture

🚀 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-26 11:18:26 +08:00

77 lines
1.9 KiB
CMake

cmake_minimum_required(VERSION 3.16)
project(ImGuiUI_Test)
set(CMAKE_CXX_STANDARD 17)
# 🔧 DEVELOPMENT MODE - Enable all debugging tools
set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_CXX_FLAGS_DEBUG "-fsanitize=address -fsanitize=undefined -g -O0 -Wall -Wextra")
set(CMAKE_C_FLAGS_DEBUG "-fsanitize=address -fsanitize=undefined -g -O0 -Wall -Wextra")
# Link AddressSanitizer
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "-fsanitize=address -fsanitize=undefined")
# Find packages
find_package(glfw3 REQUIRED)
find_package(OpenGL REQUIRED)
# Add FetchContent for dependencies
include(FetchContent)
# nlohmann/json
FetchContent_Declare(
nlohmann_json
GIT_REPOSITORY https://github.com/nlohmann/json.git
GIT_TAG v3.11.3
)
# Dear ImGui
FetchContent_Declare(
imgui
GIT_REPOSITORY https://github.com/ocornut/imgui.git
GIT_TAG v1.90.1
)
FetchContent_MakeAvailable(nlohmann_json imgui)
# Create ImGui library with OpenGL/GLFW backends
add_library(imgui_backends
${imgui_SOURCE_DIR}/imgui.cpp
${imgui_SOURCE_DIR}/imgui_demo.cpp
${imgui_SOURCE_DIR}/imgui_draw.cpp
${imgui_SOURCE_DIR}/imgui_tables.cpp
${imgui_SOURCE_DIR}/imgui_widgets.cpp
${imgui_SOURCE_DIR}/backends/imgui_impl_glfw.cpp
${imgui_SOURCE_DIR}/backends/imgui_impl_opengl3.cpp
)
target_include_directories(imgui_backends PUBLIC
${imgui_SOURCE_DIR}
${imgui_SOURCE_DIR}/backends
)
target_link_libraries(imgui_backends PUBLIC glfw OpenGL::GL)
# Test executable
add_executable(test_imgui_ui
test_imgui_ui.cpp
core/src/ImGuiUI.cpp
)
target_include_directories(test_imgui_ui PRIVATE
core/include
${imgui_SOURCE_DIR}
${imgui_SOURCE_DIR}/backends
)
target_link_libraries(test_imgui_ui
imgui_backends
nlohmann_json::nlohmann_json
glfw
OpenGL::GL
)
# Copy to build directory
set_target_properties(test_imgui_ui PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)