summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2004-10-04 16:31:09 (GMT)
committerKen Martin <ken.martin@kitware.com>2004-10-04 16:31:09 (GMT)
commit1066af45278f29e7a5f1b5ba3d7d12bce15719e4 (patch)
tree6beeea084d3bb262b2d9ada6c562a4ac7109e34c /Source/cmake.cxx
parent7e3c70082ae433e7793afad6d9a3366bf6c1e215 (diff)
downloadCMake-1066af45278f29e7a5f1b5ba3d7d12bce15719e4.zip
CMake-1066af45278f29e7a5f1b5ba3d7d12bce15719e4.tar.gz
CMake-1066af45278f29e7a5f1b5ba3d7d12bce15719e4.tar.bz2
ENH: Mathieus support for path conversions
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx26
1 files changed, 26 insertions, 0 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index ae57145..37da3a9 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -40,6 +40,7 @@
#endif
#include <stdlib.h> // required for atoi
+#include <fstream>
#ifdef __APPLE__
#include <sys/types.h>
@@ -983,6 +984,9 @@ int cmake::DoPreConfigureChecks()
int cmake::Configure()
{
+ // Construct right now our path conversion table before it's too late:
+ this->UpdateConversionPathTable();
+
int res = 0;
if ( !m_ScriptMode )
{
@@ -1506,3 +1510,25 @@ void cmake::CleanupWrittenFiles()
{
m_WrittenFiles.clear();
}
+
+void cmake::UpdateConversionPathTable()
+{
+ // Update the path conversion table with any specified file:
+ const char* tablepath =
+ m_CacheManager->GetCacheValue("CMAKE_PATH_TRANSLATION_FILE");
+
+ if(tablepath)
+ {
+ std::ifstream table( tablepath );
+ std::string a, b;
+ if( table.is_open() && table.good() )
+ {
+ while(!table.eof())
+ {
+ // two entries per line
+ table >> a; table >> b;
+ cmSystemTools::AddTranslationPath( a.c_str(), b.c_str());
+ }
+ }
+ }
+}