set(RMLUI_LIBRARIES
  lib/RmlCore
)
if(WIN32)
  list(APPEND RMLUI_LIBRARIES lib/RmlDebugger)
endif()

add_compile_definitions(
  L_RMLUI_WITH_DEBUGGER=$<PLATFORM_ID:WIN32>
)

add_external(
  rmlui
  CMAKE
  CONFIG_INSTALL_DIR
  GIT_REPOSITORY https://github.com/mikke89/RmlUi.git
  GIT_TAG d3e97d8e4d94ea5031bb50a4969d1c0fcf3dc9e6 # 4.2
  INCLUDE_DIRS include
  LIBRARIES ${RMLUI_LIBRARIES}
  CMAKE_ARGS
    -DBUILD_SHARED_LIBS=OFF
    -DNO_FONT_INTERFACE_DEFAULT=ON
    -DNO_THIRDPARTY_CONTAINERS=ON
    -DDISABLE_RTTI_AND_EXCEPTIONS=ON
)
