Implemented workaround for cmake bug 14481

This commit is contained in:
Dragos Carp 2013-10-15 01:00:53 +02:00
parent c72d5e5baf
commit ce7f26ec29
2 changed files with 10 additions and 4 deletions

View file

@ -115,7 +115,11 @@ IF(NOT CMAKE_D_COMPILER_ID_RUN)
PATHS ${CMAKE_ROOT}/Modules ${CMAKE_MODULE_PATH}) PATHS ${CMAKE_ROOT}/Modules ${CMAKE_MODULE_PATH})
FILE(READ ${CMAKE_PLATFORM_ID_CONTENT_FILE} CMAKE_D_COMPILER_ID_PLATFORM_CONTENT) FILE(READ ${CMAKE_PLATFORM_ID_CONTENT_FILE} CMAKE_D_COMPILER_ID_PLATFORM_CONTENT)
INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake) INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
CMAKE_DETERMINE_COMPILER_ID(D DFLAGS CMakeDCompilerId.d) # Workaround for bug http://public.kitware.com/Bug/view.php?id=14481
FIND_FILE(CMAKE_COMPILER_ID_FILE_IN CMakeDCompilerId.d.in PATHS ${CMAKE_ROOT}/Modules ${CMAKE_MODULE_PATH})
FILE(RELATIVE_PATH CMAKE_COMPILER_ID_FILE_IN_RELATIVE ${CMAKE_ROOT}/Modules ${CMAKE_COMPILER_ID_FILE_IN})
STRING(REGEX REPLACE "[.]in$" "" CMAKE_COMPILER_ID_FILE_RELATIVE ${CMAKE_COMPILER_ID_FILE_IN_RELATIVE})
CMAKE_DETERMINE_COMPILER_ID(D DFLAGS ${CMAKE_COMPILER_ID_FILE_RELATIVE})
# Set old compiler and platform id variables. # Set old compiler and platform id variables.
IF("${CMAKE_D_COMPILER_ID}" MATCHES "GNU") IF("${CMAKE_D_COMPILER_ID}" MATCHES "GNU")

View file

@ -60,11 +60,13 @@ ELSE(NOT CMAKE_D_COMPILER_WORKS)
ELSE(CMAKE_D_COMPILER_FORCED) ELSE(CMAKE_D_COMPILER_FORCED)
# Try to identify the ABI and configure it into CMakeDCompiler.cmake # Try to identify the ABI and configure it into CMakeDCompiler.cmake
INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake) INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
FIND_FILE(CMAKE_D_COMPLER_ABI_SRC CMakeDCompilerABI.d FIND_FILE(CMAKE_D_COMPILER_ABI_SRC CMakeDCompilerABI.d
PATHS ${CMAKE_ROOT}/Modules ${CMAKE_MODULE_PATH})
CMAKE_DETERMINE_COMPILER_ABI(D ${CMAKE_D_COMPILER_ABI_SRC})
FIND_FILE(CMAKE_D_COMPILER_CMAKE_IN CMakeDCompiler.cmake.in
PATHS ${CMAKE_ROOT}/Modules ${CMAKE_MODULE_PATH}) PATHS ${CMAKE_ROOT}/Modules ${CMAKE_MODULE_PATH})
CMAKE_DETERMINE_COMPILER_ABI(D ${CMAKE_D_COMPLER_ABI_SRC})
CONFIGURE_FILE( CONFIGURE_FILE(
${CMAKE_ROOT}/Modules/CMakeDCompiler.cmake.in ${CMAKE_D_COMPILER_CMAKE_IN}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeDCompiler.cmake ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeDCompiler.cmake
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0 @ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
) )