diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx index 9dc2a252a6..b493eb3127 100644 --- a/Source/cmIncludeDirectoryCommand.cxx +++ b/Source/cmIncludeDirectoryCommand.cxx @@ -49,6 +49,13 @@ bool cmIncludeDirectoryCommand } std::string unixPath = *i; cmSystemTools::ConvertToUnixSlashes(unixPath); + if(!cmSystemTools::FileIsFullPath(unixPath.c_str())) + { + std::string tmp = this->Makefile->GetStartDirectory(); + tmp += "/"; + tmp += unixPath; + unixPath = tmp; + } this->Makefile->AddIncludeDirectory(unixPath.c_str(), before); } return true; diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt index 92fa7efa12..81ade768c4 100644 --- a/Tests/Complex/CMakeLists.txt +++ b/Tests/Complex/CMakeLists.txt @@ -92,7 +92,7 @@ ENDIF(${fooCACHE_TEST_VAR2} MATCHES bar) # (BEFORE is for coverage) # INCLUDE_DIRECTORIES( - ${Complex_SOURCE_DIR}/Library + Library ${Complex_SOURCE_DIR}/../../Source ${Complex_BINARY_DIR}/../../Source ) diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt index 92fa7efa12..81ade768c4 100644 --- a/Tests/ComplexOneConfig/CMakeLists.txt +++ b/Tests/ComplexOneConfig/CMakeLists.txt @@ -92,7 +92,7 @@ ENDIF(${fooCACHE_TEST_VAR2} MATCHES bar) # (BEFORE is for coverage) # INCLUDE_DIRECTORIES( - ${Complex_SOURCE_DIR}/Library + Library ${Complex_SOURCE_DIR}/../../Source ${Complex_BINARY_DIR}/../../Source ) diff --git a/Tests/ComplexRelativePaths/CMakeLists.txt b/Tests/ComplexRelativePaths/CMakeLists.txt index 92fa7efa12..81ade768c4 100644 --- a/Tests/ComplexRelativePaths/CMakeLists.txt +++ b/Tests/ComplexRelativePaths/CMakeLists.txt @@ -92,7 +92,7 @@ ENDIF(${fooCACHE_TEST_VAR2} MATCHES bar) # (BEFORE is for coverage) # INCLUDE_DIRECTORIES( - ${Complex_SOURCE_DIR}/Library + Library ${Complex_SOURCE_DIR}/../../Source ${Complex_BINARY_DIR}/../../Source )