From e65c7887676b419bfcc6b89cb64f7e6c66b174f1 Mon Sep 17 00:00:00 2001 From: Dragos Carp Date: Thu, 24 Oct 2013 22:20:31 +0200 Subject: CMakeDetermineCompilerId: Load src from CMAKE_MODULE_PATH (#14481) Support new languages using CMAKE_MODULE_PATH. --- Modules/CMakeDetermineCompilerId.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 762d4ae..4087060 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -85,7 +85,9 @@ endfunction() #----------------------------------------------------------------------------- # Function to write the compiler id source file. function(CMAKE_DETERMINE_COMPILER_ID_WRITE lang src) - file(READ ${CMAKE_ROOT}/Modules/${src}.in ID_CONTENT_IN) + find_file(src_in ${src}.in PATHS ${CMAKE_ROOT}/Modules ${CMAKE_MODULE_PATH} NO_DEFAULT_PATH) + file(READ ${src_in} ID_CONTENT_IN) + unset(src_in CACHE) string(CONFIGURE "${ID_CONTENT_IN}" ID_CONTENT_OUT @ONLY) file(WRITE ${CMAKE_${lang}_COMPILER_ID_DIR}/${src} "${ID_CONTENT_OUT}") endfunction() -- cgit v0.12