[CMake] Support for frameworks in OS X?

Bill Hoffman bill.hoffman at kitware.com
Wed Apr 16 16:09:38 EDT 2008


Convey Christian J NPRI wrote:
> I guess this is as much an OS X question as a CMake question...
> 
> I'm new to OS X programming, but I'm porting a CMake-based Linux project to also work on OS X.  It generally builds fine, except for the project's OpenGL programs.  The compiler isn't finding gl.h, despite there being several installed frameworks that have gl.h.
> 
> Does anyone know, when using CMake on OS X, what one does to tell tell the compiler which framework(s) to use when searching for header files?
> 
> For example, am I supposed to just manually call INCLUDE_DIRECTORIES, such as:
>    INCLUDE_DIRECTORIES(/Developer/SDKs/MacOSX10.4u.sdk/....../A/Headers)
> 
> Or is there something more along the lines of:
>    SET(CMAKE_CXX_FLAGS "-g -framework OpenGL")
> or
>    SET(OSX_FRAMEWORKS AGL OpenGL)
> that lets the compiler know in which directories to look for files like gl.h?
> 
If you put the path to a framework in either an include_directories 
command or a link command then cmake will add the correct -F -f stuff.

-Bill


More information about the CMake mailing list