|
@@ -37,8 +37,12 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
37
|
37
|
message(STATUS "Setting build type to 'Debug' as none was specified.")
|
38
|
38
|
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
|
39
|
39
|
# Set the possible values of build type for cmake-gui
|
40
|
|
- set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
|
41
|
|
- "MinSizeRel" "RelWithDebInfo")
|
|
40
|
+ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
|
|
41
|
+ "Debug"
|
|
42
|
+ "Release"
|
|
43
|
+ "MinSizeRel"
|
|
44
|
+ "RelWithDebInfo"
|
|
45
|
+ )
|
42
|
46
|
endif()
|
43
|
47
|
|
44
|
48
|
# If CMAKE_BUILD_TYPE is not specified, assume Release.
|
|
@@ -51,7 +55,6 @@ option ( LEMMA_BUILD_EXAMPLES "Compile example Lemma applications" OFF )
|
51
|
55
|
option ( LEMMA_USE_OPENMP "Use OpenMP in Lemma" OFF )
|
52
|
56
|
option ( LEMMA_BUILD_DOCUMENTATION "Build Doxygen man pages" OFF )
|
53
|
57
|
|
54
|
|
-#option (LEMMA_VTK7_SUPPORT "VTK 7.x library for visualisation and grids" OFF)
|
55
|
58
|
option (LEMMA_VTK8_SUPPORT "VTK 8.x library for visualisation and grids" OFF)
|
56
|
59
|
|
57
|
60
|
#option (CMAKE_CROSSCOMPILING "Target different arch than you are on" OFF)
|
|
@@ -64,6 +67,7 @@ SET (CMAKE_CROSSCOMPILING TRUE)
|
64
|
67
|
##########################################################################################
|
65
|
68
|
## Only look for packages where we build them...this makes finding VTK a problem though! #
|
66
|
69
|
##########################################################################################
|
|
70
|
+
|
67
|
71
|
if (CMAKE_CROSSCOMPILING)
|
68
|
72
|
message ( STATUS "Performing SuperBuild") #, Only searching in install directory for components." )
|
69
|
73
|
# Kind of hack-ish, CMake doesn't always find this. It's buried in Cross compilation, so,
|
|
@@ -82,14 +86,15 @@ if (CMAKE_CROSSCOMPILING)
|
82
|
86
|
# UNSET( yaml-cpp_FOUND CACHE )
|
83
|
87
|
|
84
|
88
|
#message( STATUS "........Looking for yaml-cpp in ${CMAKE_INSTALL_PREFIX}" )
|
85
|
|
-
|
|
89
|
+ project (CHECKSUPERBUILD CXX)
|
86
|
90
|
find_package (yaml-cpp 0.6 PATHS ${CMAKE_INSTALL_PREFIX} NO_DEFAULT_PATH ) # Serialisation of classes
|
87
|
91
|
find_package (Eigen3 3.3 PATHS ${CMAKE_INSTALL_PREFIX} NO_DEFAULT_PATH ) # Matrix/Vector & Math
|
88
|
|
-
|
|
92
|
+ find_package (VTK 8.2.0 EXACT PATHS ${CMAKE_INSTALL_PREFIX} NO_DEFAULT_PATH ) # Visualization
|
89
|
93
|
#message( STATUS "yaml-cpp include dir ${YAML_CPP_INCLUDE_DIR}" )
|
90
|
94
|
else()
|
91
|
|
- find_package (Eigen3 3.3 QUIET) # Matrix/Vector & Math
|
|
95
|
+ find_package (Eigen3 3.3 QUIET ) # Matrix/Vector & Math
|
92
|
96
|
find_package (yaml-cpp 0.6 QUIET ) # Serialisation of classes
|
|
97
|
+ find_package (VTK 8.2 QUIET ) # Visualization
|
93
|
98
|
endif()
|
94
|
99
|
|
95
|
100
|
INCLUDE_DIRECTORIES(${YAML_CPP_INCLUDE_DIR})
|
|
@@ -117,6 +122,7 @@ endif()
|
117
|
122
|
## Optional Dependencies
|
118
|
123
|
if ( NOT Eigen3_FOUND OR
|
119
|
124
|
NOT yaml-cpp_FOUND OR
|
|
125
|
+ (LEMMA_VTK8_SUPPORT AND NOT VTK_FOUND) OR
|
120
|
126
|
(LEMMA_ENABLE_TESTING AND NOT CxxTest_FOUND) )
|
121
|
127
|
message ( STATUS "Missing hard dependencies have been found, these will be downloaded any compiled." )
|
122
|
128
|
message ( STATUS "This necessitates a two step build." )
|
|
@@ -183,69 +189,47 @@ endif()
|
183
|
189
|
# External Projects
|
184
|
190
|
###################
|
185
|
191
|
|
186
|
|
-# We don't build VTK, it is too heavy.
|
187
|
|
-#if ( LEMMA_VTK7_SUPPORT )
|
188
|
|
-# #find_package(VTK 7 REQUIRED NO_MODULE)
|
189
|
|
-# find_package(VTK 7.0 COMPONENTS vtkCommonCore vtkRenderingCore vtkFiltersCore vtkFiltersSources
|
|
192
|
+#if ( LEMMA_VTK8_SUPPORT )
|
|
193
|
+# find_package(VTK 8)
|
|
194
|
+# find_package(VTK 8.9 COMPONENTS vtkCommonCore vtkRenderingCore vtkFiltersCore vtkFiltersSources
|
190
|
195
|
# vtkCommonDataModel vtkFiltersHyperTree vtkIOXML vtkIOImage vtkIOLegacy vtkIOGeometry vtkInteractionStyle
|
191
|
196
|
# vtkRenderingAnnotation vtkFiltersHybrid vtkFiltersModeling vtkRenderingVolumeOpenGL2 NO_MODULE)
|
192
|
|
-# set(volumeRenderer volumerenderer.cxx)
|
|
197
|
+ #find_package(VTK 8 NO_MODULE)
|
|
198
|
+ #vtkCommonDataModel vtkFiltersHyperTree vtkIOXML vtkIOImage vtkIOLegacy vtkIOGeometry vtkInteractionStyle
|
|
199
|
+ #vtkRenderingAnnotation vtkFiltersHybrid vtkFiltersModeling vtkRenderingVolumeOpenGL2 NO_MODULE)
|
|
200
|
+ #if ( ${VTK_MINOR_VERSION} != 2 )
|
|
201
|
+ # message(FATAL_ERROR "VTK 8 was found! " ${VTK_VERSION}, ${VTK_MINOR_VERSION}, ${VTK_USE_FILE} )
|
|
202
|
+ #endif()
|
|
203
|
+# if (VTK_VERSION VERSION_GREATER "8.20.0")
|
|
204
|
+# message( AUTHOR_WARNING "VTK > 8.20.0 was found! " ${VTK_VERSION}, ${VTK_MINOR_VERSION}, ${VTK_USE_FILE} )
|
|
205
|
+# endif()
|
193
|
206
|
# if (VTK_FOUND)
|
194
|
|
-# message(STATUS "VTK 7 was found! ")
|
195
|
|
-# include(${VTK_USE_FILE})
|
196
|
|
-# #add_compile_options(-DLEMMAUSEVTK)
|
197
|
|
-# #target_compile_definitions( lemmacore PRIVATE LEMMAUSEVTK=1 )
|
198
|
|
-# add_definitions(-DLEMMAUSEVTK)
|
|
207
|
+# #message(STATUS "VTK 8 was found! " ${VTK_VERSION}, ${VTK_USE_FILE} )
|
|
208
|
+# message(STATUS "VTK 8 was found! " ${VTK_VERSION}, ${VTK_MINOR_VERSION}, ${VTK_USE_FILE} )
|
|
209
|
+# set(volumeRenderer volumerenderer.cxx)
|
|
210
|
+# #include(${VTK_USE_FILE})
|
199
|
211
|
# else()
|
200
|
|
-# ExternalProject_Add(VTK
|
|
212
|
+# message( STATUS "External build of VTK 8 has been added, this may take some time to build." )
|
|
213
|
+# ExternalProject_Add(VTK8
|
201
|
214
|
# GIT_REPOSITORY "https://gitlab.kitware.com/vtk/vtk.git"
|
202
|
|
-# GIT_TAG "v7.1.1"
|
203
|
|
-# PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/vtk7
|
204
|
|
-# CMAKE_ARGS
|
205
|
|
-# -DBUILD_SHARED_LIBS:BOOL=ON
|
206
|
|
-# -DBUILD_EXAMPLES:BOOL=OFF
|
207
|
|
-# -DBUILD_TESTING:BOOL=OFF
|
208
|
|
-# -DVTK_Group_Web:BOOL=OFF
|
209
|
|
-# -DModule_vtkImagingMath:BOOL=ON
|
210
|
|
-# LOG_DOWNLOAD 0
|
|
215
|
+# GIT_TAG "v8.2.0"
|
|
216
|
+# PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/vtk8
|
|
217
|
+# CMAKE_ARGS
|
|
218
|
+# -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
|
|
219
|
+# -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} /
|
|
220
|
+# -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} /
|
|
221
|
+# -DBUILD_SHARED_LIBS:BOOL=ON /
|
|
222
|
+# -DBUILD_EXAMPLES:BOOL=OFF /
|
|
223
|
+# -DBUILD_TESTING:BOOL=OFF /
|
|
224
|
+# -DVTK_Group_Web:BOOL=OFF /
|
|
225
|
+# -DModule_vtkImagingMath:BOOL=ON /
|
|
226
|
+# LOG_DOWNLOAD 0 /
|
211
|
227
|
# LOG_UPDATE 0
|
212
|
228
|
# )
|
213
|
229
|
# endif()
|
|
230
|
+# add_definitions(-DLEMMAUSEVTK)
|
214
|
231
|
#endif()
|
215
|
232
|
|
216
|
|
-if ( LEMMA_VTK8_SUPPORT )
|
217
|
|
- find_package(VTK 8.2 COMPONENTS vtkCommonCore vtkRenderingCore vtkFiltersCore vtkFiltersSources
|
218
|
|
- vtkCommonDataModel vtkFiltersHyperTree vtkIOXML vtkIOImage vtkIOLegacy vtkIOGeometry vtkInteractionStyle
|
219
|
|
- vtkRenderingAnnotation vtkFiltersHybrid vtkFiltersModeling vtkRenderingVolumeOpenGL2 NO_MODULE)
|
220
|
|
- #find_package(VTK 8 NO_MODULE)
|
221
|
|
- #vtkCommonDataModel vtkFiltersHyperTree vtkIOXML vtkIOImage vtkIOLegacy vtkIOGeometry vtkInteractionStyle
|
222
|
|
- #vtkRenderingAnnotation vtkFiltersHybrid vtkFiltersModeling vtkRenderingVolumeOpenGL2 NO_MODULE)
|
223
|
|
- if (VTK_FOUND)
|
224
|
|
- message(STATUS "VTK 8 was found! " ${VTK_VERSION}, ${VTK_USE_FILE} )
|
225
|
|
- set(volumeRenderer volumerenderer.cxx)
|
226
|
|
- #include(${VTK_USE_FILE})
|
227
|
|
- else()
|
228
|
|
- message( STATUS "External build of VTK 8 has been added, this may take some time to build." )
|
229
|
|
- ExternalProject_Add(VTK8
|
230
|
|
- GIT_REPOSITORY "https://gitlab.kitware.com/vtk/vtk.git"
|
231
|
|
- GIT_TAG "v8.2.0"
|
232
|
|
- PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/vtk8
|
233
|
|
- CMAKE_ARGS
|
234
|
|
- -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
|
235
|
|
- -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} /
|
236
|
|
- -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} /
|
237
|
|
- -DBUILD_SHARED_LIBS:BOOL=ON /
|
238
|
|
- -DBUILD_EXAMPLES:BOOL=OFF /
|
239
|
|
- -DBUILD_TESTING:BOOL=OFF /
|
240
|
|
- -DVTK_Group_Web:BOOL=OFF /
|
241
|
|
- -DModule_vtkImagingMath:BOOL=ON /
|
242
|
|
- LOG_DOWNLOAD 0 /
|
243
|
|
- LOG_UPDATE 0
|
244
|
|
- )
|
245
|
|
- endif()
|
246
|
|
- add_definitions(-DLEMMAUSEVTK)
|
247
|
|
-endif()
|
248
|
|
-
|
249
|
233
|
#######################
|
250
|
234
|
# Lemma Configuration #
|
251
|
235
|
#######################
|