From 5e49d9ae366e9120afc66907a66a99db269db706 Mon Sep 17 00:00:00 2001 From: Dragos Carp Date: Tue, 4 Mar 2014 21:46:10 +0100 Subject: [PATCH] Don't patch CMakeDetermineCompilerId.cmake in CMake 3.0 or newer --- cmake-d/CMakeDetermineDCompiler.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake-d/CMakeDetermineDCompiler.cmake b/cmake-d/CMakeDetermineDCompiler.cmake index e9712c4..b677489 100644 --- a/cmake-d/CMakeDetermineDCompiler.cmake +++ b/cmake-d/CMakeDetermineDCompiler.cmake @@ -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)