[CMake] a question about archiving libraries

Eric Noulard eric.noulard at gmail.com
Thu Feb 3 02:12:26 EST 2011


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


More information about the CMake mailing list