forked from roboptim/roboptim-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
114 lines (102 loc) · 5.14 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
104
105
106
107
108
109
110
111
112
113
114
# Copyright 2010, Thomas Moulard, LAAS-CNRS
#
# This file is part of roboptim-core.
# roboptim-core is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# roboptim-core 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 Lesser Public License for more details.
# You should have received a copy of the GNU Lesser General Public License
# along with roboptim-core. If not, see <http://www.gnu.org/licenses/>.
# Requires at least CMake 2.6 to configure the package.
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
INCLUDE(cmake/base.cmake)
INCLUDE(cmake/boost.cmake)
INCLUDE(cmake/lapack.cmake)
INCLUDE(cmake/cpack.cmake)
INCLUDE(cmake/eigen.cmake)
SET(PROJECT_NAME roboptim-core)
SET(PROJECT_DESCRIPTION "RobOptim Core")
SET(PROJECT_URL "http://github.com/roboptim/roboptim-core")
SET(HEADERS
${CMAKE_SOURCE_DIR}/include/roboptim/core/result.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/identity-function.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/solver-factory.hxx
${CMAKE_SOURCE_DIR}/include/roboptim/core/problem.hxx
${CMAKE_SOURCE_DIR}/include/roboptim/core/util.hxx
${CMAKE_SOURCE_DIR}/include/roboptim/core/n-times-derivable-function.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/solver.hxx
${CMAKE_SOURCE_DIR}/include/roboptim/core/sys.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/function.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/portability.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/parametrized-function.hxx
${CMAKE_SOURCE_DIR}/include/roboptim/core/numeric-quadratic-function.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/io.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/solver-error.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/linear-function.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/twice-derivable-function.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/twice-differentiable-function.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/indent.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/constant-function.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/generic-solver.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/fwd.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/problem.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/derivative-size.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/plugin/dummy.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/plugin/dummy-laststate.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/debug.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/solver-factory.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/derivable-function.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/differentiable-function.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/finite-difference-gradient.hxx
${CMAKE_SOURCE_DIR}/include/roboptim/core/finite-difference-gradient.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/solver-warning.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/numeric-linear-function.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/n-times-derivable-function.hxx
${CMAKE_SOURCE_DIR}/include/roboptim/core/visualization/gnuplot-function.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/visualization/fwd.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/visualization/gnuplot.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/visualization/gnuplot-commands.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/solver.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/sum-of-c1-squares.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/result-with-warnings.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/parametrized-function.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/quadratic-function.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/derivable-parametrized-function.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/filter/split.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/filter/cached-function.hxx
${CMAKE_SOURCE_DIR}/include/roboptim/core/filter/split.hxx
${CMAKE_SOURCE_DIR}/include/roboptim/core/filter/cached-function.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core/util.hh
${CMAKE_SOURCE_DIR}/include/roboptim/core.hh
)
SETUP_PROJECT()
# Add extra keys to pkg-config file to export the location of the
# plug-in directory in a robust manner.
SET(PKG_CONFIG_EXTRA "plugindir=${CMAKE_INSTALL_PREFIX}/lib/roboptim-core")
# Add main library to pkg-config file.
PKG_CONFIG_APPEND_LIBS(roboptim-core)
# Search for dependencies.
SEARCH_FOR_BOOST()
ADD_REQUIRED_DEPENDENCY("eigen3 >= 3.0.0")
ADD_REQUIRED_DEPENDENCY("liblog4cxx >= 0.10.0")
# Libtool dynamic loading
# This project does not use Libtool directly but still uses ltdl for
# plug-in loading.
INCLUDE(CheckIncludeFileCXX)
CHECK_INCLUDE_FILE_CXX(ltdl.h LTDL_H_FOUND)
IF (NOT LTDL_H_FOUND)
MESSAGE(FATAL_ERROR
"Failed to find ltdl.h, check that Libtool ltdl is installed.")
ENDIF()
#FIXME: check that libltdl.so is available instead of adding it blindly.
PKG_CONFIG_APPEND_LIBS(ltdl)
HEADER_INSTALL("${HEADERS}")
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(tests)
SETUP_PROJECT_FINALIZE()
SETUP_PROJECT_CPACK()