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.

FindThirdPartyGNEEDaccessAPI.cmake 3.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. # ---------------------------------
  2. # Finds GNEEDaccessAPI
  3. # Adds library to target
  4. # Adds include path
  5. # ---------------------------------
  6. IF(WIN32)
  7. IF("${PLATFORM_TARGET}" STREQUAL "x64")
  8. SET(PATHS_GNEEDaccessAPI "C:/Program Files/gtec/gNEEDaccess Client API/C")
  9. SET(PATHS_GNEEDaccessLIB "C:/Program Files/gtec/gNEEDaccess Client API/C/x64")
  10. SET(PATHS_GNEEDaccessServer "C:/Program Files/gtec/gNEEDaccess/")
  11. ELSE()
  12. SET(PATHS_GNEEDaccessAPI "C:/Program Files/gtec/gNEEDaccess Client API/C" "C:/Program Files (x86)/gtec/gNEEDaccess Client API/C")
  13. SET(PATHS_GNEEDaccessLIB "C:/Program Files/gtec/gNEEDaccess Client API/C/win32" "C:/Program Files (x86)/gtec/gNEEDaccess Client API/C/win32")
  14. SET(PATHS_GNEEDaccessServer "C:/Program Files/gtec/gNEEDaccess/" "C:/Program Files (x86)/gtec/gNEEDaccess/")
  15. ENDIF()
  16. FIND_PATH(PATH_GNEEDaccessAPI GDSClientAPI.h PATHS
  17. ${PATHS_GNEEDaccessAPI}
  18. NO_DEFAULT_PATH)
  19. IF(PATH_GNEEDaccessAPI)
  20. MESSAGE(STATUS " Found gtec gNEEDaccessAPI...")
  21. # Find GDSClientAPI lib and dll
  22. FIND_PATH(PATH_ClientLIB GDSClientAPI.dll PATHS
  23. ${PATHS_GNEEDaccessLIB}
  24. NO_DEFAULT_PATH)
  25. FIND_LIBRARY(LIB_GDSClientAPI GDSClientAPI PATHS ${PATHS_GNEEDaccessLIB} NO_DEFAULT_PATH)
  26. IF(LIB_GDSClientAPI)
  27. MESSAGE(STATUS " [ OK ] lib ${LIB_GDSClientAPI}")
  28. ELSE(LIB_GDSClientAPI)
  29. MESSAGE(STATUS " [FAILED] lib GDSClientAPI")
  30. ENDIF(LIB_GDSClientAPI)
  31. # Find GDSServer dll
  32. FIND_PATH(PATH_ServerDLL GDSServer.dll PATHS
  33. ${PATHS_GNEEDaccessServer}
  34. NO_DEFAULT_PATH)
  35. IF(PATH_ServerDLL)
  36. MESSAGE(STATUS " [ OK ] dll ${PATH_ServerDLL}")
  37. ELSE(PATH_ServerDLL)
  38. MESSAGE(STATUS " [FAILED] dll GDSServer")
  39. ENDIF(PATH_ServerDLL)
  40. # Find GDSServer lib
  41. FIND_LIBRARY(LIB_GDSServer GDSServer PATHS ${PATHS_GNEEDaccessLIB} NO_DEFAULT_PATH)
  42. IF(LIB_GDSServer)
  43. MESSAGE(STATUS " [ OK ] lib ${LIB_GDSServer}")
  44. ELSE(LIB_GDSServer)
  45. MESSAGE(STATUS " [FAILED] lib GDSServer")
  46. ENDIF(LIB_GDSServer)
  47. # MESSAGE(STATUS "1, ${PATH_ClientLIB} 2, ${LIB_GDSClientAPI} 3, ${PATH_ServerDLL} 4, ${LIB_GDSServer}")
  48. # Only add the compile/install directive if all necessary components were found
  49. IF(PATH_ClientLIB AND LIB_GDSClientAPI AND PATH_ServerDLL AND LIB_GDSServer)
  50. # Copy the DLL file at install
  51. INSTALL(PROGRAMS "${PATH_ClientLIB}/GDSClientAPI.dll" DESTINATION ${DIST_BINDIR})
  52. INSTALL(PROGRAMS "${PATH_ClientLIB}/gAPI.dll" DESTINATION ${DIST_BINDIR})
  53. INSTALL(PROGRAMS "${PATH_ClientLIB}/Networking.dll" DESTINATION ${DIST_BINDIR})
  54. INSTALL(PROGRAMS "${PATH_ServerDLL}/GDSServer.dll" DESTINATION ${DIST_BINDIR})
  55. INCLUDE_DIRECTORIES(${PATH_GNEEDaccessAPI})
  56. TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_GDSClientAPI} )
  57. TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_GDSServer} )
  58. ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyGNEEDaccessAPI)
  59. SET(OV_ThirdPartyGNEEDaccess "YES")
  60. ENDIF(PATH_ClientLIB AND LIB_GDSClientAPI AND PATH_ServerDLL AND LIB_GDSServer)
  61. ELSE(PATH_GNEEDaccessAPI)
  62. MESSAGE(STATUS " FAILED to find gtec gNEEDaccessAPI (optional driver)")
  63. ENDIF(PATH_GNEEDaccessAPI)
  64. ENDIF(WIN32)