diff options
author | Brad King <brad.king@kitware.com> | 2014-03-10 20:51:41 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-03-10 21:12:00 (GMT) |
commit | 6852fb8034d30d14498dc874378881696a6ada23 (patch) | |
tree | 59345bdceb1b7894b2ff919aaeeb240e776755c1 /Modules/CMakeDetermineASMCompiler.cmake | |
parent | a7c956b86736ea82ade88bea6414cd6a8c84e307 (diff) | |
download | CMake-6852fb8034d30d14498dc874378881696a6ada23.zip CMake-6852fb8034d30d14498dc874378881696a6ada23.tar.gz CMake-6852fb8034d30d14498dc874378881696a6ada23.tar.bz2 |
CMakeDetermine*Compiler: Factor out search for compiler in PATH
Factor out a _cmake_find_compiler_path helper macro to avoid duplication
of the search for a full path to the compiler.
Diffstat (limited to 'Modules/CMakeDetermineASMCompiler.cmake')
-rw-r--r-- | Modules/CMakeDetermineASMCompiler.cmake | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake index ca7eb8b..1d9617f 100644 --- a/Modules/CMakeDetermineASMCompiler.cmake +++ b/Modules/CMakeDetermineASMCompiler.cmake @@ -48,22 +48,7 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER) _cmake_find_compiler(ASM${ASM_DIALECT}) else() - - # we only get here if CMAKE_ASM${ASM_DIALECT}_COMPILER was specified using -D or a pre-made CMakeCache.txt - # (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE - # - # if a compiler was specified by the user but without path, - # now try to find it with the full path - # if it is found, force it into the cache, - # if not, don't overwrite the setting (which was given by the user) with "NOTFOUND" - 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}) - 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() + _cmake_find_compiler_path(ASM${ASM_DIALECT}) endif() mark_as_advanced(CMAKE_ASM${ASM_DIALECT}_COMPILER) |