2 # This module finds an installed PThread using the variable PTHREAD_ROOT_DIR
4 # It sets the following variables:
5 # PTHREAD_FOUND - set to true if PThread is found
6 # PTHREAD_INCLUDE_DIR - the directory where the include files are located
7 # PTHREAD_LIBRARIES - the path to PThread library
9 # The file "pthread.h" is looked for PTHREAD_INCLUDE_DIR.
10 # Libraries are searched with following names:
19 #############################################################
20 # Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
22 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
23 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
25 # This library is free software; you can redistribute it and/or
26 # modify it under the terms of the GNU Lesser General Public
27 # License as published by the Free Software Foundation; either
28 # version 2.1 of the License, or (at your option) any later version.
30 # This library is distributed in the hope that it will be useful,
31 # but WITHOUT ANY WARRANTY; without even the implied warranty of
32 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
33 # Lesser General Public License for more details.
35 # You should have received a copy of the GNU Lesser General Public
36 # License along with this library; if not, write to the Free Software
37 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
39 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
42 IF(NOT PThread_FIND_QUIETLY)
43 MESSAGE(STATUS "Looking for PThread...")
47 SET(PTHREADS_INCLUDE_TO_FIND pthread.h)
48 FIND_PATH(PTHREAD_INCLUDE_DIR ${PTHREADS_INCLUDE_TO_FIND})
49 # Default build type is assumed to be Release:
50 IF(NOT CMAKE_BUILD_TYPE STREQUAL Debug)
51 FIND_LIBRARY(PTHREAD_LIBRARIES pthreadVC2)
53 FIND_LIBRARY(PTHREAD_LIBRARIES pthreadVC2d)
56 FIND_PATH(PTHREAD_INCLUDE_DIR pthread.h)
57 FIND_LIBRARY(PTHREAD_LIBRARIES NAMES pthread)
60 INCLUDE(FindPackageHandleStandardArgs)
61 FIND_PACKAGE_HANDLE_STANDARD_ARGS(PThread REQUIRED_VARS PTHREAD_INCLUDE_DIR PTHREAD_LIBRARIES)
64 IF(NOT PThread_FIND_QUIETLY)
65 MESSAGE(STATUS "PThread library: ${PTHREAD_LIBRARIES}")