forked from ifm/libo3d3xx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
135 lines (119 loc) · 4.67 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
project(O3D3XX_EXAMPLES)
cmake_minimum_required(VERSION 2.8.12)
set(CMAKE_BUILD_TYPE Release) # Release or Debug
set(CMAKE_MODULE_PATH
${O3D3XX_EXAMPLES_SOURCE_DIR}/../../cmake/modules
${CMAKE_MODULE_PATH}
)
# force an out-of-source build of the code
include(MacroOutOfSourceBuild)
macro_ensure_out_of_source_build(
"Please build ${PROJECT_NAME} out-of-source")
# get version of ubuntu
include(ubuntu_version)
get_ubuntu_version(${UBUNTU_VERSION})
################################################
## Bring in dependent projects
################################################
include(o3d3xx_version)
find_package(o3d3xx_camera ${O3D3XX_VERSION_STRING} EXACT REQUIRED)
find_package(o3d3xx_framegrabber ${O3D3XX_VERSION_STRING} EXACT REQUIRED)
find_package(o3d3xx_image ${O3D3XX_VERSION_STRING} EXACT REQUIRED)
find_package(o3d3xx_pcicclient ${O3D3XX_VERSION_STRING} EXACT REQUIRED)
find_package(PCL 1.7.1 REQUIRED COMPONENTS common io)
find_package(OpenCV REQUIRED)
find_package(Boost REQUIRED COMPONENTS system)
find_library(LIB_boost_system NAMES boost_system)
# Fix this: https://bugs.launchpad.net/ubuntu/+source/vtk6/+bug/1573234
if(NOT (UBUNTU_VERSION VERSION_LESS "16.04"))
list(REMOVE_ITEM PCL_IO_LIBRARIES "vtkproj4")
endif()
################################################
## Manage our compiler and linker flags
################################################
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
include_directories(
${O3D3XX_IMAGE_INCLUDE_DIRS}
${O3D3XX_CAMERA_INCLUDE_DIRS}
${O3D3XX_FRAMEGRABBER_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
)
link_directories(
${O3D3XX_IMAGE_LIBRARY_DIR}
${O3D3XX_CAMERA_LIBRARY_DIR}
${O3D3XX_FRAMEGRABBER_LIBRARY_DIR}
${PCL_LIBRARY_DIRS}
${OpenCV_LIBRARY_DIRS}
)
add_definitions(
${PCL_DEFINITIONS}
${OpenCV_DEFINITIONS}
)
################################################
## Build the examples
################################################
add_executable(ex-100k ex-100k.cpp)
target_link_libraries(ex-100k
${O3D3XX_CAMERA_LIBRARIES}
${O3D3XX_FRAMEGRABBER_LIBRARIES}
${O3D3XX_IMAGE_LIBRARIES}
${PCL_COMMON_LIBRARIES}
${OpenCV_LIBRARIES}
)
add_executable(ex-cartesian ex-cartesian.cpp)
target_link_libraries(ex-cartesian
${O3D3XX_CAMERA_LIBRARIES}
${O3D3XX_FRAMEGRABBER_LIBRARIES}
${O3D3XX_IMAGE_LIBRARIES}
${OpenCV_LIBRARIES}
${LIB_boost_system}
)
add_executable(ex-cartesian_compare ex-cartesian_compare.cpp)
target_link_libraries(ex-cartesian_compare
${O3D3XX_CAMERA_LIBRARIES}
${O3D3XX_FRAMEGRABBER_LIBRARIES}
${O3D3XX_IMAGE_LIBRARIES}
${OpenCV_LIBRARIES}
${PCL_IO_LIBRARIES}
${LIB_boost_system}
)
add_executable(ex-file_io ex-file_io.cpp)
target_link_libraries(ex-file_io
${O3D3XX_CAMERA_LIBRARIES}
${O3D3XX_FRAMEGRABBER_LIBRARIES}
${O3D3XX_IMAGE_LIBRARIES}
${PCL_IO_LIBRARIES}
${OpenCV_LIBRARIES}
)
add_executable(ex-framegrabber_recycling ex-framegrabber_recycling.cpp)
target_link_libraries(ex-framegrabber_recycling
${O3D3XX_CAMERA_LIBRARIES}
${O3D3XX_FRAMEGRABBER_LIBRARIES}
${LIB_boost_system}
)
add_executable(ex-exposure_times ex-exposure_times.cpp)
target_link_libraries(ex-exposure_times
${O3D3XX_CAMERA_LIBRARIES}
${O3D3XX_FRAMEGRABBER_LIBRARIES}
${O3D3XX_IMAGE_LIBRARIES}
${PCL_COMMON_LIBRARIES}
${OpenCV_LIBRARIES}
)
add_executable(ex-change_ip ex-change_ip.cpp)
target_link_libraries(ex-change_ip
${O3D3XX_CAMERA_LIBRARIES}
${LIB_boost_system}
)
add_executable(ex-pcicclient_set_io ex-pcicclient_set_io.cpp)
target_link_libraries(ex-pcicclient_set_io
${O3D3XX_CAMERA_LIBRARIES}
${O3D3XX_PCICCLIENT_LIBRARIES}
${LIB_boost_system}
)
add_executable(ex-pcicclient_async_messages ex-pcicclient_async_messages.cpp)
target_link_libraries(ex-pcicclient_async_messages
${O3D3XX_CAMERA_LIBRARIES}
${O3D3XX_PCICCLIENT_LIBRARIES}
${LIB_boost_system}
)