[zeromq-dev] zmq cmake patch
George Neill
georgen at neillnet.com
Thu Nov 20 20:01:27 CET 2008
Malo,
On Thu, Nov 20, 2008 at 6:59 AM, Pavol Malosek <malosek at fastmq.com> wrote:
> George,
>
> In attachment is patch against rev. 641 it adds only very basic support for
> cmake (only zmq and zmq_server is build on Linux).
> It is based on your work and should be seen as a model and starting point.
> I'm "few hours" cmake user and hence your experience is important for us,
> anyway here are my notes to cmake support.
Regarding your attached patch, you'll probably want to remove this
(below) from trunk/zmq_server/CMakeLists.txt, as it's already created
by the trunk/zmq/CMakeLists.txt
configure_file (
"${libzmq_SOURCE_DIR}/platform.hpp.cmake"
"${libzmq_BINARY_DIR}/platform.hpp"
)
It is not necessary to do it a second time.
Also, when doing this (below) you'll probably want to take in to
account libs such as socket nsl, rt, etc .. not just compile macros.
# Set compile defines according platform
if (ZMQ_HAVE_LINUX)
add_definitions (-D_REENTRANT)
elseif (ZMQ_HAVE_SOLARIS)
add_definitions (-D_REENTRANT -D_PTHREADS)
>>>>>>>> set( SOCKET_LIBS "socket;nsl") <<<<<<<<<<<
elseif (ZMQ_HAVE_FREEBSD OR ZMQ_HAVE_QNXNTO)
add_definitions (-D_THREAD_SAFE)
elseif (ZMQ_HAVE_UNKNOWN)
MESSAGE (FATAL_ERROR "Not supported OS: ${CMAKE_SYSTEM_NAME}")
endif (ZMQ_HAVE_LINUX)
I don't think it is fair to stop the build here.
e.g. windows, would compile fine without any additional compile macros.
At a minimum you'd have to have an elseif for windows.
Once you start adding this kind of stuff the top level cmake file will
possibly get out of hand, that's why i broke the files out in to their
respective areas/files.
Thanks,
George.
More information about the zeromq-dev
mailing list