File: FindOSMesa.cmake

package info (click to toggle)
vtk6 6.3.0%2Bdfsg1-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 118,532 kB
  • ctags: 138,251
  • sloc: cpp: 1,443,749; ansic: 113,395; python: 72,383; tcl: 46,998; xml: 8,127; yacc: 4,525; java: 4,239; perl: 3,108; lex: 1,694; sh: 1,093; asm: 471; makefile: 95; objc: 17
file content (47 lines) | stat: -rw-r--r-- 1,234 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Try to find Mesa off-screen library and include dir.
# Once done this will define
#
# OSMESA_FOUND        - true if OSMesa has been found
# OSMESA_INCLUDE_DIR  - where the GL/osmesa.h can be found
# OSMESA_LIBRARY      - Link this to use OSMesa


if(NOT OSMESA_INCLUDE_DIR)

  # If we have a root defined look there first
  if(OSMESA_ROOT)
    find_path(OSMESA_INCLUDE_DIR GL/osmesa.h PATHS ${OSMESA_ROOT}/include
      NO_DEFAULT_PATH
    )
  endif()

  if(NOT OSMESA_INCLUDE_DIR)
    find_path(OSMESA_INCLUDE_DIR GL/osmesa.h PATHS
      /usr/openwin/share/include
      /opt/graphics/OpenGL/include
    )
  endif()
endif()

# This may be left blank if OSMesa symbols are included
# in the main Mesa library
if(NOT OSMESA_LIBRARY)
  # If we have a root defined look there first
  if(OSMESA_ROOT)
    find_library(OSMESA_LIBRARY OSMesa PATHS ${OSMESA_ROOT}/lib
      NO_DEFAULT_PATH
    )
  endif()

  if(NOT OSMESA_LIBRARY)
    find_library(OSMESA_LIBRARY OSMesa PATHS
      /opt/graphics/OpenGL/lib
      /usr/openwin/lib
    )
  endif()
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OSMesa  DEFAULT_MSG  OSMESA_LIBRARY  OSMESA_INCLUDE_DIR)

mark_as_advanced(OSMESA_INCLUDE_DIR OSMESA_LIBRARY)