Statistics
| Branch: | Tag: | Revision:

humotion / examples / meka / CMakeLists.txt @ 5fba4e15

History | View | Annotate | Download (1.862 KB)

1
PROJECT(meka_humotion_server)
2
cmake_minimum_required(VERSION 2.8)
3
SET(MAIN ${PROJECT_NAME})
4

    
5
set(ENV{ROS_LANG_DISABLE} "genjava")
6
set(ROS_BUILD_TYPE Debug)
7

    
8
################################################################
9
# check for ROS support:
10
find_package(catkin REQUIRED COMPONENTS roscpp std_msgs sensor_msgs message_generation genmsg)
11
IF (catkin_FOUND)
12
    set(ROS_FOUND 1)
13
    message(STATUS "ROS Support is ON")
14
    add_definitions(-DROS_SUPPORT=1)
15
ENDIF (catkin_FOUND)
16

    
17
IF (NOT catkin_FOUND)
18
  message(FATAL_ERROR "Error: could not find ROS!")
19
ENDIF ()
20

    
21
FIND_PACKAGE(Boost REQUIRED COMPONENTS system thread)
22
FIND_PACKAGE(humotion)
23

    
24
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
25
#add_message_files(
26
#    FILES
27
#)
28

    
29
#generate_messages(
30
#    DEPENDENCIES
31
#    std_msgs
32
#)
33

    
34
#hack to allow sub dir calls work
35

    
36
catkin_package(
37
    INCLUDE_DIRS include
38
    LIBRARIES humotion
39
    #CATKIN_DEPENDS message_runtime
40
    #DEPENDS system_lib
41
)
42

    
43
include_directories( ${catkin_INCLUDE_DIRS})
44

    
45
# add include directories
46
INCLUDE_DIRECTORIES(${YARP_INCLUDE_DIRS} ${ICUB_INCLUDE_DIRS} ${humotion_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} include/)
47
link_directories(${Boost_LIBRARY_DIRS} ${humotion_LIBRARY_DIRS})
48

    
49
# add required linker flags
50

    
51
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${ICUB_LINK_FLAGS}")
52
file(GLOB DUMMY_HEADER_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} include/*.h)
53

    
54
#add_dependencies(${MAIN} ${catkin_EXPORTED_TARGETS})
55
ADD_EXECUTABLE(${MAIN} src/main.cpp src/mekajointinterface.cpp ${DUMMY_HEADER_LIST})
56

    
57
TARGET_LINK_LIBRARIES(${MAIN} ${Boost_LIBRARIES} ${catkin_LIBRARIES} ${humotion_LIBRARIES})
58
set_property(TARGET ${MAIN} PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
59

    
60

    
61
#INSTALL(TARGETS ${MAIN} DESTINATION bin)
62
install(TARGETS ${MAIN}
63
    ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
64
    LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
65
    RUNTIME DESTINATION bin 
66
)
67