-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
76 lines (62 loc) · 2.32 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
##
# Copyright (C) 2013 MACSi Project
# Author: Woody Rousseau
# email: [email protected]
# website: www.macsi.isir.upmc.fr
# Permission is granted to copy, distribute, and/or modify this program
# under the terms of the GNU General Public License, version 2 or any
# later version published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details
##
cmake_minimum_required(VERSION 2.8)
set(KEYWORD "yarprosbridge")
# Start a project.
project(${KEYWORD})
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
# Find YARP. Point the YARP_DIR environment variable at your build.
find_package(YARP REQUIRED)
find_package(OpenCV REQUIRED)
find_package(PythonLibs REQUIRED)
#ADD_ROSPACK_DEPENDENCY(roscpp)
find_package(catkin REQUIRED COMPONENTS roscpp cv_bridge)
# Search for source code.
file(GLOB folder_source src/*.cpp src/*.cc src/*.c)
file(GLOB folder_header include/*.h)
source_group("Source Files" FILES ${folder_source})
source_group("Header Files" FILES ${folder_header})
# Automatically add include directories if needed.
foreach(header_file ${folder_header})
get_filename_component(p ${header_file} PATH)
include_directories(${p})
endforeach(header_file ${folder_header})
# Inclue any directories needed for YARP
include_directories(${YARP_INCLUDE_DIRS}
${modHelp_INCLUDE_DIRS}
${objects_INCLUDE_DIRS}
${PYTHON_INCLUDE_DIRS})
# Set up our main executable.
if (folder_source)
add_executable(${KEYWORD} ${folder_source} ${folder_header})
target_link_libraries(${KEYWORD} ${YARP_LIBRARIES}
${OpenCV_LIBS}
${PYTHON_LIBRARIES}
modHelp
objects)
else (folder_source)
message(FATAL_ERROR "No source code files found. Please add something")
endif (folder_source)
install(TARGETS ${KEYWORD} DESTINATION /usr/local/bin)
target_link_libraries(${KEYWORD}
${catkin_LIBRARIES}
)
add_custom_target(run
COMMAND yarprosbridge
DEPENDS yarprosbridge
WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
)
set(CMAKE_CXX_FLAGS "-std=c++0x -ggdb")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lpython2.7")