-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
52 lines (37 loc) · 1.88 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
# Copyright: (C) 2015 iCub Facility Istituto Italiano di Tecnologia
# Authors: Raffaele Colombo
# CopyPolicy: Released under the terms of the GNU GPL v2.0.
cmake_minimum_required(VERSION 3.12)
project(R1_OBJECT_RETRIEVAL LANGUAGES CXX C VERSION 1.0.0)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED 11)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
find_package(YCM)
find_package(YARP 3.7 REQUIRED COMPONENTS os sig dev math idl_tools)
find_package(ICUB REQUIRED)
list(APPEND CMAKE_MODULE_PATH ${ICUB_MODULE_PATH})
find_package(IPOPT)
if(NOT IPOPT_FOUND)
message(WARNING "IPOPT library was not found, some kinematics module will not be available.")
endif()
include(GNUInstallDirs)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
set(YARP_FORCE_DYNAMIC_PLUGINS TRUE CACHE INTERNAL "${PROJECT_NAME} is always built with dynamic plugins")
yarp_configure_external_installation(${PROJECT_NAME} WITH_PLUGINS)
include(AddInstallRPATHSupport)
add_install_rpath_support(BIN_DIRS "${CMAKE_INSTALL_FULL_BINDIR}"
LIB_DIRS "${CMAKE_INSTALL_FULL_LIBDIR}"
INSTALL_NAME_DIR "${CMAKE_INSTALL_FULL_LIBDIR}"
USE_LINK_PATH)
# Everything is configured now, we can start adding source code
add_subdirectory(app)
add_subdirectory(modules)
add_subdirectory(interfaces)
# Append to .bashrc
file(APPEND $ENV{HOME}/.bashrc "\n##### R1 OBJECT RETRIEVAL #####")
file(APPEND $ENV{HOME}/.bashrc "\nexport R1_OBR_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}")
file(APPEND $ENV{HOME}/.bashrc "\nexport R1_OBR_BUILD_DIR=${CMAKE_CURRENT_BINARY_DIR}")