summaryrefslogtreecommitdiffstats
path: root/Source/cmCollectFlags.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2000-09-21 17:45:08 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2000-09-21 17:45:08 (GMT)
commit1e3ba0f1d72873233193ce69614fd4bd880e8fc5 (patch)
treeda0313b2bf9af52e9b17f639d78a940788c30a2a /Source/cmCollectFlags.cxx
parent749b7ff7a3556934f4a7d6ead0f9a4d3ade7fad0 (diff)
downloadCMake-1e3ba0f1d72873233193ce69614fd4bd880e8fc5.zip
CMake-1e3ba0f1d72873233193ce69614fd4bd880e8fc5.tar.gz
CMake-1e3ba0f1d72873233193ce69614fd4bd880e8fc5.tar.bz2
ENH: clean up code, and varible names
Diffstat (limited to 'Source/cmCollectFlags.cxx')
-rw-r--r--Source/cmCollectFlags.cxx30
1 files changed, 30 insertions, 0 deletions
diff --git a/Source/cmCollectFlags.cxx b/Source/cmCollectFlags.cxx
index c936718..6e7e33c 100644
--- a/Source/cmCollectFlags.cxx
+++ b/Source/cmCollectFlags.cxx
@@ -1,4 +1,5 @@
#include "cmCollectFlags.h"
+#include "cmMakefile.h"
#include "cmSystemTools.h"
#include <fstream>
#include <iterator>
@@ -107,3 +108,32 @@ void cmCollectFlags::ParseDirectory(const char* dir)
this->ParseDirectory(dotdotDir.c_str());
}
}
+
+
+// expance CMAKE_BINARY_DIR and CMAKE_SOURCE_ROOT in the
+// include and library directories.
+
+void cmCollectFlags::ExpandVaribles(cmMakefile* makefile)
+{
+ // Now replace varibles
+ std::vector<std::string>& includes = m_IncludeDirectories;
+ std::vector<std::string>::iterator j, begin, end;
+ begin = m_IncludeDirectories.begin();
+ end = m_IncludeDirectories.end();
+ for(j = begin; j != end; ++j)
+ {
+ cmSystemTools::ReplaceString(*j, "${CMAKE_BINARY_DIR}",
+ makefile->GetOutputHomeDirectory() );
+ cmSystemTools::ReplaceString(*j, "${CMAKE_SOURCE_ROOT}",
+ makefile->GetHomeDirectory() );
+ }
+ begin = m_LinkDirectories.begin();
+ end = m_LinkDirectories.end();
+ for(j = begin; j != end; ++j)
+ {
+ cmSystemTools::ReplaceString(*j, "${CMAKE_BINARY_DIR}",
+ makefile->GetOutputHomeDirectory() );
+ cmSystemTools::ReplaceString(*j, "${CMAKE_SOURCE_ROOT}",
+ makefile->GetHomeDirectory() );
+ }
+}