[cmake-developers] [PATCH 4/5] FindGLUT.cmake: Add imported targets and documentation
Philipp Moeller
bootsarehax at gmail.com
Tue Jun 24 10:06:44 EDT 2014
Brad King <brad.king at kitware.com> writes:
> On 06/10/2014 05:55 AM, Philipp Möller wrote:
>> The APPLE part works, but definitely could be improved upon.
> [snip]
>> + if(APPLE)
>> + # Using the hardcoded paths is certainly not the best thing to
>> + # do, but it is done the include path already.
>> + set_target_properties(GLUT::GLUT PROPERTIES
>> + IMPORTED_LOCATION "/System/Library/Frameworks/GLUT.framework/GLUT")
>> + if(NOT TARGET GLUT::Cocoa)
>> + add_library(GLUT::Cocoa UNKNOWN IMPORTED)
>> + set_target_properties(GLUT::Cocoa PROPERTIES
>> + IMPORTED_LOCATION "/System/Library/Frameworks/Cocoa.framework/Cocoa")
>> + endif()
>> + set_target_properties(GLUT::GLUT PROPERTIES
>> + INTERFACE_LINK_LIBRARIES GLUT::Cocoa)
>> + else()
>
> The path to the framework is hard-coded for the include path only
> as a possible search location, not as a result. The above code
> hard-codes it as a result. FindGLUT is one of the only modules
> left that hard-codes "-framework XYZ" as a result on OS X instead
> of allowing find_library to locate the framework. That needs to
> be fixed first, and then the framework path can be handled here
> the same way as it is in FindOpenGL.
I removed the -framework part and the code now checks if find_library
returned a path to a framework. I also removed the hard-coded path from
the find_library call so this now behaves like most other Find Modules.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FindGLUT-targets.patch
Type: text/x-diff
Size: 3475 bytes
Desc: fixed FindGLUT-targets.patch
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20140624/649168fc/attachment-0002.patch>
More information about the cmake-developers
mailing list