[CMake] Add external static libraries / ar-archives to a build.

Martin Köhler martin.pleissa at web.de
Tue Oct 21 04:06:19 EDT 2008


Hi, 
I'm working on a library to solve sparse linear systems. All basic vector operations are realized by using the BLAS. The FindBLAS works fine but most of the blas implementations are provided as an ar-archive somewhere in the filesystem ( we use a standard blas, ATLAS, GotoBlas or malefactor specific variants). Is it possible to pass the wanted libblas.a as a parameter to cmake and add it to a target? 
For example when I want to use  the GotoBLAS  I want to call cmake this way:
 cmake -DBLAS=/path/to/lib/libgoto.a PATH_TO_SOURCE 

If I link the lib manually I enter
gcc -o output myfile.c /path/to/lib/libgoto.a

Is there an easy way to do so in cmake? The static linking is necessary because programs based on this library are executed on an MPI-Cluster and working with dynamic libraries is more than buggy.

regards, 

Martin





____________________________________________________________________
Psssst! Schon vom neuen WEB.DE MultiMessenger gehört? 
Der kann`s mit allen: http://www.produkte.web.de/messenger/?did=3123



More information about the CMake mailing list