diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2008-09-11 15:41:00 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2008-09-11 15:41:00 (GMT) |
commit | 0e5319f21dc6a6079a8af82e40ca3e9da563b6de (patch) | |
tree | 7f23acb8f337d99b19b71cd8b3f1c73ccbebc15a /Modules/FindThreads.cmake | |
parent | 7e5222165d598b93e3166e9941a67f099fdfecdd (diff) | |
download | CMake-0e5319f21dc6a6079a8af82e40ca3e9da563b6de.zip CMake-0e5319f21dc6a6079a8af82e40ca3e9da563b6de.tar.gz CMake-0e5319f21dc6a6079a8af82e40ca3e9da563b6de.tar.bz2 |
BUG: fix for 6586, set THREADS_FOUND
Diffstat (limited to 'Modules/FindThreads.cmake')
-rw-r--r-- | Modules/FindThreads.cmake | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake index 98031e2..6facb51 100644 --- a/Modules/FindThreads.cmake +++ b/Modules/FindThreads.cmake @@ -8,6 +8,7 @@ INCLUDE (CheckIncludeFiles) INCLUDE (CheckLibraryExists) +SET(Threads_FOUND FALSE) # Do we have sproc? IF(CMAKE_SYSTEM MATCHES IRIX) @@ -30,11 +31,13 @@ ELSE(CMAKE_HAVE_SPROC_H) IF(CMAKE_HAVE_PTHREADS_CREATE) SET(CMAKE_THREAD_LIBS_INIT "-lpthreads") SET(CMAKE_HAVE_THREADS_LIBRARY 1) + SET(Threads_FOUND TRUE) ENDIF(CMAKE_HAVE_PTHREADS_CREATE) # Ok, how about -lpthread CHECK_LIBRARY_EXISTS(pthread pthread_create "" CMAKE_HAVE_PTHREAD_CREATE) IF(CMAKE_HAVE_PTHREAD_CREATE) SET(CMAKE_THREAD_LIBS_INIT "-lpthread") + SET(Threads_FOUND TRUE) SET(CMAKE_HAVE_THREADS_LIBRARY 1) ENDIF(CMAKE_HAVE_PTHREAD_CREATE) IF(CMAKE_SYSTEM MATCHES "SunOS.*") @@ -43,6 +46,7 @@ ELSE(CMAKE_HAVE_SPROC_H) IF(CMAKE_HAVE_THR_CREATE) SET(CMAKE_THREAD_LIBS_INIT "-lthread") SET(CMAKE_HAVE_THREADS_LIBRARY 1) + SET(Threads_FOUND TRUE) ENDIF(CMAKE_HAVE_THR_CREATE) ENDIF(CMAKE_SYSTEM MATCHES "SunOS.*") ENDIF(NOT THREADS_HAVE_PTHREAD_ARG) @@ -58,6 +62,7 @@ ELSE(CMAKE_HAVE_SPROC_H) COMPILE_OUTPUT_VARIABLE OUTPUT) IF(THREADS_HAVE_PTHREAD_ARG) IF(THREADS_PTHREAD_ARG MATCHES "^2$") + SET(Threads_FOUND TRUE) MESSAGE(STATUS "Check if compiler accepts -pthread - yes") ELSE(THREADS_PTHREAD_ARG MATCHES "^2$") MESSAGE(STATUS "Check if compiler accepts -pthread - no") @@ -73,6 +78,7 @@ ELSE(CMAKE_HAVE_SPROC_H) ENDIF(THREADS_HAVE_PTHREAD_ARG) ENDIF("THREADS_HAVE_PTHREAD_ARG" MATCHES "^THREADS_HAVE_PTHREAD_ARG") IF(THREADS_HAVE_PTHREAD_ARG) + SET(Threads_FOUND TRUE) SET(CMAKE_THREAD_LIBS_INIT "-pthread") ENDIF(THREADS_HAVE_PTHREAD_ARG) ENDIF(NOT CMAKE_HAVE_THREADS_LIBRARY) @@ -81,10 +87,12 @@ ENDIF(CMAKE_HAVE_SPROC_H) IF(CMAKE_THREAD_LIBS_INIT) SET(CMAKE_USE_PTHREADS_INIT 1) + SET(Threads_FOUND TRUE) ENDIF(CMAKE_THREAD_LIBS_INIT) IF(CMAKE_SYSTEM MATCHES "Windows") SET(CMAKE_USE_WIN32_THREADS_INIT 1) + SET(Threads_FOUND TRUE) ENDIF(CMAKE_SYSTEM MATCHES "Windows") IF(CMAKE_USE_PTHREADS_INIT) @@ -101,6 +109,7 @@ IF(CMAKE_USE_PTHREADS_INIT) IF(CMAKE_HAVE_HP_CMA) SET(CMAKE_THREAD_LIBS_INIT "-lcma") SET(CMAKE_HP_PTHREADS_INIT 1) + SET(Threads_FOUND TRUE) ENDIF(CMAKE_HAVE_HP_CMA) SET(CMAKE_USE_PTHREADS_INIT 1) ENDIF(CMAKE_SYSTEM MATCHES "HP-UX-*") @@ -112,8 +121,11 @@ IF(CMAKE_USE_PTHREADS_INIT) IF(CMAKE_SYSTEM MATCHES "CYGWIN_NT*") SET(CMAKE_USE_PTHREADS_INIT 1) + SET(Threads_FOUND TRUE) SET(CMAKE_THREAD_LIBS_INIT ) SET(CMAKE_USE_WIN32_THREADS_INIT 0) ENDIF(CMAKE_SYSTEM MATCHES "CYGWIN_NT*") ENDIF(CMAKE_USE_PTHREADS_INIT) +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Threads DEFAULT_MSG Threads_FOUND) |