CMakeLists.txt 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. cmake_minimum_required(VERSION 2.8.3)
  2. project(gnss)
  3. find_package(catkin REQUIRED
  4. COMPONENTS
  5. roscpp
  6. roslint
  7. )
  8. catkin_package(
  9. INCLUDE_DIRS include
  10. LIBRARIES gnss
  11. )
  12. include_directories(
  13. include
  14. ${catkin_INCLUDE_DIRS}
  15. )
  16. add_library(gnss
  17. src/geo_pos_conv.cpp
  18. )
  19. target_link_libraries(gnss
  20. ${catkin_LIBRARIES}
  21. )
  22. file(GLOB_RECURSE ROSLINT_FILES
  23. LIST_DIRECTORIES false
  24. *.cpp *.h *.hpp
  25. )
  26. list(APPEND ROSLINT_CPP_OPTS
  27. "--extensions=cc,h,hpp,cpp,cu,cuh"
  28. "--filter=-build/c++14"
  29. )
  30. roslint_cpp(${ROSLINT_FILES})
  31. install(DIRECTORY include/${PROJECT_NAME}/
  32. DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
  33. FILES_MATCHING PATTERN "*.hpp"
  34. )
  35. install(TARGETS gnss
  36. ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  37. LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  38. RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
  39. )
  40. if(CATKIN_ENABLE_TESTING)
  41. roslint_add_test()
  42. find_package(rostest REQUIRED)
  43. find_package(rosunit REQUIRED)
  44. add_rostest_gtest(test_gnss
  45. test/test_gnss.test test/test_gnss.cpp
  46. src/geo_pos_conv.cpp
  47. )
  48. target_link_libraries(test_gnss ${catkin_LIBRARIES})
  49. add_dependencies(test_gnss ${catkin_EXPORTED_TARGETS})
  50. endif()