[cmake-developers] [PATCH] Tell CTest about Apache Maven warnings

Rolf Eike Beer eike at sf-mail.de
Fri Mar 18 04:51:44 EDT 2011


Hi,

we had a lot of fun debugging our nightly builds in the last couple of days. 
Part of our build process are some programs that get build using Apache Maven 
and are used to generate other files later on. It's something like this:

ADD_CUSTOM_COMMAND(
	OUTPUT ${artifact}
	DEPENDS ${sources}
	WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
	COMMAND ${MAVEN_EXECUTABLE} --quiet install
	COMMENT "Building Java artifacts using Apache Maven..."
	VERBATIM
)
ADD_CUSTOM_TARGET(${target} ALL DEPENDS ${artifact})

And then some other ADD_CUSTOM_COMMANDS that depend on ${target}. When this 
was run on any of our desktops it worked fine, when we log in to the build 
machines it works fine, but when it runs with cron it doesn't work (not even 
on the Windows hosts). Since the first errors we got in CDash log were those 
of the target files that could not be generated because the maven output was 
missing we suspected some sort of dependency problem. It took us a while to 
find out that the dependencies were fine and Maven really wrote out some 
errors but CTest just didn't catch them. At the end it was just JAVA_HOME 
environment not being set when running with cron (easily fixed by "source 
/etc/profile" in the nightly script).

To prevent other people wasting their time hunting bugs that are simply not 
there: here is a small patch that tells CTest to detect Mavens error and 
warning messages.

Eike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-CTest-catch-warning-output-of-Apache-Maven.patch
Type: text/x-patch
Size: 1546 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20110318/c2ec74e3/attachment-0002.bin>


More information about the cmake-developers mailing list