-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
56 lines (41 loc) · 1.81 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
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-FileCopyrightText: Czech Technical University in Prague
cmake_minimum_required(VERSION 3.10.2)
project(camera_info_manager_metadata_extractor)
set(CMAKE_CXX_STANDARD 17)
find_package(catkin REQUIRED COMPONENTS
camera_info_manager_lib
cras_cpp_common
movie_publisher
pluginlib
)
catkin_package()
include_directories(${catkin_INCLUDE_DIRS})
add_library(${PROJECT_NAME} src/CamInfoManagerMetadataExtractor.cpp)
add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES})
install(TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
)
install(FILES
plugins.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
if (CATKIN_ENABLE_TESTING)
find_package(roslint REQUIRED)
find_package(rostest REQUIRED)
roslint_custom(catkin_lint "-W2" .)
# Roslint C++ - checks formatting and some other rules for C++ files
file(GLOB_RECURSE ROSLINT_FILES include/*.h include/*.hpp src/*.cpp src/*.hpp src/*.h test/*.cpp)
set(ROSLINT_CPP_OPTS "--extensions=h,hpp,hh,c,cpp,cc;--linelength=120;--filter=\
-build/header_guard,-build/include,-readability/namespace,-whitespace/braces,-runtime/references,\
-build/c++11,-readability/nolint,-readability/todo,-legal/copyright")
roslint_cpp(${ROSLINT_FILES})
roslint_add_test()
catkin_add_gtest(test_${PROJECT_NAME} test/test_extractor.cpp)
target_link_libraries(test_${PROJECT_NAME} ${PROJECT_NAME} ${catkin_LIBRARIES})
target_include_directories(test_${PROJECT_NAME} PRIVATE src)
target_compile_definitions(test_${PROJECT_NAME} PRIVATE -DTEST_DATA_DIR="${CMAKE_CURRENT_SOURCE_DIR}/test")
endif()