[CMake] multiple languages with single target

Bill Hoffman bill.hoffman at kitware.com
Thu Oct 1 08:53:02 EDT 2009


Chris Roberts wrote:
> Hello,
> 
> I am trying to implement support for a new language compiler but I'm
> having difficulty with link phase.
> The problem is that I need to split the link step into two different
> commands and filter the objects that are sent to each linker.
> 
> 
> Currently cmake is generating a command like:
> 
> c++ -o MyTarget object1.o object2.o object3.mylang
> 
> or if I change the LINK_PREFERENCE:
> 
> myld -o MyTarget object1.o object2.o object3.mylang
> 
> 
> 
> I would like to be able to have it generate something like:
> 
> c++ -o MyTarget object1.o object2.o && myld -o MyTarget object3.mylang
> 

I think what you want is a POST_BUILD add_custom_command.

-Bill


More information about the CMake mailing list