Add the ability to explicitly not build tests. Option defaults to ON to keep the current behavior, but give the user the option to disable building of tests.
When cppzmq is build out of source e.g. ${CMAKE_SOURCE_DIR}/build:
mkdir build
cd build
cmake ..
then .git is not found properly, DRAFT build not enabled and poller test
not added to pool of tests.
when cppzmq is not the root folder of cmake (i.e., it is embedded in a
super project), CMAKE_SOURCE_DIR will not be the correct path to copy
FindZeroMQ.cmake.
and add it to CMAKE_MODULE_PATH on failed load
this allows downstream packages that have loaded cppzmq to call find_package(ZeroMQ) and succeed without shipping their own copy of the fallback.
Additionally, a check for if the libzmq target is defined avoids duplicate definitions when called multiple times
Export CMake targets to package config via interface libraries. This
allows the user to simple depends on this project and thereby gets
the additionally dependencies like ZeroMQ automatically.
Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>