From b3e6c6d3bbb0faf683d9114f53ee142136a495ac Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Sun, 15 Jan 2006 13:49:12 +0000 Subject: -small wrapper around cmake's CheckTypeSize to turn it into a "CheckPrototypeExists" Alex svn path=/trunk/KDE/kdesdk/cmake/; revision=498414 --- modules/CheckPrototypeExists.cmake | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 modules/CheckPrototypeExists.cmake (limited to 'modules/CheckPrototypeExists.cmake') diff --git a/modules/CheckPrototypeExists.cmake b/modules/CheckPrototypeExists.cmake new file mode 100644 index 00000000..4797865f --- /dev/null +++ b/modules/CheckPrototypeExists.cmake @@ -0,0 +1,16 @@ +# - Check if the prototype for a function exists. +# CHECK_PROTOTYPE_EXISTS (FUNCTION HEADER VARIABLE) +# +# FUNCTION - the name of the function you are looking for +# HEADER - the header(s) where the prototype should be declared +# VARIABLE - variable to store the result +# + +INCLUDE(CheckTypeSize) + +MACRO(CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT) + SET(CMAKE_EXTRA_INCLUDE_FILES ${_HEADER}) + CHECK_TYPE_SIZE(${_SYMBOL} ${_RESULT}) + SET(CMAKE_EXTRA_INCLUDE_FILES) +ENDMACRO(CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT) + -- cgit v1.2.1 From 1d78fb83f0d0c05d0d0bd8b4bbb53747fc55778d Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Wed, 25 Jan 2006 20:41:54 +0000 Subject: add the stuff moved from kdesdk, maybe... Alex svn path=/trunk/KDE/kdelibs/; revision=502383 --- modules/CheckPrototypeExists.cmake | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'modules/CheckPrototypeExists.cmake') diff --git a/modules/CheckPrototypeExists.cmake b/modules/CheckPrototypeExists.cmake index 4797865f..38d9d6ba 100644 --- a/modules/CheckPrototypeExists.cmake +++ b/modules/CheckPrototypeExists.cmake @@ -6,11 +6,20 @@ # VARIABLE - variable to store the result # -INCLUDE(CheckTypeSize) +INCLUDE(CheckCXXSourceCompiles) MACRO(CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT) - SET(CMAKE_EXTRA_INCLUDE_FILES ${_HEADER}) - CHECK_TYPE_SIZE(${_SYMBOL} ${_RESULT}) - SET(CMAKE_EXTRA_INCLUDE_FILES) + SET(_CHECK_PROTO_EXISTS_SOURCE_CODE " +#include <${_HEADER}> +void cmakeRequireSymbol(int dummy,...){(void)dummy;} +int main() +{ +#ifndef ${_SYMBOL} + cmakeRequireSymbol(0,&${_SYMBOL}); +#endif + return 0; +} +") + CHECK_CXX_SOURCE_COMPILES("${_CHECK_PROTO_EXISTS_SOURCE_CODE}" ${_RESULT}) ENDMACRO(CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT) -- cgit v1.2.1 From 023d276597dd2c8889efeeb946ecf316e112f006 Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Thu, 26 Jan 2006 18:43:52 +0000 Subject: -fix by Tanner Lovelace, generate correct include statements Alex svn path=/trunk/KDE/kdelibs/; revision=502616 --- modules/CheckPrototypeExists.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'modules/CheckPrototypeExists.cmake') diff --git a/modules/CheckPrototypeExists.cmake b/modules/CheckPrototypeExists.cmake index 38d9d6ba..90f7d5dc 100644 --- a/modules/CheckPrototypeExists.cmake +++ b/modules/CheckPrototypeExists.cmake @@ -9,8 +9,13 @@ INCLUDE(CheckCXXSourceCompiles) MACRO(CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT) + SET(_INCLUDE_FILES) + FOREACH(it ${_HEADER}) + SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n") + ENDFOREACH(it) + SET(_CHECK_PROTO_EXISTS_SOURCE_CODE " -#include <${_HEADER}> +${_INCLUDE_FILES} void cmakeRequireSymbol(int dummy,...){(void)dummy;} int main() { -- cgit v1.2.1 From 4fcbcf67384df12e986f06d491262e3e28da5732 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20K=C3=BCmmel?= Date: Sun, 5 Feb 2006 03:23:14 +0000 Subject: with msvc all tests fail because of a linker error svn path=/trunk/KDE/kdelibs/; revision=505849 --- modules/CheckPrototypeExists.cmake | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules/CheckPrototypeExists.cmake') diff --git a/modules/CheckPrototypeExists.cmake b/modules/CheckPrototypeExists.cmake index 90f7d5dc..0c72adef 100644 --- a/modules/CheckPrototypeExists.cmake +++ b/modules/CheckPrototypeExists.cmake @@ -20,7 +20,11 @@ void cmakeRequireSymbol(int dummy,...){(void)dummy;} int main() { #ifndef ${_SYMBOL} +#ifndef _MSC_VER cmakeRequireSymbol(0,&${_SYMBOL}); +#else + char i = sizeof(&${_SYMBOL}); +#endif #endif return 0; } -- cgit v1.2.1 From a25005cff76d7aa55440e1354c948d2cdfe1b203 Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Sun, 5 Feb 2006 11:27:17 +0000 Subject: the former version of CheckPrototypeExists was basically a CheckFunctionExists, the fix by Peter Kuemmel is also the fix for UNXI Alex svn path=/trunk/KDE/kdelibs/; revision=505907 --- modules/CheckPrototypeExists.cmake | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'modules/CheckPrototypeExists.cmake') diff --git a/modules/CheckPrototypeExists.cmake b/modules/CheckPrototypeExists.cmake index 0c72adef..1c0d7c13 100644 --- a/modules/CheckPrototypeExists.cmake +++ b/modules/CheckPrototypeExists.cmake @@ -16,15 +16,10 @@ MACRO(CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT) SET(_CHECK_PROTO_EXISTS_SOURCE_CODE " ${_INCLUDE_FILES} -void cmakeRequireSymbol(int dummy,...){(void)dummy;} int main() { #ifndef ${_SYMBOL} -#ifndef _MSC_VER - cmakeRequireSymbol(0,&${_SYMBOL}); -#else - char i = sizeof(&${_SYMBOL}); -#endif + int i = sizeof(&${_SYMBOL}); #endif return 0; } -- cgit v1.2.1 From ffc69376dc591eae7b0ed2e974a599fb1b8b2aa8 Mon Sep 17 00:00:00 2001 From: David Faure Date: Wed, 15 Feb 2006 10:47:36 +0000 Subject: Lowercase some common keywords to improve readability svn path=/trunk/KDE/kdelibs/; revision=509624 --- modules/CheckPrototypeExists.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'modules/CheckPrototypeExists.cmake') diff --git a/modules/CheckPrototypeExists.cmake b/modules/CheckPrototypeExists.cmake index 1c0d7c13..1c994ed4 100644 --- a/modules/CheckPrototypeExists.cmake +++ b/modules/CheckPrototypeExists.cmake @@ -9,12 +9,12 @@ INCLUDE(CheckCXXSourceCompiles) MACRO(CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT) - SET(_INCLUDE_FILES) - FOREACH(it ${_HEADER}) - SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n") - ENDFOREACH(it) + set(_INCLUDE_FILES) + foreach(it ${_HEADER}) + set(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n") + endforeach(it) - SET(_CHECK_PROTO_EXISTS_SOURCE_CODE " + set(_CHECK_PROTO_EXISTS_SOURCE_CODE " ${_INCLUDE_FILES} int main() { -- cgit v1.2.1 From f4363cbf7f33cb4f448ec09602bcf3f2ba019b77 Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Tue, 7 Mar 2006 23:39:26 +0000 Subject: -prepare these two files for moving to cmake Alex svn path=/trunk/KDE/kdelibs/; revision=516651 --- modules/CheckPrototypeExists.cmake | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'modules/CheckPrototypeExists.cmake') diff --git a/modules/CheckPrototypeExists.cmake b/modules/CheckPrototypeExists.cmake index 1c994ed4..ed0945df 100644 --- a/modules/CheckPrototypeExists.cmake +++ b/modules/CheckPrototypeExists.cmake @@ -5,16 +5,22 @@ # 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_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT) - set(_INCLUDE_FILES) - foreach(it ${_HEADER}) - set(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n") - endforeach(it) + SET(_INCLUDE_FILES) + FOREACH(it ${_HEADER}) + SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n") + ENDFOREACH(it) - set(_CHECK_PROTO_EXISTS_SOURCE_CODE " + SET(_CHECK_PROTO_EXISTS_SOURCE_CODE " ${_INCLUDE_FILES} int main() { -- cgit v1.2.1 From 191846e3e21c697c28bd5c8a166edeb4072161e3 Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Mon, 20 Mar 2006 21:05:37 +0000 Subject: minor cleanups: indenting, adding newline to end of file, etc. svn path=/trunk/KDE/kdelibs/; revision=520790 --- modules/CheckPrototypeExists.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules/CheckPrototypeExists.cmake') diff --git a/modules/CheckPrototypeExists.cmake b/modules/CheckPrototypeExists.cmake index ed0945df..da319f13 100644 --- a/modules/CheckPrototypeExists.cmake +++ b/modules/CheckPrototypeExists.cmake @@ -14,11 +14,11 @@ INCLUDE(CheckCXXSourceCompiles) -MACRO(CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT) +MACRO (CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT) SET(_INCLUDE_FILES) - FOREACH(it ${_HEADER}) + FOREACH (it ${_HEADER}) SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n") - ENDFOREACH(it) + ENDFOREACH (it) SET(_CHECK_PROTO_EXISTS_SOURCE_CODE " ${_INCLUDE_FILES} @@ -31,5 +31,5 @@ int main() } ") CHECK_CXX_SOURCE_COMPILES("${_CHECK_PROTO_EXISTS_SOURCE_CODE}" ${_RESULT}) -ENDMACRO(CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT) +ENDMACRO (CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT) -- 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/CheckPrototypeExists.cmake | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'modules/CheckPrototypeExists.cmake') diff --git a/modules/CheckPrototypeExists.cmake b/modules/CheckPrototypeExists.cmake index da319f13..8afc6f74 100644 --- a/modules/CheckPrototypeExists.cmake +++ b/modules/CheckPrototypeExists.cmake @@ -11,6 +11,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 814455b7ad321c88e730662fda58261087b72e72 Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Mon, 18 Feb 2008 19:06:32 +0000 Subject: some improvements to the docs: -some modules were not at all documented, only few are left now -the copyright message doesn't have to be printed for every module in the docs -fix FindKorundom.cmake, it didn't follow the style guide and had typos (e.g. Korumdum_FOUND instead of KORUNDUM_FOUND) Alex (will commit modified FindKDE4Internal.cmake after Christians commit) svn path=/trunk/KDE/kdelibs/; revision=776742 --- modules/CheckPrototypeExists.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/CheckPrototypeExists.cmake') diff --git a/modules/CheckPrototypeExists.cmake b/modules/CheckPrototypeExists.cmake index 8afc6f74..811d6489 100644 --- a/modules/CheckPrototypeExists.cmake +++ b/modules/CheckPrototypeExists.cmake @@ -11,7 +11,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