ENH:Reworked CMake to clearer indicate what the variables do

This commit is contained in:
Will Schroeder 2000-11-02 10:24:59 -05:00
parent 366c783f6c
commit 1ae64b11fb
3 changed files with 19 additions and 8 deletions

6
README
View File

@ -2,8 +2,8 @@
CMakeLists.txt -> File in each directory that contains classes, exe, etc CMakeLists.txt -> File in each directory that contains classes, exe, etc
CMakeLists.txt contains the following: CMakeLists.txt contains the following:
# build targets # build targets
WIN32_CLASSES = WIN32_SOURCE_FILES =
UNIX_CLASSES = UNIX_SOURCE_FILES =
ABSTRACT_CLASSES = ABSTRACT_CLASSES =
SUBDIRS = SUBDIRS =
EXECUTABLES = EXECUTABLES =
@ -25,7 +25,7 @@ BEGIN MAKE VERBATIM
... # copy stuff into CMakeTargets.make directly ... # copy stuff into CMakeTargets.make directly
LOCAL_BUILD_TARGETS = // These are done first before anything else LOCAL_BUILD_TARGETS = // These are done first before anything else
END MAKE VERBATIM END MAKE VERBATIM
TEMPLATE_INSTANCE_DIR = AUX_SOURCE_DIR =
Windows / Visual Studio 6.0 programs Windows / Visual Studio 6.0 programs
CMakeSetup.exe -> window MFC based GUI for configure on windows CMakeSetup.exe -> window MFC based GUI for configure on windows

View File

@ -21,8 +21,19 @@ void cmClassFile::SetName(const char* name, const char* dir)
pathname += "/"; pathname += "/";
} }
// First try and see whether the listed file can be found
// as is without extensions added on.
pathname += m_ClassName; pathname += m_ClassName;
std::string hname = pathname; std::string hname = pathname;
if(cmSystemTools::FileExists(hname.c_str()))
{
m_HeaderFileOnly = false;
m_FullPath = hname;
return;
}
// Try various extentions
hname = pathname;
hname += ".cxx"; hname += ".cxx";
if(cmSystemTools::FileExists(hname.c_str())) if(cmSystemTools::FileExists(hname.c_str()))
{ {

View File

@ -42,7 +42,7 @@ bool cmMakefile::ReadMakefile(const char* filename)
{ {
std::string line = inbuffer; std::string line = inbuffer;
cmClassFile file; cmClassFile file;
if(line.find("COMPILE_CLASSES") != std::string::npos) if(line.find("SOURCE_FILES") != std::string::npos)
{ {
if(line.find("\\") != std::string::npos) if(line.find("\\") != std::string::npos)
{ {
@ -50,7 +50,7 @@ bool cmMakefile::ReadMakefile(const char* filename)
} }
} }
#ifdef _WIN32 #ifdef _WIN32
else if(line.find("WIN32_CLASSES") != std::string::npos) else if(line.find("WIN32_SOURCE_FILES") != std::string::npos)
{ {
if(line.find("\\") != std::string::npos) if(line.find("\\") != std::string::npos)
{ {
@ -58,7 +58,7 @@ bool cmMakefile::ReadMakefile(const char* filename)
} }
} }
#else #else
else if(line.find("UNIX_CLASSES") != std::string::npos) else if(line.find("UNIX_SOURCE_FILES") != std::string::npos)
{ {
if(line.find("\\") != std::string::npos) if(line.find("\\") != std::string::npos)
{ {
@ -73,7 +73,7 @@ bool cmMakefile::ReadMakefile(const char* filename)
this->ReadClasses(fin, true); this->ReadClasses(fin, true);
} }
} }
else if(line.find("TEMPLATE_INSTANCE_DIRECTORY") != std::string::npos) else if(line.find("AUX_SOURCE_DIRECTORY") != std::string::npos)
{ {
this->ReadTemplateInstanceDirectory(line); this->ReadTemplateInstanceDirectory(line);
} }
@ -173,7 +173,7 @@ void cmMakefile::ReadClasses(std::ifstream& fin,
} }
// Find all of the files in dir as specified from this line: // Find all of the files in dir as specified from this line:
// TEMPLATE_INSTANCE_DIRECTORY = dir // AUX_SOURCE_DIRECTORY = dir
// Add all the files to the m_Classes array. // Add all the files to the m_Classes array.
void cmMakefile::ReadTemplateInstanceDirectory(std::string& line) void cmMakefile::ReadTemplateInstanceDirectory(std::string& line)