-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
66 lines (55 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
cmake_minimum_required(VERSION 3.0.2)
project(adaptive_nlp)
## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11)
## System dependencies are found with CMake's conventions
#############################
## Find CasADi
#############################
## -----------
## Option 1
## -----------
# set(CASADI_DIR "/usr/local")
# set(CMAKE_PREFIX_PATH ${CASADI_DIR} ${CMAKE_PREFIX_PATH})
# find_package(casadi
# REQUIRED
# HINTS ${CASADI_DIR} ${CASADI_DIR}/lib
# )
# set(CASADI_LIBRARY_DIRS ${CASADI_DIR}/lib)
# set(CASADI_INCLUDEDIR ${CASADI_DIR}/include)
# set(CASADI_LIBRARIES casadi)
## -----------
## Option 2
## -----------
## Test if pkg-config is able to find your Ipopt installation by using 'pkg-config --libs ipopt'
set(CASADI_DIR "/usr/local")
set(CMAKE_PREFIX_PATH ${CASADI_DIR} ${CMAKE_PREFIX_PATH})
set(PKG_CONFIG_PATH ${CASADI_DIR}/lib/pkgconfig ${PKG_CONFIG_PATH})
find_package(PkgConfig REQUIRED)
pkg_search_module(CASADI casadi REQUIRED)
# ## -----------
# # if(NOT CASADI_LIBRARIES)
# # message(SEND_ERROR "Could not find casadi.pc - did you set PKG_CONFIG_PATH?")
# # endif()
# message("CASADI_LIBRARY_DIRS: ${CASADI_LIBRARY_DIRS}")
# message("CASADI_LIBRARIES: ${CASADI_LIBRARIES}")
# message("CASADI_INCLUDEDIR: ${CASADI_INCLUDEDIR}")
#############################
## Find IPOPT
#############################
## Test if pkg-config is able to find your Ipopt installation by using 'pkg-config --libs ipopt'
# set(PKG_CONFIG_PATH "/usr/local/include/coin-or/")
# set(PKG_CONFIG_PATH "/usr/local/lib/pkgconfig/")
find_package(PkgConfig)
pkg_search_module(IPOPT ipopt REQUIRED)
set(IPOPT_INC "/usr/local/include/coin-or/")
#############################
## Find Eigen
#############################
set(EIGEN_INC "/usr/include/eigen3")
###########
## Build ##
###########
link_directories(${CASADI_LIBRARY_DIRS})
add_subdirectory(src)
add_subdirectory(examples)