BackendAutoSelection.cmake 875 B

123456789101112131415161718192021222324252627282930313233
  1. function(backends_auto_selection_error)
  2. message(FATAL_ERROR
  3. "RmlUi ${RMLUI_BACKEND} backend for ${CMAKE_SYSTEM_NAME} is not available. "
  4. "Please select a backend that is available on the system. "
  5. "Possible options for RMLUI_BACKEND are: ${RMLUI_BACKEND_OPTIONS}"
  6. )
  7. endfunction()
  8. if(RMLUI_BACKEND STREQUAL "auto")
  9. if(EMSCRIPTEN)
  10. set(RMLUI_BACKEND SDL_GL3)
  11. elseif(WIN32)
  12. set(RMLUI_BACKEND GLFW_GL3)
  13. elseif(APPLE)
  14. set(RMLUI_BACKEND SDL_SDLrenderer)
  15. elseif(UNIX)
  16. set(RMLUI_BACKEND GLFW_GL3)
  17. else()
  18. backends_auto_selection_error()
  19. endif()
  20. elseif(RMLUI_BACKEND STREQUAL "native")
  21. if(EMSCRIPTEN)
  22. set(RMLUI_BACKEND SDL_GL3)
  23. elseif(WIN32)
  24. set(RMLUI_BACKEND WIN32_GL2)
  25. elseif(UNIX AND NOT APPLE)
  26. set(RMLUI_BACKEND X11_GL2)
  27. else()
  28. backends_auto_selection_error()
  29. endif()
  30. endif()
  31. message(STATUS "Using RmlUi backend ${RMLUI_BACKEND} for samples")