Statistics
| Branch: | Tag: | Revision:

hlrc / server / CMakeLists.txt @ master

History | View | Annotate | Download (3.081 KB)

1
cmake_minimum_required(VERSION 2.8.3)
2
project(hlrc_server)
3

    
4
INCLUDE(FindPkgConfig)
5

    
6
#######################################
7

    
8
# check for ROS support:
9
find_package(catkin QUIET)
10
IF (catkin_FOUND)
11
    SET(ROS_FOUND 1)
12

    
13
    find_package(catkin REQUIRED COMPONENTS roscpp std_msgs geometry_msgs sensor_msgs message_generation genmsg actionlib_msgs actionlib tf2_ros tf2_eigen angles humotion)
14
    find_package(PkgConfig REQUIRED)
15
    pkg_search_module(EIGEN3 REQUIRED eigen3)
16

    
17
    message(STATUS "ROS Support is ON")
18
    add_definitions(-DROS_SUPPORT=1)
19

    
20
    add_message_files(
21
        FILES
22
        phoneme.msg
23
        soundchunk.msg
24
        utterance.msg
25
    )
26

    
27
    add_service_files(
28
        FILES
29
    )
30

    
31
    add_action_files(
32
        DIRECTORY action
33
        FILES
34
        animation.action
35
        speech.action
36
        utterance.action
37
        tts.action
38
        emotionstate.action
39
        gazetarget.action
40
        lookattarget.action
41
        mouthtarget.action
42
    )
43

    
44
    generate_messages(
45
        DEPENDENCIES
46
        actionlib_msgs
47
        std_msgs
48
        geometry_msgs
49
        hlrc_server
50
    )
51

    
52
    catkin_package(
53
        # INCLUDE_DIRS include
54
        LIBRARIES
55
        CATKIN_DEPENDS actionlib_msgs
56
        #CATKIN_DEPENDS message_runtime
57
        #DEPENDS system_lib
58
    )
59
ELSE(catkin_FOUND)
60
    message(STATUS "ROS not found.")
61
ENDIF(catkin_FOUND)
62

    
63
add_definitions ("-Wall")
64

    
65
###################################
66
# humotion
67
INCLUDE(FindPkgConfig)
68
find_package(humotion 0.0.1 REQUIRED)
69
message(STATUS "using humotion includes from " ${humotion_INCLUDE_DIRS})
70

    
71
###################################
72
# libao audio
73
PKG_CHECK_MODULES(AO REQUIRED ao>=1.1.0)
74
SET(AO_LIBRARY_DIRS "${AO_PREFIX}/lib")
75
SET(AO_INCLUDE_DIRS "${AO_PREFIX}/include")
76
SET(AO_LIBRARIES "ao")
77
MESSAGE(STATUS "using libao version ${AO_VERSION} from ${AO_PREFIX}")
78

    
79
#build
80
include_directories(include ${catkin_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIRS} ${humotion_INCLUDE_DIRS} ${AO_INCLUDE_DIRS} ${humotion_INCLUDE_DIRS})
81
link_directories(${catkin_LIBRARY_DIRS} ${AO_LIBRARY_DIRS} ${humotion_LIBRARY_DIRS})
82

    
83
#build dummy list of header files
84
file(GLOB DUMMY_HEADER_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} include/*.h include/ROS/*.h)
85

    
86
# declare library
87
add_executable(${PROJECT_NAME}
88
    src/main.cpp
89
    src/MiddlewareROS.cpp
90
    src/Arbiter.cpp
91
    src/Utterance.cpp
92
    src/Animation.cpp
93
    src/AudioPlayer.cpp
94
    src/AudioPlayerLibAO.cpp
95
    src/MouthConfig.cpp
96
    src/EmotionState.cpp
97
    src/EmotionConfig.cpp
98
    src/Middleware.cpp
99
    ${MIDDLEWARE_SOURCES}
100
    ${DUMMY_HEADER_LIST}
101
)
102

    
103
#create example:
104
target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES} ${catkin_LIBRARIES} ${humotion_LIBRARIES} ${AO_LIBRARIES})
105
set_property(TARGET ${PROJECT_NAME} PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
106

    
107

    
108
IF (catkin_FOUND)
109
add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS} hlrc_server_gencpp)
110
ENDIF (catkin_FOUND)
111

    
112
#    install(TARGETS ${PROJECT_NAME}
113
#        ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
114
#        LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
115
#        RUNTIME DESTINATION bin
116
#    )
117

    
118
install(TARGETS ${PROJECT_NAME} DESTINATION bin)