Add a program object file to link

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Add a program object file to link

David-39
Hello,

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")

But I hope there is a better solution.
Of course, I have'nt the file needed to generate this file.o.

Any advices?

Thank you

David

---------
cmake 2.6.4
gcc 4
---------




_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Add a program object file to link

Tyler Roscoe
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
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake