-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
50 lines (41 loc) · 1.63 KB
/
CMakeLists.txt
File metadata and controls
50 lines (41 loc) · 1.63 KB
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
# Generated by "yarp cmake"
# A cmake file to get started with for new YARP projects.
# It assumes you want to build an executable from source code in
# the current directory.
# Replace "yarpy" with whatever your executable should be called.
cmake_minimum_required(VERSION 2.8.9)
set(KEYWORD "yarpy")
# Start a project.
project(${KEYWORD})
# Find YARP. Point the YARP_DIR environment variable at your build.
find_package(YARP REQUIRED)
list(APPEND CMAKE_MODULE_PATH ${YARP_MODULE_PATH})
find_package( OpenCV REQUIRED )
# Search for source code.
file(GLOB folder_source *.cpp *.cc *.c)
file(GLOB folder_header *.h)
source_group("Source Files" FILES ${folder_source})
source_group("Header Files" FILES ${folder_header})
# Search for IDL files.
file(GLOB idl_files *.thrift *.msg *.srv)
foreach(idl ${idl_files})
yarp_idl_to_dir(${idl} ${CMAKE_BINARY_DIR}/idl IDL_SRC IDL_HDR IDL_INCLUDE)
set(folder_source ${folder_source} ${IDL_SRC})
set(folder_header ${folder_header} ${IDL_HDR})
include_directories(${IDL_INCLUDE})
endforeach()
# 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})
# Set up our main executable.
if (folder_source)
add_executable(${KEYWORD} ${folder_source} ${folder_header})
target_link_libraries(${KEYWORD} ${YARP_LIBRARIES})
target_link_libraries( ${KEYWORD} ${OpenCV_LIBS} )
else (folder_source)
message(FATAL_ERROR "No source code files found. Please add something")
endif (folder_source)