SFML/cmake/Modules/FindEGL.cmake
Chris Thrasher f0e72be285 Prefer using IMPORTED targets where possible
My goal is to reduce our need on sfml_find_package until it can
finally be removed. It's preferred to simply use find_package to
find 3rd party projects.

I had to add IMPORTED targets to some of our find modules so that
we could get away from using INTERFACE libraries for external code.
That also implied that our find moduels need to be installed so that
users have access to them when processing SFML's config module.
2023-08-23 09:14:59 -06:00

20 lines
490 B
CMake

#
# Try to find EGL library and include path.
# Once done this will define
#
# EGL_FOUND
# EGL_INCLUDE_PATH
# EGL_LIBRARY
#
find_path(EGL_INCLUDE_DIR EGL/egl.h)
find_library(EGL_LIBRARY NAMES EGL)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(EGL DEFAULT_MSG EGL_LIBRARY EGL_INCLUDE_DIR)
add_library(EGL::EGL IMPORTED UNKNOWN)
set_target_properties(EGL::EGL PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${EGL_INCLUDE_DIR}
IMPORTED_LOCATION ${EGL_LIBRARY})