[CMake] Linking an object file

Brad King brad.king at kitware.com
Tue Aug 16 10:20:36 EDT 2005


dohadwala, moiz wrote:
> Is there any way to directly include an object file directly into a 
> library created by cmake? I am using a third party software which is 
> distributed as static/shared libs and as some standalone .o files. I 
> need to link them all in my executable.

Just list it as a source file and it will be linked in automatically:

ADD_EXECUTABLE(my_exe my_main.c their_obj.o)

It is up to you to make sure the object file is link-compatible with the 
rest of your program.

-Brad


More information about the CMake mailing list