Statistics
| Branch: | Tag: | Revision:

humotion / examples / yarp_icub / CMakeLists.txt @ 79d4e516

History | View | Annotate | Download (1.941 KB)

1
PROJECT(humotion_yarp_icub)
2
cmake_minimum_required(VERSION 2.8)
3

    
4
FIND_PACKAGE(YARP)
5
FIND_PACKAGE(ICUB)
6
FIND_PACKAGE(Boost REQUIRED COMPONENTS system thread)
7
FIND_PACKAGE(humotion)
8

    
9
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
10

    
11
# add include directories
12
INCLUDE_DIRECTORIES(${YARP_INCLUDE_DIRS} ${ICUB_INCLUDE_DIRS} ${humotion_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} include/)
13
link_directories(${Boost_LIBRARY_DIRS} ${humotion_LIBRARY_DIRS})
14

    
15
# add required linker flags
16
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${ICUB_LINK_FLAGS}")
17
SET(MAIN icub_humotion_server)
18

    
19
file(GLOB DUMMY_HEADER_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} include/*.h)
20

    
21
ADD_EXECUTABLE(${MAIN} src/main.cpp src/icub_jointinterface.cpp src/icub_faceinterface.cpp src/icub_data_receiver.cpp ${DUMMY_HEADER_LIST})
22

    
23
# we now add the YARP and iCub libraries to our project.
24
TARGET_LINK_LIBRARIES(${MAIN} ${Boost_LIBRARIES} ${YARP_LIBRARIES} ${ICUB_LIBRARIES} ${humotion_LIBRARIES})
25
set_property(TARGET ${MAIN} PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
26

    
27
INSTALL(TARGETS ${MAIN} DESTINATION bin)
28

    
29

    
30
#################
31
## style guide ##
32
#################
33
SET(CPPLINT_CMAKE ${CMAKE_CURRENT_SOURCE_DIR}/../../stylecheck/CpplintWrapper.cmake)
34

    
35
if(EXISTS "${CPPLINT_CMAKE}")
36
  set(ENABLE_CPPLINT 1)
37
  include(${CPPLINT_CMAKE})
38
  CPPLINT_RECURSIVE(cpplint_include
39
    ${CMAKE_CURRENT_SOURCE_DIR}/include
40
    ${CMAKE_CURRENT_SOURCE_DIR}/include
41
    ${CMAKE_CURRENT_BINARY_DIR}/include)
42
  CPPLINT_RECURSIVE(cpplint_src
43
    ${CMAKE_CURRENT_SOURCE_DIR}/src
44
    ${CMAKE_CURRENT_SOURCE_DIR}/src
45
    ${CMAKE_CURRENT_BINARY_DIR}/src)
46
  add_dependencies(${MAIN} cpplint_src cpplint_include)
47
else ()
48
  message(WARNING "Could not find cpplint cmake file. Will not do code stylecheck!")
49
endif ()
50
#workaround for qtcreator ide integration. do not remove!
51
file(GLOB_RECURSE NODE_DUMMY_TARGETS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.h *.cfg *.yaml *.xml *.launch)
52
add_custom_target(_dummy_target SOURCES ${NODE_DUMMY_TARGETS})
53