libiio 1.0 is new and not yet packaged by distributions, so keep the
0.x API as the default and add ENABLE_LIBIIO_V1 (default OFF) to build
against 1.x explicitly.
The finder used to look for the 1.x header in IIO_DIR and in the system
paths before falling back to 0.x, independently of where it found the
library. With 1.x installed system-wide and IIO_DIR pointing at 0.26,
it combined 1.x headers with the 0.26 library and the link failed. Now
each candidate install (IIO_DIR, then the one pkg-config reports, then
the system paths) must provide both the header and the library for the
requested API; an install with the other API is skipped with a message.
Changing ENABLE_LIBIIO_V1 triggers detection again in an existing build
directory.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>