File: c%2B%2B.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 (65 lines) | stat: -rw-r--r-- 2,289 bytes parent folder | download | duplicates (4)
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
# cmake/modules/cxx.cmake
#
# C++ binding configuration
#
# Copyright (C) 2006  Andrew Ross
#
# 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 C++ binding configuration options

# Option to enable C++ binding
if(DEFAULT_NO_BINDINGS)
  OPTION(ENABLE_cxx "Enable C++ binding" OFF)
else(DEFAULT_NO_BINDINGS)
  OPTION(ENABLE_cxx "Enable C++ binding" ON)
endif(DEFAULT_NO_BINDINGS)

if(NOT PLPLOT_CXX_COMPILER_WORKS)
  workaround_9220(CXX PLPLOT_CXX_COMPILER_WORKS)
  if(NOT PLPLOT_CXX_COMPILER_WORKS)
    message(STATUS "WARNING: no working C++ compiler so disabling C++ binding and examples.")
    set(ENABLE_cxx OFF CACHE BOOL "Enable C++ binding" FORCE)
  endif(NOT PLPLOT_CXX_COMPILER_WORKS)
endif(NOT PLPLOT_CXX_COMPILER_WORKS)

if(PLPLOT_CXX_COMPILER_WORKS)
  # Find and check C++ compiler.
  enable_language(CXX OPTIONAL)

  if(NOT CMAKE_CXX_COMPILER_WORKS)
    message(STATUS "No working C++ compiler found so disabling C++ binding and examples.")
    set(ENABLE_cxx OFF CACHE BOOL "Enable C++ binding" FORCE)
  endif(NOT CMAKE_CXX_COMPILER_WORKS)
endif(PLPLOT_CXX_COMPILER_WORKS)

if(CMAKE_CXX_COMPILER_WORKS)
  # Check if "using namespace std;" works
  INCLUDE(TestForNamespace)

  # Check for <cmath>
  INCLUDE(CheckIncludeFileCXX)
  CHECK_INCLUDE_FILE_CXX(cmath HAVE_CMATH)

  if(NOT MSVC)
    # Need to add check for broken cmath with isnan missing (PL_BROKEN_ISNAN_CXX)
    # but not for Visual C++ compilers
    include(TestBrokenIsnanCXX)
  endif(NOT MSVC)

  # Need to add check if stdint.h can be used from c++ (PL_HAVE_CXX_STDINT_H)
  INCLUDE(TestForStdintCXX)
endif(CMAKE_CXX_COMPILER_WORKS)