ENH:Beginning clean up; adding documentation
This commit is contained in:
parent
26f072dfe1
commit
26dbdd4671
|
@ -1,10 +1,24 @@
|
||||||
|
/*=========================================================================
|
||||||
|
|
||||||
|
Program: Insight Segmentation & Registration Toolkit
|
||||||
|
Module: $RCSfile$
|
||||||
|
Language: C++
|
||||||
|
Date: $Date$
|
||||||
|
Version: $Revision$
|
||||||
|
|
||||||
|
|
||||||
|
Copyright (c) 2000 National Library of Medicine
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
See COPYRIGHT.txt for copyright details.
|
||||||
|
|
||||||
|
=========================================================================*/
|
||||||
#ifndef cmAbstractFilesRule_h
|
#ifndef cmAbstractFilesRule_h
|
||||||
#define cmAbstractFilesRule_h
|
#define cmAbstractFilesRule_h
|
||||||
|
|
||||||
#include "cmStandardIncludes.h"
|
#include "cmStandardIncludes.h"
|
||||||
#include "cmRuleMaker.h"
|
#include "cmRuleMaker.h"
|
||||||
|
|
||||||
|
|
||||||
class cmAbstractFilesRule : public cmRuleMaker
|
class cmAbstractFilesRule : public cmRuleMaker
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -12,20 +26,36 @@ public:
|
||||||
{
|
{
|
||||||
return new cmAbstractFilesRule;
|
return new cmAbstractFilesRule;
|
||||||
}
|
}
|
||||||
// This is called when the rule is firt encountered in
|
|
||||||
// the input file
|
/**
|
||||||
|
* This is called when the rule is first encountered in
|
||||||
|
* the input file.
|
||||||
|
*/
|
||||||
virtual bool Invoke(std::vector<std::string>& args);
|
virtual bool Invoke(std::vector<std::string>& args);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is called at the end after all the information
|
||||||
|
* specified by the rules is accumulated.
|
||||||
|
*/
|
||||||
virtual void FinalPass() { }
|
virtual void FinalPass() { }
|
||||||
|
|
||||||
// This is the name used in the input file.
|
/**
|
||||||
|
* The name of the rule as specified in CMakeList.txt.
|
||||||
|
*/
|
||||||
virtual const char* GetName() { return "ABSTRACT_FILES";}
|
virtual const char* GetName() { return "ABSTRACT_FILES";}
|
||||||
virtual const char* TerseDocumentaion()
|
|
||||||
|
/**
|
||||||
|
* Succinct documentation.
|
||||||
|
*/
|
||||||
|
virtual const char* TerseDocumentation()
|
||||||
{
|
{
|
||||||
return "A list of abstract classes, useful for wrappers.";
|
return "A list of abstract classes, useful for wrappers.";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return full documentation for the rule
|
/**
|
||||||
virtual const char* FullDocumentaion()
|
* Longer documentation.
|
||||||
|
*/
|
||||||
|
virtual const char* FullDocumentation()
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
"ABSTRACT_FILES(file1 file2 ..)";
|
"ABSTRACT_FILES(file1 file2 ..)";
|
||||||
|
|
|
@ -1,37 +1,76 @@
|
||||||
|
/*=========================================================================
|
||||||
|
|
||||||
|
Program: Insight Segmentation & Registration Toolkit
|
||||||
|
Module: $RCSfile$
|
||||||
|
Language: C++
|
||||||
|
Date: $Date$
|
||||||
|
Version: $Revision$
|
||||||
|
|
||||||
|
|
||||||
|
Copyright (c) 2000 National Library of Medicine
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
See COPYRIGHT.txt for copyright details.
|
||||||
|
|
||||||
|
=========================================================================*/
|
||||||
#ifndef cmAddTargetRule_h
|
#ifndef cmAddTargetRule_h
|
||||||
#define cmAddTargetRule_h
|
#define cmAddTargetRule_h
|
||||||
|
|
||||||
#include "cmStandardIncludes.h"
|
#include "cmStandardIncludes.h"
|
||||||
#include "cmRuleMaker.h"
|
#include "cmRuleMaker.h"
|
||||||
|
|
||||||
|
/** \class cmAddTargetRule
|
||||||
|
* \brief Rule that adds a target to the build system.
|
||||||
|
*
|
||||||
|
* cmAddTargetRule adds an extra target to the build system.
|
||||||
|
* This is useful when you would like to add special
|
||||||
|
* targets like "install,", "clean," and so on.
|
||||||
|
*/
|
||||||
class cmAddTargetRule : public cmRuleMaker
|
class cmAddTargetRule : public cmRuleMaker
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/**
|
||||||
|
* This is a virtual constructor for the rule.
|
||||||
|
*/
|
||||||
virtual cmRuleMaker* Clone()
|
virtual cmRuleMaker* Clone()
|
||||||
{
|
{
|
||||||
return new cmAddTargetRule;
|
return new cmAddTargetRule;
|
||||||
}
|
}
|
||||||
// This is called when the rule is firt encountered in
|
|
||||||
// the input file
|
/**
|
||||||
|
* This is called when the rule is first encountered in
|
||||||
|
* the CMakeLists.txt file.
|
||||||
|
*/
|
||||||
virtual bool Invoke(std::vector<std::string>& args);
|
virtual bool Invoke(std::vector<std::string>& args);
|
||||||
virtual void FinalPass() { }
|
|
||||||
|
|
||||||
// This is the name used in the input file.
|
/**
|
||||||
virtual const char* GetName() { return "ADD_TARGET";}
|
* This is called at the end after all the information
|
||||||
virtual const char* TerseDocumentaion()
|
* specified by the rules is accumulated.
|
||||||
|
*/
|
||||||
|
virtual void FinalPass() {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The name of the rule as specified in CMakeList.txt.
|
||||||
|
*/
|
||||||
|
virtual const char* GetName()
|
||||||
|
{return "ADD_TARGET";}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Succinct documentation.
|
||||||
|
*/
|
||||||
|
virtual const char* TerseDocumentation()
|
||||||
{
|
{
|
||||||
return "Add an extra target to the build system.";
|
return "Add an extra target to the build system.";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return full documentation for the rule
|
/**
|
||||||
virtual const char* FullDocumentaion()
|
* More documentation.
|
||||||
|
*/
|
||||||
|
virtual const char* FullDocumentation()
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
"ADD_TARGET(Name \"command to run\");";
|
"ADD_TARGET(Name \"command to run\");";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -19,14 +19,14 @@ public:
|
||||||
|
|
||||||
// This is the name used in the input file.
|
// This is the name used in the input file.
|
||||||
virtual const char* GetName() { return "AUX_SOURCE_DIRECTORY";}
|
virtual const char* GetName() { return "AUX_SOURCE_DIRECTORY";}
|
||||||
virtual const char* TerseDocumentaion()
|
virtual const char* TerseDocumentation()
|
||||||
{
|
{
|
||||||
return "Add all the source files found in the specified directory to\n"
|
return "Add all the source files found in the specified directory to\n"
|
||||||
" the build.";
|
" the build.";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return full documentation for the rule
|
// Return full documentation for the rule
|
||||||
virtual const char* FullDocumentaion()
|
virtual const char* FullDocumentation()
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
"AUX_SOURCE_DIRECTORY(dir)";
|
"AUX_SOURCE_DIRECTORY(dir)";
|
||||||
|
|
|
@ -13,33 +13,47 @@
|
||||||
See COPYRIGHT.txt for copyright details.
|
See COPYRIGHT.txt for copyright details.
|
||||||
|
|
||||||
=========================================================================*/
|
=========================================================================*/
|
||||||
/**
|
|
||||||
* cmDSPMakefile generate a microsoft DSP project file.
|
|
||||||
* see the *.dsptemplate files for information on the templates
|
|
||||||
* used for making the project files.
|
|
||||||
*/
|
|
||||||
#ifndef cmDSPMakefile_h
|
#ifndef cmDSPMakefile_h
|
||||||
#define cmDSPMakefile_h
|
#define cmDSPMakefile_h
|
||||||
|
|
||||||
#include "cmStandardIncludes.h"
|
#include "cmStandardIncludes.h"
|
||||||
#include "cmMakefile.h"
|
#include "cmMakefile.h"
|
||||||
|
|
||||||
|
/** \class cmDSPMakefile
|
||||||
|
* \brief Generate a Microsoft DSP project file.
|
||||||
|
*
|
||||||
|
* cmDSPMakefile generates a Microsoft DSP project file.
|
||||||
|
* See the *.dsptemplate files for information on the templates
|
||||||
|
* used for making the project files.
|
||||||
|
*/
|
||||||
class cmDSPMakefile
|
class cmDSPMakefile
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cmDSPMakefile(cmMakefile*);
|
cmDSPMakefile(cmMakefile*);
|
||||||
~cmDSPMakefile();
|
~cmDSPMakefile();
|
||||||
void OutputDSPFile();
|
void OutputDSPFile();
|
||||||
enum BuildType { STATIC_LIBRARY, DLL, EXECUTABLE };
|
enum BuildType {STATIC_LIBRARY, DLL, EXECUTABLE};
|
||||||
void SetBuildType(BuildType );
|
|
||||||
// return array of created DSP names
|
/**
|
||||||
// Each executable must have its own dsp
|
* Specify the type of the build: static, dll, or executable.
|
||||||
|
*/
|
||||||
|
void SetBuildType(BuildType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return array of created DSP names in a STL vector.
|
||||||
|
* Each executable must have its own dsp.
|
||||||
|
*/
|
||||||
std::vector<std::string> GetCreatedProjectNames()
|
std::vector<std::string> GetCreatedProjectNames()
|
||||||
{
|
{
|
||||||
return m_CreatedProjectNames;
|
return m_CreatedProjectNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the makefile.
|
||||||
|
*/
|
||||||
cmMakefile* GetMakefile()
|
cmMakefile* GetMakefile()
|
||||||
{
|
{
|
||||||
return m_Makefile;
|
return m_Makefile;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -63,7 +77,7 @@ private:
|
||||||
const char* source,
|
const char* source,
|
||||||
const char* result,
|
const char* result,
|
||||||
const char* command);
|
const char* command);
|
||||||
private:
|
|
||||||
std::string m_IncludeOptions;
|
std::string m_IncludeOptions;
|
||||||
std::string m_DebugLibraryOptions;
|
std::string m_DebugLibraryOptions;
|
||||||
std::string m_ReleaseLibraryOptions;
|
std::string m_ReleaseLibraryOptions;
|
||||||
|
|
|
@ -13,33 +13,47 @@
|
||||||
See COPYRIGHT.txt for copyright details.
|
See COPYRIGHT.txt for copyright details.
|
||||||
|
|
||||||
=========================================================================*/
|
=========================================================================*/
|
||||||
/**
|
|
||||||
* cmDSPMakefile generate a microsoft DSP project file.
|
|
||||||
* see the *.dsptemplate files for information on the templates
|
|
||||||
* used for making the project files.
|
|
||||||
*/
|
|
||||||
#ifndef cmDSPMakefile_h
|
#ifndef cmDSPMakefile_h
|
||||||
#define cmDSPMakefile_h
|
#define cmDSPMakefile_h
|
||||||
|
|
||||||
#include "cmStandardIncludes.h"
|
#include "cmStandardIncludes.h"
|
||||||
#include "cmMakefile.h"
|
#include "cmMakefile.h"
|
||||||
|
|
||||||
|
/** \class cmDSPMakefile
|
||||||
|
* \brief Generate a Microsoft DSP project file.
|
||||||
|
*
|
||||||
|
* cmDSPMakefile generates a Microsoft DSP project file.
|
||||||
|
* See the *.dsptemplate files for information on the templates
|
||||||
|
* used for making the project files.
|
||||||
|
*/
|
||||||
class cmDSPMakefile
|
class cmDSPMakefile
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cmDSPMakefile(cmMakefile*);
|
cmDSPMakefile(cmMakefile*);
|
||||||
~cmDSPMakefile();
|
~cmDSPMakefile();
|
||||||
void OutputDSPFile();
|
void OutputDSPFile();
|
||||||
enum BuildType { STATIC_LIBRARY, DLL, EXECUTABLE };
|
enum BuildType {STATIC_LIBRARY, DLL, EXECUTABLE};
|
||||||
void SetBuildType(BuildType );
|
|
||||||
// return array of created DSP names
|
/**
|
||||||
// Each executable must have its own dsp
|
* Specify the type of the build: static, dll, or executable.
|
||||||
|
*/
|
||||||
|
void SetBuildType(BuildType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return array of created DSP names in a STL vector.
|
||||||
|
* Each executable must have its own dsp.
|
||||||
|
*/
|
||||||
std::vector<std::string> GetCreatedProjectNames()
|
std::vector<std::string> GetCreatedProjectNames()
|
||||||
{
|
{
|
||||||
return m_CreatedProjectNames;
|
return m_CreatedProjectNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the makefile.
|
||||||
|
*/
|
||||||
cmMakefile* GetMakefile()
|
cmMakefile* GetMakefile()
|
||||||
{
|
{
|
||||||
return m_Makefile;
|
return m_Makefile;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -63,7 +77,7 @@ private:
|
||||||
const char* source,
|
const char* source,
|
||||||
const char* result,
|
const char* result,
|
||||||
const char* command);
|
const char* command);
|
||||||
private:
|
|
||||||
std::string m_IncludeOptions;
|
std::string m_IncludeOptions;
|
||||||
std::string m_DebugLibraryOptions;
|
std::string m_DebugLibraryOptions;
|
||||||
std::string m_ReleaseLibraryOptions;
|
std::string m_ReleaseLibraryOptions;
|
||||||
|
|
|
@ -19,13 +19,13 @@ public:
|
||||||
|
|
||||||
// This is the name used in the input file.
|
// This is the name used in the input file.
|
||||||
virtual const char* GetName() { return "EXECUTABLES";}
|
virtual const char* GetName() { return "EXECUTABLES";}
|
||||||
virtual const char* TerseDocumentaion()
|
virtual const char* TerseDocumentation()
|
||||||
{
|
{
|
||||||
return "Add a list of executables files.";
|
return "Add a list of executables files.";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return full documentation for the rule
|
// Return full documentation for the rule
|
||||||
virtual const char* FullDocumentaion()
|
virtual const char* FullDocumentation()
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
"EXECUTABLES(file1 file2 ...)";
|
"EXECUTABLES(file1 file2 ...)";
|
||||||
|
|
|
@ -20,13 +20,13 @@ public:
|
||||||
|
|
||||||
// This is the name used in the input file.
|
// This is the name used in the input file.
|
||||||
virtual const char* GetName() { return "FIND_INCLUDE";}
|
virtual const char* GetName() { return "FIND_INCLUDE";}
|
||||||
virtual const char* TerseDocumentaion()
|
virtual const char* TerseDocumentation()
|
||||||
{
|
{
|
||||||
return "Find an include path.";
|
return "Find an include path.";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return full documentation for the rule
|
// Return full documentation for the rule
|
||||||
virtual const char* FullDocumentaion()
|
virtual const char* FullDocumentation()
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
"FIND_INCLUDE(DEFINE try1 try2 ...);";
|
"FIND_INCLUDE(DEFINE try1 try2 ...);";
|
||||||
|
|
|
@ -20,13 +20,13 @@ public:
|
||||||
|
|
||||||
// This is the name used in the input file.
|
// This is the name used in the input file.
|
||||||
virtual const char* GetName() { return "FIND_LIBRARY";}
|
virtual const char* GetName() { return "FIND_LIBRARY";}
|
||||||
virtual const char* TerseDocumentaion()
|
virtual const char* TerseDocumentation()
|
||||||
{
|
{
|
||||||
return "Set a name for the entire project. One argument.";
|
return "Set a name for the entire project. One argument.";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return full documentation for the rule
|
// Return full documentation for the rule
|
||||||
virtual const char* FullDocumentaion()
|
virtual const char* FullDocumentation()
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
"FIND_LIBRARY(DEFINE try1 try2);";
|
"FIND_LIBRARY(DEFINE try1 try2);";
|
||||||
|
|
|
@ -20,13 +20,13 @@ public:
|
||||||
|
|
||||||
// This is the name used in the input file.
|
// This is the name used in the input file.
|
||||||
virtual const char* GetName() { return "FIND_PROGRARM";}
|
virtual const char* GetName() { return "FIND_PROGRARM";}
|
||||||
virtual const char* TerseDocumentaion()
|
virtual const char* TerseDocumentation()
|
||||||
{
|
{
|
||||||
return "not implemented.";
|
return "not implemented.";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return full documentation for the rule
|
// Return full documentation for the rule
|
||||||
virtual const char* FullDocumentaion()
|
virtual const char* FullDocumentation()
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
"not implemented.\n"
|
"not implemented.\n"
|
||||||
|
|
|
@ -20,13 +20,13 @@ public:
|
||||||
|
|
||||||
// This is the name used in the input file.
|
// This is the name used in the input file.
|
||||||
virtual const char* GetName() { return "INCLUDE_DIRECTORIES";}
|
virtual const char* GetName() { return "INCLUDE_DIRECTORIES";}
|
||||||
virtual const char* TerseDocumentaion()
|
virtual const char* TerseDocumentation()
|
||||||
{
|
{
|
||||||
return "Add include directories to the build.";
|
return "Add include directories to the build.";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return full documentation for the rule
|
// Return full documentation for the rule
|
||||||
virtual const char* FullDocumentaion()
|
virtual const char* FullDocumentation()
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
"INCLUDE_DIRECTORIES(dir1 dir2 ...).\n";
|
"INCLUDE_DIRECTORIES(dir1 dir2 ...).\n";
|
||||||
|
|
|
@ -19,13 +19,13 @@ public:
|
||||||
|
|
||||||
// This is the name used in the input file.
|
// This is the name used in the input file.
|
||||||
virtual const char* GetName() { return "LIBRARY";}
|
virtual const char* GetName() { return "LIBRARY";}
|
||||||
virtual const char* TerseDocumentaion()
|
virtual const char* TerseDocumentation()
|
||||||
{
|
{
|
||||||
return "Set a name for the Library.";
|
return "Set a name for the Library.";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return full documentation for the rule
|
// Return full documentation for the rule
|
||||||
virtual const char* FullDocumentaion()
|
virtual const char* FullDocumentation()
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
"LIBRARY(libraryname);";
|
"LIBRARY(libraryname);";
|
||||||
|
|
|
@ -21,13 +21,13 @@ public:
|
||||||
|
|
||||||
// This is the name used in the input file.
|
// This is the name used in the input file.
|
||||||
virtual const char* GetName() { return "LINK_DIRECTORIES";}
|
virtual const char* GetName() { return "LINK_DIRECTORIES";}
|
||||||
virtual const char* TerseDocumentaion()
|
virtual const char* TerseDocumentation()
|
||||||
{
|
{
|
||||||
return "Specify link directories.";
|
return "Specify link directories.";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return full documentation for the rule
|
// Return full documentation for the rule
|
||||||
virtual const char* FullDocumentaion()
|
virtual const char* FullDocumentation()
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
"Specify the paths to the libraries that will be linked in.\n"
|
"Specify the paths to the libraries that will be linked in.\n"
|
||||||
|
|
|
@ -21,7 +21,7 @@ public:
|
||||||
|
|
||||||
// This is the name used in the input file.
|
// This is the name used in the input file.
|
||||||
virtual const char* GetName() { return "LINK_LIBRARIES";}
|
virtual const char* GetName() { return "LINK_LIBRARIES";}
|
||||||
virtual const char* TerseDocumentaion()
|
virtual const char* TerseDocumentation()
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
"Specify a list of libraries to be linked into executables or \n"
|
"Specify a list of libraries to be linked into executables or \n"
|
||||||
|
@ -29,7 +29,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return full documentation for the rule
|
// Return full documentation for the rule
|
||||||
virtual const char* FullDocumentaion()
|
virtual const char* FullDocumentation()
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
"Specify a list of libraries to be linked into executables or \n"
|
"Specify a list of libraries to be linked into executables or \n"
|
||||||
|
|
|
@ -19,13 +19,13 @@ public:
|
||||||
|
|
||||||
// This is the name used in the input file.
|
// This is the name used in the input file.
|
||||||
virtual const char* GetName() { return "PROJECT";}
|
virtual const char* GetName() { return "PROJECT";}
|
||||||
virtual const char* TerseDocumentaion()
|
virtual const char* TerseDocumentation()
|
||||||
{
|
{
|
||||||
return "Set a name for the entire project. One argument.";
|
return "Set a name for the entire project. One argument.";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return full documentation for the rule
|
// Return full documentation for the rule
|
||||||
virtual const char* FullDocumentaion()
|
virtual const char* FullDocumentation()
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
"Set the name for the entire project. This takes one argument.\n"
|
"Set the name for the entire project. This takes one argument.\n"
|
||||||
|
|
|
@ -1,52 +1,129 @@
|
||||||
|
/*=========================================================================
|
||||||
|
|
||||||
|
Program: Insight Segmentation & Registration Toolkit
|
||||||
|
Module: $RCSfile$
|
||||||
|
Language: C++
|
||||||
|
Date: $Date$
|
||||||
|
Version: $Revision$
|
||||||
|
|
||||||
|
|
||||||
|
Copyright (c) 2000 National Library of Medicine
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
See COPYRIGHT.txt for copyright details.
|
||||||
|
|
||||||
|
=========================================================================*/
|
||||||
#ifndef cmRuleMaker_h
|
#ifndef cmRuleMaker_h
|
||||||
#define cmRuleMaker_h
|
#define cmRuleMaker_h
|
||||||
|
|
||||||
#include "cmStandardIncludes.h"
|
#include "cmStandardIncludes.h"
|
||||||
#include "cmMakefile.h"
|
#include "cmMakefile.h"
|
||||||
|
|
||||||
|
/** \class cmRuleMaker
|
||||||
|
* \brief Superclass for all rules in CMake.
|
||||||
|
*
|
||||||
|
* cmRuleMaker is the base class for all rules in CMake.
|
||||||
|
* cmRuleMaker defines the API for rules with such features
|
||||||
|
* as enable/disable, inheritance, documentation, and construction.
|
||||||
|
*/
|
||||||
class cmRuleMaker
|
class cmRuleMaker
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cmRuleMaker() { m_Makefile = 0; m_Enabled = true; }
|
/**
|
||||||
void SetMakefile(cmMakefile*m) {m_Makefile = m; }
|
* Construct the rule enabled with no makefile.
|
||||||
// This is called when the rule is firt encountered in
|
* the input file.
|
||||||
// the input file
|
*/
|
||||||
|
cmRuleMaker()
|
||||||
|
{m_Makefile = 0; m_Enabled = true;}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the makefile.
|
||||||
|
*/
|
||||||
|
void SetMakefile(cmMakefile*m)
|
||||||
|
{m_Makefile = m; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is called when the rule is first encountered in
|
||||||
|
* the CMakeLists.txt file.
|
||||||
|
*/
|
||||||
virtual bool Invoke(std::vector<std::string>& args) = 0;
|
virtual bool Invoke(std::vector<std::string>& args) = 0;
|
||||||
// This is called after the entire file has been parsed.
|
|
||||||
|
/**
|
||||||
|
* This is called at the end after all the information
|
||||||
|
* specified by the rules is accumulated.
|
||||||
|
*/
|
||||||
virtual void FinalPass() = 0;
|
virtual void FinalPass() = 0;
|
||||||
// This is called to let the rule check the cache
|
|
||||||
virtual void LoadCache() { }
|
/**
|
||||||
|
* This is called to let the rule check the cache.
|
||||||
|
*/
|
||||||
|
virtual void LoadCache() {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is a virtual constructor for the rule.
|
||||||
|
*/
|
||||||
virtual cmRuleMaker* Clone() = 0;
|
virtual cmRuleMaker* Clone() = 0;
|
||||||
|
|
||||||
// This determines if the rule gets passed down
|
/**
|
||||||
// to sub directory makefiles
|
* This determines if the rule gets propagated down
|
||||||
|
* to makefiles located in subdirectories.
|
||||||
|
*/
|
||||||
virtual bool IsInherited()
|
virtual bool IsInherited()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// This is the name used in the input file.
|
|
||||||
|
/**
|
||||||
|
* The name of the rule as specified in CMakeList.txt.
|
||||||
|
*/
|
||||||
virtual const char* GetName() = 0;
|
virtual const char* GetName() = 0;
|
||||||
// Return the terse documentaion for the rule
|
|
||||||
virtual const char* TerseDocumentaion() = 0;
|
/**
|
||||||
// Return full documentation for the rule
|
* Succinct documentation.
|
||||||
virtual const char* FullDocumentaion() = 0;
|
*/
|
||||||
// enable or disable this rule
|
virtual const char* TerseDocumentation() = 0;
|
||||||
bool GetEnabled() { return m_Enabled; }
|
|
||||||
void SetEnableOn() { m_Enabled = true; }
|
/**
|
||||||
void SetEnableOff() { m_Enabled = false; }
|
* More documentation.
|
||||||
const char* GetError() { return m_Error.c_str();}
|
*/
|
||||||
|
virtual const char* FullDocumentation() = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable the rule.
|
||||||
|
*/
|
||||||
|
void EnabledOn()
|
||||||
|
{m_Enabled = true;}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disable the rule.
|
||||||
|
*/
|
||||||
|
void EnabledOff()
|
||||||
|
{m_Enabled = false;}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Query whether the rule is enabled.
|
||||||
|
*/
|
||||||
|
bool GetEnabled()
|
||||||
|
{return m_Enabled;}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the last error string.
|
||||||
|
*/
|
||||||
|
const char* GetError()
|
||||||
|
{return m_Error.c_str();}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void SetError(const char* e)
|
void SetError(const char* e)
|
||||||
{
|
{
|
||||||
m_Error = this->GetName();
|
m_Error = this->GetName();
|
||||||
m_Error += " ";
|
m_Error += " ";
|
||||||
m_Error += e;
|
m_Error += e;
|
||||||
}
|
}
|
||||||
cmMakefile* m_Makefile;
|
cmMakefile* m_Makefile;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_Enabled;
|
bool m_Enabled;
|
||||||
std::string m_Error;
|
std::string m_Error;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -19,13 +19,13 @@ public:
|
||||||
|
|
||||||
// This is the name used in the input file.
|
// This is the name used in the input file.
|
||||||
virtual const char* GetName() { return "SOURCE_FILES_REQUIRE";}
|
virtual const char* GetName() { return "SOURCE_FILES_REQUIRE";}
|
||||||
virtual const char* TerseDocumentaion()
|
virtual const char* TerseDocumentation()
|
||||||
{
|
{
|
||||||
return "Add a list of source files.";
|
return "Add a list of source files.";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return full documentation for the rule
|
// Return full documentation for the rule
|
||||||
virtual const char* FullDocumentaion()
|
virtual const char* FullDocumentation()
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
"SOURCE_FILES(file1 file2 ...)";
|
"SOURCE_FILES(file1 file2 ...)";
|
||||||
|
|
|
@ -19,13 +19,13 @@ public:
|
||||||
|
|
||||||
// This is the name used in the input file.
|
// This is the name used in the input file.
|
||||||
virtual const char* GetName() { return "SOURCE_FILES";}
|
virtual const char* GetName() { return "SOURCE_FILES";}
|
||||||
virtual const char* TerseDocumentaion()
|
virtual const char* TerseDocumentation()
|
||||||
{
|
{
|
||||||
return "Add a list of source files.";
|
return "Add a list of source files.";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return full documentation for the rule
|
// Return full documentation for the rule
|
||||||
virtual const char* FullDocumentaion()
|
virtual const char* FullDocumentation()
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
"SOURCE_FILES(file1 file2 ...)";
|
"SOURCE_FILES(file1 file2 ...)";
|
||||||
|
|
|
@ -19,13 +19,13 @@ public:
|
||||||
|
|
||||||
// This is the name used in the input file.
|
// This is the name used in the input file.
|
||||||
virtual const char* GetName() { return "SUBDIRS";}
|
virtual const char* GetName() { return "SUBDIRS";}
|
||||||
virtual const char* TerseDocumentaion()
|
virtual const char* TerseDocumentation()
|
||||||
{
|
{
|
||||||
return "Add a list of subdirectories to the build.";
|
return "Add a list of subdirectories to the build.";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return full documentation for the rule
|
// Return full documentation for the rule
|
||||||
virtual const char* FullDocumentaion()
|
virtual const char* FullDocumentation()
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
"Add a list of subdirectories to the build.\n"
|
"Add a list of subdirectories to the build.\n"
|
||||||
|
|
|
@ -19,13 +19,13 @@ public:
|
||||||
|
|
||||||
// This is the name used in the input file.
|
// This is the name used in the input file.
|
||||||
virtual const char* GetName() { return "TESTS";}
|
virtual const char* GetName() { return "TESTS";}
|
||||||
virtual const char* TerseDocumentaion()
|
virtual const char* TerseDocumentation()
|
||||||
{
|
{
|
||||||
return "Add a list of executables files that are run as tests.";
|
return "Add a list of executables files that are run as tests.";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return full documentation for the rule
|
// Return full documentation for the rule
|
||||||
virtual const char* FullDocumentaion()
|
virtual const char* FullDocumentation()
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
"TESTS(file1 file2 ...)";
|
"TESTS(file1 file2 ...)";
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
cmUnixDefinesRule::cmUnixDefinesRule()
|
cmUnixDefinesRule::cmUnixDefinesRule()
|
||||||
{
|
{
|
||||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
this->SetEnableOff();
|
this->EnabledOff();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,13 +21,13 @@ public:
|
||||||
|
|
||||||
// This is the name used in the input file.
|
// This is the name used in the input file.
|
||||||
virtual const char* GetName() { return "UNIX_DEFINES";}
|
virtual const char* GetName() { return "UNIX_DEFINES";}
|
||||||
virtual const char* TerseDocumentaion()
|
virtual const char* TerseDocumentation()
|
||||||
{
|
{
|
||||||
return "Add -D flags to the command line for unix only.";
|
return "Add -D flags to the command line for unix only.";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return full documentation for the rule
|
// Return full documentation for the rule
|
||||||
virtual const char* FullDocumentaion()
|
virtual const char* FullDocumentation()
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
"Add -D flags to the command line for unix only.\n"
|
"Add -D flags to the command line for unix only.\n"
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
cmUnixLibrariesRule::cmUnixLibrariesRule()
|
cmUnixLibrariesRule::cmUnixLibrariesRule()
|
||||||
{
|
{
|
||||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
this->SetEnableOff();
|
this->EnabledOff();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,13 +21,13 @@ public:
|
||||||
|
|
||||||
// This is the name used in the input file.
|
// This is the name used in the input file.
|
||||||
virtual const char* GetName() { return "UNIX_LIBRARIES";}
|
virtual const char* GetName() { return "UNIX_LIBRARIES";}
|
||||||
virtual const char* TerseDocumentaion()
|
virtual const char* TerseDocumentation()
|
||||||
{
|
{
|
||||||
return "Add libraries that are only used for unix programs.";
|
return "Add libraries that are only used for unix programs.";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return full documentation for the rule
|
// Return full documentation for the rule
|
||||||
virtual const char* FullDocumentaion()
|
virtual const char* FullDocumentation()
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
"UNIX_LIBRARIES(library -lm ...);";
|
"UNIX_LIBRARIES(library -lm ...);";
|
||||||
|
|
|
@ -20,13 +20,13 @@ public:
|
||||||
virtual bool IsInherited() { return true; }
|
virtual bool IsInherited() { return true; }
|
||||||
// This is the name used in the input file.
|
// This is the name used in the input file.
|
||||||
virtual const char* GetName() { return "WIN32_DEFINES";}
|
virtual const char* GetName() { return "WIN32_DEFINES";}
|
||||||
virtual const char* TerseDocumentaion()
|
virtual const char* TerseDocumentation()
|
||||||
{
|
{
|
||||||
return "Add -D define flags to command line for win32 environments.";
|
return "Add -D define flags to command line for win32 environments.";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return full documentation for the rule
|
// Return full documentation for the rule
|
||||||
virtual const char* FullDocumentaion()
|
virtual const char* FullDocumentation()
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
"Add -D define flags to command line for win32 environments.\n"
|
"Add -D define flags to command line for win32 environments.\n"
|
||||||
|
|
|
@ -21,13 +21,13 @@ public:
|
||||||
|
|
||||||
// This is the name used in the input file.
|
// This is the name used in the input file.
|
||||||
virtual const char* GetName() { return "WIN32_LIBRARIES";}
|
virtual const char* GetName() { return "WIN32_LIBRARIES";}
|
||||||
virtual const char* TerseDocumentaion()
|
virtual const char* TerseDocumentation()
|
||||||
{
|
{
|
||||||
return "Set a name for the library to be built. One argument.";
|
return "Set a name for the library to be built. One argument.";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return full documentation for the rule
|
// Return full documentation for the rule
|
||||||
virtual const char* FullDocumentaion()
|
virtual const char* FullDocumentation()
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
"Set the name for the library in this makefile. \n"
|
"Set the name for the library in this makefile. \n"
|
||||||
|
|
Loading…
Reference in New Issue