diff --git a/CMakeLists.txt b/CMakeLists.txt index 51dc2c3c96..6f0786915e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -133,7 +133,14 @@ if(MSVC) set(PThreads_LIBRARIES PThreads4W::PThreads4W) set(PThreads_INCLUDE_DIRS ${PThreads4W_INCLUDE_DIRS}) else() - find_package(PThreads REQUIRED) + find_package(PThreads) + if(NOT PThreads_FOUND) + include(CheckIncludeFile) + check_include_file(pthread.h HAVE_PTHREAD_H) + if(NOT HAVE_PTHREAD_H) + message(FATAL_ERROR "Could not find pthreads.") + endif() + endif() endif() set(FLINT_USES_PTHREAD ON CACHE BOOL "Use POSIX Threads.") else()