hlrc / server / CMakeLists.txt @ d81c4f8b
History | View | Annotate | Download (3.267 KB)
1 | 0c286af0 | Simon Schulz | cmake_minimum_required(VERSION 2.8.3) |
---|---|---|---|
2 | project(hlrc_server) |
||
3 | |||
4 | fc4357ee | Robert Haschke | if(NOT "${CMAKE_CXX_STANDARD}") |
5 | set(CMAKE_CXX_STANDARD 11) |
||
6 | endif() |
||
7 | set(CMAKE_CXX_STANDARD_REQUIRED ON) |
||
8 | set(CMAKE_CXX_EXTENSIONS OFF) |
||
9 | |||
10 | 0c286af0 | Simon Schulz | INCLUDE(FindPkgConfig) |
11 | |||
12 | ####################################### |
||
13 | 9aa2bb7c | semeyerz | |
14 | 0c286af0 | Simon Schulz | # check for ROS support: |
15 | 23fe067c | Robert Haschke | find_package(catkin QUIET) |
16 | 0c286af0 | Simon Schulz | IF (catkin_FOUND) |
17 | SET(ROS_FOUND 1) |
||
18 | |||
19 | 96284eda | Fabian Berthold | find_package(catkin REQUIRED COMPONENTS roscpp std_msgs geometry_msgs sensor_msgs message_generation genmsg actionlib_msgs actionlib tf2_ros tf2_eigen angles humotion) |
20 | 2cf3c285 | Robert Haschke | find_package(PkgConfig REQUIRED) |
21 | pkg_search_module(EIGEN3 REQUIRED eigen3) |
||
22 | 0c286af0 | Simon Schulz | |
23 | message(STATUS "ROS Support is ON") |
||
24 | add_definitions(-DROS_SUPPORT=1) |
||
25 | |||
26 | add_message_files( |
||
27 | FILES |
||
28 | phoneme.msg |
||
29 | soundchunk.msg |
||
30 | b47687f8 | Robert Haschke | utterance.msg |
31 | 0c286af0 | Simon Schulz | ) |
32 | |||
33 | add_service_files( |
||
34 | FILES |
||
35 | ) |
||
36 | |||
37 | add_action_files( |
||
38 | DIRECTORY action |
||
39 | FILES |
||
40 | animation.action |
||
41 | speech.action |
||
42 | utterance.action |
||
43 | b47687f8 | Robert Haschke | tts.action |
44 | 0c286af0 | Simon Schulz | emotionstate.action |
45 | gazetarget.action |
||
46 | b47687f8 | Robert Haschke | lookattarget.action |
47 | 0c286af0 | Simon Schulz | mouthtarget.action |
48 | ) |
||
49 | |||
50 | generate_messages( |
||
51 | DEPENDENCIES |
||
52 | actionlib_msgs |
||
53 | std_msgs |
||
54 | b47687f8 | Robert Haschke | geometry_msgs |
55 | 0c286af0 | Simon Schulz | hlrc_server |
56 | ) |
||
57 | |||
58 | catkin_package( |
||
59 | 96284eda | Fabian Berthold | # INCLUDE_DIRS include |
60 | f0dcf4ca | Robert Haschke | LIBRARIES |
61 | 0c286af0 | Simon Schulz | CATKIN_DEPENDS actionlib_msgs |
62 | #CATKIN_DEPENDS message_runtime |
||
63 | #DEPENDS system_lib |
||
64 | ) |
||
65 | 23fe067c | Robert Haschke | ELSE(catkin_FOUND) |
66 | message(STATUS "ROS not found.") |
||
67 | ENDIF(catkin_FOUND) |
||
68 | 0c286af0 | Simon Schulz | |
69 | add_definitions ("-Wall") |
||
70 | |||
71 | ################################### |
||
72 | # humotion |
||
73 | INCLUDE(FindPkgConfig) |
||
74 | 23fe067c | Robert Haschke | find_package(humotion 0.0.1 REQUIRED) |
75 | message(STATUS "using humotion includes from " ${humotion_INCLUDE_DIRS}) |
||
76 | 0c286af0 | Simon Schulz | |
77 | ################################### |
||
78 | # libao audio |
||
79 | PKG_CHECK_MODULES(AO REQUIRED ao>=1.1.0) |
||
80 | 23fe067c | Robert Haschke | SET(AO_LIBRARY_DIRS "${AO_PREFIX}/lib") |
81 | SET(AO_INCLUDE_DIRS "${AO_PREFIX}/include") |
||
82 | SET(AO_LIBRARIES "ao") |
||
83 | MESSAGE(STATUS "using libao version ${AO_VERSION} from ${AO_PREFIX}") |
||
84 | 0c286af0 | Simon Schulz | |
85 | fc4357ee | Robert Haschke | #build |
86 | include_directories(include ${catkin_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIRS} ${humotion_INCLUDE_DIRS} ${AO_INCLUDE_DIRS} ${humotion_INCLUDE_DIRS}) |
||
87 | link_directories(${catkin_LIBRARY_DIRS} ${AO_LIBRARY_DIRS} ${humotion_LIBRARY_DIRS}) |
||
88 | 0c286af0 | Simon Schulz | |
89 | #build dummy list of header files |
||
90 | d81c4f8b | Matthias Barth | file(GLOB DUMMY_HEADER_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} include/*.h include/ROS/*.h) |
91 | 0c286af0 | Simon Schulz | |
92 | # declare library |
||
93 | add_executable(${PROJECT_NAME} |
||
94 | src/main.cpp |
||
95 | src/MiddlewareROS.cpp |
||
96 | src/Arbiter.cpp |
||
97 | src/Utterance.cpp |
||
98 | src/Animation.cpp |
||
99 | src/AudioPlayer.cpp |
||
100 | src/AudioPlayerLibAO.cpp |
||
101 | src/MouthConfig.cpp |
||
102 | src/EmotionState.cpp |
||
103 | src/EmotionConfig.cpp |
||
104 | src/Middleware.cpp |
||
105 | ${MIDDLEWARE_SOURCES} |
||
106 | ${DUMMY_HEADER_LIST} |
||
107 | ) |
||
108 | |||
109 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") |
||
110 | |||
111 | #create example: |
||
112 | d81c4f8b | Matthias Barth | target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES} ${catkin_LIBRARIES} ${humotion_LIBRARIES} ${AO_LIBRARIES}) |
113 | 5303d8b4 | Simon Schulz | set_property(TARGET ${PROJECT_NAME} PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE) |
114 | |||
115 | 0c286af0 | Simon Schulz | |
116 | IF (catkin_FOUND) |
||
117 | add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS} hlrc_server_gencpp) |
||
118 | ENDIF (catkin_FOUND) |
||
119 | |||
120 | # install(TARGETS ${PROJECT_NAME} |
||
121 | # ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} |
||
122 | # LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} |
||
123 | # RUNTIME DESTINATION bin |
||
124 | # ) |
||
125 | |||
126 | install(TARGETS ${PROJECT_NAME} DESTINATION bin) |