if(UNIX) find_package(OpenGL COMPONENTS EGL) if(OPENGL_egl_LIBRARY) set(EGL_LIBRARY "${OPENGL_egl_LIBRARY}" CACHE STRING "") set(EGL_INCLUDE_DIR "${OPENGL_EGL_INCLUDE_DIRS}" CACHE STRING "") endif() endif() set(VCPKG_SETUP_EGL OFF) if(NOT TARGET EGL::EGL) set(VCPKG_SETUP_EGL ON) endif() if("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static" AND WIN32) include(SelectLibraryConfigurations) find_library(GLESv2_LIBRARY_DEBUG NAMES libGLESv2 GLESv2 NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH) find_library(GLESv2_LIBRARY_RELEASE NAMES libGLESv2 GLESv2 NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH) select_library_configurations(GLESv2) find_library(ANGLE_LIBRARY_DEBUG NAMES libANGLE ANGLE NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH) find_library(ANGLE_LIBRARY_RELEASE NAMES libANGLE ANGLE NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH) select_library_configurations(ANGLE) if(CMAKE_BUILD_TYPE MATCHES "[Dd][Ee][Bb][Uu][Gg]") list(APPEND CMAKE_REQUIRED_LIBRARIES "${GLESv2_LIBRARY_DEBUG}" "${ANGLE_LIBRARY_DEBUG}" ZLIB::ZLIB D3d9.lib dxguid.lib DXGI.lib) else() list(APPEND CMAKE_REQUIRED_LIBRARIES "${GLESv2_LIBRARY_RELEASE}" "${ANGLE_LIBRARY_RELEASE}" ZLIB::ZLIB D3d9.lib dxguid.lib DXGI.lib) endif() list(APPEND CMAKE_REQUIRED_DEFINITIONS "-DKHRONOS_STATIC") find_package(ZLIB REQUIRED) set(VCPKG_BACKUP_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}") set(VCPKG_BACKUP_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}") endif() _find_package(${ARGS}) if(VCPKG_SETUP_EGL AND TARGET EGL::EGL AND "@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static" AND WIN32) if(GLESv2_LIBRARY_DEBUG) set_property(TARGET EGL::EGL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "$<$:${GLESv2_LIBRARY_DEBUG}>") endif() if(ANGLE_LIBRARY_DEBUG) set_property(TARGET EGL::EGL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "$<$:${ANGLE_LIBRARY_DEBUG}>") endif() if(GLESv2_LIBRARY_RELEASE) set_property(TARGET EGL::EGL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "$<$>:${GLESv2_LIBRARY_RELEASE}>") endif() if(ANGLE_LIBRARY_RELEASE) set_property(TARGET EGL::EGL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "$<$>:${ANGLE_LIBRARY_RELEASE}>") endif() set_property(TARGET EGL::EGL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "ZLIB::ZLIB;D3d9.lib;dxguid.lib;DXGI.lib") set(CMAKE_REQUIRED_LIBRARIES "${VCPKG_BACKUP_CMAKE_REQUIRED_LIBRARIES}") set(CMAKE_REQUIRED_DEFINITIONS "${VCPKG_BACKUP_CMAKE_REQUIRED_DEFINITIONS}") unset(VCPKG_BACKUP_CMAKE_REQUIRED_LIBRARIES) unset(VCPKG_BACKUP_CMAKE_REQUIRED_DEFINITIONS) endif() unset(VCPKG_SETUP_EGL)