[CMake] problem with frameworks on OS X (and new Makefile generator)

Brad King brad.king at kitware.com
Tue May 3 10:51:56 EDT 2005


Alexander Neundorf wrote:
> until recently a line like  
> TARGET_LINK_LIBRARIES(foo -framework myframework)  
>   
> produced a command like  
> gcc foo.o -o foo -framework myframework  
>   
> Since I updated cmake (to the new Makefile generator) I get the  
> following:  
>   
> gcc foo.o -o foo -framework -lmyframework  
>   
> i.e. the parameter to framework is interpreted as a normal library.  
> I changed my CMakeLists.txt like this:  
> TARGET_LINK_LIBRARIES(foo "-framework myframework")  
> then it works again.
> Is this the intended behaviour?

This must have been working only in some CVS version and it was never 
intended to work.  The 2.0 releases do not support this.

 > What's the recommended way to link to a framework ?

The double-quoted version is correct because it is a single library so 
it should be a single argument to TARGET_LINK_LIBRARIES.

-Brad


More information about the CMake mailing list