-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
225 lines (167 loc) · 7.73 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
#===============================================================================
# Configuration
project(lronacPipeline)
cmake_minimum_required(VERSION 2.8)
set(PACKAGE_VERSION "0.1")
set(PACKAGE_NAME "LRONAC Pipeline")
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(PACKAGE_BUGREPORT "scott.t.mcmichael@nasa.gov")
set(BASESYSTEM_INSTALL_DIR "/u/smcmich1/projects/BaseSystem")
set(VISIONWORKBENCH_ROOT "/u/smcmich1/projects/visionworkbench/build")
set(StereoPipeline_ROOT "/u/smcmich1/projects/StereoPipeline/build")
set(NGT_TOOLS_SOURCE "/u/smcmich1/projects/Tools") # Need to point to FindX.cmake files there
set(CERES_INSTALL_DIR ${BASESYSTEM_INSTALL_DIR})
set(SUITESPARSE_INSTALL_DIR ${BASESYSTEM_INSTALL_DIR})
# Add NGT/Tools path to custom modules list
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${NGT_TOOLS_SOURCE})
# Custom options
option(BUILD_SHARED_LIBS "Produce shared libraries." TRUE)
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON )
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
set(CMAKE_BUILD_TYPE RelWithDebInfo)
#==================================================================================
# Find dependencies
#find_package(Boost 1.50.0
# COMPONENTS
# program_options
# system
# filesystem
# thread
# )
message("--------------------------------------------------------------")
message("Searching for boost...")
set(BOOST_ROOT "${BASESYSTEM_INSTALL_DIR}/include/boost-1_55")
set(BOOST_LIBRARYDIR "${BASESYSTEM_INSTALL_DIR}/lib")
set(BOOST_INCLUDEDIR "${BASESYSTEM_INSTALL_DIR}/include/boost-1_55/boost")
set(Boost_NO_SYSTEM_PATHS ON) #This does not seem to work
#set(Boost_DEBUG 1) # Uncomment for useful finding boost debug output
set(BOOST_MIN_VERSION "1.55.0")
set(REQUIRED_BOOST_LIBS program_options system filesystem regex date_time thread iostreams)
find_package(Boost ${BOOST_MIN_VERSION} REQUIRED COMPONENTS ${REQUIRED_BOOST_LIBS})
if(Boost_FOUND)
message("Successfully found Boost version ${Boost_VERSION}!")
message("---Boost Include Dir = ${Boost_INCLUDE_DIR}")
#set(Boost_LIBRARY_DIR ${BASESYSTEM_INSTALL_DIR}/lib) # Override this value
message("---Boost Library Dir = ${Boost_LIBRARY_DIRS}")
message("---Boost libraries = ${Boost_LIBRARIES}")
include_directories(${Boost_INCLUDE_DIR})
link_directories(${Boost_LIBRARY_DIR})
endif(Boost_FOUND)
message("--------------------------------------------------------------")
message("--------------------------------------------------------------")
message("Searching for QT...")
# TODO: Make sure this finds the correct install!
#set (QT_QMAKE_EXECUTABLE ${BASESYSTEM_INSTALL_DIR}/bin/qmake)
#SET(CMAKE_PREFIX_PATH ${BASESYSTEM_INSTALL_DIR} ${CMAKE_PREFIX_PATH})
#set(REQUIRED_QT_LIBS QtCore QtXml QtGui ) #TODO: Figure this out
#find_package(Qt4 4.8.5 REQUIRED )# ${REQUIRED_QT_LIBS})
# Testing: Manual QT settings
set(QT_FOUND True)
set(QT_INCLUDE_DIRS ${BASESYSTEM_INSTALL_DIR}/include/Qt
${BASESYSTEM_INSTALL_DIR}/include/Qt3Support
${BASESYSTEM_INSTALL_DIR}/include/QtCore
${BASESYSTEM_INSTALL_DIR}/include/QtDesigner
${BASESYSTEM_INSTALL_DIR}/include/QtGui
${BASESYSTEM_INSTALL_DIR}/include/QtHelp
${BASESYSTEM_INSTALL_DIR}/include/QtMultimedia
${BASESYSTEM_INSTALL_DIR}/include/QtNetwork
${BASESYSTEM_INSTALL_DIR}/include/QtSql
${BASESYSTEM_INSTALL_DIR}/include/QtSvg
${BASESYSTEM_INSTALL_DIR}/include/QtTest
${BASESYSTEM_INSTALL_DIR}/include/QtUiTools
${BASESYSTEM_INSTALL_DIR}/include/QtXml
${BASESYSTEM_INSTALL_DIR}/include/QtXmlPatterns)
set(QT_LIBRARY_DIR ${BASESYSTEM_INSTALL_DIR}/lib)
set(QT_LIBRARIES libQt3Support.so
libQtCLucene.so
libQtCore.so
libQtDesignerComponents.so
libQtDesigner.so
libQtGui.so
libQtHelp.so
libQtMultimedia.so
libQtNetwork.so
libQtSql.so
libQtSvg.so
libQtTest.so
libQtXmlPatterns.so
libQtXml.so )
if(QT_FOUND)
message("QT include dirs ")
foreach(f ${QT_INCLUDE_DIRS})
message("${f}")
include_directories("${f}")
endforeach(f)
link_directories(${QT_LIBRARY_DIR})
endif(QT_FOUND)
message("--------------------------------------------------------------")
# Get NAIF includes (Needed for reading/writing SPICE data)
set(NAIF_FOUND True)
set(NAIF_INCLUDE_DIRS ${BASESYSTEM_INSTALL_DIR}/include/naif/)
find_package(VisionWorkbench REQUIRED
COMPONENTS
core
math
image
camera
fileio
cartography
geometry
interestPoint
stereo
mosaic
)
message("Found vision workbench include directory: ${VISIONWORKBENCH_INCLUDE_DIRS}")
find_package(StereoPipeline REQUIRED COMPONENTS core spiceIO isisIO)
message("Found stereo pipeline include directory: ${StereoPipeline_INCLUDE_DIR}")
set(PROTOBUF_FOUND)
set(PROTOBUF_INCLUDE_DIR ${BASESYSTEM_INSTALL_DIR}/include )
set(PROTOBUF_LIBRARY ${BASESYSTEM_INSTALL_DIR}/lib/libprotobuf.so)
include_directories("${PROTOBUF_INCLUDE_DIR}")
include_directories("${QT_INCLUDE_DIRS}")
include_directories("${NAIF_INCLUDE_DIRS}")
include_directories(${VISIONWORKBENCH_INCLUDE_DIRS})
include_directories(${StereoPipeline_INCLUDE_DIR})
include_directories(${Boost_INCLUDE_DIRS})
include_directories(${PROTOBUF_INCLUDE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
link_directories(${Boost_LIBRARY_DIRS})
set(EIGEN_INCLUDE_DIR ${BASESYSTEM_INSTALL_DIR}/include/eigen3)
include_directories("${EIGEN_INCLUDE_DIR}")
include_directories("${SUITESPARSE_INSTALL_DIR}/include")
link_directories("${SUITESPARSE_INSTALL_DIR}/lib")
set(SUITESPARSE_LIBRARIES libamd.a libccolamd.a libcolamd.a libklu.a libspqr.a libbtf.a libcxsparse.a libldl.a libsuitesparseconfig.a libcholmod.a libcxsparse.a librbio.a libumfpack.a libcamd.a)
# The order of the libraries here is important
FIND_PACKAGE(OpenMP REQUIRED)
if (OPENMP_FOUND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
# if (UNIX)
# # At least on Linux, we need pthreads to be enabled for mutex to
# # compile. This may not work on Windows or Android.
# FIND_PACKAGE(Threads REQUIRED)
# SET(STATIC_LIBRARY_FLAGS
# "${STATIC_LIBRARY_FLAGS} ${CMAKE_THREAD_LIBS_INIT}")
# SET(CMAKE_SHARED_LINKER_FLAGS
# "${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_THREAD_LIBS_INIT}")
# ADD_DEFINITIONS(-DCERES_HAVE_PTHREAD)
# ADD_DEFINITIONS(-DCERES_HAVE_RWLOCK)
# endif (UNIX)
endif (OPENMP_FOUND)
# Add the Ceres library
set(CERES_LIBRARIES ${CERES_INSTALL_DIR}/lib/libceres.so)
set(CERES_INCLUDE_DIRS ${CERES_INSTALL_DIR}/include)
foreach(f ${CERES_INCLUDE_DIRS})
message("${f}")
include_directories("${f}")
endforeach(f)
#===================================================================================
# Executables
add_executable(lronacAngleDoubleSolver IsisInterfaceLineScanRot.h IsisInterfaceLineScanRot.cc lronacAngleDoubleSolver.cc lronacSolverSupport.h lronacSolverModelDouble.h)
target_link_libraries(lronacAngleDoubleSolver ${QT_LIBRARIES} ${VISIONWORKBENCH_LIBRARIES} ${StereoPipeline_LIBRARIES} ${CERES_LIBRARIES} ${SUITESPARSE_LIBRARIES} ${Boost_LIBRARIES} -lisis3)
add_executable(spiceEditor IsisInterfaceLineScanRot.h IsisInterfaceLineScanRot.cc SpiceEditor.cc)
target_link_libraries(spiceEditor ${VISIONWORKBENCH_LIBRARIES} ${StereoPipeline_LIBRARIES} ${Boost_LIBRARIES} -lisis3 -lcspice)
add_executable(spiceEditorV2 IsisInterfaceLineScanRot.h IsisInterfaceLineScanRot.cc SpiceEditorV2.cc)
target_link_libraries(spiceEditorV2 ${VISIONWORKBENCH_LIBRARIES} ${StereoPipeline_LIBRARIES} ${Boost_LIBRARIES} -lisis3)