hlrc / server / CMakeLists.txt @ 2a6db5bb
History | View | Annotate | Download (3.267 KB)
1 |
cmake_minimum_required(VERSION 2.8.3) |
---|---|
2 |
project(hlrc_server) |
3 |
|
4 |
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 |
INCLUDE(FindPkgConfig) |
11 |
|
12 |
####################################### |
13 |
|
14 |
# check for ROS support: |
15 |
find_package(catkin QUIET) |
16 |
IF (catkin_FOUND) |
17 |
SET(ROS_FOUND 1) |
18 |
|
19 |
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 |
find_package(PkgConfig REQUIRED) |
21 |
pkg_search_module(EIGEN3 REQUIRED eigen3) |
22 |
|
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 |
utterance.msg |
31 |
) |
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 |
tts.action |
44 |
emotionstate.action |
45 |
gazetarget.action |
46 |
lookattarget.action |
47 |
mouthtarget.action |
48 |
) |
49 |
|
50 |
generate_messages( |
51 |
DEPENDENCIES |
52 |
actionlib_msgs |
53 |
std_msgs |
54 |
geometry_msgs |
55 |
hlrc_server |
56 |
) |
57 |
|
58 |
catkin_package( |
59 |
# INCLUDE_DIRS include |
60 |
LIBRARIES |
61 |
CATKIN_DEPENDS actionlib_msgs |
62 |
#CATKIN_DEPENDS message_runtime |
63 |
#DEPENDS system_lib |
64 |
) |
65 |
ELSE(catkin_FOUND) |
66 |
message(STATUS "ROS not found.") |
67 |
ENDIF(catkin_FOUND) |
68 |
|
69 |
add_definitions ("-Wall") |
70 |
|
71 |
################################### |
72 |
# humotion |
73 |
INCLUDE(FindPkgConfig) |
74 |
find_package(humotion 0.0.1 REQUIRED) |
75 |
message(STATUS "using humotion includes from " ${humotion_INCLUDE_DIRS}) |
76 |
|
77 |
################################### |
78 |
# libao audio |
79 |
PKG_CHECK_MODULES(AO REQUIRED ao>=1.1.0) |
80 |
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 |
|
85 |
#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 |
|
89 |
#build dummy list of header files |
90 |
file(GLOB DUMMY_HEADER_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} include/*.h include/ROS/*.h) |
91 |
|
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 |
target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES} ${catkin_LIBRARIES} ${humotion_LIBRARIES} ${AO_LIBRARIES}) |
113 |
set_property(TARGET ${PROJECT_NAME} PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE) |
114 |
|
115 |
|
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) |