James Turner | 20 Jun 2012 15:42
Picon

Xcode generation, transformation of framework includes to -F

I've encountered a problem with OSX framework detection, I think exposed due to updating to Xcode 4.3.3
(was previously using 4.3.2), though I'm sure the real issue is actually in my cmake-files.

It appears that /Library/Frameworks is no longer searched by default (this makes sense for better SDK
support), but the code in the XCode project generator to transform include paths to framework search
paths isn't being invoked due to how I'm detecting the paths (i.e logic starting around line 1928 of cmGlobalXCodeGenerator)

I have a custom framework /Library/Frameworks/ALUT.framework, and a FindALUT.cmake module which is
very similar to other equivalents (eg, FindOpenAL.cmake from the official distribution). The include
path is being detected as '/Library/Frameworks/ALUT.framework/Headers', which is why the include
isn't being transformed to a framework search path - 'cmSystemTools::IsPathToFramework' is only
considering paths which /end/ in .framework.

My guess is this all worked before because XCode automatically searched /Library/Frameworks, hiding the
issue. If I edit the project search paths in XCode manually to include /Library/Frameworks, I can compile
as before.

I think my bug is in my FindALUT.cmake module, in that the detected include path ends in Headers/ - the
relevant fragment is below:

========

FIND_PATH(ALUT_INCLUDE_DIR alut.h
  HINTS
  $ENV{ALUTDIR}
  PATH_SUFFIXES include/AL include/ALUT include
  PATHS
  ~/Library/Frameworks
  /Library/Frameworks
  /usr/local
(Continue reading)


Gmane