forked from photoneo/phoxi_camera
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
172 lines (146 loc) · 3.64 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
cmake_minimum_required(VERSION 2.8.12)
project(phoxi_camera)
find_package(PhoXi REQUIRED CONFIG PATHS "$ENV{PHOXI_CONTROL_PATH}")
find_package(Eigen3 REQUIRED)
find_package(Boost REQUIRED COMPONENTS system)
find_package(catkin REQUIRED
COMPONENTS
roscpp
rospy
std_msgs
sensor_msgs
pcl_ros
dynamic_reconfigure
diagnostic_updater
geometry_msgs
eigen_conversions
cv_bridge
message_generation
)
catkin_python_setup()
include_directories(include
${catkin_INCLUDE_DIRS}
${PHOXI_INCLUDE_DIRS}
${Eigen_INCLUDE_DIRS}
)
add_message_files(
FILES
PhoXiSize.msg
DeviceConnectionStatus.msg
DeviceType.msg
DeviceInformation.msg
)
add_service_files(
FILES
Deprecated/Empty.srv #deprecated
Deprecated/IsConnected.srv #deprecated
Deprecated/IsAcquiring.srv #deprecated
ConnectCamera.srv
TriggerImage.srv
GetDeviceList.srv
GetBool.srv
GetFrame.srv
GetHardwareIdentification.srv
GetSupportedCapturingModes.srv
SaveFrame.srv
SaveLastFrame.srv
SetCoordinatesSpace.srv
SetTransformationMatrix.srv
GetString.srv
)
generate_messages(
DEPENDENCIES
std_msgs
sensor_msgs
)
generate_dynamic_reconfigure_options(
cfg/phoxi_camera.cfg
)
catkin_package(
INCLUDE_DIRS
include
${PHOXI_INCLUDE_DIRS}
LIBRARIES
${PROJECT_NAME}_PhoXi_Interface
${PROJECT_NAME}_Ros_Interface
CATKIN_DEPENDS
roscpp
message_runtime
std_msgs
sensor_msgs
pcl_ros
dynamic_reconfigure
diagnostic_updater
geometry_msgs
cv_bridge
eigen_conversions
DEPENDS
PhoXi
)
add_compile_options(-w)
add_compile_options(-std=c++11)
add_compile_options(-fpermissive)
add_compile_options(-pthread)
add_compile_options(-O2)
# add PhoXi version definitions to code
add_definitions(-DPHOXI_API_VERSION_MAJOR=${PHO_SOFTWARE_VERSION_MAJOR})
add_definitions(-DPHOXI_API_VERSION_MINOR=${PHO_SOFTWARE_VERSION_MINOR})
add_definitions(-DPHOXI_API_VERSION_PATCH=${PHO_SOFTWARE_VERSION_PATCH})
add_library(
${PROJECT_NAME}_PhoXi_Interface
src/PhoXiInterface.cpp
)
add_library(
${PROJECT_NAME}_Ros_Interface
src/RosInterface.cpp
)
add_executable(
${PROJECT_NAME}
src/phoxi_camera_node.cpp
)
add_dependencies(
${PROJECT_NAME}_Ros_Interface
${PROJECT_NAME}_PhoXi_Interface
${PROJECT_NAME}_gencfg
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
add_dependencies(
${PROJECT_NAME}
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
${PROJECT_NAME}_Ros_Interface
)
target_link_libraries(
${PROJECT_NAME}_PhoXi_Interface
${PHOXI_LIBRARY}
rt
pthread
)
target_link_libraries(
${PROJECT_NAME}_Ros_Interface
${PROJECT_NAME}_PhoXi_Interface
${catkin_LIBRARIES}
)
target_link_libraries(
${PROJECT_NAME}
${catkin_LIBRARIES}
${PROJECT_NAME}_Ros_Interface
)
install(TARGETS ${PROJECT_NAME}_Ros_Interface ${PROJECT_NAME}_PhoXi_Interface
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION})
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION})
if (CATKIN_ENABLE_TESTING)
find_package(rostest REQUIRED)
add_rostest(test/launch/phoxi_camera_ros_interfaces_exist.test)
add_rostest(test/launch/phoxi_camera_ros_interfaces.test)
add_rostest_gtest(${PROJECT_NAME}_unittest
test/launch/phoxi_api_interface_class.test
test/gtest/test_phoxi_api_interface.cpp)
target_link_libraries(${PROJECT_NAME}_unittest
${catkin_LIBRARIES}
${PROJECT_NAME}_Ros_Interface)
endif()