X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/595e59c568ff5f8510de201bfd800951cdc2adcb..b763a2a396e1ac0c4989ebbb462df519767ed3ce:/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index d99da0de15..cde287ef96 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,6 +60,9 @@ if(APPLE AND (CMAKE_C_COMPILER_VERSION VERSION_LESS "4.6")) set(HAVE_UCONTEXT_H 0) endif() +### Check threading support +set(CMAKE_THREAD_PREFER_PTHREAD TRUE) +find_package(Threads) ### Setup Options include(${CMAKE_HOME_DIRECTORY}/tools/cmake/Option.cmake) @@ -274,7 +277,6 @@ endif() # Checks for header libraries functions. CHECK_LIBRARY_EXISTS(rt clock_gettime "" HAVE_POSIX_GETTIME) -CHECK_LIBRARY_EXISTS(pthread pthread_create "" HAVE_PTHREAD) if(NOT APPLE) # OS X El Capitan deprecates this function CHECK_LIBRARY_EXISTS(pthread sem_init "" HAVE_SEM_INIT_LIB) endif() @@ -388,7 +390,7 @@ if(HAVE_LIBUNWIND) endif() else() if(enable_model-checking) - message(FATAL_ERROR "Please either install the libunwind7-dev package (or equivalent) or turn off the model-checking option of SimGrid.") + message(FATAL_ERROR "Please install libunwind-dev libdw-dev libevent-dev if you want to compile the SimGrid model checker.") endif() endif() @@ -460,7 +462,7 @@ endif() ### Initialize of CONTEXT THREADS set(HAVE_THREAD_CONTEXTS 0) -if(HAVE_PTHREAD) +if(CMAKE_USE_PTHREADS_INIT) ### Test that we have a way to create semaphores if(HAVE_SEM_OPEN_LIB)