From 332771c942c25c0e60de136091fe77ac761e1965 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 24 Oct 2013 11:31:58 -0400 Subject: CMakeDetermine*Compiler: Remove temporary cache entry When the user or toolchain file sets CMAKE__COMPILER to a name without a path we use find_program with CMAKE__COMPILER_WITH_PATH to search for the tool. Remove the temporary cache entry afterward to avoid exposing it to projects. It is not set by other logic paths so no one should be using it. --- Modules/CMakeDetermineASMCompiler.cmake | 2 +- Modules/CMakeDetermineCCompiler.cmake | 2 +- Modules/CMakeDetermineCXXCompiler.cmake | 2 +- Modules/CMakeDetermineFortranCompiler.cmake | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake index 0fecb5d..1adfadb 100644 --- a/Modules/CMakeDetermineASMCompiler.cmake +++ b/Modules/CMakeDetermineASMCompiler.cmake @@ -59,10 +59,10 @@ else() get_filename_component(_CMAKE_USER_ASM${ASM_DIALECT}_COMPILER_PATH "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" PATH) if(NOT _CMAKE_USER_ASM${ASM_DIALECT}_COMPILER_PATH) find_program(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH NAMES ${CMAKE_ASM${ASM_DIALECT}_COMPILER}) - mark_as_advanced(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH) if(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH) set(CMAKE_ASM${ASM_DIALECT}_COMPILER ${CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH} CACHE FILEPATH "Assembler" FORCE) endif() + unset(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH CACHE) endif() endif() mark_as_advanced(CMAKE_ASM${ASM_DIALECT}_COMPILER) diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake index 8769c66..9807677 100644 --- a/Modules/CMakeDetermineCCompiler.cmake +++ b/Modules/CMakeDetermineCCompiler.cmake @@ -92,10 +92,10 @@ else() get_filename_component(_CMAKE_USER_C_COMPILER_PATH "${CMAKE_C_COMPILER}" PATH) if(NOT _CMAKE_USER_C_COMPILER_PATH) find_program(CMAKE_C_COMPILER_WITH_PATH NAMES ${CMAKE_C_COMPILER}) - mark_as_advanced(CMAKE_C_COMPILER_WITH_PATH) if(CMAKE_C_COMPILER_WITH_PATH) set(CMAKE_C_COMPILER ${CMAKE_C_COMPILER_WITH_PATH} CACHE STRING "C compiler" FORCE) endif() + unset(CMAKE_C_COMPILER_WITH_PATH CACHE) endif() endif() mark_as_advanced(CMAKE_C_COMPILER) diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake index c79ba89..0a4624c 100644 --- a/Modules/CMakeDetermineCXXCompiler.cmake +++ b/Modules/CMakeDetermineCXXCompiler.cmake @@ -91,10 +91,10 @@ else() get_filename_component(_CMAKE_USER_CXX_COMPILER_PATH "${CMAKE_CXX_COMPILER}" PATH) if(NOT _CMAKE_USER_CXX_COMPILER_PATH) find_program(CMAKE_CXX_COMPILER_WITH_PATH NAMES ${CMAKE_CXX_COMPILER}) - mark_as_advanced(CMAKE_CXX_COMPILER_WITH_PATH) if(CMAKE_CXX_COMPILER_WITH_PATH) set(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER_WITH_PATH} CACHE STRING "CXX compiler" FORCE) endif() + unset(CMAKE_CXX_COMPILER_WITH_PATH CACHE) endif() endif() mark_as_advanced(CMAKE_CXX_COMPILER) diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake index 13cfb00..10574b1 100644 --- a/Modules/CMakeDetermineFortranCompiler.cmake +++ b/Modules/CMakeDetermineFortranCompiler.cmake @@ -109,11 +109,11 @@ else() get_filename_component(_CMAKE_USER_Fortran_COMPILER_PATH "${CMAKE_Fortran_COMPILER}" PATH) if(NOT _CMAKE_USER_Fortran_COMPILER_PATH) find_program(CMAKE_Fortran_COMPILER_WITH_PATH NAMES ${CMAKE_Fortran_COMPILER}) - mark_as_advanced(CMAKE_Fortran_COMPILER_WITH_PATH) if(CMAKE_Fortran_COMPILER_WITH_PATH) set(CMAKE_Fortran_COMPILER ${CMAKE_Fortran_COMPILER_WITH_PATH} CACHE STRING "Fortran compiler" FORCE) endif() + unset(CMAKE_Fortran_COMPILER_WITH_PATH CACHE) endif() endif() mark_as_advanced(CMAKE_Fortran_COMPILER) -- cgit v0.12