-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
100 lines (79 loc) · 2.99 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
cmake_minimum_required(VERSION 2.8.3)
project(mechanical_scanning_imaging_sonar_gazebo)
find_package(catkin REQUIRED COMPONENTS roslint
image_transport
cv_bridge
roscpp
sensor_msgs
sonar_msgs)
find_package(OpenCV REQUIRED)
find_package(GAZEBO REQUIRED)
find_package(Boost REQUIRED)
set(MECHANICAL_SCANNING_IMAGING_SONAR "")
catkin_package(
INCLUDE_DIRS include
${GAZEBO_INCLUDE_DIRS}
${GAZEBO_MSG_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
)
include_directories(
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/test/include
${catkin_INCLUDE_DIRS}
${GAZEBO_INCLUDE_DIRS}
${GAZEBO_ODE_INCLUDE_DIRS}
${GAZEBO_MSG_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GAZEBO_CXX_FLAGS}")
set(ROSLINT_CPP_OPTS "--extensions=hpp,cpp,c,hh,cc,h")
set(MECHANICAL_SCANNING_IMAGING_SONAR_SRCS
src/MSISonar.cc
src/MSISonarRos.cc)
set(MECHANICAL_SCANNING_IMAGING_SONAR_HEADERS
include/${PROJECT_NAME}/MSISonar.hh
include/${PROJECT_NAME}/MSISonarRos.hh
include/${PROJECT_NAME}/SDFTool.hh)
roslint_cpp()
roslint_cpp(${MECHANICAL_SCANNING_IMAGING_SONAR_SRCS}
${MECHANICAL_SCANNING_IMAGING_SONAR_HEADERS})
add_library(MSISonar src/MSISonar.cc)
target_link_libraries(MSISonar ${GAZEBO_LIBRARIES} ${OpenCV_LIBRARIES} ${MECHANICAL_SCANNING_IMAGING_SONAR_LIST})
list(APPEND MECHANICAL_SCANNING_IMAGING_SONAR_LIST MSISonar)
add_library(MechanicalScanningImagingSonarGazebo src/MSISonarRos.cc)
target_link_libraries(MechanicalScanningImagingSonarGazebo ${catkin_LIBRARIES} ${MECHANICAL_SCANNING_IMAGING_SONAR_LIST})
add_dependencies(MechanicalScanningImagingSonarGazebo ${catkin_EXPORTED_TARGETS})
list(APPEND MECHANICAL_SCANNING_IMAGING_SONAR_LIST MechanicalScanningImagingSonarGazebo)
install(TARGETS ${MECHANICAL_SCANNING_IMAGING_SONAR_LIST} ${MECHANICAL_SCANNING_IMAGING_SONAR_LIST}
DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
FILES_MATCHING PATTERN "*.hh"
PATTERN "*~" EXCLUDE
)
install(DIRECTORY media launch worlds xacro
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
if (CATKIN_ENABLE_TESTING)
find_package(cmake_modules)
find_package(rostest REQUIRED)
find_package(TinyXML REQUIRED)
find_package(GAZEBO REQUIRED)
find_package(OpenCV REQUIRED)
include_directories(include ${catkin_INCLUDE_DIRS}
${GAZEBO_INCLUDE_DIRS}
${TinyXML_INCLUDE_DIRS})
link_directories(
${GAZEBO_LIBRARY_DIRS}
)
add_rostest_gtest(MSISonar_TEST test/pure_gazebo_test.test test/MSISonar_TEST.cc)
target_link_libraries(MSISonar_TEST gazebo_test_fixture ${GAZEBO_LIBRARIES} gtest ${OpenCV_LIBRARIES} ${MECHANICAL_SCANNING_IMAGING_SONAR_LIST})
#Add Media Path
set_target_properties(MSISonar_TEST PROPERTIES COMPILE_DEFINITIONS "OGRE_MEDIA_PATH=\"${PROJECT_SOURCE_DIR}/media\"")
roslint_add_test()
endif()