You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FindThirdPartyPThreadsVCE2.cmake 1.5KB

3 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # ---------------------------------
  2. # Finds third party pthreads VCE2 (largely for Fieldtrip)
  3. # Adds library to target
  4. # Adds include path
  5. # ---------------------------------
  6. GET_PROPERTY(OV_PRINTED GLOBAL PROPERTY OV_TRIED_ThirdPartyPThreadsVCE2)
  7. IF(WIN32)
  8. FIND_PATH(PTHREAD_DIR lib PATHS ${LIST_DEPENDENCIES_PATH} PATH_SUFFIXES pthread NO_DEFAULT_PATH)
  9. FIND_PATH(PTHREAD_DIR lib PATHS ${LIST_DEPENDENCIES_PATH} PATH_SUFFIXES pthreads NO_DEFAULT_PATH)
  10. FIND_LIBRARY(PTHREAD_LIB pthreadVCE2 PATHS ${PTHREAD_DIR} PATH_SUFFIXES lib NO_DEFAULT_PATH)
  11. INCLUDE("OvSetWindowsSDKPath")
  12. SET(WS232_LIB "WS232_LIB-NOTFOUND")
  13. FIND_LIBRARY(WS232_LIB ws2_32 ${OV_MS_SDK_PATH}/lib NO_DEFAULT_PATH)
  14. FIND_LIBRARY(WS232_LIB ws2_32 ${OV_MS_SDK_PATH}/lib)
  15. IF(PTHREAD_LIB AND WS232_LIB)
  16. OV_PRINT(OV_PRINTED " Found PThreads VCE2")
  17. INCLUDE_DIRECTORIES(${PTHREAD_DIR}/include)
  18. TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${WS232_LIB})
  19. TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${PTHREAD_LIB})
  20. ADD_DEFINITIONS(-DTARGET_HAS_PThreadsVCE2)
  21. ELSE()
  22. OV_PRINT(OV_PRINTED " FAILED to find PThreads VCE2")
  23. ENDIF()
  24. IF(PTHREAD_LIB)
  25. OV_PRINT(OV_PRINTED " [ OK ] Third party lib ${PTHREAD_LIB}")
  26. ELSE()
  27. OV_PRINT(OV_PRINTED " [FAILED] Third party lib ${PTHREAD_LIB}")
  28. ENDIF()
  29. IF(WS232_LIB)
  30. OV_PRINT(OV_PRINTED " [ OK ] Third party lib ${WS232_LIB}")
  31. ELSE()
  32. OV_PRINT(OV_PRINTED " [FAILED] Third party lib ${WS232_LIB}")
  33. ENDIF()
  34. ENDIF(WIN32)
  35. SET_PROPERTY(GLOBAL PROPERTY OV_TRIED_ThirdPartyPThreadsVCE2 "Yes")