1
# - Check if the system has the specified type
2
# CHECK_TYPE_EXISTS (TYPE HEADER VARIABLE)
4
# TYPE - the name of the type or struct or class you are interested in
5
# HEADER - the header(s) where the prototype should be declared
6
# VARIABLE - variable to store the result
8
# The following variables may be set before calling this macro to
9
# modify the way the check is run:
11
# CMAKE_REQUIRED_FLAGS = string of compile command line flags
12
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
13
# CMAKE_REQUIRED_INCLUDES = list of include directories
14
# Copyright (c) 2009, Michihiro NAKAJIMA
15
# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
17
# Redistribution and use is allowed according to the terms of the BSD license.
18
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
21
INCLUDE(CheckCSourceCompiles)
23
MACRO (CHECK_TYPE_EXISTS _TYPE _HEADER _RESULT)
25
FOREACH (it ${_HEADER})
26
SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n")
29
SET(_CHECK_TYPE_EXISTS_SOURCE_CODE "
39
CHECK_C_SOURCE_COMPILES("${_CHECK_TYPE_EXISTS_SOURCE_CODE}" ${_RESULT})
41
ENDMACRO (CHECK_TYPE_EXISTS)