- Fix JsonDataNode::getChildReadOnly() to handle JSON array access by numeric index - Fix test_ui_showcase to use JSON array for children (matching test_single_button pattern) - Add visual test files: test_single_button, test_ui_showcase, test_sprite_debug - Clean up debug logging from SpritePass, SceneCollector, UIButton, BgfxDevice The root cause was that UITree couldn't access array children in JSON layouts. UIButton hover/click now works correctly in both test files. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
126 lines
3.1 KiB
CMake
126 lines
3.1 KiB
CMake
# ============================================================================
|
|
# UIModule - CMake Configuration
|
|
# ============================================================================
|
|
|
|
cmake_minimum_required(VERSION 3.20)
|
|
|
|
# ============================================================================
|
|
# UIModule Shared Library
|
|
# ============================================================================
|
|
|
|
add_library(UIModule SHARED
|
|
# Main module
|
|
UIModule.cpp
|
|
|
|
# Core
|
|
Core/UITree.cpp
|
|
Core/UILayout.cpp
|
|
Core/UIContext.cpp
|
|
Core/UIStyle.cpp
|
|
Core/UITooltip.cpp
|
|
|
|
# Widgets
|
|
Widgets/UIPanel.cpp
|
|
Widgets/UILabel.cpp
|
|
Widgets/UIButton.cpp
|
|
Widgets/UIImage.cpp
|
|
Widgets/UISlider.cpp
|
|
Widgets/UICheckbox.cpp
|
|
Widgets/UIProgressBar.cpp
|
|
Widgets/UITextInput.cpp
|
|
Widgets/UIScrollPanel.cpp
|
|
|
|
# Rendering
|
|
Rendering/UIRenderer.cpp
|
|
)
|
|
|
|
target_include_directories(UIModule PRIVATE
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../include
|
|
)
|
|
|
|
target_link_libraries(UIModule PRIVATE
|
|
GroveEngine::impl
|
|
spdlog::spdlog
|
|
nlohmann_json::nlohmann_json
|
|
)
|
|
|
|
target_compile_features(UIModule PRIVATE cxx_std_17)
|
|
|
|
set_target_properties(UIModule PROPERTIES
|
|
PREFIX "lib"
|
|
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/modules
|
|
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/modules
|
|
)
|
|
|
|
# ============================================================================
|
|
# Platform-specific settings
|
|
# ============================================================================
|
|
|
|
if(WIN32)
|
|
target_compile_definitions(UIModule PRIVATE
|
|
WIN32_LEAN_AND_MEAN
|
|
NOMINMAX
|
|
)
|
|
endif()
|
|
|
|
if(UNIX AND NOT APPLE)
|
|
target_link_libraries(UIModule PRIVATE
|
|
pthread
|
|
dl
|
|
)
|
|
endif()
|
|
|
|
# ============================================================================
|
|
# UIModule Static Library (for tests that can't use DLL loading)
|
|
# ============================================================================
|
|
|
|
add_library(UIModule_static STATIC
|
|
# Main module
|
|
UIModule.cpp
|
|
|
|
# Core
|
|
Core/UITree.cpp
|
|
Core/UILayout.cpp
|
|
Core/UIContext.cpp
|
|
Core/UIStyle.cpp
|
|
Core/UITooltip.cpp
|
|
|
|
# Widgets
|
|
Widgets/UIPanel.cpp
|
|
Widgets/UILabel.cpp
|
|
Widgets/UIButton.cpp
|
|
Widgets/UIImage.cpp
|
|
Widgets/UISlider.cpp
|
|
Widgets/UICheckbox.cpp
|
|
Widgets/UIProgressBar.cpp
|
|
Widgets/UITextInput.cpp
|
|
Widgets/UIScrollPanel.cpp
|
|
|
|
# Rendering
|
|
Rendering/UIRenderer.cpp
|
|
)
|
|
|
|
target_include_directories(UIModule_static PUBLIC
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../include
|
|
)
|
|
|
|
target_link_libraries(UIModule_static PUBLIC
|
|
GroveEngine::impl
|
|
spdlog::spdlog
|
|
nlohmann_json::nlohmann_json
|
|
)
|
|
|
|
target_compile_features(UIModule_static PRIVATE cxx_std_17)
|
|
|
|
# Mark as static build to skip C exports (avoids multiple definition errors)
|
|
target_compile_definitions(UIModule_static PRIVATE GROVE_MODULE_STATIC)
|
|
|
|
if(WIN32)
|
|
target_compile_definitions(UIModule_static PRIVATE
|
|
WIN32_LEAN_AND_MEAN
|
|
NOMINMAX
|
|
)
|
|
endif()
|