Hi Jim, On Tue, Mar 23, 2010 at 6:19 PM, Jim Brooks <[email protected]> wrote: >>Something else that is confusing CMake? Perhaps a Cmake bug? Which >>version of CMake are you using? > > > What is happening is that BSD splits POSIX pthreads into > standard and non-standard headers: > > -r--r--r-- 1 root wheel 10775 Nov 21 08:55 /usr/include/pthread.h > -r--r--r-- 1 root wheel 3258 Nov 21 08:55 /usr/include/pthread_np.h > > cmake finds that function but the _np header isn't included by C++. > > Waitaminute...*_np() functions are in the BSD thread library > but are missing in the BSD man pages (undocumented). > Nevertheless, I'd only consider them as available if Linux.
So we have two options - check for the pthread_np.h header and include this as well as or instead of pthread.h, or disable the use the np functions. In the later case CHECK_FUNCTION_EXISTS is obviously not up to job as it looks like it checks for the presence of the function in the lib by linking a test app, which succeds because FreeBSD does indeed support NP. So if not CHECK_FUNCTION_EXISTS hows about try CHECK_PROTOTYPE_EXISTS instead? I've come across the following CMake docs page that discusses these two methods. http://www.cmake.org/Wiki/CMake_HowToDoPlatformChecks So I'm wondering if something like this might suffice? CHECK_PROTOTYPE_EXISTS(pthread_setaffinity_np "pthread.h" HAVE_PTHREAD_SETAFFINITY_NP) IF(HAVE_PTHREAD_SETAFFINITY_NP) CHECK_FUNCTION_EXISTS(pthread_setaffinity_np HAVE_PTHREAD_SETAFFINITY_NP) ENDIF() Thoughts? Robert. _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
