This repository has been archived by the owner on Aug 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
CMakeLists.txt
83 lines (67 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
# ----------------------------------------------------------------------------
# 2020 Bernd Pfrommer [email protected]
#
cmake_minimum_required(VERSION 3.5)
project(flir_spinnaker_common LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo)
endif()
# the spinnaker SDK does not provide a cmake file
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
find_package(SPINNAKER REQUIRED)
# find dependencies
find_package(ament_cmake REQUIRED)
find_package(ament_cmake_auto REQUIRED)
find_package(ament_cmake_ros REQUIRED)
add_library(flir_spinnaker_common
src/driver.cpp
src/driver_impl.cpp
src/image.cpp
src/pixel_format.cpp
src/genicam_utils.cpp
)
target_link_libraries(flir_spinnaker_common PRIVATE Spinnaker::Spinnaker)
target_include_directories(flir_spinnaker_common
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
# associates an "export_*" target with the library target
install(
TARGETS flir_spinnaker_common
EXPORT export_flir_spinnaker_common
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
install(
DIRECTORY include
DESTINATION ${CMAKE_INSTALL_PREFIX}
)
# this is what probably builds the cmake config files
ament_export_targets(export_flir_spinnaker_common)
if(BUILD_TESTING)
find_package(ament_cmake REQUIRED)
find_package(ament_cmake_copyright REQUIRED)
find_package(ament_cmake_cppcheck REQUIRED)
find_package(ament_cmake_cpplint REQUIRED)
find_package(ament_cmake_flake8 REQUIRED)
find_package(ament_cmake_lint_cmake REQUIRED)
find_package(ament_cmake_pep257 REQUIRED)
find_package(ament_cmake_clang_format REQUIRED)
find_package(ament_cmake_xmllint REQUIRED)
ament_copyright()
ament_cppcheck(LANGUAGE c++)
ament_cpplint(FILTERS "-build/include,-runtime/indentation_namespace")
ament_flake8()
ament_lint_cmake()
ament_pep257()
ament_clang_format(CONFIG_FILE .clang-format)
ament_xmllint()
endif()
ament_package()