diff options
author | Alexander Neundorf <neundorf@kde.org> | 2006-04-26 20:34:40 +0000 |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2006-04-26 20:34:40 +0000 |
commit | 6a3973d0089eb03cf6b56d8cded6441d55a7db1c (patch) | |
tree | 34aa9fc0a75b62ca51223a6daafcbeae22329cd8 /modules/CheckCXXCompilerFlag.cmake | |
parent | 3862d6ce313b4525242c859645ad13b1047054af (diff) | |
download | extra-cmake-modules-6a3973d0089eb03cf6b56d8cded6441d55a7db1c.tar.gz extra-cmake-modules-6a3973d0089eb03cf6b56d8cded6441d55a7db1c.tar.bz2 |
-move the test for a compiler flag into an own generic cmake module: CheckCXXCompilerFlag.cmake
-add a comment about removing CheckTypeSize.cmake once we require cmake 2.4.1
Alex
svn path=/trunk/KDE/kdelibs/; revision=534314
Diffstat (limited to 'modules/CheckCXXCompilerFlag.cmake')
-rw-r--r-- | modules/CheckCXXCompilerFlag.cmake | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/CheckCXXCompilerFlag.cmake b/modules/CheckCXXCompilerFlag.cmake new file mode 100644 index 00000000..74af207b --- /dev/null +++ b/modules/CheckCXXCompilerFlag.cmake @@ -0,0 +1,16 @@ +# - Check whether the compiler supports a given flag. +# CHECK_CXX_COMPILER_FLAG(FLAG VARIABLE) +# +# FLAG - the compiler flag +# VARIABLE - variable to store the result +# + +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) + |