forked from Jastock/rs_addons
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
178 lines (147 loc) · 6.03 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
173
174
175
176
177
178
cmake_minimum_required(VERSION 2.8.3)
#cmake_policy(NEW)
project(rs_addons)
find_package(simtrack_nodes QUIET)
if(simtrack_nodes_FOUND)
message(STATUS "OPTIONAL MODULE simtrack FOUND")
set(OPTIONAL_simtrack simtrack_nodes)
endif(simtrack_nodes_FOUND)
find_package(json_prolog QUIET)
if(json_prolog_FOUND)
message(STATUS "OPTIONAL MODULE json_prolog FOUND")
set(OPTIONAL_json_prolog json_prolog)
endif(json_prolog_FOUND)
find_package(Caffe QUIET)
find_package(aruco QUIET)
find_package(MPI QUIET)
find_package(RapidJSON REQUIRED)
if(Caffe_FOUND)
add_definitions(-DWITH_CAFFE)
message(STATUS "OPTIONAL MODULE Caffe FOUND")
set(OPTIONAL_Caffe Caffe)
add_definitions( -DCAFFE_FOUND ${Caffe_DEFINITIONS})
include_directories(${Caffe_INCLUDE_DIRS})
endif(Caffe_FOUND)
find_package(catkin REQUIRED robosherlock
message_generation
message_runtime
${OPTIONAL_simtrack}
${OPTIONAL_json_prolog}
tf_conversions
robosherlock_msgs
)
message(STATUS " RS built with google googgles: " ${RS_WITH_GG})
message(STATUS " RS built with Caffe: " ${RS_WITH_CAFFE})
#################################################################################
### Constants for project ##
#################################################################################
set(NAMESPACE rs_addons)
set(TYPESYSTEM_CPP_PATH ${PROJECT_SOURCE_DIR}/include/rs_addons/types)
set(TYPESYSTEM_XML_PATH ${PROJECT_SOURCE_DIR}/descriptors/typesystem)
set(ANNOTATOR_PATH ${PROJECT_SOURCE_DIR}/descriptors/annotators)
set(ENGINE_PATH ${PROJECT_SOURCE_DIR}/descriptors/analysis_engines)
configure_file(${RS_PROJECT_CONFIG} ${PROJECT_SOURCE_DIR}/cmake/${PROJECT_NAME}_config.cmake)
#include(cmake/rs_addons_config.cmake)
################################################################################
## Find all include directories ##
################################################################################
find_include_dirs(RS_ADDONS_INCLUDE_DIRS_LIST)
catkin_package(
#INCLUDE_DIRS ${RS_ADDONS_INCLUDE_DIRS_LIST}
#LIBRARIES ${RS_LIBS}
CATKIN_DEPENDS robosherlock
#CFG_EXTRAS ${PROJECT_NAME}_config.cmake
)
include_directories(
${RapidJSON_INCLUDE_DIRS}
${RS_ADDONS_INCLUDE_DIRS_LIST}
${catkin_INCLUDE_DIRS}
)
################################################################################
## Update analysis engines, typesystem and include all relevant files ##
################################################################################
## generate classes from the typesystem xml files
generate_type_system(robosherlock)
#find all relevant files
find_additional_files()
###############################################################################
# Sub Projects ##
###############################################################################
#If you want to divide your projects into subprojects include the subdirectories
#each containing a CMakeLists.txt here
#add_subdirectory(src/xxx)
if(simtrack_nodes_FOUND)
rs_add_library(rs_simtrack src/SimtrackDetection.cpp)
target_link_libraries(rs_simtrack ${catkin_LIBRARIES})
endif(simtrack_nodes_FOUND)
if(aruco_FOUND)
message(STATUS "OPTIONAL MODULE aruco FOUND")
add_definitions( -DARUCO_FOUND)
message(STATUS "Building AR Markers Detector")
include_directories(${aruco_INCLUDE_DIRS})
rs_add_library(rs_arMarkersDetector src/ARMarkersDetector.cpp)
target_link_libraries(rs_arMarkersDetector ${CATKIN_LIBRARIES} ${aruco_LIBS})
else(aruco_FOUND)
message(WARNING "Aruco not found. AR Markers Detector will NOT be built")
endif(aruco_FOUND)
if(Caffe_FOUND AND RS_WITH_CAFFE)
rs_add_library(rs_caffeClassification src/CaffeClassificationAnnotator.cpp)
target_link_libraries(rs_caffeClassification
${catkin_LIBRARIES}
${Caffe_LIBRARIES}
)
rs_add_library(rs_deCafClassifier src/DeCafClassifier.cpp)
target_link_libraries(rs_deCafClassifier
${catkin_LIBRARIES}
${PCL_LIBRARIES}
${Caffe_LIBRARIES}
)
endif()
add_executable(featureExtractor src/tools/feature_extractor.cpp)
target_link_libraries(featureExtractor
${PCL_LIBRARIES}
${catkin_LIBRARIES}
${OpenCV_LIBRARIES}
${Boost_LIBRARIES}
${Caffe_LIBRARIES}
)
add_library(rs_classifiers src/classifiers/RSClassifier.cpp
src/classifiers/RSSVM.cpp
src/classifiers/RSRF.cpp
src/classifiers/RSKNN.cpp)
target_link_libraries(rs_classifiers ${OpenCV_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES})
#this should be an executable
add_executable(train_classifier src/tools/classifier_trainer.cpp)
target_link_libraries(train_classifier rs_classifiers
${CATKIN_LIBRARIES}
${OpenCV_LIBRARIES}
${Boost_LIBRARIES})
rs_add_library(rs_svmAnnotator src/SvmAnnotator.cpp)
target_link_libraries(rs_svmAnnotator rs_classifiers
${catkin_LIBRARIES}
${OpenCV_LIBRARIES})
rs_add_library(rs_rfAnnotator src/RfAnnotator.cpp)
target_link_libraries(rs_rfAnnotator rs_classifiers
${catkin_LIBRARIES}
${OpenCV_LIBRARIES})
rs_add_library(rs_knnAnnotator src/KnnAnnotator.cpp)
target_link_libraries(rs_knnAnnotator rs_classifiers
${CATKIN_LIBRARIES}
${OpenCV_LIBRARIES})
# rs_add_library(rs_knnAnnotatorKnownObject src/KnnAnnotatorKnownObj.cpp)
# target_link_libraries(rs_knnAnnotatorKnownObject rs_classifiers
# ${CATKIN_LIBRARIES}
# ${OpenCV_LIBRARIES})
rs_add_library(rs_unrealGTAnnotator src/UnrealGTAnnotator.cpp)
target_link_libraries(rs_unrealGTAnnotator
${catkin_LIBRARIES}
${OpenCV_LIBRARIES}
)
# this needs to be renamed...if this is just for running test
# data trhough the system it can an executable
rs_add_library(rs_classifyOfflineAnnotator src/ClassifyOfflineAnnotator.cpp)
target_link_libraries(rs_classifyOfflineAnnotator rs_classifiers
${CATKIN_LIBRARIES}
${OpenCV_LIBRARIES}
${Boost_LIBRARIES})
add_subdirectory(src/annotators)