[zeromq-dev] malamute CMake & eclipse

Matjaž Ostroveršnik matjaz.ostroversnik at gmail.com
Wed Apr 6 14:38:27 CEST 2016


Hi all,

I am in process of experimenting with malamute. In order to play with 
it, the development environment needs to be configured.
Below is my experience with malamute & eclipse & cmake. Perhaps someone 
can shorten his/her environment establishing time. :-)

1. get the sources  & build (from https://github.com/zeromq/malamute)

|git clone git://github.com/jedisct1/libsodium.git git clone 
git://github.com/zeromq/libzmq.git git clone 
git://github.com/zeromq/czmq.git git clone 
git://github.com/zeromq/malamute.git for project in libsodium libzmq 
czmq malamute; do cd $project ./autogen.sh ./configure && make check 
sudo make install sudo ldconfig cd .. done|

2. create build folder in parallel with malamute folder
     assuming you are in malamute folder
|  mkdir ../build|
3. minor fixes to the malamute distribution
     fix CMakeLists.txt file
     comment out all set_target_properties (for all binaries and libraries)
>    #set_target_properties(
>     #    mlm_perftest
>     #    PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${SOURCE_DIR}/src"
>     #)
     add two helper scripts:
     debug_build.sh
> #!/bin/bash
> cmake -G"Eclipse CDT4 - Unix Makefiles" \
>    -DCMAKE_ECLIPSE_VERSION=4.5.2 \
>    -DCMAKE_BUILD_TYPE=Debug \
>    -DCMAKE_CXX_COMPILER_ARG1=-std=c++14 \
>    -DCMAKE_CXX_STANDARD=14 \
>    $HOME/malamute/malamute
     release_build.sh
> #!/bin/bash
> cmake -G"Eclipse CDT4 - Unix Makefiles" \
>    -DCMAKE_ECLIPSE_VERSION=4.5.2 \
>    -DCMAKE_BUILD_TYPE=Release \
>    -DCMAKE_CXX_STANDARD=14 \
>    $HOME/malamute/malamute

4. establish soft links between build and source folders (in build folder)
>  ln -s ../malamute top
>  ln -s ../malamute/src src
5. build the project (in build folder)
> top/debug_build.sh (first time or when you want to change from debug 
> to release)
> make                          (to manually rebuild the package)
6. establish project in eclipse
     - step 5 must be executed before (debug_build.sh / release_build.sh 
establishes two hidden files that eclipse needs (.cproject, .project))
     - in eclipse define new project
       file/import/General/Existing Projects into Workspace

    - press Browse beside "select root directory" and navigate to the 
build folder established in step 2.  After selecting the folder, 
projects edit box
      will populate and finish button become enabled.
    - press Finish button

7. start to work :-)
     You can build manually (i.e. make in build folder) or inside 
eclipse (Ctrl B)
     If you want to switch to debug/release build, simply go into build 
folder and execute top/debug_build.sh or top/release_build.sh.


Disclaimer: (I don't want to start the holly war ;-) )
1. I prefer the out of source builds, since this way I  don't pollute 
the sources.
2. I prefer cmake builds over autobuilds
3. I know that CMakeLists.txt file is autogenerated, but at the current 
stage I do not posses the knowledge which file is the actual source 
file, which needs to be fixed, so that after the regeneration of the 
project, the changes are not lost.

Best regards

Matjaž

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20160406/a7712f95/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ibchaaja.png
Type: image/png
Size: 57790 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20160406/a7712f95/attachment.png>


More information about the zeromq-dev mailing list