[CMake] a question about archiving libraries

mina adel elecengineer_mina at yahoo.com
Thu Feb 3 20:44:40 EST 2011


Hi,
Thank you so much for your reply.

About archiving the libraries, can I use "ar" with "custom_command()" to archive 
the three libraries into one big library.?

Thank you in advance
Mina




________________________________
From: Eric Noulard <eric.noulard at gmail.com>
To: mina adel <elecengineer_mina at yahoo.com>
Cc: cmake at cmake.org
Sent: Thu, February 3, 2011 2:12:26 AM
Subject: Re: [CMake] a question about archiving libraries

2011/2/3 mina adel <elecengineer_mina at yahoo.com>:
>
>
> Hi All
>
> In my code I use an available libraries (amd btf colamd)
>
> In order to compile those using cmake I use add_custom_command() to "cd"
> into each folder and then run "make" for each library.

You should have a look at:
ExternalProject_Add from the ExternalProject CMake module.

> Now each library will have a lib file compiled, for example "Lib/libamd.a "
>
> Now, I want to take all the made libraries from the three folders (amd btf
> colamd), and make one big library (libsparse.a).
>
> How I can do this using cmake?

You don't, at least not 'out of the box' with CMake.
If you know how to do that by "hand" then you can craft a custom
commande to do it.

You are looking for something like "Convenience library" which are not
supported by CMake:
http://www.cmake.org/Wiki/CMake_FAQ#Does_CMake_support_.22convenience.22_libraries.3F


Now if your 3 libs (amd btf colamd) are "just" a set of file to compile
then may be creating a add_library CMake rule which is the collation
of all sources
in there may be a solution.



-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110203/3b04a955/attachment.htm>


More information about the CMake mailing list