소스 검색

cleaning up VTK support in CMAKE files

iss7
Trevor Irons 5 년 전
부모
커밋
2e3fcc5fac
1개의 변경된 파일15개의 추가작업 그리고 89개의 파일을 삭제
  1. 15
    89
      CMakeLists.txt

+ 15
- 89
CMakeLists.txt 파일 보기

@@ -10,7 +10,7 @@ SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)
10 10
 # Lemma versioning, set Major, minor, and patch here                                               #
11 11
 set(LEMMA_VERSION_MAJOR "0")                                                                       #
12 12
 set(LEMMA_VERSION_MINOR "3")                                                                       #
13
-set(LEMMA_VERSION_PATCH "0")                                                                       #
13
+set(LEMMA_VERSION_PATCH "1")                                                                       #
14 14
 set(LEMMA_VERSION "\"${LEMMA_VERSION_MAJOR}.${LEMMA_VERSION_MINOR}.${LEMMA_VERSION_PATCH}\"")      #
15 15
 set(LEMMA_VERSION_NOQUOTES "${LEMMA_VERSION_MAJOR}.${LEMMA_VERSION_MINOR}.${LEMMA_VERSION_PATCH}") #
16 16
 ####################################################################################################
@@ -24,13 +24,6 @@ set(LEMMA_VERSION_NOQUOTES "${LEMMA_VERSION_MAJOR}.${LEMMA_VERSION_MINOR}.${LEMM
24 24
 ## Options--what do you want to do
25 25
 option ( BUILD_SHARED_LIBS      "Shared or static libraries"  OFF )
26 26
 
27
-# Disallow in-source build
28
-#if ("${Lemma_SOURCE_DIR}"  STREQUAL "${Lemma_BINARY_DIR}")
29
-#  message(FATAL_ERROR
30
-#    "ParaView requires an out of source Build. "
31
-#    "Please create a separate binary directory and run CMake there.")
32
-#endif()
33
-
34 27
 #------------------------------------------------------------------------------
35 28
 # Set a default build type if none was specified
36 29
 if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
@@ -45,22 +38,16 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
45 38
   )
46 39
 endif()
47 40
 
48
-# If CMAKE_BUILD_TYPE is not specified, assume Release. 
49
-#IF( NOT CMAKE_BUILD_TYPE )
50
-#   SET( CMAKE_BUILD_TYPE Release ... FORCE )
51
-#ENDIF()
52
-
53 41
 option ( LEMMA_ENABLE_TESTING       "Turn on unit testing" OFF )
54 42
 option ( LEMMA_BUILD_EXAMPLES       "Compile example Lemma applications" OFF )
55 43
 option ( LEMMA_USE_OPENMP           "Use OpenMP in Lemma" OFF )
56 44
 option ( LEMMA_BUILD_DOCUMENTATION  "Build Doxygen man pages" OFF )
45
+option ( LEMMA_VTK8_SUPPORT         "VTK 8.x library for visualisation and grids" OFF)
57 46
 
58
-option (LEMMA_VTK8_SUPPORT "VTK 8.x library for visualisation and grids" OFF)
59
-
47
+# We end up using this for all builds, TODO remove this variable but follow same path
60 48
 #option (CMAKE_CROSSCOMPILING "Target different arch than you are on" OFF)
61 49
 
62 50
 SET( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/CMake/ )
63
-#message( STATUS "MODULE PATH ${CMAKE_MODULE_PATH}" )
64 51
 
65 52
 SET (CMAKE_CROSSCOMPILING TRUE)
66 53
 
@@ -69,35 +56,26 @@ SET (CMAKE_CROSSCOMPILING TRUE)
69 56
 ########################################################################################## 
70 57
 
71 58
 if (CMAKE_CROSSCOMPILING)
