From 923ea3d1931fb19628575b453889e026b6a706fe Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Sun, 28 Jan 2007 21:00:21 +0000 Subject: -revert commit from Laurent, we have to discuss requiring cmake 2.4.5 (or 2.4.6) first before requiting it Alex CCMAIL: montel@kde.org svn path=/trunk/KDE/kdelibs/; revision=628019 --- modules/CheckCXXCompilerFlag.cmake | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 modules/CheckCXXCompilerFlag.cmake (limited to 'modules/CheckCXXCompilerFlag.cmake') diff --git a/modules/CheckCXXCompilerFlag.cmake b/modules/CheckCXXCompilerFlag.cmake new file mode 100644 index 00000000..43ea9a64 --- /dev/null +++ b/modules/CheckCXXCompilerFlag.cmake @@ -0,0 +1,21 @@ +# - Check whether the CXX compiler supports a given flag. +# CHECK_CXX_COMPILER_FLAG(FLAG VARIABLE) +# +# FLAG - the compiler flag +# VARIABLE - variable to store the result + +# 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) + +MACRO (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT) + SET(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}") + SET(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}") + CHECK_CXX_SOURCE_COMPILES("int main() { return 0;}" ${_RESULT}) + SET (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}") +ENDMACRO (CHECK_CXX_COMPILER_FLAG) + -- cgit v1.2.1