-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
130 lines (107 loc) · 3.25 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
cmake_minimum_required(VERSION 2.8)
project(SubjuGator)
# Ensure CMake will find our custom modules in the cmake directory
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# Load our template functions
include(Templates)
include(UseDoxygen)
include(PythonUtils)
# Turn on warnings
add_definitions(-Wall)
# Handle build types
if(NOT SUB_BUILD_TYPE)
set(SUB_BUILD_TYPE all CACHE STRING "The set of programs to build. all, pc, or gumstix")
endif()
if(${SUB_BUILD_TYPE} STREQUAL "pc")
set(BUILD_PC TRUE)
set(BUILD_GUMSTIX FALSE)
elseif(${SUB_BUILD_TYPE} STREQUAL "gumstix")
set(BUILD_PC FALSE)
set(BUILD_GUMSTIX TRUE)
else()
set(BUILD_PC TRUE)
set(BUILD_GUMSTIX TRUE)
endif()
# Handle building legacy stuff
if(NOT SUB_BUILD_LEGACY)
set(SUB_BUILD_LEGACY OFF CACHE BOOL "Whether to build legacy libraries and programs")
endif()
# find required packages
find_package(NDDS REQUIRED)
find_package(Eigen3 REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIR})
find_package(Boost 1.36 REQUIRED COMPONENTS system thread date_time regex program_options filesystem)
include_directories(${Boost_INCLUDE_DIRS})
find_package(PythonInterp)
# add shared projects
add_subdirectory(Shared/HAL)
add_subdirectory(Shared/DDS)
add_subdirectory(Shared/LibSub)
add_subdirectory(Tools/WorkerManager)
# add legacy shared stuff
if(SUB_BUILD_LEGACY)
add_subdirectory(Legacy/HAL)
add_subdirectory(Legacy/DDS)
add_subdirectory(Legacy/DataObjects)
add_subdirectory(Legacy/SubMain)
endif()
# We're building LPOSVSS binaries for both systems until its running smoothly on the gumstix
add_subdirectory(Sensors/LPOSVSS)
# handle libraries and projects that only runs on the pc
if(BUILD_PC)
find_package(Qt4)
if(NOT QT_FOUND)
message("QT Not found! No projects depending on QT will be built.")
endif()
find_package(QWT)
if(NOT QWT_FOUND)
message("QWT Not found! No projects depending on QWT will be build.")
endif()
find_package(OpenCV)
if(NOT OpenCV_FOUND)
message("OpenCV not found! No projects depending on OpenCV will be built")
endif()
find_package(FlyCapture)
if(NOT FLYCAPTURE_FOUND)
message("FlyCapture not found! No projects depending on FlyCapture will be built")
endif()
find_package(FFTW)
if(FFTW_FOUND)
include_directories(${FFTW_INCLUDES})
add_definitions(-DEIGEN_FFTW_DEFAULT)
else()
message(WARNING "FFTW not found. Eigen will fall back to kissfft.")
endif()
if(PYTHONINTERP_FOUND)
add_subdirectory(Shared/Python)
add_subdirectory(Mission/MissionPlanner)
endif()
add_subdirectory(Sensors/Hydrophone)
add_subdirectory(Control/PrimitiveDriver)
add_subdirectory(Control/TrackingController)
if(SUB_BUILD_LEGACY)
add_subdirectory(Control/TrajectoryGenerator)
endif()
add_subdirectory(Control/C3Trajectory)
add_subdirectory(Tools/SubLog)
if(OpenCV_FOUND)
add_subdirectory(Mission/Vision)
endif()
if(QT_FOUND)
add_subdirectory(Tools/SubControl)
if(SUB_BUILD_LEGACY)
add_subdirectory(Tools/MotorCalibrate)
add_subdirectory(Tools/DDSWatcher)
add_subdirectory(Tools/PDTest)
if(QWT_FOUND)
add_subdirectory(Tools/TrajectoryTest)
endif()
endif()
endif()
endif()
# handle projects that only run on the gumstix
if(BUILD_GUMSTIX)
add_subdirectory(Sensors/IMU)
add_subdirectory(Sensors/Depth)
add_subdirectory(Sensors/DVL)
endif()