45 lines
1.5 KiB
CMake
45 lines
1.5 KiB
CMake
|
# ---------------------------------
|
||
|
# Finds third party pthreads VCE2 (largely for Fieldtrip)
|
||
|
# Adds library to target
|
||
|
# Adds include path
|
||
|
# ---------------------------------
|
||
|
|
||
|
GET_PROPERTY(OV_PRINTED GLOBAL PROPERTY OV_TRIED_ThirdPartyPThreadsVCE2)
|
||
|
|
||
|
IF(WIN32)
|
||
|
FIND_PATH(PTHREAD_DIR lib PATHS ${LIST_DEPENDENCIES_PATH} PATH_SUFFIXES pthread NO_DEFAULT_PATH)
|
||
|
FIND_PATH(PTHREAD_DIR lib PATHS ${LIST_DEPENDENCIES_PATH} PATH_SUFFIXES pthreads NO_DEFAULT_PATH)
|
||
|
FIND_LIBRARY(PTHREAD_LIB pthreadVCE2 PATHS ${PTHREAD_DIR} PATH_SUFFIXES lib NO_DEFAULT_PATH)
|
||
|
|
||
|
INCLUDE("OvSetWindowsSDKPath")
|
||
|
SET(WS232_LIB "WS232_LIB-NOTFOUND")
|
||
|
FIND_LIBRARY(WS232_LIB ws2_32 ${OV_MS_SDK_PATH}/lib NO_DEFAULT_PATH)
|
||
|
FIND_LIBRARY(WS232_LIB ws2_32 ${OV_MS_SDK_PATH}/lib)
|
||
|
|
||
|
IF(PTHREAD_LIB AND WS232_LIB)
|
||
|
OV_PRINT(OV_PRINTED " Found PThreads VCE2")
|
||
|
INCLUDE_DIRECTORIES(${PTHREAD_DIR}/include)
|
||
|
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${WS232_LIB})
|
||
|
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${PTHREAD_LIB})
|
||
|
ADD_DEFINITIONS(-DTARGET_HAS_PThreadsVCE2)
|
||
|
ELSE()
|
||
|
OV_PRINT(OV_PRINTED " FAILED to find PThreads VCE2")
|
||
|
ENDIF()
|
||
|
|
||
|
IF(PTHREAD_LIB)
|
||
|
OV_PRINT(OV_PRINTED " [ OK ] Third party lib ${PTHREAD_LIB}")
|
||
|
ELSE()
|
||
|
OV_PRINT(OV_PRINTED " [FAILED] Third party lib ${PTHREAD_LIB}")
|
||
|
ENDIF()
|
||
|
|
||
|
IF(WS232_LIB)
|
||
|
OV_PRINT(OV_PRINTED " [ OK ] Third party lib ${WS232_LIB}")
|
||
|
ELSE()
|
||
|
OV_PRINT(OV_PRINTED " [FAILED] Third party lib ${WS232_LIB}")
|
||
|
ENDIF()
|
||
|
|
||
|
ENDIF(WIN32)
|
||
|
|
||
|
SET_PROPERTY(GLOBAL PROPERTY OV_TRIED_ThirdPartyPThreadsVCE2 "Yes")
|
||
|
|