If Wayland includes are located in standard path i.e. "/usr/include" without any subdirectory, cmake function 'pkg_check_modules' will not set WAYLAND_INCLUDE_DIRS variable.
'pkg_check_modules' uses 'pkg-config --cflags-only-I' behind the scenes which ignores standard paths like "/usr/include".
When WAYLAND_INCLUDE_DIRS is empty, 'find_package_handle_standard_args' function complains about it.
To fix the issue, empty variable is detected first and then 'pkg_get_variable' function is used to get include dir path.
If Wayland includes are located in standard path i.e. "/usr/include" without any subdirectory, cmake function 'pkg_check_modules' will not set WAYLAND_INCLUDE_DIRS variable. 'pkg_check_modules' uses 'pkg-config --cflags-only-I' behind the scenes which ignores standard paths like "/usr/include". When WAYLAND_INCLUDE_DIRS is empty, 'find_package_handle_standard_args' function complains about it. To fix the issue, empty variable is detected first and then 'pkg_get_variable' function is used to get include dir path.