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.

FindThirdPartyBioSemiLabViewAPI.cmake 1.4KB

3 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # ---------------------------------
  2. # Finds BioSemi LabView API
  3. # Adds library to target
  4. # Adds include path
  5. # ---------------------------------
  6. GET_PROPERTY(OV_PRINTED GLOBAL PROPERTY OV_TRIED_ThirdPartyBioSemiLabViewAPI)
  7. IF(WIN32)
  8. # note: care must be taken here that lib of wrong bitness is not picked
  9. IF("${PLATFORM_TARGET}" STREQUAL "x64")
  10. SET(PATH_BioSemiAPI "C:/Program Files/BioSemi/Developers_kit/C-code")
  11. ELSE()
  12. SET(PATH_BioSemiAPI "C:/Program Files (x86)/BioSemi/Developers_kit/C-code")
  13. ENDIF()
  14. FIND_FILE(LABVIEW_HEADER labview_dll.h
  15. PATHS ${PATH_BioSemiAPI}
  16. NO_SYSTEM_ENVIRONMENT_PATH
  17. NO_DEFAULT_PATH)
  18. IF(LABVIEW_HEADER)
  19. OV_PRINT(OV_PRINTED " Found BioSemi LabView API...")
  20. INCLUDE_DIRECTORIES(${PATH_BioSemiAPI})
  21. FIND_LIBRARY(LIB_BioSemiAPI Labview_DLL PATHS ${PATH_BioSemiAPI} NO_SYSTEM_ENVIRONMENT_PATH NO_DEFAULT_PATH)
  22. IF(LIB_BioSemiAPI)
  23. OV_PRINT(OV_PRINTED " [ OK ] lib ${LIB_BioSemiAPI}")
  24. TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_BioSemiAPI} )
  25. ELSE(LIB_BioSemiAPI)
  26. OV_PRINT(OV_PRINTED " [FAILED] lib Labview_DLL")
  27. ENDIF(LIB_BioSemiAPI)
  28. # Copy the DLL file at install
  29. INSTALL(PROGRAMS "${PATH_BioSemiAPI}/Labview_DLL.dll" DESTINATION ${DIST_BINDIR})
  30. ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyBioSemiAPI)
  31. ELSE()
  32. OV_PRINT(OV_PRINTED " FAILED to find BioSemi LabView API (optional driver)")
  33. ENDIF()
  34. ENDIF(WIN32)
  35. SET_PROPERTY(GLOBAL PROPERTY OV_TRIED_ThirdPartyBioSemiLabViewAPI "Yes")