From 4003d9108c0254fbaafb03b33f011cd63983510f Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Sun, 30 Apr 2006 21:39:02 +0000 Subject: -two cmake modules to check whether a given struct or pointer has a specified member variable Alex svn path=/trunk/KDE/kdelibs/; revision=535981 --- modules/CheckStructMember.cmake | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 modules/CheckStructMember.cmake (limited to 'modules/CheckStructMember.cmake') diff --git a/modules/CheckStructMember.cmake b/modules/CheckStructMember.cmake new file mode 100644 index 00000000..fd5d3461 --- /dev/null +++ b/modules/CheckStructMember.cmake @@ -0,0 +1,36 @@ +# - Check if the given struct or class has the specified member variable +# CHECK_STRUCT_MEMBER (STRUCT MEMBER HEADER VARIABLE) +# +# STRUCT - the name of the struct or class you are interested in +# MEMBER - the member which existence you want to check +# HEADER - the header(s) where the prototype should be declared +# VARIABLE - variable to store the result +# +# The following variables may be set before calling this macro to +# modify the way the check is run: +# +# CMAKE_REQUIRED_FLAGS = string of compile command line flags +# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) +# CMAKE_REQUIRED_INCLUDES = list of include directories + +INCLUDE(CheckCXXSourceCompiles) + +MACRO (CHECK_STRUCT_MEMBER _STRUCT _MEMBER _HEADER _RESULT) + SET(_INCLUDE_FILES) + FOREACH (it ${_HEADER}) + SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n") + ENDFOREACH (it) + + SET(_CHECK_STRUCT_MEMBER_SOURCE_CODE " +${_INCLUDE_FILES} +int main() +{ + ${_STRUCT}* tmp; + tmp->${_MEMBER}; + return 0; +} +") + CHECK_CXX_SOURCE_COMPILES("${_CHECK_STRUCT_MEMBER_SOURCE_CODE}" ${_RESULT}) + +ENDMACRO (CHECK_STRUCT_MEMBER) + -- cgit v1.2.1 From c778596920e0d5357f216c885e35b4f97d371a23 Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Sat, 9 Sep 2006 10:18:35 +0000 Subject: added copyright notice everywhere. Now they all are BSD-licensed, as copyright holder I inserted everywhere the one who added it to svn (or Kitware if it is an enhanced copy from taken cmake) Some developers committed quite often but were not the ones who added the file, if you feel you have also copyright on the file add your name in the specific file. Copyright holders: CCMAIL: montel@kde.org CCMAIL: toscano.pino@tiscali.it CCMAIL: adymo@kdevelop.org CCMAIL: ranger@befunk.com CCMAIL: zack@kde.org CCMAIL: caslav.ilic@gmx.net CCMAIL: syntheticpp@yahoo.com CCMAIL: js@iidea.pl CCMAIL: michael.larouche@kdemail.net CCMAIL: ossi@kde.org CCMAIL: faure@kde.org Committers, but no files added so that they are not listed as copyright holders: CCMAIL: ch.ehrlicher@gmx.de CCMAIL: winter@kde.org CCMAIL: ralf.habacker@freenet.de CCMAIL: moura@kdewebdev.org CCMAIL: kde-buildsystem@kde.org Alex svn path=/trunk/KDE/kdelibs/; revision=582410 --- modules/CheckStructMember.cmake | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'modules/CheckStructMember.cmake') diff --git a/modules/CheckStructMember.cmake b/modules/CheckStructMember.cmake index fd5d3461..739e8cee 100644 --- a/modules/CheckStructMember.cmake +++ b/modules/CheckStructMember.cmake @@ -12,6 +12,12 @@ # CMAKE_REQUIRED_FLAGS = string of compile command line flags # CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) # CMAKE_REQUIRED_INCLUDES = list of include directories +# +# Copyright (c) 2006, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + INCLUDE(CheckCXXSourceCompiles) -- cgit v1.2.1 From a044c4815efc9c5e069e14a251b9cc8200df8c12 Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Mon, 18 Sep 2006 22:04:32 +0000 Subject: -CheckCXXCompilerFlag.cmake can be removed once we require cmake 2.4.4 or later Alex svn path=/trunk/KDE/kdelibs/; revision=586171 --- modules/CheckStructMember.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/CheckStructMember.cmake') diff --git a/modules/CheckStructMember.cmake b/modules/CheckStructMember.cmake index 739e8cee..eeb1b65c 100644 --- a/modules/CheckStructMember.cmake +++ b/modules/CheckStructMember.cmake @@ -12,7 +12,7 @@ # CMAKE_REQUIRED_FLAGS = string of compile command line flags # CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) # CMAKE_REQUIRED_INCLUDES = list of include directories -# + # Copyright (c) 2006, Alexander Neundorf, # # Redistribution and use is allowed according to the terms of the BSD license. -- cgit v1.2.1