cmake: Look for dbus-arch-deps.h next to DBus1Config.cmake

<dbus/dbus-arch-deps.h> is architecture-dependent, and compilers have
not traditionally supported an installation path for architecture-specific
headers (Debian-based systems have /usr/include/${multiarch_tuple}, but
that isn't portable beyond Debian). When dbus was built using Autotools,
dependent projects that use CMake need to look for this header in the
right place.

Unfortunately, it seems that at least recent versions of CMake will
ignore the HINTS we get from pkg-config if they are told to search in
a non-standard prefix via ${DBus1_ROOT}.

Look for dbus-arch-deps.h in a directory derived from the filename of
the CMake config file, before trying the normal search algorithm. The
CMake config file is in ${libdir}, and so is the architecture-specific
header, so this should work reasonably reliably.

According to the CMake documentation, if we search for the same thing
multiple times, the first successful result will be used; and searching
with NO_DEFAULT_PATH is the official way to prepend things to the
search order.

Resolves: dbus/dbus#314
Signed-off-by: Simon McVittie <smcv@collabora.com>
11 jobs for wip/find-arch-include-dir in 16 minutes and 55 seconds (queued for 9 seconds)
latest
Status Job ID Name Coverage
  Build
passed #5514444
build:cmake

00:04:25

passed #5514441
build:debug

00:08:41

manual #5514446
allowed to fail manual
build:i686-w64-mingw32-cmake
passed #5514445
build:i686-w64-mingw32-debug

00:05:19

manual #5514443
allowed to fail manual
build:legacy
passed #5514440
build:production

00:04:49

manual #5514442
allowed to fail manual
build:reduced
manual #5514449
allowed to fail manual
build:stretch
passed #5514447
build:x86_64-w64-mingw32

00:04:32

passed #5514448
build:x86_64-w64-mingw32-cmake-debug

00:11:28

manual #5514450
allowed to fail manual
build:xenial