c2ae14f94d
IF(${CMAKE_OSX_SYSROOT} STREQUAL "/Developer/SDKs/MacOSX10.7.sdk") ... ELSEIF(${CMAKE_OSX_SYSROOT} STREQUAL "/Developer/SDKs/MacOSX10.5.sdk" OR ${CMAKE_OSX_SYSROOT} STREQUAL "/Developer/SDKs/MacOSX10.6.sdk") ... ELSEIF(EXISTS /Developer/SDKs/MacOSX10.4u.sdk) ... ELSE() ... ENDIF() Which is fragile because XCode could be installed into another directory than /Developer. (In case XCode is not installed into the /Developer directory CMake can automatically resolve the path via command line utility ${CMAKE_XCODE_SELECT} --print-path) This issue bites me currently because the latest XCode (Version 4.3.1 - 4E1019) installed through the Mac App Store is per default installed in "/Applications/Xcode.app/Contents/Developer" and hence the 10.7 SDK in "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk" Searching the web to find the proper way to determine the version of the Platform SDK programmatically, I found no standard way. I came up with 2 options myself: 1) Parse the path string to extract the version number 2) Read a value from the SDKSettings.plist found in the root of each SDK (e.g., "defaults read ${CMAKE_OSX_ROOT}/SDKSettings.plist CanonicalName" gives "macosx10.7") I implemented the last option and verified that at least the following Mac OS SDKs (10.3.9, 10.4, 10.5, 10.6, 10.7) support this method. It also looks reasonably future proof. An additional benefit of this method is that it also seems to be compatible with iOS and iOS Simulator SDKs (at least for version 5.1, but I assume this also applies to older versions). This is interesting because the CMake infrastructure to build OSG for iOS currently still contains similar hard-coded paths and even requires you to manually change the cmake file to build for another iOS SDK version. In the near future I hope to address these issues, but I haven't been able to try this yet." |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
CompositeViewer.cpp | ||
DarwinUtils.h | ||
DarwinUtils.mm | ||
GraphicsWindow.cpp | ||
GraphicsWindowCarbon.cpp | ||
GraphicsWindowCocoa.mm | ||
GraphicsWindowIOS.mm | ||
GraphicsWindowWin32.cpp | ||
GraphicsWindowX11.cpp | ||
HelpHandler.cpp | ||
IOSUtils.h | ||
IOSUtils.mm | ||
PixelBufferCarbon.cpp | ||
PixelBufferCocoa.mm | ||
PixelBufferWin32.cpp | ||
PixelBufferX11.cpp | ||
Renderer.cpp | ||
Scene.cpp | ||
ScreenCaptureHandler.cpp | ||
StatsHandler.cpp | ||
Version.cpp | ||
View.cpp | ||
Viewer.cpp | ||
ViewerBase.cpp | ||
ViewerEventHandlers.cpp |