cmake_minimum_required(VERSION 2.8.3) project(hlrc_server) ## System dependencies are found with CMake's conventions # find_package(Boost REQUIRED COMPONENTS system) INCLUDE(FindPkgConfig) find_package(Boost REQUIRED COMPONENTS system thread) ####################################### # check if we have RSB support: FIND_PACKAGE(RSB 0.11) IF (RSB_FOUND) #RSB SET(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib:\$ORIGIN/") FIND_PACKAGE(RSC 0.11 REQUIRED) FIND_PACKAGE(RSB 0.11 REQUIRED) #RST FIND_PACKAGE(RST REQUIRED COMPONENTS sandbox) INCLUDE_DIRECTORIES(BEFORE SYSTEM ${RST_INCLUDE_DIRS}) ADD_DEFINITIONS(${RST_CFLAGS} ${RSTSANDBOX_CFLAGS}) INCLUDE_DIRECTORIES(BEFORE SYSTEM ${RSB_INCLUDE_DIRS}) LIST(INSERT CMAKE_MODULE_PATH 0 ${RSC_CMAKE_MODULE_PATH}) #RSB SET(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib:\$ORIGIN/") FIND_PACKAGE(RSC 0.11 REQUIRED) FIND_PACKAGE(RSB 0.11 REQUIRED) #RST FIND_PACKAGE(RST REQUIRED COMPONENTS sandbox) INCLUDE_DIRECTORIES(BEFORE SYSTEM ${RST_INCLUDE_DIRS}) ADD_DEFINITIONS(${RST_CFLAGS} ${RSTSANDBOX_CFLAGS}) INCLUDE_DIRECTORIES(BEFORE SYSTEM ${RSB_INCLUDE_DIRS}) LIST(INSERT CMAKE_MODULE_PATH 0 ${RSC_CMAKE_MODULE_PATH}) message(STATUS "RSB Support is ON") add_definitions(-DRSB_SUPPORT=1) ENDIF (RSB_FOUND) ################################################################ # check for ROS support: find_package(catkin) IF (catkin_FOUND) SET(ROS_FOUND 1) find_package(catkin REQUIRED COMPONENTS roscpp std_msgs sensor_msgs message_generation genmsg actionlib_msgs actionlib) message(STATUS "ROS Support is ON") add_definitions(-DROS_SUPPORT=1) add_message_files( FILES phoneme.msg soundchunk.msg ) add_service_files( FILES ) add_action_files( DIRECTORY action FILES animation.action speech.action utterance.action emotionstate.action gazetarget.action mouthtarget.action ) generate_messages( DEPENDENCIES actionlib_msgs std_msgs hlrc_server ) catkin_package( INCLUDE_DIRS include LIBRARIES hlrc_server CATKIN_DEPENDS actionlib_msgs #CATKIN_DEPENDS message_runtime #DEPENDS system_lib ) ENDIF (catkin_FOUND) add_definitions ("-Wall") ################################### # humotion INCLUDE(FindPkgConfig) find_package(humotion 0.0.1) IF (humotion_FOUND) message("> using humotion includes from " ${humotion_INCLUDE_DIRS}) ELSE (humotion_FOUND) message(FATAL_ERROR "> error: can not find libhumotion") endif (humotion_FOUND) ################################### # libao audio PKG_CHECK_MODULES(AO REQUIRED ao>=1.1.0) IF (AO_FOUND) SET(AO_LIBRARY_DIRS "${AO_PREFIX}/lib") SET(AO_INCLUDE_DIRS "${AO_PREFIX}/include") SET(AO_LIBRARIES "ao") MESSAGE("using libao version ${AO_VERSION} from ${AO_PREFIX}") ELSE (AO_FOUND) message(FATAL_ERROR "Error: Cannot find libao") ENDIF (AO_FOUND) #build include_directories(include ${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${humotion_INCLUDE_DIRS} ${AO_INCLUDE_DIRS}) link_directories(${catkin_LIBRARY_DIRS} ${Boost_LIBRARY_DIRS} ${AO_LIBRARY_DIRS}) #build dummy list of header files file(GLOB DUMMY_HEADER_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} include/*.h include/RSB/*.h include/ROS/*.h) # declare library add_executable(${PROJECT_NAME} src/main.cpp src/MiddlewareRSB.cpp src/MiddlewareROS.cpp src/Arbiter.cpp src/Utterance.cpp src/Animation.cpp src/AudioPlayer.cpp src/AudioPlayerRSB.cpp src/AudioPlayerLibAO.cpp src/MouthConfig.cpp src/EmotionState.cpp src/EmotionConfig.cpp src/Middleware.cpp ${MIDDLEWARE_SOURCES} ${DUMMY_HEADER_LIST} ) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") #create example: target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES} ${RSB_LIBRARIES} ${catkin_LIBRARIES} ${RST_LIBRARIES} ${humotion_LIBRARIES} ${AO_LIBRARIES}) IF (catkin_FOUND) add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS} hlrc_server_gencpp) ENDIF (catkin_FOUND) # install(TARGETS ${PROJECT_NAME} # ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} # LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} # RUNTIME DESTINATION bin # ) install(TARGETS ${PROJECT_NAME} DESTINATION bin) install(PROGRAMS tools/hlrc_test_gui.py DESTINATION bin) install(FILES tools/hlrc_play_animation.py DESTINATION lib/python2.7/site-packages) install(FILES tools/hlrc_speak_utterance.py DESTINATION lib/python2.7/site-packages) #workaround to keep functionallity of old py scripts: install(PROGRAMS tools/hlrc_speak_utterance.py DESTINATION bin) install(PROGRAMS tools/hlrc_play_animation.py DESTINATION bin) install(PROGRAMS tools/hlrc_set_emotion.py DESTINATION bin) install(FILES tools/textgrid_hlrc.py DESTINATION lib/python2.7/site-packages) FILE(GLOB example_files_wav "${CMAKE_CURRENT_SOURCE_DIR}/tools/examples/*.wav") FILE(GLOB example_files_praat "${CMAKE_CURRENT_SOURCE_DIR}/tools/examples/*.praat") LIST(APPEND example_files ${example_files_wav} ${example_files_praat}) install(FILES ${example_files} DESTINATION share/hlrc_server/examples)