[CMake] Linking on OSX

Guy Harris guy at alum.mit.edu
Tue Jun 4 16:24:24 EDT 2019


On Jun 3, 2019, at 3:27 PM, Juan E. Sanchez <juan.e.sanchez at gmail.com> wrote:

> It looks like macOS made it so you have to do something like this:
> open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
> 
> for libraries and includes to be put into /usr.

*Libraries* should exist in /usr/lib regardless of whether you do that, or even whether you have Xcode, or the command-line developer tools, installed - if you don't have the shared libraries in /usr/lib, programs using the libraries won't work, and programs shipped with macOS use, at minimum, libSystem, and may use other libraries.  vi, for example, uses the ncurses library.

It's the *headers* that aren't installed in /usr/include by default.  The compiler *should* look in the directory where they're installed, however.

Note that macOS 10.15 Catalina apparently has a separate read-only volume that contains all the executables and libraries, and presumably including /usr, so it may be *impossible* to arrange, on 10.15, that there be a /usr/include directory.


More information about the CMake mailing list