-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
76 lines (67 loc) · 2.25 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
set(LIBRARY_NAME state_representation)
set(CORE_SOURCES
src/MathTools.cpp
src/State.cpp
src/space/SpatialState.cpp
src/space/cartesian/CartesianState.cpp
src/space/cartesian/CartesianPose.cpp
src/space/cartesian/CartesianTwist.cpp
src/space/cartesian/CartesianAcceleration.cpp
src/space/cartesian/CartesianWrench.cpp
src/space/joint/JointState.cpp
src/space/joint/JointPositions.cpp
src/space/joint/JointVelocities.cpp
src/space/joint/JointAccelerations.cpp
src/space/joint/JointTorques.cpp
src/space/Jacobian.cpp
src/parameters/Event.cpp
src/parameters/Parameter.cpp
src/parameters/ParameterInterface.cpp
src/parameters/ParameterMap.cpp
src/parameters/Predicate.cpp
src/geometry/Shape.cpp
src/geometry/Ellipsoid.cpp
)
if (EXPERIMENTAL_FEATURES)
list(APPEND CORE_SOURCES
src/space/dual_quaternion/DualQuaternionState.cpp
src/space/dual_quaternion/DualQuaternionPose.cpp
src/space/dual_quaternion/DualQuaternionTwist.cpp
)
endif ()
add_library(${LIBRARY_NAME} SHARED ${CORE_SOURCES})
add_library(${PROJECT_NAME}::${LIBRARY_NAME} ALIAS ${LIBRARY_NAME})
# add include directories
target_include_directories(${LIBRARY_NAME}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
# install the target and create export-set
install(TARGETS ${LIBRARY_NAME}
EXPORT ${LIBRARY_NAME}_targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(DIRECTORY include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
# generate and install export file
install(EXPORT ${LIBRARY_NAME}_targets
FILE ${PROJECT_NAME}_${LIBRARY_NAME}_targets.cmake
NAMESPACE ${PROJECT_NAME}::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
)
if (BUILD_TESTING)
add_executable(test_${LIBRARY_NAME} test/test_state_representation.cpp)
file(GLOB_RECURSE MODULE_TEST_SOURCES test/tests test_*.cpp)
target_sources(test_${LIBRARY_NAME} PRIVATE ${MODULE_TEST_SOURCES})
target_link_libraries(test_${LIBRARY_NAME}
${LIBRARY_NAME}
${GTEST_LIBRARIES}
pthread
)
add_test(NAME test_${LIBRARY_NAME} COMMAND test_${LIBRARY_NAME})
endif ()