[CMake] Add a program object file to link

Tyler Roscoe tyler at cryptio.net
Tue Sep 29 10:55:38 EDT 2009


On Tue, Sep 29, 2009 at 09:16:31AM +0200, David wrote:
> I have a library which provides some static library (.a) and a program
> object file (.o).
> The .o is needed to compile the project which migrates from autotools to
> cmake but I don't know
> how adding properly this file into my CMakelist.
> My current solution is to add the file.o to CMAKE_C_FLAGS.
> For example :
> set(CMAKE_C_FLAGS "-g -Wall file.o")

Heh, nice hack.

I think you can just add the .o to the list of source files in your
add_library() or add_executable().

tyler


More information about the CMake mailing list