[CMake] Linking with -l and -L flags

James Bigler bigler at cs.utah.edu
Thu Jan 12 16:36:00 EST 2006


>> I'm not sure, but the problem seems to be that the linker is favoring
>> shared object libraries over static libraries regardless of the order of
>> the -L paths.  Thus, if I want to link in my static Tcl library the
>> linker never chooses it.

For our project we had to set BUILD_SHARED_LIBS to OFF or ON depending on what 
we wanted.

SET(BUILD_SHARED_LIBS ON)

This will add different arguments to linker.  For gcc -shared or -static will 
tell gcc to give preference to shared or static libraries.

James


More information about the CMake mailing list