diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index f38cda284..815421f93 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -388,11 +388,7 @@ std::string cmMakefile::GetParentListFileName(const char *currentFileName) void cmMakefile::ExpandVariables() { - // make sure binary and source dir are defined - this->AddDefinition("CMAKE_BINARY_DIR", this->GetHomeOutputDirectory()); - this->AddDefinition("CMAKE_SOURCE_DIR", this->GetHomeDirectory()); - - // Now expand varibles in the include and link strings + // Now expand varibles in the include and link strings std::vector::iterator j, begin, end; begin = m_IncludeDirectories.begin(); end = m_IncludeDirectories.end(); diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 62961e86e..293d2bfb3 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -173,6 +173,7 @@ public: { m_cmHomeDirectory = dir; cmSystemTools::ConvertToUnixSlashes(m_cmHomeDirectory); + this->AddDefinition("CMAKE_SOURCE_DIR", this->GetHomeDirectory()); } const char* GetHomeDirectory() { @@ -182,6 +183,7 @@ public: { m_HomeOutputDirectory = lib; cmSystemTools::ConvertToUnixSlashes(m_HomeOutputDirectory); + this->AddDefinition("CMAKE_BINARY_DIR", this->GetHomeOutputDirectory()); } const char* GetHomeOutputDirectory() {