CMAKE: sem_timedwait is found in pthread on newer linuxes

git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@1121 a31d4220-a93d-0410-bf67-fe4944624d44
This commit is contained in:
bgk 2012-09-07 19:09:16 +00:00
parent f7be31935d
commit c9a781270a
1 changed files with 9 additions and 1 deletions

View File

@ -126,11 +126,19 @@ ADD_DEFINITIONS (-DHAVE_NETINET_IN_H -DHAVE_ARPA_INET_H -DHAVE_ZLIB_H -DFINAL_VE
ADD_DEFINITIONS (-DVERSION='"${VERSION}"' -DPKGDATADIR='"${PKGDATADIR}"' -DPACKAGE='') ADD_DEFINITIONS (-DVERSION='"${VERSION}"' -DPKGDATADIR='"${PKGDATADIR}"' -DPACKAGE='')
if( ENABLE_LINK ) if( ENABLE_LINK )
# IPC linking code needs sem_timedwait which can be either in librt or pthreads
FIND_LIBRARY(RT_LIB rt) FIND_LIBRARY(RT_LIB rt)
IF(RT_LIB) IF(RT_LIB)
SET(CMAKE_REQUIRED_LIBRARIES ${RT_LIB}) SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${RT_LIB})
SET(VBAMCORE_LIBS ${VBAMCORE_LIBS} ${RT_LIB}) SET(VBAMCORE_LIBS ${VBAMCORE_LIBS} ${RT_LIB})
ENDIF(RT_LIB) ENDIF(RT_LIB)
FIND_LIBRARY(PTHREAD_LIB pthread)
IF(PTHREAD_LIB)
SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${PTHREAD_LIB})
SET(VBAMCORE_LIBS ${VBAMCORE_LIBS} ${PTHREAD_LIB})
ENDIF(PTHREAD_LIB)
INCLUDE(CheckFunctionExists) INCLUDE(CheckFunctionExists)
CHECK_FUNCTION_EXISTS(sem_timedwait SEM_TIMEDWAIT) CHECK_FUNCTION_EXISTS(sem_timedwait SEM_TIMEDWAIT)
IF( SEM_TIMEDWAIT) IF( SEM_TIMEDWAIT)