3 include(CheckIncludeFiles)
5 #option(THREAD_PTHREADS "Use posix threads" ON)
8 if (CMAKE_USE_PTHREADS_INIT)
9 check_include_files(pthread.h HAVE_PTHREAD_H)
10 #set(THREAD_PTHREADS 1)
11 add_definitions(-DTHREAD_PTHREADS)
12 set(THREAD_MPI_SRC thread_mpi/threads.c thread_mpi/tmpi_init.c
13 thread_mpi/comm.c thread_mpi/send_recv.c
14 thread_mpi/multicast.c)
15 set(THREAD_LIB ${CMAKE_THREAD_LIBS_INIT})
16 else (CMAKE_USE_PTHREADS_INIT)
17 if (CMAKE_USE_WIN32_THREADS_INIT)
19 add_definitions(-DTHREAD_WINDOWS)
20 set(THREAD_MPI_SRC thread_mpi/threads.c thread_mpi/tmpi_init.c
21 thread_mpi/comm.c thread_mpi/send_recv.c
22 thread_mpi/multicast.c)
24 endif (CMAKE_USE_WIN32_THREADS_INIT)
25 endif (CMAKE_USE_PTHREADS_INIT)