Changed the way usage requirements (include dirs, compile defs, dependent libraries) are specified, to match the recommended standard practice for modern CMake. This involves using target-specific functions (target_include_directories, target_compile_definitions, etc.), along with the PUBLIC, PRIVATE or INTERFACE modifiers.
Updated chain-building support to imitate new-style Find modules (import libs), instead of old-style Find modules (cache variables).
Built tarballs are not including all of the files needed
to build the test suite because they are missing from the
<target>_SOURCES variable in Makefile.am.
The patch does not modify any source files, it only adds 3 new files
(CMakelists.txt, ares_build.h.cmake, ares_config.h.cmake) which form the
build system. I've tried to go through as much of the autotools tests and
extracted what I thought was appropriate, though many of the tests aren't
as in-depth in CMake as they are for autotools ... it is unclear why some
of them exist at all, I'm guessing for legacy systems that CMake probably
doesn't support anyhow.
Building the library, and examples (adig, ahost, acountry) plus installation
should work across a large number of tested platforms. The tests have not
yet been integrated.
Fix up a couple of problems with configuring whether c-ares rotates
between different name servers between requests.
Firstly, ares_save_options() returns (in *optmask) the value of
(channel->optmask & ARES_OPT_ROTATE), which doesn't necessarily
indicate whether the channel is or is not actually doing rotation.
This can be confusing/incorrect if:
- the channel was originally configured without ARES_OPT_ROTATE
(so it appears that the channel is not rotating)
- the /etc/resolv.conf file includes the 'rotate' option
(so the channel is actually performing rotation).
Secondly, it is not possible to reliably configure a channel
to not-rotate; leaving off ARES_OPT_ROTATE is not enough, since
a 'rotate' option in /etc/resolv.conf will turn it on again.
Therefore:
- add an ARES_OPT_NOROTATE optmask value to allow explicit
configuration of no-rotate behaviour
- in ares_save_options(), report the value of channel->rotate
as exactly one of (optmask & ARES_OPT_ROTATE) or
(optmask & ARES_OPT_NOROTATE).
In terms of back-compatibility:
- existing apps that set ARES_OPT_ROTATE will continue to rotate,
and to have ARES_OPT_ROTATE reported back from ares_save_options()
- existing apps that don't set ARES_OPT_ROTATE will continue to
use local config/defaults to decide whether to rotate, and will
now get ARES_OPT_ROTATE or ARES_OPT_NOROTATE reported back from
ares_save_options() rather than 0.