hlrc / server / CMakeLists.txt @ 4b075581
History | View | Annotate | Download (4.315 KB)
1 | 0c286af0 | Simon Schulz | cmake_minimum_required(VERSION 2.8.3) |
---|---|---|---|
2 | project(hlrc_server) |
||
3 | |||
4 | ## System dependencies are found with CMake's conventions |
||
5 | # find_package(Boost REQUIRED COMPONENTS system) |
||
6 | |||
7 | INCLUDE(FindPkgConfig) |
||
8 | |||
9 | find_package(Boost REQUIRED COMPONENTS system thread) |
||
10 | |||
11 | ####################################### |
||
12 | # check if we have RSB support: |
||
13 | FIND_PACKAGE(RSB 0.11) |
||
14 | IF (RSB_FOUND) |
||
15 | #RSB |
||
16 | SET(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib:\$ORIGIN/") |
||
17 | FIND_PACKAGE(RSC 0.11 REQUIRED) |
||
18 | FIND_PACKAGE(RSB 0.11 REQUIRED) |
||
19 | #RST |
||
20 | FIND_PACKAGE(RST REQUIRED COMPONENTS sandbox) |
||
21 | INCLUDE_DIRECTORIES(BEFORE SYSTEM ${RST_INCLUDE_DIRS}) |
||
22 | ADD_DEFINITIONS(${RST_CFLAGS} ${RSTSANDBOX_CFLAGS}) |
||
23 | |||
24 | INCLUDE_DIRECTORIES(BEFORE SYSTEM ${RSB_INCLUDE_DIRS}) |
||
25 | LIST(INSERT CMAKE_MODULE_PATH 0 ${RSC_CMAKE_MODULE_PATH}) |
||
26 | #RSB |
||
27 | SET(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib:\$ORIGIN/") |
||
28 | FIND_PACKAGE(RSC 0.11 REQUIRED) |
||
29 | FIND_PACKAGE(RSB 0.11 REQUIRED) |
||
30 | #RST |
||
31 | FIND_PACKAGE(RST REQUIRED COMPONENTS sandbox) |
||
32 | INCLUDE_DIRECTORIES(BEFORE SYSTEM ${RST_INCLUDE_DIRS}) |
||
33 | ADD_DEFINITIONS(${RST_CFLAGS} ${RSTSANDBOX_CFLAGS}) |
||
34 | |||
35 | INCLUDE_DIRECTORIES(BEFORE SYSTEM ${RSB_INCLUDE_DIRS}) |
||
36 | LIST(INSERT CMAKE_MODULE_PATH 0 ${RSC_CMAKE_MODULE_PATH}) |
||
37 | |||
38 | message(STATUS "RSB Support is ON") |
||
39 | add_definitions(-DRSB_SUPPORT=1) |
||
40 | ENDIF (RSB_FOUND) |
||
41 | |||
42 | ################################################################ |
||
43 | # check for ROS support: |
||
44 | find_package(catkin) |
||
45 | IF (catkin_FOUND) |
||
46 | SET(ROS_FOUND 1) |
||
47 | |||
48 | find_package(catkin REQUIRED COMPONENTS roscpp std_msgs sensor_msgs message_generation genmsg actionlib_msgs actionlib) |
||
49 | |||
50 | message(STATUS "ROS Support is ON") |
||
51 | add_definitions(-DROS_SUPPORT=1) |
||
52 | |||
53 | add_message_files( |
||
54 | FILES |
||
55 | phoneme.msg |
||
56 | soundchunk.msg |
||
57 | ) |
||
58 | |||
59 | add_service_files( |
||
60 | FILES |
||
61 | ) |
||
62 | |||
63 | add_action_files( |
||
64 | DIRECTORY action |
||
65 | FILES |
||
66 | animation.action |
||
67 | speech.action |
||
68 | utterance.action |
||
69 | emotionstate.action |
||
70 | gazetarget.action |
||
71 | mouthtarget.action |
||
72 | ) |
||
73 | |||
74 | generate_messages( |
||
75 | DEPENDENCIES |
||
76 | actionlib_msgs |
||
77 | std_msgs |
||
78 | hlrc_server |
||
79 | ) |
||
80 | |||
81 | catkin_package( |
||
82 | INCLUDE_DIRS include |
||
83 | LIBRARIES hlrc_server |
||
84 | CATKIN_DEPENDS actionlib_msgs |
||
85 | #CATKIN_DEPENDS message_runtime |
||
86 | #DEPENDS system_lib |
||
87 | ) |
||
88 | ENDIF (catkin_FOUND) |
||
89 | |||
90 | add_definitions ("-Wall") |
||
91 | |||
92 | ################################### |
||
93 | # humotion |
||
94 | INCLUDE(FindPkgConfig) |
||
95 | find_package(humotion 0.0.1) |
||
96 | IF (humotion_FOUND) |
||
97 | message("> using humotion includes from " ${humotion_INCLUDE_DIRS}) |
||
98 | ELSE (humotion_FOUND) |
||
99 | message(FATAL_ERROR "> error: can not find libhumotion") |
||
100 | |||
101 | endif (humotion_FOUND) |
||
102 | |||
103 | ################################### |
||
104 | # libao audio |
||
105 | PKG_CHECK_MODULES(AO REQUIRED ao>=1.1.0) |
||
106 | IF (AO_FOUND) |
||
107 | SET(AO_LIBRARY_DIRS "${AO_PREFIX}/lib") |
||
108 | SET(AO_INCLUDE_DIRS "${AO_PREFIX}/include") |
||
109 | SET(AO_LIBRARIES "ao") |
||
110 | MESSAGE("using libao version ${AO_VERSION} from ${AO_PREFIX}") |
||
111 | ELSE (AO_FOUND) |
||
112 | message(FATAL_ERROR "Error: Cannot find libao") |
||
113 | ENDIF (AO_FOUND) |
||
114 | |||
115 | #build |
||
116 | include_directories(include ${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${humotion_INCLUDE_DIRS} ${AO_INCLUDE_DIRS}) |
||
117 | link_directories(${catkin_LIBRARY_DIRS} ${Boost_LIBRARY_DIRS} ${AO_LIBRARY_DIRS}) |
||
118 | |||
119 | #build dummy list of header files |
||
120 | file(GLOB DUMMY_HEADER_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} include/*.h include/RSB/*.h include/ROS/*.h) |
||
121 | |||
122 | # declare library |
||
123 | add_executable(${PROJECT_NAME} |
||
124 | src/main.cpp |
||
125 | src/MiddlewareRSB.cpp |
||
126 | src/MiddlewareROS.cpp |
||
127 | src/Arbiter.cpp |
||
128 | src/Utterance.cpp |
||
129 | src/Animation.cpp |
||
130 | src/AudioPlayer.cpp |
||
131 | src/AudioPlayerRSB.cpp |
||
132 | src/AudioPlayerLibAO.cpp |
||
133 | src/MouthConfig.cpp |
||
134 | src/EmotionState.cpp |
||
135 | src/EmotionConfig.cpp |
||
136 | src/Middleware.cpp |
||
137 | ${MIDDLEWARE_SOURCES} |
||
138 | ${DUMMY_HEADER_LIST} |
||
139 | ) |
||
140 | |||
141 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") |
||
142 | |||
143 | #create example: |
||
144 | target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES} ${RSB_LIBRARIES} ${catkin_LIBRARIES} ${RST_LIBRARIES} ${humotion_LIBRARIES} ${AO_LIBRARIES}) |
||
145 | |||
146 | IF (catkin_FOUND) |
||
147 | add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS} hlrc_server_gencpp) |
||
148 | ENDIF (catkin_FOUND) |
||
149 | |||
150 | # install(TARGETS ${PROJECT_NAME} |
||
151 | # ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} |
||
152 | # LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} |
||
153 | # RUNTIME DESTINATION bin |
||
154 | # ) |
||
155 | |||
156 | install(TARGETS ${PROJECT_NAME} DESTINATION bin) |
||
157 |