72
-    message ( STATUS "Performing SuperBuild") #, Only searching in install directory for components." )
73
-    # Kind of hack-ish, CMake doesn't always find this. It's buried in Cross compilation, so, 
74
-    # hopefully anyone doing this can problem solve. 
75
-    #    SET( CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX}/CMake ${CMAKE_INSTALL_PREFIX}/share/eigen3 )
76
-
77
-    #    SET( CMAKE_MODULE_PATH ${CMAKE_INSTALL_PREFIX} )
78
-    #    SET( CMAKE_FIND_ROOT_PATH ONLY ${CMAKE_INSTALL_PREFIX} )
79
-    #    SET( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY  ONLY ) 
80
-    #    SET( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE  ONLY ) 
81
-    #    SET( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE  ONLY )
82
-
83
-    #    UNSET( Eigen3_DIR CACHE ) 
84
-    #    UNSET( yaml-cpp_DIR CACHE ) 
85
-    #    UNSET( Eigen3_FOUND CACHE ) 
86
-    #    UNSET( yaml-cpp_FOUND CACHE ) 
87
-
88
-    #message( STATUS "........Looking for yaml-cpp in ${CMAKE_INSTALL_PREFIX}" )
89
-    project (CHECKSUPERBUILD CXX)
59
+    message ( STATUS "Performing SuperBuild") 
60
+    project (CHECKSUPERBUILD CXX) # Necessary for VTK query 
90 61
     find_package (yaml-cpp 0.6 PATHS ${CMAKE_INSTALL_PREFIX}  NO_DEFAULT_PATH ) # Serialisation of classes 
91 62
     find_package (Eigen3   3.3 PATHS ${CMAKE_INSTALL_PREFIX}  NO_DEFAULT_PATH ) # Matrix/Vector & Math
92
-    find_package (VTK      8.2.0 EXACT PATHS ${CMAKE_INSTALL_PREFIX}  NO_DEFAULT_PATH ) # Visualization 
93
-    #message( STATUS "yaml-cpp include dir ${YAML_CPP_INCLUDE_DIR}" )
63
+    if (LEMMA_VTK8_SUPPORT)
64
+        find_package (VTK      8.2.0 EXACT PATHS ${CMAKE_INSTALL_PREFIX}  NO_DEFAULT_PATH ) # Visualization 
65
+    endif()
94 66
 else()
95 67
     find_package (Eigen3   3.3 QUIET )  # Matrix/Vector & Math
96 68
     find_package (yaml-cpp 0.6 QUIET )  # Serialisation of classes 
97
-    find_package (VTK      8.2 QUIET )  # Visualization 
69
+    if (LEMMA_VTK8_SUPPORT)
70
+        find_package (VTK      8.2 QUIET )  # Visualization 
71
+    endif()
98 72
 endif()
99 73
 
100 74
 INCLUDE_DIRECTORIES(${YAML_CPP_INCLUDE_DIR})
75
+if (VTK_FOUND)
76
+    set(volumeRenderer volumerenderer.cxx)
77
+	add_definitions(-DLEMMAUSEVTK) 
78
+endif()
101 79
 
102 80
 if (LEMMA_BUILD_DOCUMENTATION)
103 81
     find_package(Doxygen REQUIRED)
@@ -178,58 +156,6 @@ else()
178 156
 	set(LABEL_SUFFIX "static")
179 157
 endif()
180 158
 
181
-#if(NOT CMAKE_BUILD_TYPE)
182
-#   set(CMAKE_BUILD_TYPE "Release" CACHE STRING
183
-#       "Choose the type of build, options are: Debug Release
184
-#        RelWithDebInfo MinSizeRel."
185
-#       FORCE)
186
-#endif(NOT CMAKE_BUILD_TYPE)
187
-
188
-###################
189
-# External Projects
190
-###################
191
-
192
-#if ( LEMMA_VTK8_SUPPORT ) 
193
-#	find_package(VTK 8) 
194
-#	find_package(VTK 8.9 COMPONENTS vtkCommonCore vtkRenderingCore vtkFiltersCore vtkFiltersSources 
195
-#			vtkCommonDataModel vtkFiltersHyperTree vtkIOXML vtkIOImage vtkIOLegacy vtkIOGeometry vtkInteractionStyle 
196
-#			vtkRenderingAnnotation vtkFiltersHybrid vtkFiltersModeling vtkRenderingVolumeOpenGL2 NO_MODULE)
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()
206
-#	if (VTK_FOUND)
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}) 
211
-#	else()
212
-#		message( STATUS "External build of VTK 8 has been added, this may take some time to build." )
213
-#		ExternalProject_Add(VTK8
214
-#  		GIT_REPOSITORY "https://gitlab.kitware.com/vtk/vtk.git"
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 /
227
-#	  	    LOG_UPDATE 0
228
-#		)
229
-#	endif()
230
-#	add_definitions(-DLEMMAUSEVTK) 
231
-#endif()
232
-
233 159
 #######################
234 160
 # Lemma Configuration #
235 161
 #######################

Loading…
취소
저장