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

Bill Hoffman bill.hoffman at kitware.com
Sat May 26 22:51:24 EDT 2007


Trevor Kellaway wrote:
>
> Hi,
>
> Does anyone know how to add an explicit reference to a pre-existing 
> object file (no related source file) to the link?
>
> I've tried:
>
> ADD_EXECUTABLE(myapp mysrc1.c mysrc2. myexisiting.o)
>
> If I perform the above CMake complains it doesn’t know how to build 
> myexisiting.o.
>
> FYI, my myexisiting.o is an embedded compiler's startup code that is 
> delivered as a pre-built object.
>
> - TrevK
>
What version of CMake are you using? The above should work.

-Bill



More information about the CMake mailing list