[zeromq-dev] cmake patch.

George Neill georgen at neillnet.com
Wed Jan 7 06:00:57 CET 2009


Malo,

On Tue, Jan 6, 2009 at 2:04 PM, Pavol Malosek <malosek at fastmq.com> wrote:
> ----- Original Message -----
> From: George Neill <georgen at neillnet.com>
> Sent: Tuesday, January 06, 2009 6:56 PM
> Subject: Re: [zeromq-dev] cmake patch.
>> >
>> > How cpack is dealing with such a situations when libzmq_sources are
> added
>> > under some condition?
>> > Will it pack those conditionally compiled files into the dist package?
>>
>> I guess I am not sure what you mean?
>>
>> .cpps don't get included in the distribution anyway, right?
>
> Hello,
>
> I mean 0MQ source distribution package which is for the moment produced by
> "make dist" (autotools).
> By using autotools we have to keep two lists of files:
> -one which is created conditionally and sources in it are being compiled
> -second which is used for creating source distribution package
>
> I was just curious if before mentioned cpack is "clever" enough to put all
> the files into the source dist package even if they are conditionally added
> into lets say libzmq_sources list.

Yes, if I understand your question.  When cpack is used in-conjunction
with cmake, cpack will follow the installation rules specified in your
CMakeLists.txt files.  So cmake will only install the files listed in
the conditionally built ${libzmq_sources} variable if we issue a cmake
INSTALL command with that variable.

If you look at the ZMQ_ADD_LIBRARY macro I created in
cmake/zmq_macros.cmake you will see how the INSTALL command can be
used in cmake.  OR, you can just do 'cmake --help-command INSTALL' for
more details.   CPack will use the install commands to build the
package.  Right now I have only put install commands in for the
zmq_server binary and libzmq.so files.

**NOTE** the library versioning doesn't work quite right at the moment
because you removed the temporary ZMQ_VERSION and ZMQ_VERSION_MAJOR
variables I had created for this.

You can use cpack simply by issuing an include(CPack) at the top of
trunk/CMakeLists.txt file and then issue a 'make package' to generate
the package.  By default I believe it will create a .sh install file.

I typically don't use cpack, but I frequently use the cmake generated
install target.

If you run cmake like this,

cmake -D"CMAKE_INSTALL_PREFIX=$HOME/zmq" /path/to/trunk

make install

will build everything and install it to $HOME/zmq (just like autotools
--prefix=)

Hope that helps,
George.



More information about the zeromq-dev mailing list