[osg-users] [build] OSG Build Error on Mac OSX with XCode 7 and CMake 3.4 (or greater)

Robert Osfield robert.osfield at gmail.com
Mon Jul 18 00:42:00 PDT 2016


Hi Ravi,

The OSX build support in the OSG has evolved over the year as has
CMake, but on the OSG side we've been in largely in maintenance mode
w.r.t our CMake build system i.e. we've tinkered with it to keep
things building.

On the OSX side I can't personally pitch in as I don't have an Mac and
don't have the OSX expertise to guide development, this means I have
to rely upon the community to do the testing and guide developments on
the OSX side.  Unfortunately Mac's are a lesser used platform so the
pool of developers that can pitch in is smaller so the likelyhood of a
break as the platforms evolve is higher.  This does mean OSX users
need to be more active relative to the wider OSG community to keep
things working, so I welcome yourself and others ptiching in.

With OSG-3.6 looming getting things sorted on all platforms is
crucial, if they are changes we need to make on the OSX side then I'm
open to suggestion/merging changes as required.

On thing I raised a couple of months back was the prospect of
increasing the minimum CMake version to 2.8.  This may help things on
the OSX side.

Robert.

Robert.



On 18 July 2016 at 07:17, Ravi Mathur <ravidavi at utexas.edu> wrote:
> Hi all,
>
> I'm surprised nobody has seen this yet, but OSG does not build on OSX when using XCode 7 and CMake 3.4+. Specifically, the Configure step can be run once, but cannot ever be run again unless the CMake cache is deleted. The error through by CMake is the infamous:
>
> Code:
> CMAKE_OSX_DEPLOYMENT_TARGET is '10.10' but CMAKE_OSX_SYSROOT:
>    ""
>   is not set to a MacOSX SDK with a recognized version.  Either set
>   CMAKE_OSX_SYSROOT to a valid SDK or set CMAKE_OSX_DEPLOYMENT_TARGET to
>   empty.
>
>
>
> After hours of debugging, I found that this error only happens on CMake 3.4 and onward, which led me to see what changed in in that version. Basically, the OS initialization phase of CMake has changed how it uses the CMAKE_OSX_ARCHITECTURES variable, which according to CMake documentation (https://cmake.org/cmake/help/v3.5/variable/CMAKE_OSX_ARCHITECTURES.html) should be set before the first call to PROJECT(). In OSG's CMakeLists.txt file, that variable is set waaaay down in line 1114:
>
> Code:
> SET(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architectures for OSX" FORCE)
>
>
>
> So the fact that this ever worked was just good fortune, but it seems our luck has run out. Commenting out that line, or equivalently removing the FORCE flag, fixes the Configure-stage error for all versions of CMake.
>
> Any thoughts on this? I think if CMAKE_OSX_ARCHITECTURES must be set in OSG, it should really be set before the first call to PROJECT. If we no longer have an OSX maintainer, then I can take a crack at coming up with a solution.
>
> Thanks,
> Ravi
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=68155#68155
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



More information about the osg-users mailing list