Added NO_DEFAULT_PATH to the find_file commands

This commit is contained in:
Dragos Carp 2013-10-26 00:06:05 +02:00
parent f41bd34fa2
commit 8f6d6ee929
2 changed files with 12 additions and 11 deletions

View file

@ -112,10 +112,11 @@ if(NOT CMAKE_D_COMPILER_ID_RUN)
# Try to identify the compiler. # Try to identify the compiler.
set(CMAKE_D_COMPILER_ID) set(CMAKE_D_COMPILER_ID)
find_file(CMAKE_PLATFORM_ID_CONTENT_FILE CMakePlatformId.di.in find_file(CMAKE_PLATFORM_ID_CONTENT_FILE CMakePlatformId.di.in PATHS ${CMAKE_ROOT}/Modules
PATHS ${CMAKE_ROOT}/Modules ${CMAKE_MODULE_PATH}) ${CMAKE_MODULE_PATH} NO_DEFAULT_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)
find_file(CMAKE_D_COMPILER_ID_FILE_IN CMakeDCompilerId.d.in PATHS ${CMAKE_ROOT}/Modules ${CMAKE_MODULE_PATH}) find_file(CMAKE_D_COMPILER_ID_FILE_IN CMakeDCompilerId.d.in PATHS ${CMAKE_ROOT}/Modules
${CMAKE_MODULE_PATH} NO_DEFAULT_PATH)
# Workaround for bug http://public.kitware.com/Bug/view.php?id=14481 # 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 # 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) get_filename_component(CMAKE_D_COMPILER_ID_FILE_IN_PATH ${CMAKE_D_COMPILER_ID_FILE_IN} PATH)
@ -124,10 +125,10 @@ if(NOT CMAKE_D_COMPILER_ID_RUN)
else(CMAKE_D_COMPILER_ID_FILE_IN_PATH STREQUAL ${CMAKE_ROOT}/Modules) 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) file(READ ${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake CMAKE_DETERMINE_COMPILER_ID_CMAKE_CONTENT)
STRING(REPLACE "file(READ \${CMAKE_ROOT}/Modules/\${src}.in ID_CONTENT_IN)" STRING(REPLACE "file(READ \${CMAKE_ROOT}/Modules/\${src}.in ID_CONTENT_IN)"
"find_file(src_in \${src}.in PATHS \${CMAKE_ROOT}/Modules \${CMAKE_MODULE_PATH}) "find_file(src_in \${src}.in PATHS \${CMAKE_ROOT}/Modules \${CMAKE_MODULE_PATH} NO_DEFAULT_PATH)
file(READ \${src_in} ID_CONTENT_IN) file(READ \${src_in} ID_CONTENT_IN)
unset(src_in CACHE)" unset(src_in CACHE)"
CMAKE_DETERMINE_COMPILER_ID_CMAKE_CONTENT_PATCHED ${CMAKE_DETERMINE_COMPILER_ID_CMAKE_CONTENT}) CMAKE_DETERMINE_COMPILER_ID_CMAKE_CONTENT_PATCHED ${CMAKE_DETERMINE_COMPILER_ID_CMAKE_CONTENT})
file(WRITE ${CMAKE_PLATFORM_INFO_DIR}/CMakeDetermineCompilerId.cmake file(WRITE ${CMAKE_PLATFORM_INFO_DIR}/CMakeDetermineCompilerId.cmake
${CMAKE_DETERMINE_COMPILER_ID_CMAKE_CONTENT_PATCHED}) ${CMAKE_DETERMINE_COMPILER_ID_CMAKE_CONTENT_PATCHED})
include(${CMAKE_PLATFORM_INFO_DIR}/CMakeDetermineCompilerId.cmake) include(${CMAKE_PLATFORM_INFO_DIR}/CMakeDetermineCompilerId.cmake)
@ -153,8 +154,8 @@ if(MSVC_D_ARCHITECTURE_ID)
"set(MSVC_D_ARCHITECTURE_ID ${MSVC_D_ARCHITECTURE_ID})") "set(MSVC_D_ARCHITECTURE_ID ${MSVC_D_ARCHITECTURE_ID})")
endif(MSVC_D_ARCHITECTURE_ID) endif(MSVC_D_ARCHITECTURE_ID)
# configure variables set in this file for fast reload later on # configure variables set in this file for fast reload later on
find_file(CMAKE_D_COMPILER_CMAKE_IN CMakeDCompiler.cmake.in find_file(CMAKE_D_COMPILER_CMAKE_IN CMakeDCompiler.cmake.in PATHS ${CMAKE_ROOT}/Modules
PATHS ${CMAKE_ROOT}/Modules ${CMAKE_MODULE_PATH}) ${CMAKE_MODULE_PATH} NO_DEFAULT_PATH)
configure_file(${CMAKE_D_COMPILER_CMAKE_IN} configure_file(${CMAKE_D_COMPILER_CMAKE_IN}
${CMAKE_PLATFORM_INFO_DIR}/CMakeDCompiler.cmake ${CMAKE_PLATFORM_INFO_DIR}/CMakeDCompiler.cmake
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0 @ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0

View file

@ -61,11 +61,11 @@ 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_COMPILER_ABI_SRC CMakeDCompilerABI.d find_file(CMAKE_D_COMPILER_ABI_SRC CMakeDCompilerABI.d PATHS ${CMAKE_ROOT}/Modules
PATHS ${CMAKE_ROOT}/Modules ${CMAKE_MODULE_PATH}) ${CMAKE_MODULE_PATH} NO_DEFAULT_PATH)
CMAKE_DETERMINE_COMPILER_ABI(D ${CMAKE_D_COMPILER_ABI_SRC}) CMAKE_DETERMINE_COMPILER_ABI(D ${CMAKE_D_COMPILER_ABI_SRC})
find_file(CMAKE_D_COMPILER_CMAKE_IN CMakeDCompiler.cmake.in find_file(CMAKE_D_COMPILER_CMAKE_IN CMakeDCompiler.cmake.in PATHS ${CMAKE_ROOT}/Modules
PATHS ${CMAKE_ROOT}/Modules ${CMAKE_MODULE_PATH}) ${CMAKE_MODULE_PATH} NO_DEFAULT_PATH)
configure_file( configure_file(
${CMAKE_D_COMPILER_CMAKE_IN} ${CMAKE_D_COMPILER_CMAKE_IN}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeDCompiler.cmake ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeDCompiler.cmake