summaryrefslogtreecommitdiff
path: root/Modules/TestForANSIForScope.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/TestForANSIForScope.cmake')
-rw-r--r--Modules/TestForANSIForScope.cmake28
1 files changed, 13 insertions, 15 deletions
diff --git a/Modules/TestForANSIForScope.cmake b/Modules/TestForANSIForScope.cmake
index 9b4d51cda..7d2aad61b 100644
--- a/Modules/TestForANSIForScope.cmake
+++ b/Modules/TestForANSIForScope.cmake
@@ -1,22 +1,20 @@
-# - Check for ANSI for scope support
-# Check if the compiler restricts the scope of variables declared in a for-init-statement to the loop body.
-# CMAKE_NO_ANSI_FOR_SCOPE - holds result
-#
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
-#=============================================================================
-# Copyright 2002-2009 Kitware, Inc.
+#.rst:
+# TestForANSIForScope
+# -------------------
+#
+# Check for ANSI for scope support
+#
+# Check if the compiler restricts the scope of variables declared in a
+# for-init-statement to the loop body.
#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
+# ::
#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-# License text for the above reference.)
+# CMAKE_NO_ANSI_FOR_SCOPE - holds result
-if("CMAKE_ANSI_FOR_SCOPE" MATCHES "^CMAKE_ANSI_FOR_SCOPE$")
+if(NOT DEFINED CMAKE_ANSI_FOR_SCOPE)
message(STATUS "Check for ANSI scope")
try_compile(CMAKE_ANSI_FOR_SCOPE ${CMAKE_BINARY_DIR}
${CMAKE_ROOT}/Modules/TestForAnsiForScope.cxx