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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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.14")
  40. FIND_LIBRARY(gUSBAmpLinux_LIBRARY NAMES "gusbampapi" PATHS "/usr/lib" "/usr/local/lib")
  41. IF(gUSBAmpLinux_LIBRARY)
  42. OV_PRINT(OV_PRINTED " Found gtec gUSBAmpAPILinux...")
  43. OV_PRINT(OV_PRINTED " [ OK ] Third party lib ${gUSBAmpLinux_LIBRARY}")
  44. ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyGUSBampCAPI_Linux)
  45. TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${gUSBAmpLinux_LIBRARY} )
  46. SET(OV_ThirdPartyGUSBAmp "YES")
  47. ELSE()
  48. OV_PRINT(OV_PRINTED " FAILED to find gtec gUSBAmpAPI Linux... (optional)")
  49. OV_PRINT(OV_PRINTED " : If it should be found, see that 'libgusbampapi.so.1.14' link exists on the fs, with no further nemeric suffixes in the filename.")
  50. OV_PRINT(OV_PRINTED " : e.g. do 'cd /usr/lib/ ; ln -s libgusbampapi.so.1.14'. See gtec-bcilab/README for details.")
  51. ENDIF()
  52. ENDIF(UNIX)
  53. SET_PROPERTY(GLOBAL PROPERTY OV_TRIED_ThirdPartyGUSBampCAPI "Yes")