[Cmake] Specifying static or dynamic linking of external libraries?

Bill Hoffman bill.hoffman at kitware.com
Wed Oct 23 15:21:19 EDT 2002


At 10:12 AM 10/23/2002 -0700, Thomas Deschamps wrote:
>Bill,
>
>I now remember when I was using this command INCLUDE (${CMAKE_ROOT}/Modules/FindVTK.cmake). Thank you for the tip.
>It works nicely, but there are still two problems:
>1) Not very important: we still need to directly provide the full name /usr/local/libvtkIO.a instead of vtkIO, otherwise the link is made against shared lib, and both libraries types co-exist.

For this, I would create a static build tree for VTK, and choose that one when you run cmake.
This will cause it to use the static version of VTK.  If you use the full path, you will have
to get the order correctly yourself, and add additional libraries.

>2) I cannot configure anymore the compilation (CC,CXX, any flag, etc...) even whith cmake -i, or ccmake. Everything is taken from UseVTK.cmake and no more accessible via the command line interactive cmake. It just ask me wether I want to use built or installed version of VTK.

This is to prevent mixed compile flags, some compilers do not support separate flags.
You can override this in the CMakeLists.txt file with a SET, you just can
not change the cache.  

>But if I want to use different compiling options than the one used for VTK?
>Is there a mechanism to modify it through cmake -i? Or should I include it in the CMakeList.txt?
>
>Thomas





More information about the CMake mailing list