File: pdl.cmake

package info (click to toggle)
plplot 5.10.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 26,280 kB
  • ctags: 13,512
  • sloc: ansic: 83,001; xml: 27,081; ada: 18,878; cpp: 15,966; tcl: 11,651; python: 7,075; f90: 7,058; ml: 6,974; java: 6,665; perl: 5,029; sh: 2,210; makefile: 199; lisp: 75; sed: 25; fortran: 7
file content (118 lines) | stat: -rw-r--r-- 5,104 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
# cmake/modules/pdl.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 configuration options related to PDL examples

if(DEFAULT_NO_BINDINGS)
  option(ENABLE_pdl "Enable Perl/PDL examples in tests" OFF)
else(DEFAULT_NO_BINDINGS)
  option(ENABLE_pdl "Enable Perl/PDL examples in tests" OFF)
endif(DEFAULT_NO_BINDINGS)

if(ENABLE_pdl)
  if(NOT BUILD_SHARED_LIBS)
    message(STATUS "WARNING: "
      "Disabling Perl/PDL examples because BUILD_SHARED_LIBS=OFF")
    set(ENABLE_pdl OFF CACHE BOOL "Enable Perl/PDL examples in tests" FORCE)
  endif(NOT BUILD_SHARED_LIBS)
endif(ENABLE_pdl)

if(ENABLE_pdl)
  option(SKIP_PDL_CHECK "SKIP all PDL checks because libplplotd not yet available at cmake time" OFF)
  if(SKIP_PDL_CHECK)
    message(STATUS "Assume PDL exists and has version >= 2.4.7")
    message(STATUS "Assume PDL-Graphics-PLplot exists and has version >= 0.55")
  else(SKIP_PDL_CHECK)
    # N.B. Some of the checks below only work if the correct version
    # of libplplotd.so (currently libplplotd.so.10) is accessible 
    # somewhere on the disk, and LD_LIBRARY_PATH
    # points to that directory location.
    if(PERL_FOUND)
      execute_process(
	COMMAND ${PERL_EXECUTABLE}
	-e "use PDL"
	RESULT_VARIABLE PDL_RETURNCODE
	OUTPUT_QUIET
	ERROR_QUIET
	)
      if(NOT PDL_RETURNCODE)
	execute_process(
	  COMMAND ${PERL_EXECUTABLE}
	  "-e use PDL; print \"$PDL::VERSION\""
	  OUTPUT_VARIABLE PDL_VERSION
	  )
	message(STATUS "PDL_VERSION = ${PDL_VERSION}")
	transform_version(NUMERICAL_PDL_MINIMUM_VERSION "2.4.7")
	transform_version(NUMERICAL_PDL_VERSION "${PDL_VERSION}")
	if(NUMERICAL_PDL_VERSION LESS "${NUMERICAL_PDL_MINIMUM_VERSION}")
          message(STATUS "WARNING: "
            "PDL version < 2.4.7. Disabling Perl/PDL examples in tests")
          set(ENABLE_pdl OFF CACHE BOOL "Enable Perl/PDL examples in tests" FORCE)
	else(NUMERICAL_PDL_VERSION LESS "${NUMERICAL_PDL_MINIMUM_VERSION}")
          execute_process(
	    COMMAND ${PERL_EXECUTABLE}
	    -MPDL::Graphics::PLplot "-e print \"$PDL::Graphics::PLplot::VERSION\""
	    RESULT_VARIABLE PDL_GRAPHICS_PLPLOT_RETURN_CODE
            OUTPUT_QUIET
            ERROR_QUIET
            )
	  if(NOT PDL_GRAPHICS_PLPLOT_RETURN_CODE)
            message(STATUS 
	      "PDL version >= 2.4.7 and  PDL::Graphics::PLplot found."
	      )
            execute_process(
	      COMMAND ${PERL_EXECUTABLE}
	      -MPDL::Graphics::PLplot "-e print \"$PDL::Graphics::PLplot::VERSION\""
              OUTPUT_VARIABLE PDL_PLPLOT_VERSION
              ERROR_VARIABLE PDL_PLPLOT_VERSION
              )
            message(STATUS "PDL_PLPLOT_VERSION = ${PDL_PLPLOT_VERSION}")
            transform_version(NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION "0.55.0")
            transform_version(NUMERICAL_PDL_PLPLOT_VERSION "${PDL_PLPLOT_VERSION}.0")
	    #message("NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION = ${NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION}")
	    #message("NUMERICAL_PDL_PLPLOT_VERSION = ${NUMERICAL_PDL_PLPLOT_VERSION}")
            if(NUMERICAL_PDL_PLPLOT_VERSION LESS "${NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION}")
              message(STATUS "WARNING: "
		"perl PDL PLplot version < 0.55\n"
		"   Drop testing of Perl/PDL examples.")
	      set(ENABLE_pdl OFF CACHE BOOL "Enable Perl/PDL examples in tests" FORCE)
            else(NUMERICAL_PDL_PLPLOT_VERSION LESS "${NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION}")
              message(STATUS
		"perl PDL PLplot version >= 0.55\n"
		"   Test Perl/PDL examples")
            endif(NUMERICAL_PDL_PLPLOT_VERSION LESS "${NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION}")
	  else(NOT PDL_GRAPHICS_PLPLOT_RETURN_CODE)
	    message(STATUS "WARNING: "
	      "perl PDL::GRAPHICS_PLplot module not found. Disabling Perl/PDL examples")
	    set(ENABLE_pdl OFF CACHE BOOL "Enable Perl/PDL examples in tests" FORCE)
	  endif(NOT PDL_GRAPHICS_PLPLOT_RETURN_CODE)
	endif(NUMERICAL_PDL_VERSION LESS "${NUMERICAL_PDL_MINIMUM_VERSION}")
      else(NOT PDL_RETURNCODE)
	message(STATUS "WARNING: "
	  "perl PDL module not found. Disabling Perl/PDL examples")
	set(ENABLE_pdl OFF CACHE BOOL "Enable Perl/PDL examples in tests" FORCE)
      endif(NOT PDL_RETURNCODE)
    else(PERL_FOUND)
      message(STATUS "WARNING: "
	"perl not found. Disabling Perl/PDL examples")
      set(ENABLE_pdl OFF CACHE BOOL "Enable Perl/PDL examples in tests" FORCE)
    endif(PERL_FOUND)
  endif(SKIP_PDL_CHECK)
endif(ENABLE_pdl)