diff options
Diffstat (limited to 'Source/cmSourceFile.cxx')
-rw-r--r-- | Source/cmSourceFile.cxx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index 380b95e..963f77c 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -51,13 +51,23 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. void cmSourceFile::SetName(const char* name, const char* dir) { m_HeaderFileOnly = true; + m_SourceName = name; std::string pathname = dir; + + // the name might include the full path already, so + // check for this case + if (name && (name[0] == '/' || + (name[0] != '\0' && name[1] == ':'))) + { + pathname = ""; + } if(pathname != "") { pathname += "/"; } - + + // First try and see whether the listed file can be found // as is without extensions added on. pathname += m_SourceName; |