CMake Builder Plugin for Hudson

Update: Check out my post introducing the newest version of the plugin.

Today I’m pleased to announce the first version of the cmakebuilder plugin for Hudson. It can be used to build cmake based projects without having to write a shell script (see my previous blog post). Using the scratch-my-own-itch approach I started out implementing only those features that I needed for my cmake projects which are mostly Linux/g++ based so far.

Let’s do a quick walk through the configuration:

1. CMake Path:
If the cmake executable is not in your $PATH variable you can set its path in the global Hudson configuration page.

2. Build Configuration:

To use the cmake builder in your Free-style project, just add “CMake Build” to your build steps. The configuration is pretty straight forward. You just have to set some basic directories and the build type.

cmakebuilder demo config
cmakebuilder demo config

The demo config above results in the following behavior (shell pseudocode):

if $WORKSPACE/build_dir does not exist
   mkdir $WORKSPACE/build_dir
end if

cd $WORKSPACE/build_dir
cmake $WORKSPACE/src -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$WORKSPACE/install_dir
make
make install

That’s it. Feedback is very much appreciated!!

Originally the plan was to have the plugin downloadable from the hudson plugins site by now but I still have some publishing problems to overcome. So if you are interested, make sure to check out the plugins site again in a few days. I will also post an update here as soon as the plugin can be downloaded.

Update: After fixing some maven settings I was finally able to publish the plugin. Check it out!

19 thoughts on “CMake Builder Plugin for Hudson”

  1. Great job! At work, we have been using Hudson for a long time. Recently, I am looking into CMake as well, and this plugin is really handy.

  2. Excellent, I’ve been using CMake for a couple of years now, and have been wanting to replace the cron + ctest + cdash CI combination I’m currently using, and have been looking at how I can make it work with Hudson.
    This looks like it’ll make an excellent first step towards that.
    I look forward to trying it out.

    1. @Stuart: Thanks for your comment. I haven’t been using ctest/cdash in a real-world project so far so your feedback will be very interesting for me. Make sure to let me know how the plugin could be improved in that regard.

    1. @pollux Su: You can download the plugin from the official hudson site. Just go to Downloads -> Plugins.

      Regarding your second question: You should be able to use the plugin for C projects, too, since CMake itself works well for C projects.

  3. Hi volkerkaiser,
    Would you like to post a blog to show me the entire CI process of implement a project written by C language. Especial unit test and cmake! Of course your cmake build plugin.:)
    Thanks

    1. @Joey Z: I’ve never done a pure C project which had a CI process and unit tests, but with regard to Hudson and the CMake Builder Plugin every thing should work as with C++. Maybe it’s possible for you to use a C++ unit testing framework to test your C code?

  4. Nice plug-in! I tested it on two projects and it works great. But I do have one request for the next version: is it possible to use the CMAKE_MAKE_PROGRAM variable to specify build tool instead of ‘make’. For instance MinGw uses mingw32-make.

    1. @Ole: Thanks for your feedback. That’s exactly the kind of requests I was hoping for since they will make the plugin applicable for more development environments. I will release a new version some time in the next few days.

  5. I too am excited to find this plugin! However I’m having problems with it deleting the workspace if cmake fails to run (in my case, because I gave it the wrong directory). Any idea what this might be about? Again thanks for your work!

  6. I am having problems with it tryng to create windows paths when connected to Unix nodes.

    e.g.
    Directory could not be created: C:\opt\Hudson\workspace when it should be trying to create /opt/Hudson/etc

  7. I’d also be interested to know: Which other Hudson plugins do you use for C++? I can’t find anything about C++ uses for Hudson on the net.

  8. Hello.
    Can you please change the order of arguments so they will correspond to the documentation:

    ====================
    cmake [options]
    ====================

    This means that the path to source should be at the end not at the beginning. And I have got an issue with this.

    When I try to define “Pre-load a script to populate the cache” using -C argument and execution fails with an error.

    P.S.
    —————-
    cmake.exe “./sourcePath” -C “./presetPath/preset.cmake” -G “Visual Studio 8 2005” -Wdev
    —————–
    fails. while
    —————-
    cmake.exe -C “./presetPath/preset.cmake” -G “Visual Studio 8 2005” -Wdev “./sourcePath”
    —————–
    succeedds.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.