On Mar 13, 2016, at 8:27 PM, Edwin Groothuis <edwin.groothuis@xxxxxxxxxxxx> wrote:
> I got it. Invoking cmake as:
>
> $ cmake -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/ .
>
> does do it cleanly. Also for PCAP. Also for ZLib.
Yes, those are all system-supplied libraries, at least in the "runtime" sense. (For Linux people, think packages such as "libm", "libpcap", "zlib" or "libz", or whatever they're called on your distribution.)
The *header files*, however, are supplied as part of either Xcode or the command-line development tools. (For Linux people, think the "XXX-dev" package corresponding to the "XXX" package, or whatever convention your distribution uses. For Windows, I guess think "SDK" or whatever it's called.)
If you only install the Shiny GUI IDE Xcode, you don't get /usr/include. You *do* get command-line tools, but they're buried inside the Xcode application bundle, just as the headers are.
If you install the "command-line (development) tools", you get separate copies of the headers, command-line tools, etc., in the usual UN*X places.
You can install both. I sincerely hope that Apple manages to keep them in sync with updates to Xcode and the command-line tools.
It Would Be Nice if CMake were to make an effort to provide a nice way to, on OS X, look in "the appropriate places" without requiring that you tell it where to look. Perhaps we're all missing the right magical way to do that.