options.cmake: Check Threads_FOUND, not CMAKE_HAVE_THREADS_LIBRARY

The former's been available since CMake v2.8 and documented since v3.17;
the latter was never documented and quietly went away in CMake v3.24.
This commit is contained in:
Aaron M. Ucko 2025-03-30 17:39:57 -04:00 committed by Albrecht Schlosser
parent f4978a0149
commit 8b28e38942

View File

@ -739,11 +739,11 @@ if(FLTK_USE_PTHREADS)
include(FindThreads)
if(CMAKE_HAVE_THREADS_LIBRARY)
if(Threads_FOUND)
add_definitions("-D_THREAD_SAFE -D_REENTRANT")
set(USE_THREADS 1)
set(FLTK_THREADS_FOUND TRUE)
endif(CMAKE_HAVE_THREADS_LIBRARY)
endif(Threads_FOUND)
if(CMAKE_USE_PTHREADS_INIT AND NOT WIN32)
set(HAVE_PTHREAD 1)