forked from Reflexxes/RMLTypeII
-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
105 lines (93 loc) · 3.34 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
cmake_minimum_required(VERSION 3.1)
project(RMLTypeII VERSION 1.2.7)
option(BUILD_EXAMPLES "Build example applications" OFF)
# Library
set(LIB_SOURCES
src/ReflexxesAPI.cpp
src/TypeIIRMLCalculatePositionalExtrems.cpp
src/TypeIIRMLDecisions.cpp
src/TypeIIRMLDecisionTree1A.cpp
src/TypeIIRMLDecisionTree1B.cpp
src/TypeIIRMLDecisionTree1C.cpp
src/TypeIIRMLDecisionTree2.cpp
src/TypeIIRMLFallBackStrategy.cpp
src/TypeIIRMLIsPhaseSynchronizationPossible.cpp
src/TypeIIRMLPolynomial.cpp
src/TypeIIRMLPosition.cpp
src/TypeIIRMLQuicksort.cpp
src/TypeIIRMLSetupModifiedSelectionVector.cpp
src/TypeIIRMLStep1.cpp
src/TypeIIRMLStep1IntermediateProfiles.cpp
src/TypeIIRMLStep1Profiles.cpp
src/TypeIIRMLStep2.cpp
src/TypeIIRMLStep2IntermediateProfiles.cpp
src/TypeIIRMLStep2PhaseSynchronization.cpp
src/TypeIIRMLStep2Profiles.cpp
src/TypeIIRMLStep2WithoutSynchronization.cpp
src/TypeIIRMLStep3.cpp
src/TypeIIRMLVelocityCalculatePositionalExtrems.cpp
src/TypeIIRMLVelocity.cpp
src/TypeIIRMLVelocityFallBackStrategy.cpp
src/TypeIIRMLVelocityIsPhaseSynchronizationPossible.cpp
src/TypeIIRMLVelocityMethods.cpp
src/TypeIIRMLVelocitySetupPhaseSyncSelectionVector.cpp
)
add_library(ReflexxesTypeII SHARED ${LIB_SOURCES})
target_include_directories(ReflexxesTypeII
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/RMLTypeII>
$<INSTALL_INTERFACE:include/RMLTypeII> # <prefix>/include/mylib
)
# target_compile_options(ReflexxesTypeII PRIVATE -Wall)
set_target_properties(ReflexxesTypeII PROPERTIES SOVERSION ${PROJECT_VERSION})
add_library(RMLTypeII::ReflexxesTypeII ALIAS ReflexxesTypeII)
# Examples
if(BUILD_EXAMPLES)
set(EXAMPLE_SOURCES
examples/01_RMLPositionSampleApplication.cpp
examples/02_RMLPositionSampleApplication.cpp
examples/03_RMLPositionSampleApplication.cpp
examples/04_RMLVelocitySampleApplication.cpp
examples/05_RMLVelocitySampleApplication.cpp
examples/06_RMLVelocitySampleApplication.cpp
examples/07_RMLPositionSampleApplication.cpp
examples/08_RMLVelocitySampleApplication.cpp
)
# Add target for each file
foreach(FILE_NAME ${EXAMPLE_SOURCES})
get_filename_component(APP_NAME ${FILE_NAME} NAME_WE)
add_executable(${APP_NAME} ${FILE_NAME})
target_link_libraries(${APP_NAME} ReflexxesTypeII)
endforeach()
endif()
# Install
include(GNUInstallDirs)
set(INSTALL_CMAKE_CONFIG_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/RMLTypeII)
install(TARGETS ReflexxesTypeII
EXPORT RMLTypeIITargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
install(DIRECTORY include/RMLTypeII DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
export(EXPORT RMLTypeIITargets
NAMESPACE RMLTypeII::
FILE ${CMAKE_CURRENT_BINARY_DIR}/RMLTypeIITargets.cmake
)
# Write CMake config files
include(CMakePackageConfigHelpers)
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/RMLTypeIIConfigVersion.cmake
COMPATIBILITY SameMajorVersion
)
configure_package_config_file(cmake/RMLTypeIIConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/RMLTypeIIConfig.cmake
INSTALL_DESTINATION ${INSTALL_CMAKE_CONFIG_DIR}
)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/RMLTypeIIConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/RMLTypeIIConfigVersion.cmake
DESTINATION ${INSTALL_CMAKE_CONFIG_DIR}
)
install(EXPORT RMLTypeIITargets
NAMESPACE RMLTypeII::
DESTINATION ${INSTALL_CMAKE_CONFIG_DIR}
)