Don't patch CMakeDetermineCompilerId.cmake in CMake 3.0 or newer

This commit is contained in:
Dragos Carp 2014-03-04 21:46:10 +01:00
parent 8f6d6ee929
commit 5e49d9ae36

View file

@ -120,7 +120,7 @@ if(NOT CMAKE_D_COMPILER_ID_RUN)
# Workaround for bug http://public.kitware.com/Bug/view.php?id=14481
# if CMAKE_MODULE_PATH is used, then patch ${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake
get_filename_component(CMAKE_D_COMPILER_ID_FILE_IN_PATH ${CMAKE_D_COMPILER_ID_FILE_IN} PATH)
if(CMAKE_D_COMPILER_ID_FILE_IN_PATH STREQUAL ${CMAKE_ROOT}/Modules)
if(CMAKE_MAJOR_VERSION GREATER 2 OR CMAKE_D_COMPILER_ID_FILE_IN_PATH STREQUAL ${CMAKE_ROOT}/Modules)
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
else(CMAKE_D_COMPILER_ID_FILE_IN_PATH STREQUAL ${CMAKE_ROOT}/Modules)
file(READ ${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake CMAKE_DETERMINE_COMPILER_ID_CMAKE_CONTENT)
@ -132,7 +132,7 @@ if(NOT CMAKE_D_COMPILER_ID_RUN)
file(WRITE ${CMAKE_PLATFORM_INFO_DIR}/CMakeDetermineCompilerId.cmake
${CMAKE_DETERMINE_COMPILER_ID_CMAKE_CONTENT_PATCHED})
include(${CMAKE_PLATFORM_INFO_DIR}/CMakeDetermineCompilerId.cmake)
endif(CMAKE_D_COMPILER_ID_FILE_IN_PATH STREQUAL ${CMAKE_ROOT}/Modules)
endif(CMAKE_MAJOR_VERSION GREATER 2 OR CMAKE_D_COMPILER_ID_FILE_IN_PATH STREQUAL ${CMAKE_ROOT}/Modules)
CMAKE_DETERMINE_COMPILER_ID(D DFLAGS CMakeDCompilerId.d)
unset(CMAKE_D_COMPILER_ID_FILE_IN CACHE)
unset(CMAKE_PLATFORM_ID_CONTENT_FILE CACHE)