[CMake] newbie question - what targets are supported?

Doug Reiland dreiland at gmail.com
Fri May 28 06:03:07 EDT 2010


Thanks. I did mean rules. The module-list is what I was after. I did piece 
together a macro for my gperf files using add_custom_command() last night 
and is working fine. But I want to make sure I am not reinventing the wheel 
here cause I am betting folks coming from make/linux world have hit the same 
things I have.

moving along slowly, it is taking longer than I thought to do this cmake 
porting test, but...

--------------------------------------------------
From: "Michael Hertling" <mhertling at online.de>
Sent: Thursday, May 27, 2010 10:16 PM
To: <cmake at cmake.org>
Subject: Re: [CMake] newbie question - what targets are supported?

> On 05/28/2010 12:14 AM, Doug Reiland wrote:
>> okay, I have ordered the book. But, in the meantime.
>>
>> I am continuing to port a large library from in-house build to cmake
>> for evaluation.
>> What builtin targets are supported?
>
> On *nix, run CMake on a directory with an empty CMakeLists.txt, then
> invoke "make help" and you'll see the targets provided a priori - or
> did you rather mean "rules" instead of "targets"?
>
>> I got lex, gperf, and other kinds of stuff.
>>
>> A (pseudo code) didn't work:
>> add_library(foo *.c *.gpref)
>
> ADD_LIBRARY() et al. process source files for languages known to CMake,
> primarily C and C++, but other files may be specified for dependency
> tracking. To process a gperf input file, e.g., use a custom command:
>
> ADD_CUSTOM_COMMAND(
>    OUTPUT xyz.c
>    COMMAND gperf xyz.gperf > xyz.c
>    DEPENDS xyz.gperf
> )
>
> The OUTPUT file can be specified in ADD_LIBRARY(foo ... xyz.c ...),
> which results in the custom command being run when xyz.c is needed for
> foo, but out of date. For lex and other input not intimately known to
> CMake, the procedure is usually quite the same. If you have many such
> files to process consider to write a function for automatization:
>
> <http://www.cmake.org/pipermail/cmake/2010-May/036955.html>
>
> Regards,
>
> Michael
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
> 


More information about the CMake mailing list