forked from robotology/yarp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
103 lines (79 loc) · 3.52 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Copyright: (C) 2009, 2010 RobotCub Consortium
# Authors: Paul Fitzpatrick, Giorgio Metta, Lorenzo Natale
# CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT
cmake_minimum_required(VERSION 3.0)
# Pick up our CMake scripts - they are all in the cmake subdirectory.
set(YARP_MODULE_DIR "${CMAKE_SOURCE_DIR}/cmake")
set(YARP_MODULE_PATH "${YARP_MODULE_DIR}")
set(YCM_REQUIRED_VERSION 0.4.0) # Used also by YarpFindDependencies
find_package(YCM ${YCM_REQUIRED_VERSION} QUIET)
if(NOT YCM_FOUND)
list(APPEND YARP_MODULE_PATH "${YARP_MODULE_DIR}/ycm-${YCM_REQUIRED_VERSION}/find-modules"
"${YARP_MODULE_DIR}/ycm-${YCM_REQUIRED_VERSION}/modules"
"${YARP_MODULE_DIR}/ycm-${YCM_REQUIRED_VERSION}/3rdparty"
"${YARP_MODULE_DIR}/ycm-${YCM_REQUIRED_VERSION}/cmake-next")
if(${CMAKE_VERSION} VERSION_LESS 3.1)
list(APPEND YARP_MODULE_PATH "${YARP_MODULE_DIR}/ycm-${YCM_REQUIRED_VERSION}/cmake-3.1/Modules")
endif()
endif()
list(APPEND CMAKE_MODULE_PATH ${YARP_MODULE_PATH})
# Get the current YARP version.
# See cmake/YarpVersion.cmake.
include(YarpVersion)
# Main project
project(YARP
VERSION ${YARP_VERSION_SHORT}
LANGUAGES C CXX)
message(STATUS "Using:")
message(STATUS " CMake: ${CMAKE_VERSION} (${CMAKE_COMMAND})")
message(STATUS " C Compiler: ${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION} (${CMAKE_C_COMPILER})")
message(STATUS " CXX Compiler: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} (${CMAKE_CXX_COMPILER})")
# The YARP build is fairly flexible, so we need to accumulate some
# information about what libraries are being built (and their dependencies),
# along with the include path. We'll be passing that along to clients
# using YARP without a global install.
set_property(GLOBAL PROPERTY YARP_TREE_INCLUDE_DIRS)
set_property(GLOBAL PROPERTY YARP_LIBS)
set_property(GLOBAL PROPERTY YARP_TOOLS)
set_property(GLOBAL PROPERTY YARP_DEFS)
set_property(GLOBAL PROPERTY USE_FOLDERS 1)
set_property(GLOBAL PROPERTY AUTOGEN_TARGETS_FOLDER "Autogen Targets")
set_property(GLOBAL PROPERTY AUTOGEN_SOURCE_GROUP "Generated Files")
# Check system configuration.
# See cmake/YarpSystemCheck.cmake.
include(YarpSystemCheck)
# Set up some compilation options.
# See cmake/YarpOptions.cmake.
include(YarpOptions)
# Check YARP dependencies, find necessary libraries.
# See cmake/YarpFindDependencies.cmake.
include(YarpFindDependencies)
include(YarpSourceGroup)
# Make some custom header files containing compile settings.
add_subdirectory(cmake)
# Build required 3rd party libraries
add_subdirectory(extern)
# Set up the main libraries and utilities.
add_subdirectory(src)
# Offer to compile bindings
add_subdirectory(bindings)
# Tests
add_subdirectory(tests)
# Platform independent data
add_subdirectory(data)
# Output configuration files describing how YARP was built, and how
# its libraries may be linked against and used. This uses
# information accumulated in the global property variables set up earlier.
# See cmake/YarpDescribe.cmake
include(YarpDescribe)
# Set up some packaging properties (for generating tarballs etc).
# See cmake/YarpPackage.cmake
include(YarpPackage)
# Make documentation target, documentation goes in doc subdirectory
# of build. See cmake/YarpDoc.cmake
include(YarpDoc)
# Make sure yarp.i and related source files get installed, to allow
# bindings for other languages to be compiled from the build material.
include(YarpBindingsSource)
# add rule for uninstalling YARP
include(AddUninstallTarget)