[CMake] custom target (kernel modules)

Peter Visser pervulgo at gmail.com
Thu Jun 28 16:49:42 EDT 2007


Hi,

could you post the working example? I'm doing something similar but I'm
doing it wrong, the add_custom_command is always being build in my case.

Thanks in advance,

Peter.

On 6/28/07, Alexandru Ciobanu <aciobanu at matrox.com> wrote:
>
> Thanks Alan, it works.
> =)
>
> Alan W. Irwin wrote:
> > On 2007-06-28 10:08-0400 Alexandru Ciobanu wrote:
> >
> >> Hi!
> >>
> >> I am trying to build kernel modules with CMake. To do that I
> >> use the command below:
> >>
> >>  add_custom_target ( manager.ko ${kbuild_cmd}
> >>     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/linux
> >>     DEPENDS ${src} linux/Kbuild
> >>  )
> >>
> >> The problem is that nobody depends on this custom target and so it is
> >> never build when running make.
> >>
> >> If I use the ALL parameter in add_custom_target() it will always
> >> rebuild it,
> >> even if none of source files has changes.
> >>
> >> So how do I make this work so that it builds when I run make but also
> >> builds only when necessary, like any other target add_library(),
> >> add_executable(), etc. ?
> >
> > Use ADD_CUSTOM_COMMAND instead with an empty (COMMANDless)
> > ADD_CUSTOM_TARGET
> > with the ALL parameter that-file depends on the custom command.
> >
> > Alan
> > __________________________
> > Alan W. Irwin
> >
> > Astronomical research affiliation with Department of Physics and
> > Astronomy,
> > University of Victoria (astrowww.phys.uvic.ca).
> >
> > Programming affiliations with the FreeEOS equation-of-state
> > implementation
> > for stellar interiors (freeeos.sf.net); PLplot scientific plotting
> > software
> > package (plplot.org); the libLASi project (unifont.org/lasi); the
> > Loads of
> > Linux Links project (loll.sf.net); and the Linux Brochure Project
> > (lbproject.sf.net).
> > __________________________
> >
> > Linux-powered Science
> > __________________________
> >
> >
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20070628/f6a2dac8/attachment.htm


More information about the CMake mailing list