[CMake] linking static vs dynamic

Dominik Szczerba dominik at itis.ethz.ch
Sat Feb 12 15:20:58 EST 2011


I never actually saw a solution to this problem in cmake:
I need to link (independent constraint from above) with libguide.a and
not libguide.so (in intel compiler, does not matter much), but both
are available, and cmake always takes the shared one when given
"guide" as the desired library to be linked.
Is there an elegant way of static linking (other than -static passed
to the linker for static linking of everything) of this particular lib
other than hacking (like deleting the .so from the folder)?
PS. This opens up a box of other related problems, like the
(independent) need to link some parts statically on exotic HPC
systems.
Many thanks,
Dominik


More information about the CMake mailing list