CMakeLists.txt 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. cmake_minimum_required(VERSION 2.8.3)
  2. project(snowboy_wakeup)
  3. find_package(catkin REQUIRED COMPONENTS
  4. roscpp
  5. audio_common_msgs
  6. dynamic_reconfigure
  7. )
  8. set(CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}")
  9. set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules)
  10. find_package(BLAS)
  11. # ------------------------------------------------------------------------------------------------
  12. # ROS MESSAGES AND SERVICES
  13. # ------------------------------------------------------------------------------------------------
  14. # Generate services
  15. # add_service_files(
  16. # FILES
  17. # service1.srv
  18. # ...
  19. # )
  20. # Generate added messages and services with any dependencies listed here
  21. # generate_messages(
  22. # DEPENDENCIES
  23. # geometry_msgs
  24. # ...
  25. # )
  26. #add dynamic reconfigure api
  27. #find_package(catkin REQUIRED dynamic_reconfigure)
  28. generate_dynamic_reconfigure_options(
  29. cfg/SnowboyReconfigure.cfg
  30. )
  31. # ------------------------------------------------------------------------------------------------
  32. # CATKIN EXPORT
  33. # ------------------------------------------------------------------------------------------------
  34. catkin_package(
  35. # INCLUDE_DIRS include
  36. # LIBRARIES hotword_detector
  37. # CATKIN_DEPENDS roscpp audio_common_msgs
  38. # DEPENDS system_lib
  39. )
  40. # ------------------------------------------------------------------------------------------------
  41. # BUILD
  42. # ------------------------------------------------------------------------------------------------
  43. include_directories(
  44. include
  45. 3rdparty
  46. ${catkin_INCLUDE_DIRS}
  47. )
  48. file(GLOB_RECURSE HEADER_FILES include/*.h)
  49. file(GLOB_RECURSE 3RD_PARTY_FILES 3rdparty/*.h)
  50. add_library(hotword_detector
  51. src/hotword_detector.cpp
  52. ${HEADER_FILES}
  53. ${3RD_PARTY_FILES}
  54. )
  55. target_link_libraries(hotword_detector
  56. ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/snowboy/lib/libsnowboy-detect.a
  57. ${catkin_LIBRARIES}
  58. ${BLAS_LIBRARIES}
  59. )
  60. add_executable(hotword_detector_node
  61. src/hotword_detector_node.cpp
  62. )
  63. target_link_libraries(hotword_detector_node
  64. hotword_detector
  65. ${catkin_LIBRARIES}
  66. )
  67. add_dependencies(hotword_detector_node ${PROJECT_NAME}_gencfg)
  68. install(
  69. TARGETS
  70. hotword_detector
  71. hotword_detector_node
  72. ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  73. LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  74. RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
  75. )
  76. install(
  77. DIRECTORY launch/
  78. DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
  79. )
  80. install(
  81. DIRECTORY resources/
  82. DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/resources
  83. )