ENH: cleaned up some old methods and vars

This commit is contained in:
Ken Martin 2005-07-07 11:44:36 -04:00
parent eb60fedfe6
commit c5bfdf6917
2 changed files with 14 additions and 36 deletions

View File

@ -191,14 +191,10 @@ void cmMakefile::Print()
std::cout << l->first << std::endl; std::cout << l->first << std::endl;
} }
std::cout << " m_CurrentOutputDirectory; " <<
m_CurrentOutputDirectory.c_str() << std::endl;
std::cout << " m_StartOutputDirectory; " << std::cout << " m_StartOutputDirectory; " <<
m_StartOutputDirectory.c_str() << std::endl; m_StartOutputDirectory.c_str() << std::endl;
std::cout << " m_HomeOutputDirectory; " << std::cout << " m_HomeOutputDirectory; " <<
m_HomeOutputDirectory.c_str() << std::endl; m_HomeOutputDirectory.c_str() << std::endl;
std::cout << " m_cmCurrentDirectory; " <<
m_cmCurrentDirectory.c_str() << std::endl;
std::cout << " m_cmStartDirectory; " << std::cout << " m_cmStartDirectory; " <<
m_cmStartDirectory.c_str() << std::endl; m_cmStartDirectory.c_str() << std::endl;
std::cout << " m_cmHomeDirectory; " << std::cout << " m_cmHomeDirectory; " <<
@ -328,13 +324,13 @@ bool cmMakefile::ReadListFile(const char* filename_in, const char *external_in)
{ {
external_abs = external_abs =
cmSystemTools::CollapseFullPath(external_in, cmSystemTools::CollapseFullPath(external_in,
m_cmCurrentDirectory.c_str()); m_cmStartDirectory.c_str());
external = external_abs.c_str(); external = external_abs.c_str();
if (filename_in) if (filename_in)
{ {
filename_abs = filename_abs =
cmSystemTools::CollapseFullPath(filename_in, cmSystemTools::CollapseFullPath(filename_in,
m_cmCurrentDirectory.c_str()); m_cmStartDirectory.c_str());
filename = filename_abs.c_str(); filename = filename_abs.c_str();
} }
} }
@ -368,7 +364,7 @@ bool cmMakefile::ReadListFile(const char* filename_in, const char *external_in)
// one, then cmake will provide one via the // one, then cmake will provide one via the
// cmListFileCache class. // cmListFileCache class.
bool requireProjectCommand = false; bool requireProjectCommand = false;
if(!external && m_cmCurrentDirectory == m_cmHomeDirectory) if(!external && m_cmStartDirectory == m_cmHomeDirectory)
{ {
if(cmSystemTools::LowerCase( if(cmSystemTools::LowerCase(
cmSystemTools::GetFilenameName(filename)) == "cmakelists.txt") cmSystemTools::GetFilenameName(filename)) == "cmakelists.txt")

View File

@ -293,10 +293,10 @@ public:
*/ */
void MakeStartDirectoriesCurrent() void MakeStartDirectoriesCurrent()
{ {
m_cmCurrentDirectory = m_cmStartDirectory; this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR",
m_CurrentOutputDirectory = m_StartOutputDirectory; m_cmStartDirectory.c_str());
this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR", m_cmCurrentDirectory.c_str()); this->AddDefinition("CMAKE_CURRENT_BINARY_DIR",
this->AddDefinition("CMAKE_CURRENT_BINARY_DIR", m_CurrentOutputDirectory.c_str()); m_StartOutputDirectory.c_str());
} }
//@{ //@{
@ -331,6 +331,8 @@ public:
{ {
m_cmStartDirectory = dir; m_cmStartDirectory = dir;
cmSystemTools::ConvertToUnixSlashes(m_cmStartDirectory); cmSystemTools::ConvertToUnixSlashes(m_cmStartDirectory);
this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR",
m_cmStartDirectory.c_str());
} }
const char* GetStartDirectory() const const char* GetStartDirectory() const
{ {
@ -341,6 +343,8 @@ public:
m_StartOutputDirectory = lib; m_StartOutputDirectory = lib;
cmSystemTools::ConvertToUnixSlashes(m_StartOutputDirectory); cmSystemTools::ConvertToUnixSlashes(m_StartOutputDirectory);
cmSystemTools::MakeDirectory(m_StartOutputDirectory.c_str()); cmSystemTools::MakeDirectory(m_StartOutputDirectory.c_str());
this->AddDefinition("CMAKE_CURRENT_BINARY_DIR",
m_StartOutputDirectory.c_str());
} }
const char* GetStartOutputDirectory() const const char* GetStartOutputDirectory() const
{ {
@ -348,33 +352,13 @@ public:
} }
//@} //@}
//@{
/**
* Set/Get the current directory (or output directory) in the project. The
* current directory is the directory of the CMakeLists.txt file that is
* currently being processed. Remember that CMake processes CMakeLists
* files by recursing up the tree starting at the StartDirectory and going
* up until it reaches the HomeDirectory.
*/
void SetCurrentDirectory(const char* dir)
{
m_cmCurrentDirectory = dir;
cmSystemTools::ConvertToUnixSlashes(m_cmCurrentDirectory);
this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR", m_cmCurrentDirectory.c_str());
}
const char* GetCurrentDirectory() const const char* GetCurrentDirectory() const
{ {
return m_cmCurrentDirectory.c_str(); return m_cmStartDirectory.c_str();
}
void SetCurrentOutputDirectory(const char* lib)
{
m_CurrentOutputDirectory = lib;
cmSystemTools::ConvertToUnixSlashes(m_CurrentOutputDirectory);
this->AddDefinition("CMAKE_CURRENT_BINARY_DIR", m_CurrentOutputDirectory.c_str());
} }
const char* GetCurrentOutputDirectory() const const char* GetCurrentOutputDirectory() const
{ {
return m_CurrentOutputDirectory.c_str(); return m_StartOutputDirectory.c_str();
} }
/* Get the current CMakeLists.txt file that is being processed. This /* Get the current CMakeLists.txt file that is being processed. This
@ -684,8 +668,6 @@ protected:
std::string m_Prefix; std::string m_Prefix;
std::vector<std::string> m_AuxSourceDirectories; // std::vector<std::string> m_AuxSourceDirectories; //
std::string m_cmCurrentDirectory;
std::string m_CurrentOutputDirectory;
std::string m_cmStartDirectory; std::string m_cmStartDirectory;
std::string m_StartOutputDirectory; std::string m_StartOutputDirectory;
std::string m_cmHomeDirectory; std::string m_cmHomeDirectory;