summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2003-02-08 15:24:03 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2003-02-08 15:24:03 (GMT)
commitbadbd8dc8dd339c445e5d16cc9d1bb4754ef1293 (patch)
tree0a411894a52111981a7b03af366c61bbeef16d4d
parent217f4b764abf42958e2fc77b5c99c295cea1b889 (diff)
downloadCMake-badbd8dc8dd339c445e5d16cc9d1bb4754ef1293.zip
CMake-badbd8dc8dd339c445e5d16cc9d1bb4754ef1293.tar.gz
CMake-badbd8dc8dd339c445e5d16cc9d1bb4754ef1293.tar.bz2
Fix for include optional
-rw-r--r--Source/cmSystemTools.cxx15
-rw-r--r--Source/cmSystemTools.h3
2 files changed, 12 insertions, 6 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index b5f3d44..4214132 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -1734,7 +1734,8 @@ std::string cmSystemTools::GetProgramPath(const char* in_name)
*/
void cmSystemTools::SplitProgramPath(const char* in_name,
std::string& dir,
- std::string& file)
+ std::string& file,
+ bool errorReport)
{
dir = in_name;
file = "";
@@ -1758,9 +1759,13 @@ void cmSystemTools::SplitProgramPath(const char* in_name,
{
std::string oldDir = in_name;
cmSystemTools::ConvertToUnixSlashes(oldDir);
- cmSystemTools::Error("Error splitting file name off end of path:\n",
- oldDir.c_str(), "\nDirectory not found: ",
- dir.c_str());
+ if(errorReport)
+ {
+ cmSystemTools::Error("Error splitting file name off end of path:\n",
+ oldDir.c_str(), "\nDirectory not found: ",
+ dir.c_str());
+ }
+
dir = in_name;
return;
}
@@ -1781,7 +1786,7 @@ std::string cmSystemTools::CollapseFullPath(const char* in_relative,
const char* in_base)
{
std::string dir, file;
- cmSystemTools::SplitProgramPath(in_relative, dir, file);
+ cmSystemTools::SplitProgramPath(in_relative, dir, file, false);
// Save original working directory.
std::string orig = cmSystemTools::GetCurrentWorkingDirectory();
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index e513733..db4c3b4 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -264,7 +264,8 @@ public:
static std::string GetProgramPath(const char*);
static void SplitProgramPath(const char* in_name,
std::string& dir,
- std::string& file);
+ std::string& file,
+ bool errorReport = true);
static std::string CollapseFullPath(const char* in_relative);
static std::string CollapseFullPath(const char* in_relative,
const char* in_base);