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.

FindThirdPartyActiCHampAPI.cmake 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # /*
  2. # * FindThirdPartyActiCHampAPI.cmake
  3. # *
  4. # * Copyright (c) 2012, Mensia Technologies SA. All rights reserved.
  5. # * -- Rights transferred to Inria, contract signed 21.11.2014
  6. # *
  7. # */
  8. # ---------------------------------
  9. # Finds ActiCHamp library
  10. # Adds library to target
  11. # Adds include path
  12. # ---------------------------------
  13. GET_PROPERTY(OV_PRINTED GLOBAL PROPERTY OV_TRIED_ThirdPartyActiCHampAPI)
  14. IF(WIN32)
  15. FIND_PATH(PATH_ActiCHampAPI ActiChamp.h PATHS ${LIST_DEPENDENCIES_PATH} PATH_SUFFIXES sdk_brainproducts_actichamp)
  16. IF(PATH_ActiCHampAPI)
  17. OV_PRINT(OV_PRINTED " Found Brain Products actiCHamp API...")
  18. INCLUDE_DIRECTORIES(${PATH_ActiCHampAPI})
  19. IF("${PLATFORM_TARGET}" STREQUAL "x64")
  20. SET(ACTICHAMP_LIBPREFIX "ActiChamp_x64")
  21. ELSE()
  22. SET(ACTICHAMP_LIBPREFIX "ActiChamp_x86")
  23. ENDIF()
  24. FIND_LIBRARY(LIB_ActiCHampAPI ${ACTICHAMP_LIBPREFIX}.lib PATHS ${PATH_ActiCHampAPI} )
  25. IF(LIB_ActiCHampAPI)
  26. OV_PRINT(OV_PRINTED " [ OK ] lib ${LIB_ActiCHampAPI}")
  27. TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_ActiCHampAPI} )
  28. ELSE()
  29. OV_PRINT(OV_PRINTED " [FAILED] lib actiCHamp")
  30. ENDIF()
  31. FIND_FILE(FIRMWARE_ActiCHampAPI ActiChamp.bit PATHS ${PATH_ActiCHampAPI} )
  32. IF(FIRMWARE_ActiCHampAPI)
  33. OV_PRINT(OV_PRINTED " [ OK ] firmware ${FIRMWARE_ActiCHampAPI}")
  34. ELSE()
  35. OV_PRINT(OV_PRINTED " [FAILED] firmware actiCHamp")
  36. ENDIF()
  37. # Copy the DLL file at install
  38. INSTALL(PROGRAMS "${PATH_ActiCHampAPI}/${ACTICHAMP_LIBPREFIX}.dll" DESTINATION ${DIST_BINDIR})
  39. # Copy the firmware file at install
  40. INSTALL(PROGRAMS "${FIRMWARE_ActiCHampAPI}" DESTINATION ${DIST_BINDIR})
  41. ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyActiCHampAPI)
  42. ELSE()
  43. OV_PRINT(OV_PRINTED " FAILED to find Brain Products actiCHamp API (optional driver)")
  44. ENDIF()
  45. ENDIF()
  46. SET_PROPERTY(GLOBAL PROPERTY OV_TRIED_ThirdPartyActiCHampAPI "Yes")