[CMake] CMake generates “-L/usr/local/lib” on Mac OSX

Oleg Zhylin ovz at yahoo.com
Mon Aug 24 15:15:00 EDT 2015


Gonzalo,
Could you please elaborate, where should I check it? Will CMake indeed generate -L/usr/local/lib argument for the linker if it sees something in LD_LIBRARY_PATH?
Do you have any insight why other flags (-arch, -isysroot) get generated in one environment, but not the other?     
 WBR Oleg Zhylin ovz at yahoo.com 


     On Sunday, August 23, 2015 8:10 PM, Oleg Zhylin <ovz at yahoo.com> wrote:
   

 I have a CMake C++ dylib project that builds correctly in one MacOS X environment but fails in another. Environments are on the same machine, but under different users. I'm seeking help how to do I troubleshoot where the failure in the second one comes from.What I managed to figure out is that in failing configuration CMake adds the following flags in link.txt (the commands used to link the executable)-arch x86_64

-isysroot  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk

-mmacosx-version-min=10.6

-L/usr/local/lib
The last one causes havoc as it makes ld pick up dependencies from /usr/local/lib instead of link directories I configured in CMake.I would appreciate any insight what triggers generating the flags above and what is the best way to squelch them, especially -L/usr/local/lib? WBR Oleg Zhylin ovz at yahoo.com

  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150824/fd447c7e/attachment.html>


More information about the CMake mailing list