[Cmake] Control of order and libs

Bill Hoffman bill.hoffman at kitware.com
Fri Oct 18 11:14:21 EDT 2002


At 03:31 PM 10/18/2002 +0100, David Mellor wrote:
>I have a couple of questions on controlling library handling, under Linux
>CMAKE.
>
>1. How do I include a library inside another library? I am created library A
>which must use libraries B and C. If A is a shared library then that will
>force B and C to be housed inside A. For static .a libraries though CMake
>prefers to pile them all on to the final binary executable.
It would be something like this:

ADD_LIBRARY(B STATIC ${B_SRCS})
ADD_LIBRARY(C STATIC ${C_SRCS})
ADD_LIBRARY(A SHARED ${A_SRCS})
TARGET_LINK_LIBRARIES(A B C)

>I need to produce a library that internally holds all of the other libraries
>that it needs.
>
>2. Also, CMake pulls in the libraries in alphabetical order rather than in
>the order specified in the CMakeLists.txt. Since some families of libraries
>must be pulled in in a specific order, this is a problem.

CMake should not put the libraries in alphabetical order.

>I may have to resort to compiling some of the software with a man made
>makefile.
>Any ideas would be much appreciated,
>
>David
>
>
>
>_______________________________________________
>Cmake mailing list
>Cmake at public.kitware.com
>http://public.kitware.com/mailman/listinfo/cmake 





More information about the CMake mailing list