1

I'm trying to add /usr/local/lib to the Xcode library search paths when I generate the Xcode files through CMake but I can't get CMake to add it.

Would any of you know how?

link_directories(/usr/local/lib) doesn't work.

cromod
  • 1,721
  • 13
  • 26
  • `... but I can't get CMake to add it.` - Why do you think that CMake doesn't add it? Show the code which uses that. – Tsyvarev Apr 17 '16 at 22:48
  • It doesn't add it to Xcode. I have to manually add it to Xcode after it generates the Xcode build files. Cause XCode complains about it. So I have to add that line to the "Library Search Paths" manually in XCode. – Matthew French Apr 18 '16 at 00:11
  • I can add a header search path through cmake but not a library search path: http://imgur.com/NqwPa05 – Matthew French Apr 18 '16 at 00:25
  • 1
    Just a guess: You issue `link_directories` command **after** `add_executable`. In that case your executable doesn't get additional directories for search libraries. See [that question](http://stackoverflow.com/questions/33992880/cmakes-link-directories-issue-with-static-library-on-mac-os-x) for more details. – Tsyvarev Apr 18 '16 at 07:18

0 Answers0