CMakeDetermineCompilerId: Load src from CMAKE_MODULE_PATH (#14481)

Support new languages using CMAKE_MODULE_PATH.
This commit is contained in:
Dragos Carp 2013-10-24 22:20:31 +02:00 committed by Brad King
parent 16df2456a4
commit e65c788767
1 changed files with 3 additions and 1 deletions

View File

@ -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()