From 8d9cd344fac0cafa508ed25c4f01f91394c6a84a Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 29 Jan 2015 15:50:51 +0000 Subject: [PATCH] GRIB-689: CMake: threads not enabled --- CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a65f95d07..c74e7f847 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -137,9 +137,19 @@ endif() set( CMAKE_THREAD_PREFER_PTHREAD 1 ) # find thread library, but prefer pthreads find_package(Threads REQUIRED) +# debug +message(STATUS " CMAKE_THREAD_LIBS_INIT=${CMAKE_THREAD_LIBS_INIT}") +message(STATUS " CMAKE_USE_PTHREADS_INIT=${CMAKE_USE_PTHREADS_INIT}") +message(STATUS " GRIB_THREADS=${GRIB_THREADS}, HAVE_GRIB_THREADS=${HAVE_GRIB_THREADS}") + +if( NOT ${CMAKE_USE_PTHREADS_INIT} ) + message( FATAL_ERROR "Only pthreads supported - thread library found is [${CMAKE_THREAD_LIBS_INIT}]" ) +endif() + set( GRIB_PTHREADS 0 ) set( GRIB_LINUX_PTHREADS 0 ) -if( GRIB_THREADS AND CMAKE_THREAD_LIBS_INIT ) +#if( HAVE_GRIB_THREADS AND CMAKE_THREAD_LIBS_INIT ) +if( HAVE_GRIB_THREADS ) if( CMAKE_USE_PTHREADS_INIT ) set( GRIB_PTHREADS 1 ) if( ${CMAKE_SYSTEM_NAME} MATCHES "Linux" )