summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorDragos Carp <dragoscarp@gmail.com>2013-10-24 20:20:31 (GMT)
committerBrad King <brad.king@kitware.com>2013-10-28 12:54:40 (GMT)
commite65c7887676b419bfcc6b89cb64f7e6c66b174f1 (patch)
treeeb00144af27980fbe1208a2eb09aec1b0fe347b5 /Modules
parent16df2456a440d87fb3e8e53fb59a2817b288b9af (diff)
downloadCMake-e65c7887676b419bfcc6b89cb64f7e6c66b174f1.zip
CMake-e65c7887676b419bfcc6b89cb64f7e6c66b174f1.tar.gz
CMake-e65c7887676b419bfcc6b89cb64f7e6c66b174f1.tar.bz2
CMakeDetermineCompilerId: Load src from CMAKE_MODULE_PATH (#14481)
Support new languages using CMAKE_MODULE_PATH.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake4
1 files changed, 3 insertions, 1 deletions
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()