File: TestSignalType.cmake

package info (click to toggle)
swi-prolog 9.2.9%2Bdfsg-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 84,456 kB
  • sloc: ansic: 401,705; perl: 374,799; lisp: 9,080; cpp: 8,920; java: 5,525; sh: 3,282; javascript: 2,690; python: 2,655; ruby: 1,594; yacc: 845; makefile: 440; xml: 317; sed: 12; sql: 6
file content (47 lines) | stat: -rw-r--r-- 2,024 bytes parent folder | download | duplicates (5)
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
# cmake/TestSignalType.cmake
#
# Test for the return type of signal defined in <signal.h>
#
# 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

# If signal.h defines signal as returning a pointer to a function 
# returning void RETSIGTYPE is defined as void. Otherwise RETSIGTYPE is
# defined as int.

IF(NOT DEFINED CMAKE_TEST_SIGNAL_TYPE)
  MESSAGE(STATUS "Check for signal return type in <signal.h>")
  TRY_COMPILE(CMAKE_TEST_SIGNAL_TYPE
    ${CMAKE_BINARY_DIR}
    ${CMAKE_CURRENT_LIST_DIR}/TestSignalType.c
    OUTPUT_VARIABLE OUTPUT)
  IF (CMAKE_TEST_SIGNAL_TYPE)
    MESSAGE(STATUS "Check for signal handler return type type void  - found")
    SET (RETSIGTYPE void CACHE INTERNAL
      "Signal return type")
      FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log
      "Determining if signal handler return type is void passed with "
      "the following output:\n${OUTPUT}\n\n")
  ELSE (CMAKE_TEST_SIGNAL_TYPE)
    MESSAGE(STATUS "Check for signal handler return type type void  - not found")
    SET (RETSIGTYPE int CACHE INTERNAL
      "Signal return type")
      FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
      "Determining if signal handler return type is void failed with "
      "the following output:\n${OUTPUT}\n\n")
  ENDIF (CMAKE_TEST_SIGNAL_TYPE)
ENDIF(NOT DEFINED CMAKE_TEST_SIGNAL_TYPE)