-
Notifications
You must be signed in to change notification settings - Fork 39
/
CMakeLists.txt
104 lines (89 loc) · 2.87 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
project(O3D3XX)
cmake_minimum_required(VERSION 2.8.12)
set(CMAKE_MODULE_PATH
${O3D3XX_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")
# how should we install?
find_program(DPKG_CMD dpkg)
if(NOT DPKG_CMD)
set(O3D3XX_INSTALL_CMD "$(MAKE)")
else()
set(O3D3XX_INSTALL_CMD ${O3D3XX_SOURCE_DIR}/cmake/utils/install_all_debs)
endif(NOT DPKG_CMD)
include(ExternalProject)
################################################
## o3d3xx-camera module
################################################
ExternalProject_Add(O3D3XX_CAMERA
SOURCE_DIR ${O3D3XX_SOURCE_DIR}/modules/camera
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=/usr
TEST_BEFORE_INSTALL 1
TEST_COMMAND make check
INSTALL_COMMAND sudo ${O3D3XX_INSTALL_CMD} install
)
ExternalProject_Add_Step(O3D3XX_CAMERA
package
DEPENDEES test
DEPENDERS install
COMMAND ${CMAKE_COMMAND} -E chdir . make package
WORKING_DIRECTORY O3D3XX_CAMERA-prefix/src/O3D3XX_CAMERA-build
)
################################################
## o3d3xx-framegrabber module
################################################
ExternalProject_Add(O3D3XX_FRAMEGRABBER
DEPENDS O3D3XX_CAMERA
SOURCE_DIR ${O3D3XX_SOURCE_DIR}/modules/framegrabber
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=/usr
TEST_BEFORE_INSTALL 1
TEST_COMMAND make check
INSTALL_COMMAND sudo ${O3D3XX_INSTALL_CMD} install
)
ExternalProject_Add_Step(O3D3XX_FRAMEGRABBER
package
DEPENDEES test
DEPENDERS install
COMMAND ${CMAKE_COMMAND} -E chdir . make package
WORKING_DIRECTORY O3D3XX_FRAMEGRABBER-prefix/src/O3D3XX_FRAMEGRABBER-build
)
################################################
## o3d3xx-pcicclient module
################################################
ExternalProject_Add(O3D3XX_PCICCLIENT
DEPENDS O3D3XX_CAMERA
SOURCE_DIR ${O3D3XX_SOURCE_DIR}/modules/pcicclient
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=/usr
TEST_BEFORE_INSTALL 1
TEST_COMMAND make check
INSTALL_COMMAND sudo ${O3D3XX_INSTALL_CMD} install
)
ExternalProject_Add_Step(O3D3XX_PCICCLIENT
package
DEPENDEES test
DEPENDERS install
COMMAND ${CMAKE_COMMAND} -E chdir . make package
WORKING_DIRECTORY O3D3XX_PCICCLIENT-prefix/src/O3D3XX_PCICCLIENT-build
)
################################################
## o3d3xx-image module
################################################
ExternalProject_Add(O3D3XX_IMAGE
DEPENDS O3D3XX_CAMERA O3D3XX_FRAMEGRABBER
SOURCE_DIR ${O3D3XX_SOURCE_DIR}/modules/image
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=/usr
TEST_BEFORE_INSTALL 1
TEST_COMMAND make check
INSTALL_COMMAND sudo ${O3D3XX_INSTALL_CMD} install
)
ExternalProject_Add_Step(O3D3XX_IMAGE
package
DEPENDEES test
DEPENDERS install
COMMAND ${CMAKE_COMMAND} -E chdir . make package
WORKING_DIRECTORY O3D3XX_IMAGE-prefix/src/O3D3XX_IMAGE-build
)