Kitware/CMake — Issue #13: Support `-iframeworks` for OSX, rather than `-F` (conditionally)
Author: leehambley
Created: 2012-01-16 20:46:29+00:00
State: open

Since OSX 10.7 linking, or even putting system frameworks in the search path yields hundreds of thousands of lines of deprecation warnings.

From the `OS X` `gcc` (Clang) documentation:

``` text
-Fdir
Add the framework directory dir to the head of the list of directories to be searched for header files. These directories are interleaved with those
specified by -I options and are scanned in a left-to-right order.

A framework directory is a directory with frameworks in it. A framework is a directory with a "Headers" and/or "PrivateHeaders" directory contained
directly in it that ends in ".framework". The name of a framework is the name of this directory excluding the ".framework". Headers associated with
the framework are found in one of those two directories, with "Headers" being searched first. A subframework is a framework directory that is in a
framework's "Frameworks" directory. Includes of subframework headers can only appear in a header of a framework that contains the subframework, or in
a sibling subframework header. Two subframeworks are siblings if they occur in the same framework. A subframework should not have the same name as a
framework, a warning will be issued if this is violated. Currently a subframework cannot have subframeworks, in the future, the mechanism may be
extended to support this. The standard frameworks can be found in "/System/Library/Frameworks" and "/Library/Frameworks". An example include looks
like "#include ", where Framework denotes the name of the framework and header.h is found in the "PrivateHeaders" or "Headers"
directory.

-iframeworkdir
Like -F except the directory is a treated as a system directory. The main effect is to not warn about constructs contained within header files found
via dir.
```

Without this, I haven't yet come up with a way to manually set the compiler options, and linker options in a way that works for me. That speaks to my inexperience with CMake, but it's perhaps something that is important to keep the tool usable. If someone would tell me what the correct options would be, I will take the time for format a patch to make something suitable.

If this is simply a reflection of my inexperience, perhaps this issue can be closed immediately, and someone would be kind enough to help me understand the workaround.