From: maier Date: Sat, 20 Oct 2012 13:45:59 +0000 (+0000) Subject: Bugfix X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf5b510cce75956167d9a14815dd204a648a24d2;p=dealii-svn.git Bugfix git-svn-id: https://svn.dealii.org/branches/branch_cmake@27152 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/cmake/checks/check_for_cxx_features.cmake b/deal.II/cmake/checks/check_for_cxx_features.cmake index adb67c9c99..dc8f291403 100644 --- a/deal.II/cmake/checks/check_for_cxx_features.cmake +++ b/deal.II/cmake/checks/check_for_cxx_features.cmake @@ -26,23 +26,23 @@ # # See if there is a compiler flag to enable C++11 features # -FOREACH(test_flag - "-std=c++11" - "-std=c++0x" - ) - - CHECK_CXX_COMPILER_FLAG("${test_flag}" DEAL_II_HAVE_CXX11_FLAG) - - IF(DEAL_II_HAVE_CXX11_FLAG) - # We have found a CXX11_FLAG that the compiler understands - SET(DEAL_II_CXX11_FLAG "${test_flag}") - BREAK() - ELSE() - # Remove test result from cache and try the next flag in the list - UNSET(DEAL_II_HAVE_CXX11_FLAG CACHE) - ENDIF() - -ENDFOREACH() +IF(NOT DEFINED DEAL_II_HAVE_CXX11_FLAG) + FOREACH(test_flag + "-std=c++11" + "-std=c++0x" + ) + CHECK_CXX_COMPILER_FLAG("${test_flag}" DEAL_II_HAVE_CXX11_FLAG) + + IF(DEAL_II_HAVE_CXX11_FLAG) + # We have found a CXX11_FLAG that the compiler understands + SET(DEAL_II_CXX11_FLAG "${test_flag}") + BREAK() + ELSE() + # Remove test result from cache and try the next flag in the list + UNSET(DEAL_II_HAVE_CXX11_FLAG CACHE) + ENDIF() + ENDFOREACH() +ENDIF() IF(DEAL_II_HAVE_CXX11_FLAG)