# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE # # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # IF (NOT PThread_FIND_QUIETLY) MESSAGE(STATUS "Looking for PThread...") ENDIF (NOT PThread_FIND_QUIETLY) IF(WIN32) SET(PTHREADS_ROOT_USER $ENV{PTHREADS_ROOT}) SET(PTHREADS_FIND_PATHS_OPTION NO_DEFAULT_PATH) SET(PTHREADS_INCLUDE_TO_FIND pthread.h) SET(PTHREADS_INCLUDE_PATHS ${PTHREADS_ROOT_USER}/include) FIND_PATH(PTHREAD_INCLUDE_DIR ${PTHREADS_INCLUDE_TO_FIND} PATHS ${PTHREADS_INCLUDE_PATHS} ${PTHREADS_FIND_PATHS_OPTION}) SET(PTHREADS_LIB_PATHS ${PTHREADS_ROOT_USER}/lib) IF(CMAKE_BUILD_TYPE STREQUAL Release) FIND_LIBRARY(PTHREAD_LIBRARY pthreadVSE2 pthreadVC2 PATHS ${PTHREADS_LIB_PATHS} ${PTHREADS_FIND_PATHS_OPTION}) ELSE(CMAKE_BUILD_TYPE STREQUAL Release) FIND_LIBRARY(PTHREAD_LIBRARY pthreadVSE2d pthreadVC2d PATHS ${PTHREADS_LIB_PATHS} ${PTHREADS_FIND_PATHS_OPTION}) ENDIF(CMAKE_BUILD_TYPE STREQUAL Release) ELSE(WIN32) FIND_PATH(PTHREAD_INCLUDE_DIR pthread.h) FIND_LIBRARY(PTHREAD_LIBRARY NAMES pthread) ENDIF(WIN32) IF (PTHREAD_INCLUDE_DIR AND PTHREAD_LIBRARY) SET(PThread_FOUND True) ENDIF (PTHREAD_INCLUDE_DIR AND PTHREAD_LIBRARY) IF (PThread_FOUND) IF (NOT PThread_FIND_QUIETLY) MESSAGE(STATUS "Found PThread:") MESSAGE(STATUS "PThread include directory: ${PTHREAD_INCLUDE_DIR}") MESSAGE(STATUS "PThread library: ${PTHREAD_LIBRARY}") ENDIF (NOT PThread_FIND_QUIETLY) ELSE (PThread_FOUND) IF (PThread_FIND_REQUIRED) MESSAGE(FATAL_ERROR "PThread not found") ELSE (PThread_FIND_REQUIRED) IF (NOT PThread_FIND_QUIETLY) MESSAGE(STATUS "PThread not found") ENDIF (NOT PThread_FIND_QUIETLY) ENDIF (PThread_FIND_REQUIRED) ENDIF (PThread_FOUND)