[CMake] Add pre-existing object file to linker line?

Trevor Kellaway tkellaway at asl-electronics.co.uk
Sun May 27 13:47:09 EDT 2007


Bill,

> You want to create your own rules for CMAKE_(LANG)_COMPILE_OBJECT:
> 
> SET(CMAKE_C_COMPILE_OBJECT
>     "<CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE} 
> ${CMAKE_CL_NOLOGO} <FLAGS> /Fo<OBJECT> /Fd<TARGET_PDB>  -c 
> <SOURCE>${CMAKE_END_TEMP_FILE}")
> 
> Each new line in this is a separate command.   You should 
> just be able 
> to append the lint stuff to end end of the existing rule variable.
> 
> Something like this:
> 
> set(CMAKE_C_COMPILE_OBJECT "${CMAKE_C_COMPILE_OBJECT\} lint <OBJECT>")

How does CMake know where one command finishes and the next starts? 

You say "each new line" but surely "lint <OBJECT>" above will just be
treated as extra arguments to the compiler? Or was you example across
multiple lines and the email merged them?

 - TrevK


More information about the CMake mailing list