summaryrefslogtreecommitdiff
path: root/Modules/CMakeTestCXXCompiler.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-12-15 08:29:43 -0500
committerBrad King <brad.king@kitware.com>2011-12-15 08:31:17 -0500
commit5f6985ac869150e468f8ad388bdbb8a39010cbb5 (patch)
treecb554f52fc600d8ff754d7073f761ee9c1432421 /Modules/CMakeTestCXXCompiler.cmake
parent4ed1769186f0622efced9d89e6593d136c920dd2 (diff)
downloadcmake-5f6985ac869150e468f8ad388bdbb8a39010cbb5.tar.gz
Avoid clobbering variable 'OUTPUT' in compiler tests (#12628)
Use an obscure name and clean up afterwards.
Diffstat (limited to 'Modules/CMakeTestCXXCompiler.cmake')
-rw-r--r--Modules/CMakeTestCXXCompiler.cmake10
1 files changed, 6 insertions, 4 deletions
diff --git a/Modules/CMakeTestCXXCompiler.cmake b/Modules/CMakeTestCXXCompiler.cmake
index 494add371a..87022e9f96 100644
--- a/Modules/CMakeTestCXXCompiler.cmake
+++ b/Modules/CMakeTestCXXCompiler.cmake
@@ -28,7 +28,7 @@ IF(NOT CMAKE_CXX_COMPILER_WORKS)
"int main(){return 0;}\n")
TRY_COMPILE(CMAKE_CXX_COMPILER_WORKS ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx
- OUTPUT_VARIABLE OUTPUT)
+ OUTPUT_VARIABLE __CMAKE_CXX_COMPILER_OUTPUT)
SET(CXX_TEST_WAS_RUN 1)
ENDIF(NOT CMAKE_CXX_COMPILER_WORKS)
@@ -41,17 +41,17 @@ IF(NOT CMAKE_CXX_COMPILER_WORKS)
FILE(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake )
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the CXX compiler works failed with "
- "the following output:\n${OUTPUT}\n\n")
+ "the following output:\n${__CMAKE_CXX_COMPILER_OUTPUT}\n\n")
MESSAGE(FATAL_ERROR "The C++ compiler \"${CMAKE_CXX_COMPILER}\" "
"is not able to compile a simple test program.\nIt fails "
- "with the following output:\n ${OUTPUT}\n\n"
+ "with the following output:\n ${__CMAKE_CXX_COMPILER_OUTPUT}\n\n"
"CMake will not be able to correctly generate this project.")
ELSE(NOT CMAKE_CXX_COMPILER_WORKS)
IF(CXX_TEST_WAS_RUN)
PrintTestCompilerStatus("CXX" " -- works")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the CXX compiler works passed with "
- "the following output:\n${OUTPUT}\n\n")
+ "the following output:\n${__CMAKE_CXX_COMPILER_OUTPUT}\n\n")
ENDIF(CXX_TEST_WAS_RUN)
SET(CMAKE_CXX_COMPILER_WORKS 1 CACHE INTERNAL "")
@@ -76,3 +76,5 @@ ELSE(NOT CMAKE_CXX_COMPILER_WORKS)
UNSET(CMAKE_CXX_ABI_FILES)
ENDIF()
ENDIF(NOT CMAKE_CXX_COMPILER_WORKS)
+
+UNSET(__CMAKE_CXX_COMPILER_OUTPUT)