# The GLFW adapter: the reference host for the library. It owns the window, the # context and the loop, and translates GLFW's events into plot::input events. # # GLFW is resolved by the shared plot_find_glfw() (cmake/plot_options.cmake), so a # build that also enables the Dear ImGui adapter -- which needs GLFW for # imgui_impl_glfw -- discovers (and at worst fetches) a single copy. plot_find_glfw(plot_glfw_dep) add_library(plot_glfw STATIC glfw_host.cpp) add_library(plot::glfw ALIAS plot_glfw) # The public include root is `adapters/`, so the header is reached as # -- the toolkit's name first, like every other adapter's. target_include_directories(plot_glfw PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..") # GLFW stays PRIVATE: the header forward-declares GLFWwindow and includes no GLFW # header, so a consumer of plot::glfw does not inherit the toolkit. target_link_libraries(plot_glfw PUBLIC plot::core PRIVATE ${plot_glfw_dep}) plot_apply_warnings(plot_glfw)