File: drivers.cmake

package info (click to toggle)
plplot 5.15.0%2Bdfsg-19
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 31,312 kB
  • sloc: ansic: 79,707; xml: 28,583; cpp: 20,033; ada: 19,456; tcl: 12,081; f90: 11,431; ml: 7,276; java: 6,863; python: 6,792; sh: 3,274; perl: 828; lisp: 75; makefile: 50; sed: 34; fortran: 5
file content (104 lines) | stat: -rw-r--r-- 3,806 bytes parent folder | download | duplicates (3)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# cmake/modules/drivers.cmake
#
# Start driver initializations
#
# Copyright (C) 2006-2015  Alan W. Irwin
#
# This file is part of PLplot.
#
# PLplot is free software; you can redistribute it and/or modify
# it under the terms of the GNU Library General Public License as published
# by the Free Software Foundation; version 2 of the License.
#
# PLplot is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public License
# along with the file PLplot; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA

# Module for configuring all device-related variables.

# Results are contained in the following variables:
# ENABLE_DYNDRIVERS (ON or OFF): whether to dynamically load device drivers.
# PLD_devicename (ON or OFF): whether each PLplot-related device is enabled
#   or not.  devicename is png, jpeg, etc.
# devicename_COMPILE_FLAGS: compile (e.g., -I) options for each individual
#   device.
# devicename_LINK_FLAGS: link options (e.g., -L  and -l) for each
#   individual device.
# DRIVERS_LINK_FLAGS: concatenated link options for all devices.
# DEVICES_LIST: list of devices (e.g. png, jpeg),where PLD_devicename is ON
# DRIVERS_LIST: list of device drivers (e.g., gd for the png and jpeg devices)
#   where at least one of the associated devices is enabled.

set(DRIVERS_LINK_FLAGS)
option(ENABLE_DYNDRIVERS "Enable dynamic loading of device drivers" ON)
if(ENABLE_DYNDRIVERS AND NOT BUILD_SHARED_LIBS)
  message(STATUS
    "WARNING: Shared libraries not built. Setting ENABLE_DYNDRIVERS OFF."
    )
  set(ENABLE_DYNDRIVERS OFF CACHE BOOL
    "Enable dynamic loading of device drivers" FORCE)
endif(ENABLE_DYNDRIVERS AND NOT BUILD_SHARED_LIBS)
if(ENABLE_DYNDRIVERS AND WIN32_OR_CYGWIN)
  if(NOT CYGWIN)
    set(LTDL_WIN32 ON)
    set(LTDL_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/include)
  endif(NOT CYGWIN)
endif(ENABLE_DYNDRIVERS AND WIN32_OR_CYGWIN)
if(ENABLE_DYNDRIVERS AND NOT LTDL_WIN32)
  find_package(LTDL)
  if(LTDL_FOUND)
    set(LTDL_LIBRARY_RPATH ${LTDL_LIBRARY_DIR})
    filter_rpath(LTDL_LIBRARY_RPATH)
    message(STATUS "LTDL_INCLUDE_DIR = ${LTDL_INCLUDE_DIR}")
    message(STATUS "LTDL_LIBRARY_DIR = ${LTDL_LIBRARY_DIR}")
    message(STATUS "LTDL_LIBRARIES = ${LTDL_LIBRARIES}")
  else(LTDL_FOUND)
    message(STATUS
      "WARNING: libltdl library not found. Setting ENABLE_DYNDRIVERS OFF.\n"
      "   Please install that library and/or set the environment variables\n"
      "   CMAKE_INCLUDE_PATH and CMAKE_LIBRARY_PATH appropriately."
      )
    set(ENABLE_DYNDRIVERS OFF CACHE BOOL
      "Enable dynamic loading of device drivers" FORCE)
  endif(LTDL_FOUND)
endif(ENABLE_DYNDRIVERS AND NOT LTDL_WIN32)

# Needed to configure traditional build system for installed examples.
if(ENABLE_DYNDRIVERS)
  set(enable_dyndrivers_true "")
  set(enable_dyndrivers_false "#")
else(ENABLE_DYNDRIVERS)
  set(enable_dyndrivers_true "#")
  set(enable_dyndrivers_false "")
endif(ENABLE_DYNDRIVERS)

# Decide whether to enable each device or not and find special resources
# when required.

# Initialize device options (e.g., PLD_png is set to ON or OFF).
include(drivers-init)

# Find *_COMPILE_FLAGS and *_LINK_FLAGS resources for device drivers that need them,
# and set appropriate PLD_devicename to OFF if the required resources are
# not available.
include(cairo)
include(cgm)
include(gd)
include(xwin)
include(tk)
include(pstex)
include(psttf)
include(qt)
include(wingcc)
include(aqt)
include(wxwidgets)
include(pdf)
include(wingdi)

# Finalize device options.
include(drivers-finish)