Move the code for collecting targets and libraries into separate functions
Found bug: targets which don't link to anything don't get inserted in the dot file. Alex
This commit is contained in:
parent
f7d56df39e
commit
de2b2bf9ef
208
Source/cmake.cxx
208
Source/cmake.cxx
|
@ -2835,6 +2835,11 @@ const char* cmake::GetCPackCommand()
|
||||||
return this->CPackCommand.c_str();
|
return this->CPackCommand.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// for target deps
|
||||||
|
#define DOT_DEP_TARGET 1
|
||||||
|
#define DOT_DEP_EXTERNAL 2
|
||||||
|
#define DOT_DEP_NONE 0
|
||||||
|
|
||||||
void cmake::GenerateGraphViz(const char* fileName) const
|
void cmake::GenerateGraphViz(const char* fileName) const
|
||||||
{
|
{
|
||||||
cmGeneratedFileStream str(fileName);
|
cmGeneratedFileStream str(fileName);
|
||||||
|
@ -2904,90 +2909,17 @@ void cmake::GenerateGraphViz(const char* fileName) const
|
||||||
const cmGlobalGenerator* gg = this->GetGlobalGenerator();
|
const cmGlobalGenerator* gg = this->GetGlobalGenerator();
|
||||||
const std::vector<cmLocalGenerator*>& localGenerators =
|
const std::vector<cmLocalGenerator*>& localGenerators =
|
||||||
gg->GetLocalGenerators();
|
gg->GetLocalGenerators();
|
||||||
std::vector<cmLocalGenerator*>::const_iterator lit;
|
|
||||||
// for target deps
|
|
||||||
// 1 - cmake target
|
|
||||||
// 2 - external target
|
|
||||||
// 0 - no deps
|
|
||||||
std::map<cmStdString, int> targetDeps;
|
std::map<cmStdString, int> targetDeps;
|
||||||
std::map<cmStdString, const cmTarget*> targetPtrs;
|
std::map<cmStdString, const cmTarget*> targetPtrs;
|
||||||
std::map<cmStdString, cmStdString> targetNamesNodes;
|
std::map<cmStdString, cmStdString> targetNamesNodes; // maps from the actual strings to node names in dot
|
||||||
int cnt = 0;
|
int cnt = 0;
|
||||||
// First pass get the list of all cmake targets
|
cnt += getAllTargets(ignoreTargetsSet, targetNamesNodes, targetPtrs,
|
||||||
for ( lit = localGenerators.begin(); lit != localGenerators.end(); ++ lit )
|
graphNodePrefix);
|
||||||
{
|
|
||||||
const cmTargets* targets = &((*lit)->GetMakefile()->GetTargets());
|
cnt += getAllExternalLibs(ignoreTargetsSet, targetNamesNodes, targetPtrs,
|
||||||
for ( cmTargets::const_iterator tit = targets->begin();
|
targetDeps, graphNodePrefix);
|
||||||
tit != targets->end();
|
|
||||||
++ tit )
|
|
||||||
{
|
|
||||||
const char* realTargetName = tit->first.c_str();
|
|
||||||
if ( ignoreTargetsSet.find(realTargetName) != ignoreTargetsSet.end() )
|
|
||||||
{
|
|
||||||
// Skip ignored targets
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
//std::cout << "Found target: " << tit->first.c_str() << std::endl;
|
|
||||||
cmOStringStream ostr;
|
|
||||||
ostr << graphNodePrefix << cnt++;
|
|
||||||
targetNamesNodes[realTargetName] = ostr.str();
|
|
||||||
targetPtrs[realTargetName] = &tit->second;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ok, now find all the stuff we link to that is not in cmake
|
|
||||||
for ( lit = localGenerators.begin(); lit != localGenerators.end(); ++ lit )
|
|
||||||
{
|
|
||||||
const cmTargets* targets = &((*lit)->GetMakefile()->GetTargets());
|
|
||||||
for ( cmTargets::const_iterator tit = targets->begin();
|
|
||||||
tit != targets->end();
|
|
||||||
++ tit )
|
|
||||||
{
|
|
||||||
const cmTarget::LinkLibraryVectorType* ll =
|
|
||||||
&(tit->second.GetOriginalLinkLibraries());
|
|
||||||
const char* realTargetName = tit->first.c_str();
|
|
||||||
if ( ignoreTargetsSet.find(realTargetName) != ignoreTargetsSet.end() )
|
|
||||||
{
|
|
||||||
// Skip ignored targets
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if ( ll->size() > 0 )
|
|
||||||
{
|
|
||||||
targetDeps[realTargetName] = 1;
|
|
||||||
}
|
|
||||||
for (cmTarget::LinkLibraryVectorType::const_iterator llit = ll->begin();
|
|
||||||
llit != ll->end();
|
|
||||||
++ llit )
|
|
||||||
{
|
|
||||||
const char* libName = llit->first.c_str();
|
|
||||||
std::map<cmStdString, cmStdString>::const_iterator tarIt =
|
|
||||||
targetNamesNodes.find(libName);
|
|
||||||
if ( ignoreTargetsSet.find(libName) != ignoreTargetsSet.end() )
|
|
||||||
{
|
|
||||||
// Skip ignored targets
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if ( tarIt == targetNamesNodes.end() )
|
|
||||||
{
|
|
||||||
cmOStringStream ostr;
|
|
||||||
ostr << graphNodePrefix << cnt++;
|
|
||||||
targetDeps[libName] = 2;
|
|
||||||
targetNamesNodes[libName] = ostr.str();
|
|
||||||
//str << " \"" << ostr.c_str() << "\" [ label=\"" << libName
|
|
||||||
//<< "\" shape=\"ellipse\"];" << std::endl;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
std::map<cmStdString, int>::const_iterator depIt
|
|
||||||
= targetDeps.find(libName);
|
|
||||||
if ( depIt == targetDeps.end() )
|
|
||||||
{
|
|
||||||
targetDeps[libName] = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Write out nodes
|
// Write out nodes
|
||||||
for(std::map<cmStdString, int>::const_iterator depIt = targetDeps.begin();
|
for(std::map<cmStdString, int>::const_iterator depIt = targetDeps.begin();
|
||||||
|
@ -3008,7 +2940,7 @@ void cmake::GenerateGraphViz(const char* fileName) const
|
||||||
|
|
||||||
str << " \"" << tarIt->second.c_str() << "\" [ label=\""
|
str << " \"" << tarIt->second.c_str() << "\" [ label=\""
|
||||||
<< newTargetName << "\" shape=\"";
|
<< newTargetName << "\" shape=\"";
|
||||||
if ( depIt->second == 1 )
|
if ( depIt->second == DOT_DEP_TARGET )
|
||||||
{
|
{
|
||||||
std::map<cmStdString, const cmTarget*>::const_iterator tarTypeIt =
|
std::map<cmStdString, const cmTarget*>::const_iterator tarTypeIt =
|
||||||
targetPtrs.find(newTargetName);
|
targetPtrs.find(newTargetName);
|
||||||
|
@ -3047,7 +2979,10 @@ void cmake::GenerateGraphViz(const char* fileName) const
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now generate the connectivity
|
// Now generate the connectivity
|
||||||
for ( lit = localGenerators.begin(); lit != localGenerators.end(); ++ lit )
|
for ( std::vector<cmLocalGenerator*>::const_iterator lit =
|
||||||
|
localGenerators.begin();
|
||||||
|
lit != localGenerators.end();
|
||||||
|
++ lit )
|
||||||
{
|
{
|
||||||
const cmTargets* targets = &((*lit)->GetMakefile()->GetTargets());
|
const cmTargets* targets = &((*lit)->GetMakefile()->GetTargets());
|
||||||
for (cmTargets::const_iterator tit = targets->begin();
|
for (cmTargets::const_iterator tit = targets->begin();
|
||||||
|
@ -3092,6 +3027,115 @@ void cmake::GenerateGraphViz(const char* fileName) const
|
||||||
str << "}" << std::endl;
|
str << "}" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int cmake::getAllTargets(const std::set<cmStdString>& ignoreTargetsSet,
|
||||||
|
std::map<cmStdString, cmStdString>& targetNamesNodes,
|
||||||
|
std::map<cmStdString, const cmTarget*>& targetPtrs,
|
||||||
|
const char* graphNodePrefix) const
|
||||||
|
{
|
||||||
|
int cnt = 0;
|
||||||
|
const std::vector<cmLocalGenerator*>& localGenerators =
|
||||||
|
this->GetGlobalGenerator()->GetLocalGenerators();
|
||||||
|
// First pass get the list of all cmake targets
|
||||||
|
for (std::vector<cmLocalGenerator*>::const_iterator lit =
|
||||||
|
localGenerators.begin();
|
||||||
|
lit != localGenerators.end();
|
||||||
|
++ lit )
|
||||||
|
{
|
||||||
|
const cmTargets* targets = &((*lit)->GetMakefile()->GetTargets());
|
||||||
|
for ( cmTargets::const_iterator tit = targets->begin();
|
||||||
|
tit != targets->end();
|
||||||
|
++ tit )
|
||||||
|
{
|
||||||
|
const char* realTargetName = tit->first.c_str();
|
||||||
|
if ( ignoreTargetsSet.find(realTargetName) != ignoreTargetsSet.end() )
|
||||||
|
{
|
||||||
|
// Skip ignored targets
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//std::cout << "Found target: " << tit->first.c_str() << std::endl;
|
||||||
|
cmOStringStream ostr;
|
||||||
|
ostr << graphNodePrefix << cnt++;
|
||||||
|
targetNamesNodes[realTargetName] = ostr.str();
|
||||||
|
targetPtrs[realTargetName] = &tit->second;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return cnt;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int cmake::getAllExternalLibs(const std::set<cmStdString>& ignoreTargetsSet,
|
||||||
|
std::map<cmStdString, cmStdString>& targetNamesNodes,
|
||||||
|
std::map<cmStdString, const cmTarget*>& targetPtrs,
|
||||||
|
std::map<cmStdString, int>& targetDeps,
|
||||||
|
const char* graphNodePrefix) const
|
||||||
|
{
|
||||||
|
int cnt = 0;
|
||||||
|
|
||||||
|
const std::vector<cmLocalGenerator*>& localGenerators =
|
||||||
|
this->GetGlobalGenerator()->GetLocalGenerators();
|
||||||
|
// Ok, now find all the stuff we link to that is not in cmake
|
||||||
|
for (std::vector<cmLocalGenerator*>::const_iterator lit =
|
||||||
|
localGenerators.begin();
|
||||||
|
lit != localGenerators.end();
|
||||||
|
++ lit )
|
||||||
|
{
|
||||||
|
const cmTargets* targets = &((*lit)->GetMakefile()->GetTargets());
|
||||||
|
for ( cmTargets::const_iterator tit = targets->begin();
|
||||||
|
tit != targets->end();
|
||||||
|
++ tit )
|
||||||
|
{
|
||||||
|
const char* realTargetName = tit->first.c_str();
|
||||||
|
if ( ignoreTargetsSet.find(realTargetName) != ignoreTargetsSet.end() )
|
||||||
|
{
|
||||||
|
// Skip ignored targets
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
const cmTarget::LinkLibraryVectorType* ll =
|
||||||
|
&(tit->second.GetOriginalLinkLibraries());
|
||||||
|
if ( ll->size() > 0 )
|
||||||
|
{
|
||||||
|
targetDeps[realTargetName] = DOT_DEP_TARGET;
|
||||||
|
fprintf(stderr, " + %s\n", realTargetName);
|
||||||
|
}
|
||||||
|
for (cmTarget::LinkLibraryVectorType::const_iterator llit = ll->begin();
|
||||||
|
llit != ll->end();
|
||||||
|
++ llit )
|
||||||
|
{
|
||||||
|
const char* libName = llit->first.c_str();
|
||||||
|
if ( ignoreTargetsSet.find(libName) != ignoreTargetsSet.end() )
|
||||||
|
{
|
||||||
|
// Skip ignored targets
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::map<cmStdString, cmStdString>::const_iterator tarIt =
|
||||||
|
targetNamesNodes.find(libName);
|
||||||
|
if ( tarIt == targetNamesNodes.end() )
|
||||||
|
{
|
||||||
|
cmOStringStream ostr;
|
||||||
|
ostr << graphNodePrefix << cnt++;
|
||||||
|
targetDeps[libName] = DOT_DEP_EXTERNAL;
|
||||||
|
targetNamesNodes[libName] = ostr.str();
|
||||||
|
//str << " \"" << ostr.c_str() << "\" [ label=\"" << libName
|
||||||
|
//<< "\" shape=\"ellipse\"];" << std::endl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::map<cmStdString, int>::const_iterator depIt =
|
||||||
|
targetDeps.find(libName);
|
||||||
|
if ( depIt == targetDeps.end() )
|
||||||
|
{
|
||||||
|
targetDeps[libName] = DOT_DEP_TARGET;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return cnt;
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
int cmake::SymlinkLibrary(std::vector<std::string>& args)
|
int cmake::SymlinkLibrary(std::vector<std::string>& args)
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,14 +21,14 @@
|
||||||
// command line arguments.
|
// command line arguments.
|
||||||
// 3) Load the cache by calling LoadCache (duh)
|
// 3) Load the cache by calling LoadCache (duh)
|
||||||
// 4) if you are using command line arguments with -D or -C flags then
|
// 4) if you are using command line arguments with -D or -C flags then
|
||||||
// call SetCacheArgs (or if for some other reason you want to modify the
|
// call SetCacheArgs (or if for some other reason you want to modify the
|
||||||
// cache, do it now.
|
// cache, do it now.
|
||||||
// 5) Finally call Configure
|
// 5) Finally call Configure
|
||||||
// 6) Let the user change values and go back to step 5
|
// 6) Let the user change values and go back to step 5
|
||||||
// 7) call Generate
|
// 7) call Generate
|
||||||
//
|
//
|
||||||
// If your GUI allows the user to change the start & home directories then
|
// If your GUI allows the user to change the start & home directories then
|
||||||
// you must at a minimum redo steps 2 through 7.
|
// you must at a minimum redo steps 2 through 7.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
|
@ -50,6 +50,7 @@ class cmExternalMakefileProjectGenerator;
|
||||||
class cmDocumentationSection;
|
class cmDocumentationSection;
|
||||||
class cmPolicies;
|
class cmPolicies;
|
||||||
class cmListFileBacktrace;
|
class cmListFileBacktrace;
|
||||||
|
class cmTarget;
|
||||||
|
|
||||||
class cmake
|
class cmake
|
||||||
{
|
{
|
||||||
|
@ -73,14 +74,14 @@ class cmake
|
||||||
static const char *GetCMakeFilesDirectory() {return "/CMakeFiles";};
|
static const char *GetCMakeFilesDirectory() {return "/CMakeFiles";};
|
||||||
static const char *GetCMakeFilesDirectoryPostSlash() {
|
static const char *GetCMakeFilesDirectoryPostSlash() {
|
||||||
return "CMakeFiles/";};
|
return "CMakeFiles/";};
|
||||||
|
|
||||||
//@{
|
//@{
|
||||||
/**
|
/**
|
||||||
* Set/Get the home directory (or output directory) in the project. The
|
* Set/Get the home directory (or output directory) in the project. The
|
||||||
* home directory is the top directory of the project. It is where
|
* home directory is the top directory of the project. It is where
|
||||||
* cmake was run. Remember that CMake processes
|
* cmake was run. Remember that CMake processes
|
||||||
* CMakeLists files by recursing up the tree starting at the StartDirectory
|
* CMakeLists files by recursing up the tree starting at the StartDirectory
|
||||||
* and going up until it reaches the HomeDirectory.
|
* and going up until it reaches the HomeDirectory.
|
||||||
*/
|
*/
|
||||||
void SetHomeDirectory(const char* dir);
|
void SetHomeDirectory(const char* dir);
|
||||||
const char* GetHomeDirectory() const
|
const char* GetHomeDirectory() const
|
||||||
|
@ -100,9 +101,9 @@ class cmake
|
||||||
* is the directory of the CMakeLists.txt file that started the current
|
* is the directory of the CMakeLists.txt file that started the current
|
||||||
* round of processing. Remember that CMake processes CMakeLists files by
|
* round of processing. Remember that CMake processes CMakeLists files by
|
||||||
* recursing up the tree starting at the StartDirectory and going up until
|
* recursing up the tree starting at the StartDirectory and going up until
|
||||||
* it reaches the HomeDirectory.
|
* it reaches the HomeDirectory.
|
||||||
*/
|
*/
|
||||||
void SetStartDirectory(const char* dir)
|
void SetStartDirectory(const char* dir)
|
||||||
{
|
{
|
||||||
this->cmStartDirectory = dir;
|
this->cmStartDirectory = dir;
|
||||||
cmSystemTools::ConvertToUnixSlashes(this->cmStartDirectory);
|
cmSystemTools::ConvertToUnixSlashes(this->cmStartDirectory);
|
||||||
|
@ -158,7 +159,7 @@ class cmake
|
||||||
///! Return the global generator assigned to this instance of cmake
|
///! Return the global generator assigned to this instance of cmake
|
||||||
cmGlobalGenerator* GetGlobalGenerator() { return this->GlobalGenerator; }
|
cmGlobalGenerator* GetGlobalGenerator() { return this->GlobalGenerator; }
|
||||||
///! Return the global generator assigned to this instance of cmake, const
|
///! Return the global generator assigned to this instance of cmake, const
|
||||||
const cmGlobalGenerator* GetGlobalGenerator() const
|
const cmGlobalGenerator* GetGlobalGenerator() const
|
||||||
{ return this->GlobalGenerator; }
|
{ return this->GlobalGenerator; }
|
||||||
|
|
||||||
///! Return the global generator assigned to this instance of cmake
|
///! Return the global generator assigned to this instance of cmake
|
||||||
|
@ -169,25 +170,25 @@ class cmake
|
||||||
|
|
||||||
///! get the cmCachemManager used by this invocation of cmake
|
///! get the cmCachemManager used by this invocation of cmake
|
||||||
cmCacheManager *GetCacheManager() { return this->CacheManager; }
|
cmCacheManager *GetCacheManager() { return this->CacheManager; }
|
||||||
|
|
||||||
///! set the cmake command this instance of cmake should use
|
///! set the cmake command this instance of cmake should use
|
||||||
void SetCMakeCommand(const char* cmd) { this->CMakeCommand = cmd; }
|
void SetCMakeCommand(const char* cmd) { this->CMakeCommand = cmd; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Given a variable name, return its value (as a string).
|
* Given a variable name, return its value (as a string).
|
||||||
*/
|
*/
|
||||||
const char* GetCacheDefinition(const char*) const;
|
const char* GetCacheDefinition(const char*) const;
|
||||||
///! Add an entry into the cache
|
///! Add an entry into the cache
|
||||||
void AddCacheEntry(const char* key, const char* value,
|
void AddCacheEntry(const char* key, const char* value,
|
||||||
const char* helpString,
|
const char* helpString,
|
||||||
int type);
|
int type);
|
||||||
/**
|
/**
|
||||||
* Execute commands during the build process. Supports options such
|
* Execute commands during the build process. Supports options such
|
||||||
* as echo, remove file etc.
|
* as echo, remove file etc.
|
||||||
*/
|
*/
|
||||||
static int ExecuteCMakeCommand(std::vector<std::string>&);
|
static int ExecuteCMakeCommand(std::vector<std::string>&);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the system information and write it to the file specified
|
* Get the system information and write it to the file specified
|
||||||
*/
|
*/
|
||||||
int GetSystemInformation(std::vector<std::string>&);
|
int GetSystemInformation(std::vector<std::string>&);
|
||||||
|
@ -210,16 +211,16 @@ class cmake
|
||||||
|
|
||||||
/** Check if a command exists. */
|
/** Check if a command exists. */
|
||||||
bool CommandExists(const char* name) const;
|
bool CommandExists(const char* name) const;
|
||||||
|
|
||||||
///! Parse command line arguments
|
///! Parse command line arguments
|
||||||
void SetArgs(const std::vector<std::string>&);
|
void SetArgs(const std::vector<std::string>&);
|
||||||
|
|
||||||
///! Is this cmake running as a result of a TRY_COMPILE command
|
///! Is this cmake running as a result of a TRY_COMPILE command
|
||||||
bool GetIsInTryCompile() { return this->InTryCompile; }
|
bool GetIsInTryCompile() { return this->InTryCompile; }
|
||||||
|
|
||||||
///! Is this cmake running as a result of a TRY_COMPILE command
|
///! Is this cmake running as a result of a TRY_COMPILE command
|
||||||
void SetIsInTryCompile(bool i) { this->InTryCompile = i; }
|
void SetIsInTryCompile(bool i) { this->InTryCompile = i; }
|
||||||
|
|
||||||
///! Parse command line arguments that might set cache values
|
///! Parse command line arguments that might set cache values
|
||||||
bool SetCacheArgs(const std::vector<std::string>&);
|
bool SetCacheArgs(const std::vector<std::string>&);
|
||||||
|
|
||||||
|
@ -227,9 +228,9 @@ class cmake
|
||||||
(const char*msg, float progress, void *);
|
(const char*msg, float progress, void *);
|
||||||
/**
|
/**
|
||||||
* Set the function used by GUI's to receive progress updates
|
* Set the function used by GUI's to receive progress updates
|
||||||
* Function gets passed: message as a const char*, a progress
|
* Function gets passed: message as a const char*, a progress
|
||||||
* amount ranging from 0 to 1.0 and client data. The progress
|
* amount ranging from 0 to 1.0 and client data. The progress
|
||||||
* number provided may be negative in cases where a message is
|
* number provided may be negative in cases where a message is
|
||||||
* to be displayed without any progress percentage.
|
* to be displayed without any progress percentage.
|
||||||
*/
|
*/
|
||||||
void SetProgressCallback(ProgressCallbackType f, void* clientData=0);
|
void SetProgressCallback(ProgressCallbackType f, void* clientData=0);
|
||||||
|
@ -244,14 +245,14 @@ class cmake
|
||||||
cmVariableWatch* GetVariableWatch() { return this->VariableWatch; }
|
cmVariableWatch* GetVariableWatch() { return this->VariableWatch; }
|
||||||
|
|
||||||
/** Get the documentation entries for the supported commands.
|
/** Get the documentation entries for the supported commands.
|
||||||
* If withCurrentCommands is true, the documentation for the
|
* If withCurrentCommands is true, the documentation for the
|
||||||
* recommended set of commands is included.
|
* recommended set of commands is included.
|
||||||
* If withCompatCommands is true, the documentation for discouraged
|
* If withCompatCommands is true, the documentation for discouraged
|
||||||
* (compatibility) commands is included.
|
* (compatibility) commands is included.
|
||||||
* You probably don't want to set both to false.
|
* You probably don't want to set both to false.
|
||||||
*/
|
*/
|
||||||
void GetCommandDocumentation(std::vector<cmDocumentationEntry>& entries,
|
void GetCommandDocumentation(std::vector<cmDocumentationEntry>& entries,
|
||||||
bool withCurrentCommands = true,
|
bool withCurrentCommands = true,
|
||||||
bool withCompatCommands = true) const;
|
bool withCompatCommands = true) const;
|
||||||
void GetPropertiesDocumentation(std::map<std::string,
|
void GetPropertiesDocumentation(std::map<std::string,
|
||||||
cmDocumentationSection *>&);
|
cmDocumentationSection *>&);
|
||||||
|
@ -278,7 +279,7 @@ class cmake
|
||||||
*/
|
*/
|
||||||
void SetScriptMode(bool mode) { this->ScriptMode = mode; }
|
void SetScriptMode(bool mode) { this->ScriptMode = mode; }
|
||||||
bool GetScriptMode() { return this->ScriptMode; }
|
bool GetScriptMode() { return this->ScriptMode; }
|
||||||
|
|
||||||
///! Debug the try compile stuff by not delelting the files
|
///! Debug the try compile stuff by not delelting the files
|
||||||
bool GetDebugTryCompile(){return this->DebugTryCompile;}
|
bool GetDebugTryCompile(){return this->DebugTryCompile;}
|
||||||
void DebugTryCompileOn(){this->DebugTryCompile = true;}
|
void DebugTryCompileOn(){this->DebugTryCompile = true;}
|
||||||
|
@ -310,7 +311,7 @@ class cmake
|
||||||
void DefineProperty(const char *name, cmProperty::ScopeType scope,
|
void DefineProperty(const char *name, cmProperty::ScopeType scope,
|
||||||
const char *ShortDescription,
|
const char *ShortDescription,
|
||||||
const char *FullDescription,
|
const char *FullDescription,
|
||||||
bool chain = false,
|
bool chain = false,
|
||||||
const char *variableGroup = 0);
|
const char *variableGroup = 0);
|
||||||
|
|
||||||
// get property definition
|
// get property definition
|
||||||
|
@ -338,7 +339,7 @@ class cmake
|
||||||
}
|
}
|
||||||
void SetSuppressDevWarnings(bool v)
|
void SetSuppressDevWarnings(bool v)
|
||||||
{
|
{
|
||||||
this->SuppressDevWarnings = v;
|
this->SuppressDevWarnings = v;
|
||||||
this->DoSuppressDevWarnings = true;
|
this->DoSuppressDevWarnings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -357,10 +358,10 @@ protected:
|
||||||
cmPropertyMap Properties;
|
cmPropertyMap Properties;
|
||||||
std::set<std::pair<cmStdString,cmProperty::ScopeType> > AccessedProperties;
|
std::set<std::pair<cmStdString,cmProperty::ScopeType> > AccessedProperties;
|
||||||
|
|
||||||
std::map<cmProperty::ScopeType, cmPropertyDefinitionMap>
|
std::map<cmProperty::ScopeType, cmPropertyDefinitionMap>
|
||||||
PropertyDefinitions;
|
PropertyDefinitions;
|
||||||
|
|
||||||
typedef
|
typedef
|
||||||
cmExternalMakefileProjectGenerator* (*CreateExtraGeneratorFunctionType)();
|
cmExternalMakefileProjectGenerator* (*CreateExtraGeneratorFunctionType)();
|
||||||
typedef std::map<cmStdString,
|
typedef std::map<cmStdString,
|
||||||
CreateExtraGeneratorFunctionType> RegisteredExtraGeneratorsMap;
|
CreateExtraGeneratorFunctionType> RegisteredExtraGeneratorsMap;
|
||||||
|
@ -374,15 +375,15 @@ protected:
|
||||||
void AddDefaultCommands();
|
void AddDefaultCommands();
|
||||||
void AddDefaultGenerators();
|
void AddDefaultGenerators();
|
||||||
void AddDefaultExtraGenerators();
|
void AddDefaultExtraGenerators();
|
||||||
void AddExtraGenerator(const char* name,
|
void AddExtraGenerator(const char* name,
|
||||||
CreateExtraGeneratorFunctionType newFunction);
|
CreateExtraGeneratorFunctionType newFunction);
|
||||||
|
|
||||||
cmPolicies *Policies;
|
cmPolicies *Policies;
|
||||||
cmGlobalGenerator *GlobalGenerator;
|
cmGlobalGenerator *GlobalGenerator;
|
||||||
cmCacheManager *CacheManager;
|
cmCacheManager *CacheManager;
|
||||||
std::string cmHomeDirectory;
|
std::string cmHomeDirectory;
|
||||||
std::string HomeOutputDirectory;
|
std::string HomeOutputDirectory;
|
||||||
std::string cmStartDirectory;
|
std::string cmStartDirectory;
|
||||||
std::string StartOutputDirectory;
|
std::string StartOutputDirectory;
|
||||||
bool SuppressDevWarnings;
|
bool SuppressDevWarnings;
|
||||||
bool DoSuppressDevWarnings;
|
bool DoSuppressDevWarnings;
|
||||||
|
@ -393,7 +394,7 @@ protected:
|
||||||
///! Check if CMAKE_CACHEFILE_DIR is set. If it is not, delete the log file.
|
///! Check if CMAKE_CACHEFILE_DIR is set. If it is not, delete the log file.
|
||||||
/// If it is set, truncate it to 50kb
|
/// If it is set, truncate it to 50kb
|
||||||
void TruncateOutputLog(const char* fname);
|
void TruncateOutputLog(const char* fname);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method called to check build system integrity at build time.
|
* Method called to check build system integrity at build time.
|
||||||
* Returns 1 if CMake should rerun and 0 otherwise.
|
* Returns 1 if CMake should rerun and 0 otherwise.
|
||||||
|
@ -416,24 +417,35 @@ protected:
|
||||||
static int ExecuteLinkScript(std::vector<std::string>& args);
|
static int ExecuteLinkScript(std::vector<std::string>& args);
|
||||||
static int VisualStudioLink(std::vector<std::string>& args, int type);
|
static int VisualStudioLink(std::vector<std::string>& args, int type);
|
||||||
static int VisualStudioLinkIncremental(std::vector<std::string>& args,
|
static int VisualStudioLinkIncremental(std::vector<std::string>& args,
|
||||||
int type,
|
int type,
|
||||||
bool verbose);
|
bool verbose);
|
||||||
static int VisualStudioLinkNonIncremental(std::vector<std::string>& args,
|
static int VisualStudioLinkNonIncremental(std::vector<std::string>& args,
|
||||||
int type,
|
int type,
|
||||||
bool hasManifest,
|
bool hasManifest,
|
||||||
bool verbose);
|
bool verbose);
|
||||||
static int ParseVisualStudioLinkCommand(std::vector<std::string>& args,
|
static int ParseVisualStudioLinkCommand(std::vector<std::string>& args,
|
||||||
std::vector<cmStdString>& command,
|
std::vector<cmStdString>& command,
|
||||||
std::string& targetName);
|
std::string& targetName);
|
||||||
static bool RunCommand(const char* comment,
|
static bool RunCommand(const char* comment,
|
||||||
std::vector<cmStdString>& command,
|
std::vector<cmStdString>& command,
|
||||||
bool verbose,
|
bool verbose,
|
||||||
int* retCodeOut = 0);
|
int* retCodeOut = 0);
|
||||||
cmVariableWatch* VariableWatch;
|
cmVariableWatch* VariableWatch;
|
||||||
|
|
||||||
|
int getAllTargets(const std::set<cmStdString>& ignoreTargetsSet,
|
||||||
|
std::map<cmStdString, cmStdString>& targetNamesNodes,
|
||||||
|
std::map<cmStdString, const cmTarget*>& targetPtrs,
|
||||||
|
const char* graphNodePrefix) const;
|
||||||
|
|
||||||
|
int getAllExternalLibs(const std::set<cmStdString>& ignoreTargetsSet,
|
||||||
|
std::map<cmStdString, cmStdString>& targetNamesNodes,
|
||||||
|
std::map<cmStdString, const cmTarget*>& targetPtrs,
|
||||||
|
std::map<cmStdString, int>& targetDeps,
|
||||||
|
const char* graphNodePrefix) const;
|
||||||
|
|
||||||
///! Find the full path to one of the cmake programs like ctest, cpack, etc.
|
///! Find the full path to one of the cmake programs like ctest, cpack, etc.
|
||||||
std::string FindCMakeProgram(const char* name) const;
|
std::string FindCMakeProgram(const char* name) const;
|
||||||
private:
|
private:
|
||||||
cmake(const cmake&); // Not implemented.
|
cmake(const cmake&); // Not implemented.
|
||||||
void operator=(const cmake&); // Not implemented.
|
void operator=(const cmake&); // Not implemented.
|
||||||
ProgressCallbackType ProgressCallback;
|
ProgressCallbackType ProgressCallback;
|
||||||
|
@ -458,7 +470,7 @@ private:
|
||||||
cmFileTimeComparison* FileComparison;
|
cmFileTimeComparison* FileComparison;
|
||||||
std::string GraphVizFile;
|
std::string GraphVizFile;
|
||||||
std::vector<std::string> DebugConfigs;
|
std::vector<std::string> DebugConfigs;
|
||||||
|
|
||||||
void UpdateConversionPathTable();
|
void UpdateConversionPathTable();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue