[cmake-developers] IMPORTED targets for some Find modules

Brad King brad.king at kitware.com
Wed Jun 25 11:22:51 EDT 2014


On 06/25/2014 06:52 AM, Philipp Moeller wrote:
> That sounds like a good idea. Although I think that would make things
> very confusing: the IMPORTED_LOCATION would be the full path of the
> library, the INTERFACE_INCLUDE_DIRECTORIES would be the full path to the
> includes, but all of this is ignored as soon as -framework is used and
> the full path to the framework isn't specified (as far as my
> understanding of OSX goes).
> 
> Maybe it would make sense to add a FRAMEWORK library type and a
> find_framework command to encapsulate all this. It would make writing
> those imports a lot smoother as well.

Ideally find_library would just find the "foo.framework/foo"
library file inside a framework so that the IMPORTED_LOCATION
could be set without constructing that manually.  However, we
have to be compatible with current behavior so that would at
least need to be an option to find_library.  I do not think
a separate find_framework is necessary.

Once the full path to a framework library file inside the
framework directory is known then CMake should pass that to
the linker by full path too instead of using "-framework foo".

-Brad




More information about the cmake-developers mailing list