-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
115 lines (115 loc) · 3.17 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
106
107
108
109
110
111
112
113
114
115
cmake_minimum_required(VERSION 3.5)
project(proc_control)
set(CMAKE_VERBOSE_MAKEFILE ON)
# Set CMAKE_BUILD_TYPE
set(CMAKE_BUILD_TYPE Release)
# Default to C99
if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 99)
endif()
# Default to C++17
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()
if(ALIAS_ROS2_TF2)
add_definitions(-Dtf2=ros2_tf2)
add_definitions(-Dtf2_ros=ros2_tf2_ros)
add_definitions(-Dmessage_filters=ros2_message_filters)
endif()
# find dependencies
find_package(ament_cmake REQUIRED)
find_package(ament_cmake_ros REQUIRED)
find_package( geometry_msgs REQUIRED)
find_package( nav_msgs REQUIRED)
find_package( rclcpp REQUIRED)
find_package( rclcpp_action REQUIRED)
find_package( sensor_msgs REQUIRED)
find_package( sonia_common_ros2 REQUIRED)
find_package( std_msgs REQUIRED)
find_package( trajectory_msgs REQUIRED)
include_directories("include/proc_control")
set (CMAKE_SKIP_BUILD_RPATH false)
set (CMAKE_BUILD_WITH_INSTALL_RPATH true)
set (CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# Node
add_executable(proc_control
src/main.cpp
src/proc_control.cpp
src/proc_control_data.cpp
src/ros2nodeinterface.cpp
src/rtGetInf.cpp
src/rtGetNaN.cpp
src/rt_nonfinite.cpp
src/slros2_initialize.cpp
src/slros_busmsg_conversion.cpp
src/slros2_generic_param.cpp
)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_compile_options(proc_control PUBLIC
$<$<OR:$<COMPILE_LANGUAGE:CXX>,$<COMPILE_LANGUAGE:C>>:
-Wall -Wextra -Wpedantic
>)
endif()
target_compile_options(proc_control PRIVATE
$<$<OR:$<COMPILE_LANGUAGE:CXX>,$<COMPILE_LANGUAGE:C>>:
-DMODEL=proc_control
-DNUMST=5
-DNCSTATES=0
-DHAVESTDIO
-DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0
-DCLASSIC_INTERFACE=0
-DALLOCATIONFCN=0
-DTID01EQ=0
-DTERMFCN=1
-DONESTEPFCN=1
-DMAT_FILE=0
-DMULTI_INSTANCE_CODE=1
-DINTEGER_CODE=0
-DMT=0
-DROS2_PROJECT
-DSTACK_SIZE=64
-D__MW_TARGET_USE_HARDWARE_RESOURCES_H__
-DRT
-fpermissive >
)
ament_target_dependencies(
proc_control
"geometry_msgs"
"nav_msgs"
"rclcpp"
"rclcpp_action"
"sensor_msgs"
"sonia_common_ros2"
"std_msgs"
"trajectory_msgs"
)
target_include_directories(proc_control PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
target_link_libraries(proc_control
"/usr/local/MATLAB/R2024a/sys/os/glnxa64/orig/libstdc++.so.6"
${CMAKE_DL_LIBS}
)
install(TARGETS proc_control
EXPORT export_${PROJECT_NAME}
DESTINATION lib/${PROJECT_NAME})
ament_export_include_directories(
include
)
foreach(file_i ${CUDA_BINS})
add_custom_command(
TARGET proc_control
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy ${PROJECT_SOURCE_DIR}/src/${file_i} ${CMAKE_INSTALL_PREFIX}/proc_control_ert_rtw/${file_i}
)
add_custom_command(
TARGET proc_control
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy ${PROJECT_SOURCE_DIR}/src/${file_i} ${CMAKE_INSTALL_PREFIX}/codegen/exe/proc_control/${file_i}
)
endforeach(file_i)
ament_package()
# Generated on Wed Nov 27 16:52:29 2024