macOS: /usr/local/include not a system include directory under CMake
It appears that when clang is invoked through CMake, the system includes are missing. Here is the minimal project that I used to replicate the behavior: cmake-include-fail.zip
Method: I started with a completely fresh install of MacOS 10.14.3. I downloaded and installed CMake 3.14.1 from source. I then installed brew per their instructions:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Next I installed nlopt via brew:
brew install nlopt
When I use my hand-rolled Makefile to build the project, /usr/local/include is correctly added to the include path make-success.log. When using the CMake generated Makefiles, /usr/local/include is dropped from the include path cmake-fail.log.