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.

FindThirdPartyGUSBampCAPI.cmake 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # ---------------------------------
  2. # Finds GUSBampCAPI
  3. # Adds library to target
  4. # Adds include path
  5. # ---------------------------------
  6. GET_PROPERTY(OV_PRINTED GLOBAL PROPERTY OV_TRIED_ThirdPartyGUSBampCAPI)
  7. IF(WIN32)
  8. IF("${PLATFORM_TARGET}" STREQUAL "x64")
  9. SET(GUSBAMP_ARCH "x64")
  10. ELSE()
  11. SET(GUSBAMP_ARCH "Win32")
  12. ENDIF()
  13. FIND_PATH(PATH_GUSBampCAPI gUSBamp.h PATHS
  14. "C:/Program Files/gtec/gUSBampCAPI/API"
  15. "C:/Program Files (x86)/gtec/gUSBampCAPI/API"
  16. "C:/Program Files/gtec/gUSBampCAPI/API/${GUSBAMP_ARCH}"
  17. "C:/Program Files (x86)/gtec/gUSBampCAPI/API/${GUSBAMP_ARCH}"
  18. ${LIST_DEPENDENCIES_PATH})
  19. IF(PATH_GUSBampCAPI)
  20. OV_PRINT(OV_PRINTED " Found gtec gUSBampCAPI...")
  21. INCLUDE_DIRECTORIES(${PATH_GUSBampCAPI})
  22. FIND_LIBRARY(LIB_GUSBampCAPI gUSBamp PATHS ${PATH_GUSBampCAPI})
  23. IF(LIB_GUSBampCAPI)
  24. OV_PRINT(OV_PRINTED " [ OK ] lib ${LIB_GUSBampCAPI}")
  25. TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_GUSBampCAPI} )
  26. ELSE(LIB_GUSBampCAPI)
  27. OV_PRINT(OV_PRINTED " [FAILED] lib gUSBamp")
  28. ENDIF(LIB_GUSBampCAPI)
  29. # Copy the DLL file at install
  30. INSTALL(PROGRAMS "${PATH_GUSBampCAPI}/gUSBamp.dll" DESTINATION ${DIST_BINDIR})
  31. ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyGUSBampCAPI)
  32. SET(OV_ThirdPartyGUSBAmp "YES")
  33. ELSE()
  34. OV_PRINT(OV_PRINTED " FAILED to find gtec gUSBampCAPI (optional driver)")
  35. ENDIF()
  36. ENDIF(WIN32)
  37. IF(UNIX)
  38. # To try other versions of the gtec's library, change the number below
  39. SET(CMAKE_FIND_LIBRARY_SUFFIXES ".so.1.16")
  40. SET(CMAKE_FIND_LIBRARY_PREFIXES "lib")
  41. FIND_LIBRARY(gUSBAmpLinux_LIBRARY NAMES "gUSBampAPIso" PATHS "/usr/lib" "/usr/local/lib")
  42. IF(gUSBAmpLinux_LIBRARY)
  43. OV_PRINT(OV_PRINTED " Found gtec gUSBAmpAPILinux...")
  44. OV_PRINT(OV_PRINTED " [ OK ] Third party lib ${gUSBAmpLinux_LIBRARY}")
  45. ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyGUSBampCAPI_Linux)
  46. TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${gUSBAmpLinux_LIBRARY} )
  47. SET(OV_ThirdPartyGUSBAmp "YES")
  48. ELSE()
  49. OV_PRINT(OV_PRINTED " FAILED to find gtec gUSBAmpAPI Linux... (optional)")
  50. OV_PRINT(OV_PRINTED " : If it should be found, see that 'libgusbampapi.so.1.16' link exists on the fs, with no further nemeric suffixes in the filename.")
  51. OV_PRINT(OV_PRINTED " : e.g. do 'cd /usr/lib/ ; ln -s libgusbampapi.so.1.16'. See gtec-bcilab/README for details.")
  52. ENDIF()
  53. ENDIF(UNIX)
  54. SET_PROPERTY(GLOBAL PROPERTY OV_TRIED_ThirdPartyGUSBampCAPI "Yes")