Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix EGL and epoxy linking for external projects #937

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cmake/PangolinConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,11 @@ find_dependency(Eigen3)
if (UNIX)
find_dependency(Threads)
endif()

if (NOT EMSCRIPTEN)
find_dependency(OpenGL REQUIRED COMPONENTS OpenGL)
endif()

if(_LINUX_)
find_dependency(OpenGL REQUIRED COMPONENTS EGL)
endif()
5 changes: 3 additions & 2 deletions components/pango_opengl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ else()
set(OpenGL_GL_PREFERENCE "GLVND")
find_package(OpenGL REQUIRED COMPONENTS OpenGL EGL)
find_package(epoxy REQUIRED)
target_link_libraries(${COMPONENT} PUBLIC epoxy::epoxy OpenGL::EGL)
target_include_directories(${COMPONENT} PUBLIC $<BUILD_INTERFACE:${OPENGL_EGL_INCLUDE_DIRS}>)
target_link_libraries(${COMPONENT} PUBLIC OpenGL::OpenGL OpenGL::EGL)
target_link_libraries(${COMPONENT} PUBLIC ${epoxy_LIBRARIES})
target_include_directories(${COMPONENT} PUBLIC $<BUILD_INTERFACE:${epoxy_INCLUDE_DIRS}>)
target_compile_definitions(${COMPONENT} PUBLIC HAVE_EPOXY)
else()
# OpenGL defaults
Expand Down
Loading