From: maier Date: Wed, 27 Mar 2013 17:11:26 +0000 (+0000) Subject: CMake: Bugfix: Implement ENABLE_IF_LINKS with CHECK_CXX_COMPILER_FLAG X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=737991db1e054df5ca87b1585ff9a61396d02b3c;p=dealii-svn.git CMake: Bugfix: Implement ENABLE_IF_LINKS with CHECK_CXX_COMPILER_FLAG git-svn-id: https://svn.dealii.org/trunk@29080 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/cmake/macros/macro_enable_if_links.cmake b/deal.II/cmake/macros/macro_enable_if_links.cmake index 6fcfb9133c..c12936568c 100644 --- a/deal.II/cmake/macros/macro_enable_if_links.cmake +++ b/deal.II/cmake/macros/macro_enable_if_links.cmake @@ -23,18 +23,15 @@ MACRO(ENABLE_IF_LINKS _variable _flag) STRING(STRIP "${_flag}" _flag_stripped) - STRING(REGEX REPLACE "^-" "" _flag_name "${_flag_stripped}") - STRING(REPLACE "," "" _flag_name "${_flag_name}") - STRING(REPLACE "-" "_" _flag_name "${_flag_name}") - IF(NOT "${_flag_stripped}" STREQUAL "") + STRING(REGEX REPLACE "^-" "" _flag_name "${_flag_stripped}") + STRING(REPLACE "," "" _flag_name "${_flag_name}") + STRING(REPLACE "--" "__" _flag_name "${_flag_name}") ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${_flag_stripped}") - CHECK_CXX_SOURCE_COMPILES( - " - int main() { return 0; } - " - DEAL_II_HAVE_FLAG_${_flag_name} - ) + CHECK_CXX_COMPILER_FLAG( + "" + DEAL_II_HAVE_FLAG_${_flag_name} + ) STRIP_FLAG(CMAKE_REQUIRED_FLAGS "${_flag_stripped}") IF(DEAL_II_HAVE_FLAG_${_flag_name}) SET(${_variable} "${${_variable}} ${_flag_stripped}") @@ -42,4 +39,3 @@ MACRO(ENABLE_IF_LINKS _variable _flag) ENDIF() ENDIF() ENDMACRO() - diff --git a/deal.II/cmake/macros/macro_enable_if_supported.cmake b/deal.II/cmake/macros/macro_enable_if_supported.cmake index bd989f8877..9c98c9155e 100644 --- a/deal.II/cmake/macros/macro_enable_if_supported.cmake +++ b/deal.II/cmake/macros/macro_enable_if_supported.cmake @@ -25,7 +25,7 @@ MACRO(ENABLE_IF_SUPPORTED _variable _flag) IF(NOT "${_flag_stripped}" STREQUAL "") STRING(REGEX REPLACE "^-" "" _flag_name "${_flag_stripped}") STRING(REPLACE "," "" _flag_name "${_flag_name}") - STRING(REPLACE "-" "_" _flag_name "${_flag_name}") + STRING(REPLACE "--" "__" _flag_name "${_flag_name}") CHECK_CXX_COMPILER_FLAG( "${_flag_stripped}" DEAL_II_HAVE_FLAG_${_flag_name}