Hi Mathias, Mathias Fröhlich schrieb:
> On Friday 29 May 2009, Stephan Maximilian Huber wrote: >> I am facing a problem with atomic operations and CMake and OS X. If I >> configure CMake to compile against the 10.4 SDK I'll get compile errors >> in OpenThreads/Atomic.cpp, because CMake decided to use >> _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC which is only valid when compiling >> against the 10.5 SDK. The cmake-test succeeds because I am on a >> 10.5-system, but I want to compile osg against 10.4 so the libs are >> usable there too. > That means that the test for the BSD features is not complete! > At the time I did that initial patch, the configure test included all > functions we really need. At a later time there were some additional > functions added, but the test was not extended as far as I see. > So we might change the cmake test code to something that really tests what is > required. Then you would get the mutex fallback. I think the test is ok (it fails on 10.4 correctly, for 10.4 there are IMHO No atomic operators), but for my scenario (compiling on 10.5 for 10.4-target) brings up this error, because the test picks the system headers and not the headers defined for the target SDK. ( the sdk-setting specifies prefix-path for all include-paths, so you can compile your sources for different os-versions) > Anyway, is there any chance to back port the current code that to the 10.4 > sdk, so that you get that atomic stuff? > With the atomic operations osg is noticable faster. > >> To rephrase: This is only a problem, when I am on a 10.5 system, and I >> want to compile against the 10.4 sdk. On a 10.4 system, the CMake-test >> will fail. >> >> So is there a way to force this setting via CMake? Or use the chosen SDK >> when compiling the atomic-test? I tried some stuff, but didn't succeed. > Currently not. > >> (I can edit Openthreads/Config per hand, but it seems errorprone) > Then you need to make sure that cmake does not rewrite that file. If I set the readonly-flag for Openthreads/include/Config, CMake will throw an error :( I'll try the patch from Alberto, Thanks again, Stephan _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org