This repository has been archived by the owner on Jul 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
CMakeLists.txt
129 lines (103 loc) · 2.2 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
cmake_minimum_required(VERSION 3.15.3)
project(win_camera)
# 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(NOT CMAKE_CXX_STANDARD_REQUIRED)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
endif()
if(NOT CMAKE_CXX_EXTENSIONS)
set(CMAKE_CXX_EXTENSIONS FALSE)
endif()
if(MSVC)
add_compile_definitions(
NOMINMAX
)
endif()
find_package(ament_cmake REQUIRED)
find_package(std_msgs REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_components REQUIRED)
find_package(image_transport REQUIRED)
find_package(camera_info_manager REQUIRED)
find_package(compressed_image_transport REQUIRED)
find_package(rosidl_default_generators REQUIRED)
rosidl_generate_interfaces(${PROJECT_NAME}_msgs
"msg/MFSample.msg"
DEPENDENCIES std_msgs
)
include_directories(
include
)
## Declare a cpp library
add_library(win_camera SHARED
src/wincapture.cpp
src/win_camera_node.cpp
)
target_compile_definitions(win_camera PRIVATE "WIN_CAMERA_BUILDING_LIBRARY")
rclcpp_components_register_nodes(
win_camera
"win_camera::CameraDriver"
)
target_link_libraries(win_camera
mf
mfplat
mfuuid
mfreadwrite
Mfsensorgroup
shlwapi
runtimeobject
)
ament_target_dependencies(win_camera
compressed_image_transport
image_transport
camera_info_manager
sensor_msgs
rclcpp
)
## Declare a cpp executable
add_executable(win_camera_node src/main.cpp)
target_link_libraries(win_camera_node
win_camera
)
ament_target_dependencies(win_camera_node
compressed_image_transport
image_transport
camera_info_manager
sensor_msgs
rclcpp
)
#############
## Install ##
#############
## Mark executables and/or libraries for installation
install(TARGETS win_camera
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
install(TARGETS win_camera_node
RUNTIME DESTINATION lib/${PROJECT_NAME}
)
install(DIRECTORY include
DESTINATION include
)
install(DIRECTORY
launch
DESTINATION share/${PROJECT_NAME}/
)
install(DIRECTORY
rviz
DESTINATION share/${PROJECT_NAME}/
)
install(DIRECTORY
camera_info
DESTINATION share/${PROJECT_NAME}/
)
ament_package()