Fix FindEGL
ClosedPublic

Authored by tcberner on Feb 16 2019, 7:18 AM.

Details

Summary

${EGL_INCLUDE_DIR} is the path up to 'egl.h' -- so the header is
${EGL_INCLUDE_DIR}/egl.h

The compile test on the other hand includes 'EGL/egl.h', so the path
that needs to be passed to the compile test is "${EGL_INCLUDE_DIR}/..".

Diff Detail

Repository
R240 Extra CMake Modules
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
tcberner created this revision.Feb 16 2019, 7:18 AM
Restricted Application added projects: Frameworks, Build System. · View Herald TranscriptFeb 16 2019, 7:18 AM
Restricted Application added subscribers: kde-buildsystem, kde-frameworks-devel. · View Herald Transcript
tcberner requested review of this revision.Feb 16 2019, 7:18 AM

Possibly the returend EGL_INCLUDE_DIR should possibly be stripped of the suffix too, as most will proably include 'EGL/egl.h', and not 'egl.h', I guess?

Yeah I think find_path should use the same style as the test program (EGL/egl.h). It is the style of inclusion as per the specification. I think that’s better than the ../ approach.

hausmann requested changes to this revision.Feb 16 2019, 8:12 AM
This revision now requires changes to proceed.Feb 16 2019, 8:12 AM
tcberner updated this revision to Diff 51842.Feb 16 2019, 9:56 AM

Store the path gathered via pkgconfig in COMPLETE_EGL_INCLUDE_DIR and
use its parent directory for EGL_INCLUDE_DIR.

I think that it should be NAMES EGL/egl.h

I think that it should be NAMES EGL/egl.h

Yeah, then it might actuayll work without redefining the path -- but in both cases we are kind of assuming that all install egl.h into a subdir called 'EGL'.

tcberner updated this revision to Diff 51847.Feb 16 2019, 10:51 AM

Simply set NAMES EGL/egl.h and fixup the header version check.

hausmann accepted this revision.Feb 17 2019, 8:47 PM

Thank you:)

This revision is now accepted and ready to land.Feb 17 2019, 8:47 PM
apol accepted this revision.Feb 18 2019, 12:16 AM

If someone could please trigger all of the Dependency Builds for FreeBSD once this has been landed that would be appreciated: https://build.kde.org/view/Failing/

This revision was automatically updated to reflect the committed changes.
dfaure added a subscriber: dfaure.Feb 22 2019, 3:20 PM

If anyone hits a cmake error about "/usr/include/EGL/EGL/egl.h" after updating ECM (e.g. in kwayland or plasma-framework), remove the cache in the builddir and rerun cmake. This commit is actually correct, it's just incompatible with existing caches.