diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2019-08-30 10:38:38 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2019-09-24 09:47:06 +0000 |
commit | 76897659f8f4897acbeec8c5a575965c44ef6e0d (patch) | |
tree | 0e8ac997ffa84648c412eea558ab100f3f42a549 /cmake | |
parent | 0bcd50b40a747329932fb2823e494575082cd150 (diff) |
Fix FindEGL on Emscripten
Fixes were upstreamed with commit
3b0bf71a72789eb2b79310b4f67602115e347f56 in extra-cmake-modules and this
brings the file in sync.
Change-Id: Ica3a29fd091afa669f29a3e9775e637566f1cb97
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/3rdparty/extra-cmake-modules/find-modules/FindEGL.cmake | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/cmake/3rdparty/extra-cmake-modules/find-modules/FindEGL.cmake b/cmake/3rdparty/extra-cmake-modules/find-modules/FindEGL.cmake index de271a1140..48e5172877 100644 --- a/cmake/3rdparty/extra-cmake-modules/find-modules/FindEGL.cmake +++ b/cmake/3rdparty/extra-cmake-modules/find-modules/FindEGL.cmake @@ -129,25 +129,33 @@ int main(int argc, char *argv[]) { cmake_pop_check_state() +set(required_vars EGL_INCLUDE_DIR HAVE_EGL) +if(NOT EMSCRIPTEN) + list(APPEND required_vars EGL_LIBRARY) +endif() + include(FindPackageHandleStandardArgs) find_package_handle_standard_args(EGL FOUND_VAR EGL_FOUND REQUIRED_VARS - EGL_LIBRARY - EGL_INCLUDE_DIR - HAVE_EGL + ${required_vars} VERSION_VAR EGL_VERSION ) if(EGL_FOUND AND NOT TARGET EGL::EGL) - add_library(EGL::EGL UNKNOWN IMPORTED) - set_target_properties(EGL::EGL PROPERTIES - IMPORTED_LOCATION "${EGL_LIBRARY}" - INTERFACE_COMPILE_OPTIONS "${EGL_DEFINITIONS}" - INTERFACE_INCLUDE_DIRECTORIES "${EGL_INCLUDE_DIR}" - ) + if (EMSCRIPTEN) + add_library(EGL::EGL INTERFACE IMPORTED) + # Nothing further to be done, system include paths have headers and linkage is implicit. + else() + add_library(EGL::EGL UNKNOWN IMPORTED) + set_target_properties(EGL::EGL PROPERTIES + IMPORTED_LOCATION "${EGL_LIBRARY}" + INTERFACE_COMPILE_OPTIONS "${EGL_DEFINITIONS}" + INTERFACE_INCLUDE_DIRECTORIES "${EGL_INCLUDE_DIR}" + ) + endif() endif() mark_as_advanced(EGL_LIBRARY EGL_INCLUDE_DIR HAVE_EGL) |