-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
41 lines (30 loc) · 1006 Bytes
/
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
cmake_minimum_required(VERSION 3.10)
project(trac_ik_lib)
# Set C++17 as the C++ version
set(CMAKE_CXX_FLAGS "-std=c++17 ${CMAKE_CXX_FLAGS}")
add_compile_options(-Wall -Wextra -fPIC)
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel.")
set(LIB_NAME
trac_ik)
find_package(Boost REQUIRED COMPONENTS date_time)
find_package(PkgConfig REQUIRED)
pkg_check_modules(pkg_nlopt REQUIRED nlopt)
pkg_check_modules(Eigen REQUIRED eigen3)
add_library(${LIB_NAME} STATIC
src/kdl_tl.cpp
src/nlopt_ik.cpp
src/trac_ik.cpp)
target_include_directories(${LIB_NAME} PUBLIC
include
${Eigen_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${pkg_nlopt_INCLUDE_DIRS}
)
target_link_libraries(${LIB_NAME} PRIVATE
${pkg_nlopt_LIBRARIES}
${Boost_LIBRARIES})
# Install target
install(TARGETS ${LIB_NAME}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(DIRECTORY include/ DESTINATION include)