[CMake] help with learning add_library

luxInteg lux-integ at btconnect.com
Sat Nov 6 17:57:45 EDT 2010


On Saturday 06 November 2010 16:27:06 Gerhard Gappmeier wrote:
> Hi
> 
> this three lines should do the job:
> 
> CMakeLists.txt:
> project(learnCMAKE)
> add_definitions(-DXXX -DYYY -DSAMPLE=5)
> add_library(learnCMAKE file1.c file2.c)
> 
> To build static libraries:
> mkdir bldStatic
> cd bldStatic
> cmake -DBUILD_SHARED_LIBS=off -DCMAKE_BUILD_TYPE=Release ..
> make
> cd ,,
> 
> To build shared libraries:
> mkdir bldDynamic
> cd bldDynamic
> cmake -DBUILD_SHARED_LIBS=on -DCMAKE_BUILD_TYPE=Release ..
> make
> cd ..
>

Thanks a lot but I am really looking for a way to do both static-lib and 
shared-lib at once. If this is the most reliable way to do it advice on 
incorporating your suggestion  in some kind  of loop would be appreciated.  
AND by the way   what does -DSAMPLE=5 signify?


sincerely
luxINTEG




More information about the CMake mailing list