[CMake] Adding new language.

Michael Hertling mhertling at online.de
Thu Mar 17 19:16:50 EDT 2011


On 03/15/2011 06:30 PM, arrowdodger wrote:
> On Tue, Mar 15, 2011 at 12:20 PM, Michael Wild <themiwi at gmail.com> wrote:
> 
>> Just one warning: AFAIK these rule variables are only used for
>> Makefile-based generators, *NOT* for Xcode and VisualStudio and the
>> like. I'd prefer the route via add_custom_command/add_custom_target...
>>
>> Michael
>>
> 
> Oh, great, then i should abandon what i've written. So, since adding new
> language involves creating rule variables, this too works only with
> Makefile's?

Yes, probably; I've just tried with Visual Studio 8, and it's actually
not impressed by a modified CMAKE_C_COMPILE_OBJECT rule variable. BTW,
this should be mentioned in the documentation and the Wiki.

Anyway, perhaps, there is another alternative for your concern: If
you achieve to sufficiently isolate your project's bytecode-related
part - logically w.r.t. target interdependencies and organisationally
w.r.t. to the directory structure - you might configure that part as an
external project for a Makefile generator explicitly. In this way, you
could use a non-Makefile generator for your overall project while the
bytecode part is built by Make, so you've CMAKE_C_COMPILE_OBJECT, the
RULE_LAUNCH properties etc. available. If the bytecode part comprises
more than a few files, possibly with non-trivial relations among one
another, this may be more appropriate than trying "by hand" with
custom commands and custom targets.

Regards,

Michael


More information about the CMake mailing list