Solution: Remove architechture checks from cmake version file
Since this is a header only library there is no need to check for 32 vs 64bits.
See similar problem: https://github.com/onqtam/doctest/pull/225
cppzmq does not follow other zeromq projects where draft builds are
enabled by default for git repository.
Solution: revert back code where ENABLE_DRAFTS in set to ON if .git
directory exists
Default build, ./ci_build.sh without any arguments, which causes to run
with draft disabled, does not work properly for git cloned repository and
C++11 compiler.
Two issues:
1. For git cloned repository ENABLE_DRAFTS is ON by default but libzmq
compiled build without drafts .Travis did not catch that because default build
runs on non C++11 compiler.
2. testutil.hpp does not build because of missing draft guards.
Solution 1: Remove check for presence of .git for enabling draft API as it
is confusing to use with ENABLE_DRAFTS flag and there should be only one
explicit way to enable draft build.
Solution 2: add missing draft guards in testutil.hpp for server/client
socket in use there.
Solution 3: add extra Travis build covering C++11 compiler and non
draft enabled build.
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>