From 8981513a810a97d10e299407e12c46aabe68f00a Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 24 Jul 2014 13:10:05 -0400 Subject: CMakeDetermineCompiler: Simplify CMAKE__COMPILER default force-cache If find_program does not find CMAKE__COMPILER, use set_property() to force the value to be that of CMAKE__COMPILER_INIT instead of set(). This allows us to set the value without re-specifying the type and documentation, thus preserving what find_program set. --- Modules/CMakeDetermineCompiler.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/CMakeDetermineCompiler.cmake b/Modules/CMakeDetermineCompiler.cmake index cd0f8b8..0ab3af6 100644 --- a/Modules/CMakeDetermineCompiler.cmake +++ b/Modules/CMakeDetermineCompiler.cmake @@ -65,7 +65,7 @@ macro(_cmake_find_compiler lang) endif() find_program(CMAKE_${lang}_COMPILER NAMES ${CMAKE_${lang}_COMPILER_LIST} DOC "${lang} compiler") if(CMAKE_${lang}_COMPILER_INIT AND NOT CMAKE_${lang}_COMPILER) - set(CMAKE_${lang}_COMPILER "${CMAKE_${lang}_COMPILER_INIT}" CACHE FILEPATH "${lang} compiler" FORCE) + set_property(CACHE CMAKE_${lang}_COMPILER PROPERTY VALUE "${CMAKE_${lang}_COMPILER_INIT}") endif() unset(_${lang}_COMPILER_HINTS) unset(_languages) -- cgit v0.12