CMakeLists.txt 4.97 KB
Newer Older
1 2 3 4 5 6 7 8
##============================================================================
##  Copyright (c) Kitware, Inc.
##  All rights reserved.
##  See LICENSE.txt for details.
##  This software is distributed WITHOUT ANY WARRANTY; without even
##  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
##  PURPOSE.  See the above copyright notice for more information.
##
Kenneth Moreland's avatar
Kenneth Moreland committed
9
##  Copyright 2016 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
10 11
##  Copyright 2016 UT-Battelle, LLC.
##  Copyright 2016 Los Alamos National Security.
12
##
Kenneth Moreland's avatar
Kenneth Moreland committed
13
##  Under the terms of Contract DE-NA0003525 with NTESS,
14 15 16 17 18 19 20 21
##  the U.S. Government retains certain rights in this software.
##
##  Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
##  Laboratory (LANL), the U.S. Government retains certain rights in
##  this software.
##============================================================================

set(headers
22
  Actor.h
23 24 25
  AxisAnnotation.h
  AxisAnnotation2D.h
  AxisAnnotation3D.h
26 27
  BitmapFont.h
  BitmapFontFactory.h
28
  BoundingBoxAnnotation.h
29
  Camera.h
30 31
  Canvas.h
  CanvasRayTracer.h
32
  Color.h
33
  ColorBarAnnotation.h
34
  ColorLegendAnnotation.h
35
  ColorTable.h
36
  ConnectivityProxy.h
37
  DecodePNG.h
38
  LineRenderer.h
39
  MatrixHelpers.h
40
  Scene.h
41 42 43
  Mapper.h
  MapperRayTracer.h
  MapperVolume.h
44
  MapperConnectivity.h
Manish Mathai's avatar
Manish Mathai committed
45
  MapperWireframer.h
46
  TextAnnotation.h
47 48
  TextAnnotationBillboard.h
  TextAnnotationScreen.h
49
  TextRenderer.h
Manish Mathai's avatar
Manish Mathai committed
50
  Texture2D.h
51
  Triangulator.h
52
  View.h
Dave Pugmire's avatar
Dave Pugmire committed
53
  View1D.h
54 55
  View2D.h
  View3D.h
56 57 58
  WorldAnnotator.h
  )

59
set(sources
60
  Actor.cxx
61
  AxisAnnotation.cxx
62
  AxisAnnotation2D.cxx
63
  AxisAnnotation3D.cxx
64 65
  BitmapFont.cxx
  BitmapFontFactory.cxx
66
  BoundingBoxAnnotation.cxx
67
  Camera.cxx
68
  Color.cxx
69
  ColorBarAnnotation.cxx
70
  ColorLegendAnnotation.cxx
71
  ColorTable.cxx
72
  DecodePNG.cxx
73
  LineRenderer.cxx
74
  MapperConnectivity.cxx
75 76
  MapperRayTracer.cxx
  MapperVolume.cxx
77
  Scene.cxx
78 79 80
  TextAnnotation.cxx
  TextAnnotationBillboard.cxx
  TextAnnotationScreen.cxx
81
  View.cxx
Dave Pugmire's avatar
Dave Pugmire committed
82
  View1D.cxx
83 84
  View2D.cxx
  View3D.cxx
85
  WorldAnnotator.cxx
86 87

  internal/RunTriangulator.cxx
88 89 90
  raytracing/ConnectivityBase.cxx
  raytracing/ConnectivityTracerBase.cxx
  raytracing/ConnectivityTracerFactory.cxx
91
  raytracing/Logger.cxx
92 93
  )

94
set(opengl_headers
95
  CanvasGL.h
96
  MapperGL.h
97
  TextureGL.h
98 99
  WorldAnnotatorGL.h
  )
100 101 102

set(opengl_sources
  CanvasGL.cxx
103
  MapperGL.cxx
104
  TextureGL.cxx
105
  WorldAnnotatorGL.cxx
106 107
  )

108 109 110
set(egl_headers
  CanvasEGL.h
)
111

112 113 114 115
set(egl_sources
  CanvasEGL.cxx
  )

116
set(osmesa_headers
117
  CanvasOSMesa.h
118 119
  )

120 121 122 123
set(osmesa_sources
  CanvasOSMesa.cxx
  )

124 125 126
# This list of sources has code that uses devices and so might need to be
# compiled with a device-specific compiler (like CUDA).
set(device_sources
127
  Canvas.cxx
128
  CanvasRayTracer.cxx
129
  ConnectivityProxy.cxx
130 131
  Mapper.cxx
  MapperWireframer.cxx
132
  TextRenderer.cxx
133

134 135 136
  raytracing/BoundingVolumeHierarchy.cxx
  raytracing/Camera.cxx
  raytracing/ChannelBuffer.cxx
137
  raytracing/ConnectivityTracer.cxx
138
  raytracing/RayOperations.cxx
139
  raytracing/RayTracer.cxx
140
  raytracing/VolumeRendererStructured.cxx
141 142
  )

143
#-----------------------------------------------------------------------------
144 145
vtkm_configure_component_OpenGL()
if(VTKm_OpenGL_FOUND)
146 147
  list(APPEND headers ${opengl_headers})
  list(APPEND sources ${opengl_sources})
148

149 150
  vtkm_configure_component_OSMesa()
  if(VTKm_OSMesa_FOUND)
151 152
    list(APPEND headers ${osmesa_headers})
    list(APPEND sources ${osmesa_sources})
153 154
  endif()

155 156 157 158 159
#  vtkm_configure_component_EGL()
#  if(VTKm_EGL_FOUND)
#    list(APPEND headers ${egl_headers})
#    list(APPEND sources ${egl_sources})
#  endif()
160
endif()
161

162 163 164 165 166
if(VTKm_ENABLE_OSMESA AND NOT VTKm_OSMesa_FOUND)
  message(SEND_ERROR "OSMesa was requested by not properly configured.
Either make sure the OSMesa headers and library are properly found or set
VTKm_ENABLE_OSMESA to OFF.")
endif()
167

168
vtkm_declare_headers(${headers})
169

170 171 172 173
vtkm_library(
  SOURCES ${sources}
  WRAP_FOR_CUDA ${device_sources}
  )
174

175
# EGL Libs are added here to ensure propper linking when statically compiling.
James Kress's avatar
James Kress committed
176
# This is safe to do even when not using EGL as the values will then be empty.
177 178 179 180
target_link_libraries(vtkm_rendering
                      PUBLIC vtkm_cont
                      PRIVATE ${VTKm_OPENGL_LIBRARIES}
                              ${VTKm_BACKEND_LIBRARIES}
181
                              ${EGL_LIBRARIES}
182
                      )
183 184

# EGL Dirs are added here to ensure propper linking when statically compiling.
James Kress's avatar
James Kress committed
185
# This is safe to do even when not using EGL as the values will then be empty.
186 187 188
target_include_directories(vtkm_rendering
                          PRIVATE ${VTKm_OPENGL_INCLUDE_DIRS}
                                  ${VTKm_BACKEND_INCLUDE_DIRS}
189
                                  ${EGL_INCLUDE_DIRS}
190 191
                          )

192 193 194 195 196
if(UNIX AND NOT APPLE)
  target_link_libraries(vtkm_rendering PRIVATE rt )
endif()


197 198
# Subclasses need rendering library
vtkm_configure_component_Rendering()
199

200 201
add_subdirectory(internal)
add_subdirectory(raytracing)
202

203 204
#-----------------------------------------------------------------------------
add_subdirectory(testing)