CMakeLists.txt 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. cmake_minimum_required(VERSION 2.8.3)
  2. project(microstrain_driver)
  3. find_package(catkin REQUIRED COMPONENTS
  4. geometry_msgs
  5. nav_msgs
  6. roscpp
  7. sensor_msgs
  8. std_msgs
  9. std_srvs
  10. tf2
  11. tf2_ros
  12. )
  13. catkin_package(
  14. INCLUDE_DIRS include
  15. )
  16. # Directories containing MIP SDK header files
  17. set(MIPLIBINC MIPSDK/C/Library/Include)
  18. set(MIPLIBSRC MIPSDK/C/Library/Source)
  19. set(MIPUTILINC MIPSDK/C/Utilities/Include)
  20. set(MIPUTILSRC MIPSDK/C/Utilities/Source)
  21. # The SDK comes with a skeleton for the user-defined functions
  22. # It might be helpful to test compilation against these skeletons
  23. # contains both .c and .h files
  24. # set(MIPUSR "MIPSDK/C/Library/User\ Functions")
  25. #include_directories(include ${MIPLIBINC} ${MIPUTILINC} ${MIPUSR})
  26. include_directories(include/${PROJECT_NAME} ${MIPLIBINC} ${MIPUTILINC} ${catkin_INCLUDE_DIRS})
  27. set(MIPINC
  28. ${MIPLIBINC}/mip.h
  29. ${MIPLIBINC}/mip_sdk_base.h
  30. ${MIPLIBINC}/mip_sdk_inteface.h
  31. ${MIPLIBINC}/mip_sdk_3dm.h
  32. ${MIPLIBINC}/mip_sdk_filter.h
  33. ${MIPLIBINC}/mip_sdk_system.h
  34. ${MIPLIBINC}/mip_sdk_ahrs.h
  35. ${MIPLIBINC}/mip_sdk_gps.h
  36. ${MIPLIBINC}/ring_buffer.h
  37. # ${MIPUSR}/mip_sdk_user_functions.h
  38. ${MIPUTILINC}/byteswap_utilities.h
  39. )
  40. set(MIPSRC
  41. ${MIPLIBSRC}/mip.c
  42. ${MIPLIBSRC}/mip_sdk_base.c
  43. ${MIPLIBSRC}/mip_sdk_inteface.c
  44. ${MIPLIBSRC}/mip_sdk_3dm.c
  45. ${MIPLIBSRC}/mip_sdk_filter.c
  46. ${MIPLIBSRC}/mip_sdk_system.c
  47. ${MIPLIBSRC}/mip_sdk_ahrs.c
  48. ${MIPLIBSRC}/mip_sdk_gps.c
  49. ${MIPLIBSRC}/ring_buffer.c
  50. # ${MIPUSR}/mip_sdk_user_functions.c
  51. ${MIPUTILSRC}/byteswap_utilities.c
  52. )
  53. # Libraries
  54. add_library(microstrain_driver src/microstrain.cpp src/mip_sdk_user_functions.c ${MIPSRC})
  55. # Executables
  56. add_executable(3dm_gx5_15_node src/3dm_gx5_15_node.cpp)
  57. add_executable(3dm_gx5_45_node src/3dm_gx5_45_node.cpp)
  58. # Linking
  59. target_link_libraries(microstrain_driver ${catkin_LIBRARIES})
  60. target_link_libraries(3dm_gx5_15_node microstrain_driver ${catkin_LIBRARIES})
  61. target_link_libraries(3dm_gx5_45_node microstrain_driver ${catkin_LIBRARIES})
  62. install(
  63. TARGETS
  64. microstrain_driver
  65. 3dm_gx5_15_node
  66. 3dm_gx5_45_node
  67. ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  68. LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  69. RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
  70. )
  71. install(DIRECTORY launch/
  72. DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
  73. PATTERN ".svn" EXCLUDE
  74. )