summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-04-26 17:53:06 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-04-28 05:50:02 (GMT)
commite4c78b37cec74c505e8a4951276c17f7e64e5f67 (patch)
tree2dc965c85fa639e2965596a5d18f532ea2eb35a5
parent410f39a43ef3ad900bcaed15e6838f97f034f0e7 (diff)
downloadCMake-e4c78b37cec74c505e8a4951276c17f7e64e5f67.zip
CMake-e4c78b37cec74c505e8a4951276c17f7e64e5f67.tar.gz
CMake-e4c78b37cec74c505e8a4951276c17f7e64e5f67.tar.bz2
cmMakefile: Inline SetHome* methods into last remaining caller.
-rw-r--r--Source/cmMakefile.cxx38
-rw-r--r--Source/cmMakefile.h11
2 files changed, 17 insertions, 32 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index c8b6849..4c68849 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -651,9 +651,23 @@ void cmMakefile::SetLocalGenerator(cmLocalGenerator* lg)
this->Properties.SetCMakeInstance(this->GetCMakeInstance());
this->WarnUnused = this->GetCMakeInstance()->GetWarnUnused();
this->CheckSystemVars = this->GetCMakeInstance()->GetCheckSystemVars();
- this->SetHomeDirectory(this->GetCMakeInstance()->GetHomeDirectory());
- this->SetHomeOutputDirectory(
- this->GetCMakeInstance()->GetHomeOutputDirectory());
+
+ {
+ const char* dir = this->GetCMakeInstance()->GetHomeDirectory();
+ this->AddDefinition("CMAKE_SOURCE_DIR", dir);
+ if ( !this->GetDefinition("CMAKE_CURRENT_SOURCE_DIR") )
+ {
+ this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR", dir);
+ }
+ }
+ {
+ const char* dir = this->GetCMakeInstance()->GetHomeOutputDirectory();
+ this->AddDefinition("CMAKE_BINARY_DIR", dir);
+ if ( !this->GetDefinition("CMAKE_CURRENT_BINARY_DIR") )
+ {
+ this->AddDefinition("CMAKE_CURRENT_BINARY_DIR", dir);
+ }
+ }
}
namespace
@@ -3385,29 +3399,11 @@ const char* cmMakefile::GetHomeDirectory() const
return this->GetCMakeInstance()->GetHomeDirectory();
}
-void cmMakefile::SetHomeDirectory(const std::string& dir)
-{
- this->AddDefinition("CMAKE_SOURCE_DIR", dir.c_str());
- if ( !this->GetDefinition("CMAKE_CURRENT_SOURCE_DIR") )
- {
- this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR", dir.c_str());
- }
-}
-
const char* cmMakefile::GetHomeOutputDirectory() const
{
return this->GetCMakeInstance()->GetHomeOutputDirectory();
}
-void cmMakefile::SetHomeOutputDirectory(const std::string& dir)
-{
- this->AddDefinition("CMAKE_BINARY_DIR", dir.c_str());
- if ( !this->GetDefinition("CMAKE_CURRENT_BINARY_DIR") )
- {
- this->AddDefinition("CMAKE_CURRENT_BINARY_DIR", dir.c_str());
- }
-}
-
void cmMakefile::SetScriptModeFile(const char* scriptfile)
{
this->AddDefinition("CMAKE_SCRIPT_MODE_FILE", scriptfile);
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 8c5ccc9..dcf56e1 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -422,19 +422,8 @@ public:
bool HasCMP0054AlreadyBeenReported(
cmListFileContext context) const;
- //@{
- /**
- * Set/Get the home directory (or output directory) in the project. The
- * home directory is the top directory of the project. It is where
- * CMakeSetup or configure was run. Remember that CMake processes
- * CMakeLists files by recursing up the tree starting at the StartDirectory
- * and going up until it reaches the HomeDirectory.
- */
- void SetHomeDirectory(const std::string& dir);
const char* GetHomeDirectory() const;
- void SetHomeOutputDirectory(const std::string& dir);
const char* GetHomeOutputDirectory() const;
- //@}
/**
* Set CMAKE_SCRIPT_MODE_FILE variable when running a -P script.