File: tk.cmake

package info (click to toggle)
plplot 5.9.0-8
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 26,256 kB
  • ctags: 9,353
  • sloc: ansic: 64,079; xml: 22,799; cpp: 8,562; tcl: 8,314; perl: 4,872; python: 4,462; f90: 4,310; java: 4,090; sh: 1,481; makefile: 261; php: 102; fortran: 59; sed: 5
file content (150 lines) | stat: -rw-r--r-- 5,839 bytes parent folder | download | duplicates (2)
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# cmake/modules/tk.cmake
#
# Copyright (C) 2006  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 determining all configuration variables related to the Tk
# related device drivers (tk, ntk, tkwin).

# The following variables are set/modified for the tk device:
# PLD_tk		  - ON means the tk device is enabled.
# tk_COMPILE_FLAGS	  - individual COMPILE_FLAGS required to compile
# 			    the tk device.
# tk_LINK_FLAGS	  	  - individual LINK_FLAGS for the dynamic tk device.
# DRIVERS_LINK_FLAGS	  - list of LINK_FLAGS for all static devices.
# tk_SOURCE		  - list of source files other than tk.c

# The following variables are set/modified for the ntk device:
# PLD_ntk		  - ON means the ntk device is enabled.
# ntk_COMPILE_FLAGS	  - individual COMPILE_FLAGS required to compile
# 			    the ntk device.
# ntk_LINK_FLAGS	  - individual LINK_FLAGS for the dynamic ntk device.
# DRIVERS_LINK_FLAGS	  - list of LINK_FLAGS for all static devices.

# The following variables are set/modified for the tkwin device:
# PLD_tkwin		  - ON means the tkwin device is enabled.
# tkwin_COMPILE_FLAGS	  - individual COMPILE_FLAGS required to compile
# 			    the tkwin device.
# tkwin_LINK_FLAGS	  - individual LINK_FLAGS for the dynamic tkwin device.
# DRIVERS_LINK_FLAGS	  - list of LINK_FLAGS for all static devices.
# tkwin_SOURCE		  - list of source files other than tkwin.c

if(NOT ENABLE_tk)
  if(PLD_tk OR PLD_ntk OR PLD_tkwin)
    message(STATUS 
    "WARNING: ENABLE_tk OFF.  Setting PLD_tk, PLD_ntk, and PLD_tkwin OFF."
    )
    set(PLD_tk OFF CACHE BOOL "Enable tk device" FORCE)
    set(PLD_ntk OFF CACHE BOOL "Enable ntk device" FORCE)
    set(PLD_tkwin OFF CACHE BOOL "Enable tkwin device" FORCE)
  endif(PLD_tk OR PLD_ntk OR PLD_tkwin)
endif(NOT ENABLE_tk)

# Transform TK_INCLUDE_PATH (which is a list) to blank-delimited flag form.
string(REGEX REPLACE ";" " -I" TKLIB_COMPILE_FLAGS "-I${TK_INCLUDE_PATH}")
	
if(PLD_tk)
  set(tk_COMPILE_FLAGS 
  "-I${TCL_INCLUDE_PATH} ${TKLIB_COMPILE_FLAGS} -I${CMAKE_SOURCE_DIR}/bindings/tcl -I${CMAKE_BINARY_DIR}/bindings/tcl -I${CMAKE_SOURCE_DIR}/bindings/tk"
  )
  set(tk_LINK_FLAGS plplottcltk${LIB_TAG} ${TCL_LIBRARY} ${TK_LIBRARY})
  set(DRIVERS_LINK_FLAGS ${DRIVERS_LINK_FLAGS} ${TCL_LIBRARY} ${TK_LIBRARY})
  if(NOT ENABLE_DYNDRIVERS)
    # All source that is in libplplottcltk
    set(
    tk_SOURCE
    ${CMAKE_SOURCE_DIR}/bindings/tcl/tclAPI.c
    ${CMAKE_SOURCE_DIR}/bindings/tcl/tclMain.c
    ${CMAKE_SOURCE_DIR}/bindings/tk/Pltk_Init.c
    ${CMAKE_SOURCE_DIR}/bindings/tk/plframe.c
    ${CMAKE_SOURCE_DIR}/bindings/tk/plr.c
    ${CMAKE_SOURCE_DIR}/bindings/tk/tcpip.c
    ${CMAKE_SOURCE_DIR}/bindings/tk/tkMain.c
    )
    # All source that is in libtclmatrix
    set(
    tk_SOURCE
    ${tk_SOURCE}
    ${CMAKE_SOURCE_DIR}/bindings/tcl/tclMatrix.c
    ${CMAKE_SOURCE_DIR}/bindings/tcl/matrixInit.c
    )
    if(ENABLE_itcl)
      set(tk_COMPILE_FLAGS
      "${tk_COMPILE_FLAGS} -I${ITCL_INCLUDE_PATH}"
      )
      set(DRIVERS_LINK_FLAGS ${DRIVERS_LINK_FLAGS} ${ITCL_LIBRARY})
    endif(ENABLE_itcl)
    if(ENABLE_itk)
      set(tk_COMPILE_FLAGS
      "${tk_COMPILE_FLAGS} -I${ITK_INCLUDE_PATH}"
      )
      set(DRIVERS_LINK_FLAGS ${DRIVERS_LINK_FLAGS} ${ITK_LIBRARY})
    endif(ENABLE_itk)
  endif(NOT ENABLE_DYNDRIVERS)
