Browse Source

Added component wise include of VTK, rather than monolithic.

enhancement_3
Trevor Irons 8 years ago
parent
commit
55f0d85cba
2 changed files with 17 additions and 13 deletions
  1. 12
    8
      CMakeLists.txt
  2. 5
    5
      LemmaCore/CMakeLists.txt

+ 12
- 8
CMakeLists.txt View File

64
 add_compile_options(-DHAVE_YAMLCPP) 
64
 add_compile_options(-DHAVE_YAMLCPP) 
65
 
65
 
66
 # tinyxml2, this library is used for XML IO 
66
 # tinyxml2, this library is used for XML IO 
67
-option(TINYXML_SUPPORT  "MATIO library support for MATLAB .mat files" OFF)
68
-if ( TINYXML_SUPPORT )
67
+option( LEMMA_TINYXML_SUPPORT  "MATIO library support for MATLAB .mat files" OFF)
68
+if ( LEMMA_TINYXML_SUPPORT )
69
 	ExternalProject_Add(TINYXML2
69
 	ExternalProject_Add(TINYXML2
70
 		GIT_REPOSITORY "https://github.com/leethomason/tinyxml2.git"
70
 		GIT_REPOSITORY "https://github.com/leethomason/tinyxml2.git"
71
 		GIT_TAG  "master"
71
 		GIT_TAG  "master"
78
 	add_compile_options(-DTINYXMLSUPPORT) 
78
 	add_compile_options(-DTINYXMLSUPPORT) 
79
 endif()
79
 endif()
80
 
80
 
81
-option(MATIO_SUPPORT  "MATIO library support for MATLAB .mat files" OFF)
82
-if ( MATIO_SUPPORT )
81
+option( LEMMA_MATIO_SUPPORT  "MATIO library support for MATLAB .mat files" OFF)
82
+if ( LEMMA_MATIO_SUPPORT )
83
 	add_compile_options(-DHAVE_MATIO) 
83
 	add_compile_options(-DHAVE_MATIO) 
84
 	# matio, this library is used for MATLAB file IO
84
 	# matio, this library is used for MATLAB file IO
85
 	ExternalProject_ADD(MATIO
85
 	ExternalProject_ADD(MATIO
96
 endif()
96
 endif()
97
 
97
 
98
 # We don't build VTK, it is too heavy.
98
 # We don't build VTK, it is too heavy.
99
-option (VTK_SUPPORT "VTK library for visualisation and grids" OFF)
100
-if (VTK_SUPPORT) 
101
-	find_package(VTK 6 REQUIRED NO_MODULE)
102
-	include(${VTK_USE_FILE})
99
+option (LEMMA_VTK_SUPPORT "VTK library for visualisation and grids" OFF)
100
+if ( LEMMA_VTK_SUPPORT ) 
101
+	#find_package(VTK 6 REQUIRED NO_MODULE)
102
+	find_package(VTK 6.0 COMPONENTS vtkCommonCore vtkRenderingCore vtkFiltersCore vtkFiltersSources 
103
+			vtkCommonDataModel vtkFiltersHyperTree vtkIOXML vtkIOImage vtkIOLegacy vtkInteractionStyle 
104
+			vtkRenderingAnnotation vtkFiltersHybrid vtkFiltersModeling vtkRenderingVolumeOpenGL NO_MODULE)
105
+	set(volumeRenderer volumerenderer.cxx)
106
+	include(${VTK_USE_FILE}) 
103
 	add_compile_options(-DLEMMAUSEVTK) 
107
 	add_compile_options(-DLEMMAUSEVTK) 
104
 	# Compile Matplot_vtk if VTK is present
108
 	# Compile Matplot_vtk if VTK is present
105
 	add_subdirectory(Matplot_vtk)	
109
 	add_subdirectory(Matplot_vtk)	

+ 5
- 5
LemmaCore/CMakeLists.txt View File

19
 
19
 
20
 # Linking
20
 # Linking
21
 add_dependencies(lemmacore YAML-CPP)
21
 add_dependencies(lemmacore YAML-CPP)
22
-if (TINYXML_SUPPORT)
22
+if (LEMMA_TINYXML_SUPPORT)
23
 	add_dependencies(lemmacore TINYXML2)
23
 	add_dependencies(lemmacore TINYXML2)
24
 endif()
24
 endif()
25
-if (MATIO_SUPPORT)
25
+if (LEMMA_MATIO_SUPPORT)
26
 	add_dependencies(lemmacore MATIO)
26
 	add_dependencies(lemmacore MATIO)
27
 endif()
27
 endif()
28
-if (VTK_SUPPORT) 
28
+if (LEMMA_VTK_SUPPORT) 
29
 	target_link_libraries(lemmacore ${VTK_LIBRARIES})
29
 	target_link_libraries(lemmacore ${VTK_LIBRARIES})
30
 	target_link_libraries(lemmacore "matplot")
30
 	target_link_libraries(lemmacore "matplot")
31
 endif()
31
 endif()
34
 # Install
34
 # Install
35
 install ( TARGETS lemmacore DESTINATION ${CMAKE_INSTALL_PREFIX}/lib )
35
 install ( TARGETS lemmacore DESTINATION ${CMAKE_INSTALL_PREFIX}/lib )
36
 
36
 
37
-option( LEMMABUILDEXAMPLES "Compile example Lemma applications" OFF )
38
-if (LEMMABUILDEXAMPLES)
37
+option( LEMMA_BUILD_EXAMPLES "Compile example Lemma applications" OFF )
38
+if (LEMMA_BUILD_EXAMPLES)
39
 	add_subdirectory(examples)
39
 	add_subdirectory(examples)
40
 endif()
40
 endif()

Loading…
Cancel
Save