FindThreads

FindThreads

This module determines the thread library of the system.

The following variables are set

CMAKE_THREAD_LIBS_INIT     - the thread library
CMAKE_USE_SPROC_INIT       - are we using sproc?
CMAKE_USE_WIN32_THREADS_INIT - using WIN32 threads?
CMAKE_USE_PTHREADS_INIT    - are we using pthreads
CMAKE_HP_PTHREADS_INIT     - are we using hp pthreads

The following import target is created

Threads::Threads

For systems with multiple thread libraries, caller can set

CMAKE_THREAD_PREFER_PTHREAD

If the use of the -pthread compiler and linker flag is prefered then the caller can set

THREADS_PREFER_PTHREAD_FLAG

Please note that the compiler flag can only be used with the imported target. Use of both the imported target as well as this switch is highly recommended for new code.

© 2000–2016 Kitware, Inc.
© 2000–2011 Insight Software Consortium
Licensed under the BSD 3-clause License.
https://cmake.org/cmake/help/v3.5/module/FindThreads.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部