Browse Source

VTK 8 build as part of Lemma

submodule
T-bone 6 years ago
parent
commit
3274c29c63
2 changed files with 46 additions and 20 deletions
  1. 39
    14
      CMakeLists.txt
  2. 7
    6
      Modules/LemmaCore/CMakeLists.txt

+ 39
- 14
CMakeLists.txt View File

@@ -66,8 +66,7 @@ include_directories ("${CMAKE_INSTALL_PREFIX}/include/eigen3")
66 66
 find_package(yaml-cpp)
67 67
 if (yaml-cpp_FOUND)
68 68
     message( STATUS "YAML-CPP FOUND ${yaml-cpp_FOUND}" )
69
-	message( STATUS "YAMLCPP_FOUND ${YAMLCPP_FOUND}" )
70
-    message( STATUS "YAML-CPP LIBNAME ${yaml-cpp_LIBNAME}" )
69
+    message( STATUS "YAML-CPP LIBRARIES ${YAML_CPP_LIBRARIES}" )
71 70
     message( STATUS "YAML-CPP LIBRARY ${yaml-cpp_LIBRARY}" )
72 71
 else()
73 72
     message( STATUS "YAML-CPP WAS NOT FOUND" )
@@ -100,8 +99,9 @@ else()
100 99
 		BUILD_COMMAND ""
101 100
 		INSTALL_COMMAND ""
102 101
     	PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/CxxTest
103
-    	CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} /
104
-			-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
102
+    	CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} /
103
+                   -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} /
104
+                   -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
105 105
 	)
106 106
 	# The values "CACHE PATH "" FORCE" makes the GUI show the values of the local CxxTest, but this can cause issues 
107 107
 	# with users wanting to specify their own path, its not recommended  
@@ -164,31 +164,56 @@ if ( LEMMA_VTK7_SUPPORT )
164 164
 			vtkCommonDataModel vtkFiltersHyperTree vtkIOXML vtkIOImage vtkIOLegacy vtkInteractionStyle 
165 165
 			vtkRenderingAnnotation vtkFiltersHybrid vtkFiltersModeling vtkRenderingVolumeOpenGL2 NO_MODULE)
166 166
 	set(volumeRenderer volumerenderer.cxx)
167
-
168 167
 	if (VTK_FOUND)
169 168
 		message(STATUS "VTK 7 was found! ") 
170 169
 	        include(${VTK_USE_FILE}) 
171 170
 	else()
172 171
 		ExternalProject_Add(VTK
173 172
   		GIT_REPOSITORY "https://gitlab.kitware.com/vtk/vtk.git"
174
-    	        PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/vtk7
173
+		GIT_TAG  "v7.1.1"
174
+    	PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/vtk7
175 175
   		CMAKE_ARGS
176 176
    	        -DBUILD_SHARED_LIBS:BOOL=ON
177 177
 	        -DBUILD_EXAMPLES:BOOL=OFF
178 178
 	        -DBUILD_TESTING:BOOL=OFF
179
-		-DVTK_Group_Web:BOOL=OFF
179
+		    -DVTK_Group_Web:BOOL=OFF
180 180
 	        -DModule_vtkImagingMath:BOOL=ON
181
-	  	INSTALL_COMMAND ""
182
-	  	LOG_DOWNLOAD 0
183
-	  	LOG_UPDATE 0
181
+	  	    LOG_DOWNLOAD 0
182
+	  	    LOG_UPDATE 0
184 183
 		)
185 184
 	endif()
185
+endif()
186 186
 
187
-
187
+option (LEMMA_VTK8_SUPPORT "VTK library for visualisation and grids" OFF)
188
+if ( LEMMA_VTK8_SUPPORT ) 
189
+	#find_package(VTK 7 REQUIRED NO_MODULE)
190
+	find_package(VTK 8.0 COMPONENTS vtkCommonCore vtkRenderingCore vtkFiltersCore vtkFiltersSources 
191
+			vtkCommonDataModel vtkFiltersHyperTree vtkIOXML vtkIOImage vtkIOLegacy vtkInteractionStyle 
192
+			vtkRenderingAnnotation vtkFiltersHybrid vtkFiltersModeling vtkRenderingVolumeOpenGL2 NO_MODULE)
193
+	if (VTK_FOUND)
194
+		message(STATUS "VTK 8 was found! ") 
195
+		set(volumeRenderer volumerenderer.cxx)
196
+	    include(${VTK_USE_FILE}) 
197
+	else()
198
+		message( STATUS "External build of VTK 8 has been added, this may take some time to build." )
199
+		ExternalProject_Add(VTK8
200
+  		GIT_REPOSITORY "https://gitlab.kitware.com/vtk/vtk.git"
201
+		GIT_TAG  "v8.1.0"
202
+    	PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/vtk8
203
+  		CMAKE_ARGS 
204
+    	    -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} 
205
+            -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} /
206
+            -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} /
207
+   	        -DBUILD_SHARED_LIBS:BOOL=ON /
208
+	        -DBUILD_EXAMPLES:BOOL=OFF /
209
+	        -DBUILD_TESTING:BOOL=OFF /
210
+		    -DVTK_Group_Web:BOOL=OFF /
211
+	        -DModule_vtkImagingMath:BOOL=ON /
212
+	  	    LOG_DOWNLOAD 0 /
213
+	  	    LOG_UPDATE 0
214
+		)
215
+	endif()
188 216
 	add_compile_options(-DLEMMAUSEVTK) 
189
-	# Compile Matplot_vtk if VTK is present
190
-	#add_subdirectory(Matplot_vtk)	
191
-	#include_directories ("${PROJECT_SOURCE_DIR}/Matplot_vtk")
192 217
 endif()
193 218
 
194 219
 #######################

+ 7
- 6
Modules/LemmaCore/CMakeLists.txt View File

@@ -21,18 +21,19 @@ if (LEMMA_MATIO_SUPPORT)
21 21
 endif()
22 22
 
23 23
 # Linking
24
-if ( LEMMA_VTK6_SUPPORT OR LEMMA_VTK7_SUPPORT ) 
24
+if ( LEMMA_VTK6_SUPPORT OR LEMMA_VTK7_SUPPORT OR LEMMA_VTK8_SUPPORT ) 
25 25
 	target_link_libraries(lemmacore ${VTK_LIBRARIES})
26 26
 #	target_link_libraries(lemmacore "matplot")
27 27
 endif()
28 28
 
29 29
 # find_package(yaml-cpp) does not seem to properly define library names...
30 30
 # a better solution than this is welcome 
31
-if (WIN32)
32
-	target_link_libraries(lemmacore "libyaml-cppmdd") 
33
-else()
34
-	target_link_libraries(lemmacore "yaml-cpp") 
35
-endif()
31
+target_link_libraries(lemmacore ${YAML_CPP_LIBRARIES}) 
32
+#if (WIN32)
33
+#	target_link_libraries(lemmacore "libyaml-cppmdd") 
34
+#else()
35
+#	target_link_libraries(lemmacore "yaml-cpp") 
36
+#endif()
36 37
 
37 38
 # Testing
38 39
 if (LEMMA_ENABLE_TESTING)

Loading…
Cancel
Save