summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2004-06-18 16:56:25 (GMT)
committerBrad King <brad.king@kitware.com>2004-06-18 16:56:25 (GMT)
commit06cfe37e220e0df6468ca65d2225d213cbb464c4 (patch)
tree765ebad7c6ca4bd8a63c017707a336e8335cde2c /Source
parent97391045bda76822c40850b83ecdabeead63f6db (diff)
downloadCMake-06cfe37e220e0df6468ca65d2225d213cbb464c4.zip
CMake-06cfe37e220e0df6468ca65d2225d213cbb464c4.tar.gz
CMake-06cfe37e220e0df6468ca65d2225d213cbb464c4.tar.bz2
BUG: Need to preserve automatic addition of source tree to -I path if CMAKE_BACKWARDS_COMPATIBILITY is set to below 2.0.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmLocalUnixMakefileGenerator.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator.cxx b/Source/cmLocalUnixMakefileGenerator.cxx
index f9b4c7e..5da812c 100644
--- a/Source/cmLocalUnixMakefileGenerator.cxx
+++ b/Source/cmLocalUnixMakefileGenerator.cxx
@@ -2494,6 +2494,23 @@ void cmLocalUnixMakefileGenerator::OutputMakeVariables(std::ostream& fout)
std::vector<std::string>& includes = m_Makefile->GetIncludeDirectories();
std::vector<std::string>::iterator i;
std::map<cmStdString, cmStdString> implicitIncludes;
+
+ // CMake versions below 2.0 would add the source tree to the -I path
+ // automatically. Preserve compatibility.
+ const char* versionValue =
+ this->GetDefinition("CMAKE_BACKWARDS_COMPATIBILITY");
+ if(versionValue)
+ {
+ int major = 0;
+ int minor = 0;
+ if(sscanf(versionValue, "%d.%d", &major, &minor) == 2 && major < 2)
+ {
+ fout << "-I"
+ << this->ConvertToOutputForExisting(m_Makefile->GetStartDirectory())
+ << " ";
+ }
+ }
+
implicitIncludes["/usr/include"] = "/usr/include";
if(m_Makefile->GetDefinition("CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES"))
{