Files
plotter/adapters/glfw/CMakeLists.txt
T

18 lines
985 B
CMake

# 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
# <glfw/glfw_host.hpp> -- 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)