endif(PLD_tk)

if(PLD_ntk)
  set(ntk_COMPILE_FLAGS "-I${TCL_INCLUDE_PATH} ${TKLIB_COMPILE_FLAGS}")
  set(ntk_LINK_FLAGS ${TCL_LIBRARY} ${TK_LIBRARY})
  set(DRIVERS_LINK_FLAGS ${DRIVERS_LINK_FLAGS} ${ntk_LINK_FLAGS})
endif(PLD_ntk)

if(PLD_tkwin)
  set(tkwin_COMPILE_FLAGS 
  "-I${TCL_INCLUDE_PATH} ${TKLIB_COMPILE_FLAGS} -I${CMAKE_SOURCE_DIR}/bindings/tcl -I${CMAKE_BINARY_DIR}/bindings/tcl -I${CMAKE_SOURCE_DIR}/bindings/tk-x-plat -I${CMAKE_SOURCE_DIR}/bindings/tk"
  )
  set(tkwin_LINK_FLAGS plplottcltk${LIB_TAG} ${TCL_LIBRARY} ${TK_LIBRARY})
  set(DRIVERS_LINK_FLAGS ${DRIVERS_LINK_FLAGS} ${TCL_LIBRARY} ${TK_LIBRARY})
  set(
  tkwin_SOURCE
  ${CMAKE_SOURCE_DIR}/bindings/tk-x-plat/Plplotter_Init.c
  ${CMAKE_SOURCE_DIR}/bindings/tk-x-plat/plplotter.c
  )
  if(NOT ENABLE_DYNDRIVERS AND NOT PLD_tk)
    # All source that is in libplplottcltk
    set(
    tkwin_SOURCE
    ${tkwin_SOURCE}
    ${CMAKE_SOURCE_DIR}/bindings/tcl/tclAPI.c
    ${CMAKE_SOURCE_DIR}/bindings/tcl/tclMain.c
    ${CMAKE_SOURCE_DIR}/bindings/tk/Pltk_Init.c
    ${CMAKE_SOURCE_DIR}/bindings/tk/plframe.c
    ${CMAKE_SOURCE_DIR}/bindings/tk/plr.c
    ${CMAKE_SOURCE_DIR}/bindings/tk/tcpip.c
    ${CMAKE_SOURCE_DIR}/bindings/tk/tkMain.c
    )
    # All source that is in libtclmatrix
    set(
    tkwin_SOURCE
    ${tkwin_SOURCE}
    ${CMAKE_SOURCE_DIR}/bindings/tcl/tclMatrix.c
    ${CMAKE_SOURCE_DIR}/bindings/tcl/matrixInit.c
    )
    if(ENABLE_itcl)
      set(tkwin_COMPILE_FLAGS
      "${tkwin_COMPILE_FLAGS} -I${ITCL_INCLUDE_PATH}"
      )
      set(DRIVERS_LINK_FLAGS ${DRIVERS_LINK_FLAGS} ${ITCL_LIBRARY})
    endif(ENABLE_itcl)
    if(ENABLE_itk)
      set(tkwin_COMPILE_FLAGS
      "${tkwin_COMPILE_FLAGS} -I${ITK_INCLUDE_PATH}"
      )
      set(DRIVERS_LINK_FLAGS ${DRIVERS_LINK_FLAGS} ${ITK_LIBRARY})
    endif(ENABLE_itk)
  endif(NOT ENABLE_DYNDRIVERS AND NOT PLD_tk)
endif(PLD_tkwin)