[CMake] Linking with -l and -L flags

Brad King brad.king at kitware.com
Fri Jan 13 21:01:44 EST 2006


William A. Hoffman wrote:
> At 07:29 PM 1/13/2006, William A. Hoffman wrote:
>>This may be the flag we are looking for:
>>
>>      -search_paths_first
>>             By  default  when  the  -dynamic  flag is in effect, the -lx and
>>             -weak-lx  options  first  search  for  a  file   of   the   form
>>             `libx.dylib'  in each directory in the library search path, then
>>             a file of the form `libx.a'  is  searched  for  in  the  library
>>             search  paths.   This  option  changes  it  so that in each path
>>             `libx.dylib' is searched for then `libx.a' before the next  path
>>             in the library search path is searched.
>>
>>So, -Wl,-search_paths_first.
> 
> I just verified this works:
>  c++ junk.o -ltcl -L. -Wl,-search_paths_first

In that case is there any reason not to just always pass this flag on 
the Mac to make it consistent with all other platforms?  How does it 
interact with frameworks?

-Brad


More information about the CMake mailing list