|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- # ---------------------------------
- # Finds third party pthread lib
- # Adds library to target
- # Adds include path
- # ---------------------------------
-
- GET_PROPERTY(OV_PRINTED GLOBAL PROPERTY OV_TRIED_ThirdPartyPThread)
-
- 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 pthreadVC2 PATHS ${PTHREAD_DIR} PATH_SUFFIXES lib NO_DEFAULT_PATH)
- FIND_PROGRAM(PTHREAD_DLL pthread.dll PATHS ${PTHREAD_DIR} PATH_SUFFIXES bin 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 AND PTHREAD_DLL)
- OV_PRINT(OV_PRINTED " Found PThreads")
- INCLUDE_DIRECTORIES(${PTHREAD_DIR}/include)
- TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${WS232_LIB})
- TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${PTHREAD_LIB})
- INSTALL(PROGRAMS "${PTHREAD_DLL}" DESTINATION ${DIST_BINDIR})
- ADD_DEFINITIONS(-DTARGET_HAS_PThread)
- ELSE()
- OV_PRINT(OV_PRINTED " FAILED to find PThreads")
- 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)
-
- IF(UNIX)
-
- FIND_LIBRARY(LIB_STANDARD_MODULE_PTHREAD pthread)
- IF(LIB_STANDARD_MODULE_PTHREAD)
- OV_PRINT(OV_PRINTED " Found pthread...")
- TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_STANDARD_MODULE_PTHREAD})
- ADD_DEFINITIONS(-DTARGET_HAS_PThread)
- ELSE(LIB_STANDARD_MODULE_PTHREAD)
- OV_PRINT(OV_PRINTED " FAILED to find pthread...")
- ENDIF(LIB_STANDARD_MODULE_PTHREAD)
-
- ENDIF(UNIX)
-
- SET_PROPERTY(GLOBAL PROPERTY OV_TRIED_ThirdPartyPThread "Yes")
-
|