CMakeLists.txt 2.2 KB
Newer Older
Gabriele Buondonno's avatar
Gabriele Buondonno committed
1
#
Guilhem Saurel's avatar
Guilhem Saurel committed
2
# Copyright (c) 2019-2020 CNRS
Gabriele Buondonno's avatar
Gabriele Buondonno committed
3
#
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# This file is part of eiquadprog.
#
# eiquadprog 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.
#
# eiquadprog 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 Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with eiquadprog.  If not, see <https://www.gnu.org/licenses/>.
#
Gabriele Buondonno's avatar
Gabriele Buondonno committed
19

Guilhem Saurel's avatar
Guilhem Saurel committed
20
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
Gabriele Buondonno's avatar
Gabriele Buondonno committed
21

Guilhem Saurel's avatar
Guilhem Saurel committed
22
23
# Project properties
SET(PROJECT_ORG stack-of-tasks)
Gabriele Buondonno's avatar
Gabriele Buondonno committed
24
25
SET(PROJECT_NAME eiquadprog)
SET(PROJECT_DESCRIPTION "C++ reimplementation of eiquadprog")
Guilhem Saurel's avatar
Guilhem Saurel committed
26
27
SET(PROJECT_URL "https://github.com/${PROJECT_ORG}/${PROJECT_NAME}")

28
29
30
# Project options
OPTION(TRACE_SOLVER "trace solver on stderr" OFF)

Guilhem Saurel's avatar
Guilhem Saurel committed
31
32
33
34
# Project configuration
SET(PROJECT_USE_CMAKE_EXPORT TRUE)
SET(CXX_DISABLE_WERROR TRUE)
SET(CMAKE_VERBOSE_MAKEFILE TRUE)
35
SET(PROJECT_CUSTOM_HEADER_EXTENSION "hpp")
Gabriele Buondonno's avatar
Gabriele Buondonno committed
36

Guilhem Saurel's avatar
Guilhem Saurel committed
37
# JRL-cmakemodule setup
Guilhem Saurel's avatar
Guilhem Saurel committed
38
39
INCLUDE(cmake/base.cmake)
INCLUDE(cmake/boost.cmake)
Gabriele Buondonno's avatar
Gabriele Buondonno committed
40

Guilhem Saurel's avatar
Guilhem Saurel committed
41
42
43
# Project definition
COMPUTE_PROJECT_ARGS(PROJECT_ARGS LANGUAGES CXX)
PROJECT(${PROJECT_NAME} ${PROJECT_ARGS})
Gabriele Buondonno's avatar
Gabriele Buondonno committed
44

Guilhem Saurel's avatar
Guilhem Saurel committed
45
# Project dependencies
Guilhem Saurel's avatar
Guilhem Saurel committed
46
ADD_PROJECT_DEPENDENCY(Eigen3 REQUIRED)
47
FIND_PACKAGE(Boost REQUIRED COMPONENTS unit_test_framework)
Gabriele Buondonno's avatar
Gabriele Buondonno committed
48

Guilhem Saurel's avatar
Guilhem Saurel committed
49
50
51
52
53
54
# Main Library
SET(${PROJECT_NAME}_HEADERS
  include/${PROJECT_NAME}/eiquadprog.hpp
  include/${PROJECT_NAME}/eiquadprog-fast.hpp
  include/${PROJECT_NAME}/eiquadprog-rt.hpp
  include/${PROJECT_NAME}/eiquadprog-rt.hxx
55
  include/${PROJECT_NAME}/eiquadprog-utils.hxx
Guilhem Saurel's avatar
Guilhem Saurel committed
56
57
  )

58
59
60
61
62
ADD_LIBRARY(${PROJECT_NAME} SHARED
  src/eiquadprog-fast.cpp
  src/eiquadprog.cpp
  )

63
64
65
66
IF(TRACE_SOLVER)
  TARGET_COMPILE_DEFINITIONS(${PROJECT_NAME} PRIVATE TRACE_SOLVER)
ENDIF(TRACE_SOLVER)

67
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} SYSTEM PUBLIC ${EIGEN3_INCLUDE_DIR})
Guilhem Saurel's avatar
Guilhem Saurel committed
68
69
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} INTERFACE $<INSTALL_INTERFACE:include>)
INSTALL(TARGETS ${PROJECT_NAME} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION lib)
Gabriele Buondonno's avatar
Gabriele Buondonno committed
70

Guilhem Saurel's avatar
Guilhem Saurel committed
71
ADD_SUBDIRECTORY(tests)