Hi,

I wanted to write a check whether pthread_mutex_init and pthread_spin_init exist in pthread.h. Therefore,
I used the following CMake commands:

INCLUDE(CheckFunctionExists)
CHECK_FUNCTION_EXISTS("pthread_spin_init" HAVE_PTHREAD_SPINLOCK)
CHECK_FUNCTION_EXISTS("pthread_mutex_init"        HAVE_PTHREAD_MUTEX)

The result of running CMake on a Linux system gives me

-- Looking for pthread_spin_init
-- Looking for pthread_spin_init - not found
-- Looking for pthread_mutex_init
-- Looking for pthread_mutex_init - found.

Although pthread_spin_init is declared in my pthread.h and my code compiles and uses it, CMake does not find it. However, I saw that this function is guarded in an "#ifdef __USE_XOPEN2K". Could that be the reason why
CMake doesn't find it or am I doing something wrong here?

Thanks in advance.

Matthias

_______________________________________________
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to