Browse Source

VTK 8 build as part of Lemma

submodule
T-bone 7 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
 find_package(yaml-cpp)
66
 find_package(yaml-cpp)
67
 if (yaml-cpp_FOUND)
67
 if (yaml-cpp_FOUND)
68
     message( STATUS "YAML-CPP FOUND ${yaml-cpp_FOUND}" )
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
     message( STATUS "YAML-CPP LIBRARY ${yaml-cpp_LIBRARY}" )
70
     message( STATUS "YAML-CPP LIBRARY ${yaml-cpp_LIBRARY}" )
72
 else()
71
 else()
73
     message( STATUS "YAML-CPP WAS NOT FOUND" )
72
     message( STATUS "YAML-CPP WAS NOT FOUND" )
100
 		BUILD_COMMAND ""
99
 		BUILD_COMMAND ""
101
 		INSTALL_COMMAND ""
100
 		INSTALL_COMMAND ""
102
     	PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/CxxTest
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
 	# The values "CACHE PATH "" FORCE" makes the GUI show the values of the local CxxTest, but this can cause issues 
106
 	# The values "CACHE PATH "" FORCE" makes the GUI show the values of the local CxxTest, but this can cause issues 
107
 	# with users wanting to specify their own path, its not recommended  
107
 	# with users wanting to specify their own path, its not recommended  
164
 			vtkCommonDataModel vtkFiltersHyperTree vtkIOXML vtkIOImage vtkIOLegacy vtkInteractionStyle 
164
 			vtkCommonDataModel vtkFiltersHyperTree vtkIOXML vtkIOImage vtkIOLegacy vtkInteractionStyle 
165
 			vtkRenderingAnnotation vtkFiltersHybrid vtkFiltersModeling vtkRenderingVolumeOpenGL2 NO_MODULE)
165
 			vtkRenderingAnnotation vtkFiltersHybrid vtkFiltersModeling vtkRenderingVolumeOpenGL2 NO_MODULE)
166
 	set(volumeRenderer volumerenderer.cxx)
166
 	set(volumeRenderer volumerenderer.cxx)
167
-
168
 	if (VTK_FOUND)
167
 	if (VTK_FOUND)
169
 		message(STATUS "VTK 7 was found! ") 
168
 		message(STATUS "VTK 7 was found! ") 
170
 	        include(${VTK_USE_FILE}) 
169
 	        include(${VTK_USE_FILE}) 
171
 	else()
170
 	else()
172
 		ExternalProject_Add(VTK
171
 		ExternalProject_Add(VTK
173
   		GIT_REPOSITORY "https://gitlab.kitware.com/vtk/vtk.git"
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
   		CMAKE_ARGS
175
   		CMAKE_ARGS
176
    	        -DBUILD_SHARED_LIBS:BOOL=ON
176
    	        -DBUILD_SHARED_LIBS:BOOL=ON
177
 	        -DBUILD_EXAMPLES:BOOL=OFF
177
 	        -DBUILD_EXAMPLES:BOOL=OFF
178
 	        -DBUILD_TESTING:BOOL=OFF
178
 	        -DBUILD_TESTING:BOOL=OFF
179
-		-DVTK_Group_Web:BOOL=OFF
179
+		    -DVTK_Group_Web:BOOL=OFF
180
 	        -DModule_vtkImagingMath:BOOL=ON
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
 	endif()
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
 	add_compile_options(-DLEMMAUSEVTK) 
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
 endif()
217
 endif()
193
 
218
 
194
 #######################
219
 #######################

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

21
 endif()
21
 endif()
22
 
22
 
23
 # Linking
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
 	target_link_libraries(lemmacore ${VTK_LIBRARIES})
25
 	target_link_libraries(lemmacore ${VTK_LIBRARIES})
26
 #	target_link_libraries(lemmacore "matplot")
26
 #	target_link_libraries(lemmacore "matplot")
27
 endif()
27
 endif()
28
 
28
 
29
 # find_package(yaml-cpp) does not seem to properly define library names...
29
 # find_package(yaml-cpp) does not seem to properly define library names...
30
 # a better solution than this is welcome 
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
 # Testing
38
 # Testing
38
 if (LEMMA_ENABLE_TESTING)
39
 if (LEMMA_ENABLE_TESTING)

Loading…
Cancel
Save