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.

FindThirdPartyThinkGearAPI.cmake 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # ---------------------------------
  2. # Finds Neurosky ThinkGear library
  3. # Adds library to target
  4. # Adds include path
  5. # ---------------------------------
  6. GET_PROPERTY(OV_PRINTED GLOBAL PROPERTY OV_TRIED_ThirdPartyThinkGearAPI)
  7. IF(WIN32)
  8. IF("${PLATFORM_TARGET}" STREQUAL "x64")
  9. SET(THINKGEAR_LIBDIR "x64")
  10. SET(THINKGEAR_LIB "thinkgear64")
  11. ELSE()
  12. SET(THINKGEAR_LIBDIR "win32")
  13. SET(THINKGEAR_LIB "thinkgear")
  14. ENDIF()
  15. FIND_PATH(PATH_ThinkGearAPI thinkgear.h PATHS
  16. "C:/Program Files/MindSet Windows Developer Tools 3.2/Stream SDK for PC/libs/${THINKGEAR_LIBDIR}/"
  17. "C:/Program Files (x86)/MindSet Windows Developer Tools 3.2/Stream SDK for PC/libs/${THINKGEAR_LIBDIR}/"
  18. ${LIST_DEPENDENCIES_PATH}
  19. NO_DEFAULT_PATH)
  20. IF(PATH_ThinkGearAPI)
  21. OV_PRINT(OV_PRINTED " Found ThinkGear API...")
  22. INCLUDE_DIRECTORIES(${PATH_ThinkGearAPI})
  23. FIND_LIBRARY(LIB_ThinkGearAPI ${THINKGEAR_LIB} PATHS ${PATH_ThinkGearAPI} )
  24. IF(LIB_ThinkGearAPI)
  25. OV_PRINT(OV_PRINTED " [ OK ] lib ${LIB_ThinkGearAPI}")
  26. TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_ThinkGearAPI} )
  27. ELSE(LIB_ThinkGearAPI)
  28. OV_PRINT(OV_PRINTED " [FAILED] lib thinkgear")
  29. ENDIF(LIB_ThinkGearAPI)
  30. # Copy the DLL file at install
  31. INSTALL(PROGRAMS "${PATH_ThinkGearAPI}/${THINKGEAR_LIB}.dll" DESTINATION ${DIST_BINDIR})
  32. ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyThinkGearAPI)
  33. ELSE(PATH_ThinkGearAPI)
  34. OV_PRINT(OV_PRINTED " FAILED to find a valid ThinkGear API for NeuroSky Mindsets (optional driver)")
  35. ENDIF(PATH_ThinkGearAPI)
  36. ENDIF(WIN32)
  37. IF(UNIX)
  38. OV_PRINT(OV_PRINTED " Skipped ThinkGear API for Neurosky MindSet, only available on windows.")
  39. ENDIF(UNIX)
  40. SET_PROPERTY(GLOBAL PROPERTY OV_TRIED_ThirdPartyThinkGearAPI "Yes")