CMakeDetermine*Compiler: Remove temporary cache entry

When the user or toolchain file sets CMAKE_<LANG>_COMPILER to a name
without a path we use find_program with CMAKE_<LANG>_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.
This commit is contained in:
Brad King 2013-10-24 11:31:58 -04:00
parent 8c0bbd37df
commit 332771c942
4 changed files with 4 additions and 4 deletions

View File

@ -59,10 +59,10 @@ else()
get_filename_component(_CMAKE_USER_ASM${ASM_DIALECT}_COMPILER_PATH "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" PATH) 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) if(NOT _CMAKE_USER_ASM${ASM_DIALECT}_COMPILER_PATH)
find_program(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH NAMES ${CMAKE_ASM${ASM_DIALECT}_COMPILER}) 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) 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) set(CMAKE_ASM${ASM_DIALECT}_COMPILER ${CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH} CACHE FILEPATH "Assembler" FORCE)
endif() endif()
unset(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH CACHE)
endif() endif()
endif() endif()
mark_as_advanced(CMAKE_ASM${ASM_DIALECT}_COMPILER) mark_as_advanced(CMAKE_ASM${ASM_DIALECT}_COMPILER)

View File

@ -92,10 +92,10 @@ else()
get_filename_component(_CMAKE_USER_C_COMPILER_PATH "${CMAKE_C_COMPILER}" PATH) get_filename_component(_CMAKE_USER_C_COMPILER_PATH "${CMAKE_C_COMPILER}" PATH)
if(NOT _CMAKE_USER_C_COMPILER_PATH) if(NOT _CMAKE_USER_C_COMPILER_PATH)
find_program(CMAKE_C_COMPILER_WITH_PATH NAMES ${CMAKE_C_COMPILER}) 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) if(CMAKE_C_COMPILER_WITH_PATH)
set(CMAKE_C_COMPILER ${CMAKE_C_COMPILER_WITH_PATH} CACHE STRING "C compiler" FORCE) set(CMAKE_C_COMPILER ${CMAKE_C_COMPILER_WITH_PATH} CACHE STRING "C compiler" FORCE)
endif() endif()
unset(CMAKE_C_COMPILER_WITH_PATH CACHE)
endif() endif()
endif() endif()
mark_as_advanced(CMAKE_C_COMPILER) mark_as_advanced(CMAKE_C_COMPILER)

View File

@ -91,10 +91,10 @@ else()
get_filename_component(_CMAKE_USER_CXX_COMPILER_PATH "${CMAKE_CXX_COMPILER}" PATH) get_filename_component(_CMAKE_USER_CXX_COMPILER_PATH "${CMAKE_CXX_COMPILER}" PATH)
if(NOT _CMAKE_USER_CXX_COMPILER_PATH) if(NOT _CMAKE_USER_CXX_COMPILER_PATH)
find_program(CMAKE_CXX_COMPILER_WITH_PATH NAMES ${CMAKE_CXX_COMPILER}) 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) if(CMAKE_CXX_COMPILER_WITH_PATH)
set(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER_WITH_PATH} CACHE STRING "CXX compiler" FORCE) set(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER_WITH_PATH} CACHE STRING "CXX compiler" FORCE)
endif() endif()
unset(CMAKE_CXX_COMPILER_WITH_PATH CACHE)
endif() endif()
endif() endif()
mark_as_advanced(CMAKE_CXX_COMPILER) mark_as_advanced(CMAKE_CXX_COMPILER)

View File

@ -109,11 +109,11 @@ else()
get_filename_component(_CMAKE_USER_Fortran_COMPILER_PATH "${CMAKE_Fortran_COMPILER}" PATH) get_filename_component(_CMAKE_USER_Fortran_COMPILER_PATH "${CMAKE_Fortran_COMPILER}" PATH)
if(NOT _CMAKE_USER_Fortran_COMPILER_PATH) if(NOT _CMAKE_USER_Fortran_COMPILER_PATH)
find_program(CMAKE_Fortran_COMPILER_WITH_PATH NAMES ${CMAKE_Fortran_COMPILER}) 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) if(CMAKE_Fortran_COMPILER_WITH_PATH)
set(CMAKE_Fortran_COMPILER ${CMAKE_Fortran_COMPILER_WITH_PATH} set(CMAKE_Fortran_COMPILER ${CMAKE_Fortran_COMPILER_WITH_PATH}
CACHE STRING "Fortran compiler" FORCE) CACHE STRING "Fortran compiler" FORCE)
endif() endif()
unset(CMAKE_Fortran_COMPILER_WITH_PATH CACHE)
endif() endif()
endif() endif()
mark_as_advanced(CMAKE_Fortran_COMPILER) mark_as_advanced(CMAKE_Fortran_COMPILER)