summaryrefslogtreecommitdiffstats
path: root/Source/cmClassFile.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2000-09-12 09:30:35 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2000-09-12 09:30:35 (GMT)
commitaa3ca2b432ab346c28ea7c758cbbf57ca346e139 (patch)
treedec236eb51e746ae123edb3e9c01a5595381e12f /Source/cmClassFile.cxx
parente2ad65d3c27177b8f3ee3c9b81382ea883a3bfbd (diff)
downloadCMake-aa3ca2b432ab346c28ea7c758cbbf57ca346e139.zip
CMake-aa3ca2b432ab346c28ea7c758cbbf57ca346e139.tar.gz
CMake-aa3ca2b432ab346c28ea7c758cbbf57ca346e139.tar.bz2
ENH: CMake and configure now use SUBDIRS in CMakeLists.txt to find all the directories of the system.
Diffstat (limited to 'Source/cmClassFile.cxx')
-rw-r--r--Source/cmClassFile.cxx29
1 files changed, 11 insertions, 18 deletions
diff --git a/Source/cmClassFile.cxx b/Source/cmClassFile.cxx
index f953bbb..6c219ed 100644
--- a/Source/cmClassFile.cxx
+++ b/Source/cmClassFile.cxx
@@ -2,23 +2,10 @@
#pragma warning ( disable : 4786 )
#endif
#include "cmClassFile.h"
-#include <sys/stat.h>
+#include "cmSystemTools.h"
#include <iostream>
-// Helper function to hide the use of system stat function
-bool cmFileExists(const char* filename)
-{
- struct stat fs;
- if (stat(filename, &fs) != 0)
- {
- return false;
- }
- else
- {
- return true;
- }
-}
// Set the name of the class and the full path to the file.
// The class must be found in dir and end in name.cxx, name.txx,
@@ -37,7 +24,7 @@ void cmClassFile::SetName(const char* name, const char* dir)
pathname += m_ClassName;
std::string hname = pathname;
hname += ".cxx";
- if(cmFileExists(hname.c_str()))
+ if(cmSystemTools::FileExists(hname.c_str()))
{
m_HeaderFileOnly = false;
m_FullPath = hname;
@@ -46,7 +33,7 @@ void cmClassFile::SetName(const char* name, const char* dir)
hname = pathname;
hname += ".c";
- if(cmFileExists(hname.c_str()))
+ if(cmSystemTools::FileExists(hname.c_str()))
{
m_HeaderFileOnly = false;
m_FullPath = hname;
@@ -54,13 +41,19 @@ void cmClassFile::SetName(const char* name, const char* dir)
}
hname = pathname;
hname += ".txx";
- if(cmFileExists(hname.c_str()))
+ if(cmSystemTools::FileExists(hname.c_str()))
{
m_HeaderFileOnly = false;
m_FullPath = hname;
return;
}
- std::cerr << "file seems to be a header only " << hname << " " << m_ClassName.c_str() << std::endl;
+ hname = pathname;
+ hname += ".h";
+ if(!cmSystemTools::FileExists(hname.c_str()))
+ {
+ std::cerr << "ERROR, can not find file " << hname;
+ std::cerr << "Tried .txx .cxx .c " << std::endl;
+ }
}