[CMake] How to emulate autotools "make check"?
Marcel Loose
loose at astron.nl
Fri Mar 20 09:59:35 EDT 2009
Perfect!
I now use add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}) and
that indeed solves the parallel build issue.
And yes, I have MAKEFLAGS set to "-j4".
Thanks,
Marcel
On Fri, 2009-03-20 at 13:44 +0100, Eric Noulard wrote:
> 2009/3/20 Marcel Loose <loose at astron.nl>:
> > Hi Erk,
> >
> > On Fri, 2009-03-20 at 10:06 +0100, Eric Noulard wrote:
> >> add_executable(t_hello t_ EXCLUDE_FROM_ALL hello.cpp)
> >>
> >> add_test(t_hello t_hello)
> >>
> >> add_custom_target(check
> >> COMMAND ${CMAKE_BUILD_TOOL} test
> >> DEPENDS t_hello)
> >
> > I stumbled upon a tiny problem with your solution:
> > make now complains with the following warning:
> > gmake[4]: warning: jobserver unavailable: using -j1. Add `+' to parent
> > make rule.
> >
> > I checked the generated file ./test/CMakeFiles/check.dir/build.make and
> > found the line that causes this warning:
> >
> > cd /export/home/loose/work/hello/build/test && /usr/bin/gmake test
> >
> > It is caused by the fact that make is called as /usr/bin/gmake, instead
> > of $(MAKE) which is recommended by the GNU Make manual. (See
> > http://www.gnu.org/software/automake/manual/make/Error-Messages.html and
> > http://www.gnu.org/software/automake/manual/make/MAKE-Variable.html#MAKE-Variable)
> >
> > I guess that /usr/bin/gmake has been put there as result of the
> > expansion of CMAKE_BUILD_TOOL. Would there be a workaround?
>
> I did never cross that one, are you using parallel build? (make -j<N> check)
>
> You may try to run "ctest" command instead "make test"
>
>
More information about the CMake
mailing list