2001-05-18 19:25:08 +00:00
|
|
|
/*=========================================================================
|
|
|
|
|
2002-10-23 22:03:27 +00:00
|
|
|
Program: CMake - Cross-Platform Makefile Generator
|
2001-05-18 19:25:08 +00:00
|
|
|
Module: $RCSfile$
|
|
|
|
Language: C++
|
|
|
|
Date: $Date$
|
|
|
|
Version: $Revision$
|
|
|
|
|
2002-10-23 22:03:27 +00:00
|
|
|
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
|
|
|
|
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
|
2002-01-21 20:30:43 +00:00
|
|
|
|
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even
|
|
|
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
PURPOSE. See the above copyright notices for more information.
|
2001-05-18 19:25:08 +00:00
|
|
|
|
|
|
|
=========================================================================*/
|
2002-08-28 18:51:10 +00:00
|
|
|
// This class represents a cmake invocation. It is the top level class when
|
|
|
|
// running cmake. Most cmake based GUIS should primarily create an instance
|
|
|
|
// of this class and communicate with it.
|
2002-09-17 18:12:03 +00:00
|
|
|
//
|
|
|
|
// The basic process for a GUI is as follows:
|
|
|
|
//
|
|
|
|
// 1) Create a cmake instance
|
|
|
|
// 2) Set the Home & Start directories, generator, and cmake command. this
|
|
|
|
// can be done using the Set methods or by using SetArgs and passing in
|
|
|
|
// command line arguments.
|
|
|
|
// 3) Load the cache by calling LoadCache (duh)
|
|
|
|
// 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
|
|
|
|
// cache, do it now.
|
|
|
|
// 5) Finally call Configure
|
|
|
|
// 6) Let the user change values and go back to step 5
|
|
|
|
// 7) call Generate
|
|
|
|
//
|
|
|
|
// If your GUI allows the user to change the start & home directories then
|
|
|
|
// you must at a minimum redo steps 2 through 7.
|
|
|
|
//
|
|
|
|
|
2001-05-18 19:25:08 +00:00
|
|
|
|
2004-10-04 16:31:09 +00:00
|
|
|
#ifndef cmake_h
|
|
|
|
#define cmake_h
|
|
|
|
|
2002-09-06 17:06:23 +00:00
|
|
|
#include "cmSystemTools.h"
|
2006-12-07 14:45:32 +00:00
|
|
|
#include "cmPropertyDefinitionMap.h"
|
|
|
|
#include "cmPropertyMap.h"
|
2002-09-06 17:06:23 +00:00
|
|
|
|
|
|
|
class cmGlobalGenerator;
|
|
|
|
class cmLocalGenerator;
|
|
|
|
class cmCacheManager;
|
|
|
|
class cmMakefile;
|
2002-09-10 20:51:29 +00:00
|
|
|
class cmCommand;
|
2003-01-08 17:59:52 +00:00
|
|
|
class cmVariableWatch;
|
2005-10-12 17:51:15 +00:00
|
|
|
class cmFileTimeComparison;
|
2007-06-08 15:57:16 +00:00
|
|
|
class cmExternalMakefileProjectGenerator;
|
2001-05-18 19:25:08 +00:00
|
|
|
|
2002-08-23 20:13:34 +00:00
|
|
|
class cmake
|
2001-05-18 19:25:08 +00:00
|
|
|
{
|
|
|
|
public:
|
2003-08-04 00:47:44 +00:00
|
|
|
typedef std::map<cmStdString, cmCommand*> RegisteredCommandsMap;
|
|
|
|
|
2002-09-06 17:06:23 +00:00
|
|
|
///! construct an instance of cmake
|
|
|
|
cmake();
|
|
|
|
///! destruct an instance of cmake
|
|
|
|
~cmake();
|
2001-05-18 19:25:08 +00:00
|
|
|
|
2006-06-14 16:28:32 +00:00
|
|
|
///! construct an instance of cmake
|
|
|
|
static const char *GetCMakeFilesDirectory() {return "/CMakeFiles";};
|
2006-06-15 15:51:51 +00:00
|
|
|
static const char *GetCMakeFilesDirectoryPostSlash() {
|
|
|
|
return "CMakeFiles/";};
|
2006-06-14 16:28:32 +00:00
|
|
|
|
2002-09-06 17:06:23 +00:00
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
* Set/Get the home directory (or output directory) in the project. The
|
|
|
|
* home directory is the top directory of the project. It is where
|
|
|
|
* cmake was run. Remember that CMake processes
|
|
|
|
* CMakeLists files by recursing up the tree starting at the StartDirectory
|
|
|
|
* and going up until it reaches the HomeDirectory.
|
|
|
|
*/
|
|
|
|
void SetHomeDirectory(const char* dir);
|
|
|
|
const char* GetHomeDirectory() const
|
|
|
|
{
|
2006-03-15 16:02:08 +00:00
|
|
|
return this->cmHomeDirectory.c_str();
|
2002-09-06 17:06:23 +00:00
|
|
|
}
|
|
|
|
void SetHomeOutputDirectory(const char* lib);
|
|
|
|
const char* GetHomeOutputDirectory() const
|
|
|
|
{
|
2006-03-15 16:02:08 +00:00
|
|
|
return this->HomeOutputDirectory.c_str();
|
2002-09-06 17:06:23 +00:00
|
|
|
}
|
|
|
|
//@}
|
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
* Set/Get the start directory (or output directory). The start directory
|
|
|
|
* is the directory of the CMakeLists.txt file that started the current
|
|
|
|
* round of processing. Remember that CMake processes CMakeLists files by
|
|
|
|
* recursing up the tree starting at the StartDirectory and going up until
|
|
|
|
* it reaches the HomeDirectory.
|
|
|
|
*/
|
|
|
|
void SetStartDirectory(const char* dir)
|
|
|
|
{
|
2006-03-15 16:02:08 +00:00
|
|
|
this->cmStartDirectory = dir;
|
|
|
|
cmSystemTools::ConvertToUnixSlashes(this->cmStartDirectory);
|
2002-09-06 17:06:23 +00:00
|
|
|
}
|
|
|
|
const char* GetStartDirectory() const
|
|
|
|
{
|
2006-03-15 16:02:08 +00:00
|
|
|
return this->cmStartDirectory.c_str();
|
2002-09-06 17:06:23 +00:00
|
|
|
}
|
|
|
|
void SetStartOutputDirectory(const char* lib)
|
|
|
|
{
|
2006-03-15 16:02:08 +00:00
|
|
|
this->StartOutputDirectory = lib;
|
|
|
|
cmSystemTools::ConvertToUnixSlashes(this->StartOutputDirectory);
|
2002-09-06 17:06:23 +00:00
|
|
|
}
|
|
|
|
const char* GetStartOutputDirectory() const
|
|
|
|
{
|
2006-03-15 16:02:08 +00:00
|
|
|
return this->StartOutputDirectory.c_str();
|
2002-09-06 17:06:23 +00:00
|
|
|
}
|
|
|
|
//@}
|
|
|
|
|
2002-09-10 20:51:29 +00:00
|
|
|
/**
|
|
|
|
* Dump documentation to a file. If 0 is returned, the
|
|
|
|
* operation failed.
|
|
|
|
*/
|
|
|
|
int DumpDocumentationToFile(std::ostream&);
|
|
|
|
|
2002-09-06 17:06:23 +00:00
|
|
|
/**
|
|
|
|
* Handle a command line invocation of cmake.
|
|
|
|
*/
|
2003-04-29 14:04:05 +00:00
|
|
|
int Run(const std::vector<std::string>&args)
|
2003-04-30 11:32:30 +00:00
|
|
|
{ return this->Run(args, false); }
|
2003-04-29 14:04:05 +00:00
|
|
|
int Run(const std::vector<std::string>&args, bool noconfigure);
|
2001-05-18 19:25:08 +00:00
|
|
|
|
|
|
|
/**
|
2007-05-28 16:23:32 +00:00
|
|
|
* Run the global generator Generate step.
|
2001-05-18 19:25:08 +00:00
|
|
|
*/
|
2002-09-06 17:06:23 +00:00
|
|
|
int Generate();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Configure the cmMakefiles. This routine will create a GlobalGenerator if
|
|
|
|
* one has not already been set. It will then Call Configure on the
|
|
|
|
* GlobalGenerator. This in turn will read in an process all the CMakeList
|
|
|
|
* files for the tree. It will not produce any actual Makefiles, or
|
|
|
|
* workspaces. Generate does that. */
|
2002-09-17 17:59:58 +00:00
|
|
|
int Configure();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Configure the cmMakefiles. This routine will create a GlobalGenerator if
|
|
|
|
* one has not already been set. It will then Call Configure on the
|
|
|
|
* GlobalGenerator. This in turn will read in an process all the CMakeList
|
|
|
|
* files for the tree. It will not produce any actual Makefiles, or
|
|
|
|
* workspaces. Generate does that. */
|
2002-11-07 14:04:20 +00:00
|
|
|
int LoadCache();
|
2004-08-17 19:36:08 +00:00
|
|
|
void PreLoadCMakeFiles();
|
2002-09-06 17:06:23 +00:00
|
|
|
|
|
|
|
///! Create a GlobalGenerator
|
|
|
|
cmGlobalGenerator* CreateGlobalGenerator(const char* name);
|
|
|
|
|
|
|
|
///! Return the global generator assigned to this instance of cmake
|
2007-06-15 14:10:24 +00:00
|
|
|
cmGlobalGenerator* GetGlobalGenerator() { return this->GlobalGenerator; }
|
|
|
|
///! Return the global generator assigned to this instance of cmake, const
|
|
|
|
const cmGlobalGenerator* GetGlobalGenerator() const
|
|
|
|
{ return this->GlobalGenerator; }
|
2002-09-06 17:06:23 +00:00
|
|
|
|
|
|
|
///! Return the global generator assigned to this instance of cmake
|
|
|
|
void SetGlobalGenerator(cmGlobalGenerator *);
|
|
|
|
|
|
|
|
///! Get the names of the current registered generators
|
|
|
|
void GetRegisteredGenerators(std::vector<std::string>& names);
|
|
|
|
|
|
|
|
///! get the cmCachemManager used by this invocation of cmake
|
2006-03-15 16:02:08 +00:00
|
|
|
cmCacheManager *GetCacheManager() { return this->CacheManager; }
|
2002-09-06 17:06:23 +00:00
|
|
|
|
2002-09-17 17:59:58 +00:00
|
|
|
///! set the cmake command this instance of cmake should use
|
2006-03-15 16:02:08 +00:00
|
|
|
void SetCMakeCommand(const char* cmd) { this->CMakeCommand = cmd; }
|
2002-09-17 17:59:58 +00:00
|
|
|
|
2002-09-06 17:06:23 +00:00
|
|
|
/**
|
|
|
|
* Given a variable name, return its value (as a string).
|
|
|
|
*/
|
|
|
|
const char* GetCacheDefinition(const char*) const;
|
2002-12-04 15:57:22 +00:00
|
|
|
///! Add an entry into the cache
|
|
|
|
void AddCacheEntry(const char* key, const char* value,
|
|
|
|
const char* helpString,
|
|
|
|
int type);
|
2002-06-03 17:08:52 +00:00
|
|
|
/**
|
|
|
|
* Execute commands during the build process. Supports options such
|
|
|
|
* as echo, remove file etc.
|
|
|
|
*/
|
2006-03-15 16:02:08 +00:00
|
|
|
static int ExecuteCMakeCommand(std::vector<std::string>&);
|
2002-06-03 17:08:52 +00:00
|
|
|
|
2007-02-27 15:10:10 +00:00
|
|
|
/**
|
|
|
|
* Get the system information and write it to the file specified
|
|
|
|
*/
|
|
|
|
int GetSystemInformation(std::vector<std::string>&);
|
|
|
|
|
2002-09-10 20:51:29 +00:00
|
|
|
/**
|
|
|
|
* Add a command to this cmake instance
|
|
|
|
*/
|
|
|
|
void AddCommand(cmCommand* );
|
2005-06-14 16:48:59 +00:00
|
|
|
void RenameCommand(const char* oldName, const char* newName);
|
2007-06-12 14:56:40 +00:00
|
|
|
void RemoveCommand(const char* name);
|
2002-09-10 20:51:29 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get a command by its name
|
|
|
|
*/
|
|
|
|
cmCommand *GetCommand(const char *name);
|
|
|
|
|
2003-08-04 00:47:44 +00:00
|
|
|
/** Get list of all commands */
|
2006-03-15 16:02:08 +00:00
|
|
|
RegisteredCommandsMap* GetCommands() { return &this->Commands; }
|
2003-08-04 00:47:44 +00:00
|
|
|
|
2002-09-10 20:51:29 +00:00
|
|
|
/** Check if a command exists. */
|
|
|
|
bool CommandExists(const char* name) const;
|
|
|
|
|
2001-11-20 22:51:03 +00:00
|
|
|
///! Parse command line arguments
|
2002-09-06 17:06:23 +00:00
|
|
|
void SetArgs(const std::vector<std::string>&);
|
|
|
|
|
2002-09-12 15:08:06 +00:00
|
|
|
///! Is this cmake running as a result of a TRY_COMPILE command
|
2006-03-15 16:02:08 +00:00
|
|
|
bool GetIsInTryCompile() { return this->InTryCompile; }
|
2002-09-12 15:08:06 +00:00
|
|
|
|
|
|
|
///! Is this cmake running as a result of a TRY_COMPILE command
|
2006-03-15 16:02:08 +00:00
|
|
|
void SetIsInTryCompile(bool i) { this->InTryCompile = i; }
|
2002-09-12 15:08:06 +00:00
|
|
|
|
2002-09-17 17:59:58 +00:00
|
|
|
///! Parse command line arguments that might set cache values
|
2003-10-29 14:45:26 +00:00
|
|
|
bool SetCacheArgs(const std::vector<std::string>&);
|
2002-09-13 17:48:14 +00:00
|
|
|
|
2006-03-15 16:02:08 +00:00
|
|
|
typedef void (*ProgressCallbackType)
|
|
|
|
(const char*msg, float progress, void *);
|
2002-09-26 19:14:20 +00:00
|
|
|
/**
|
|
|
|
* Set the function used by GUI's to receive progress updates
|
|
|
|
* Function gets passed: message as a const char*, a progress
|
|
|
|
* amount ranging from 0 to 1.0 and client data. The progress
|
|
|
|
* number provided may be negative in cases where a message is
|
|
|
|
* to be displayed without any progress percentage.
|
|
|
|
*/
|
2006-03-15 16:02:08 +00:00
|
|
|
void SetProgressCallback(ProgressCallbackType f, void* clientData=0);
|
2002-09-26 19:14:20 +00:00
|
|
|
|
|
|
|
///! this is called by generators to update the progress
|
|
|
|
void UpdateProgress(const char *msg, float prog);
|
|
|
|
|
2003-01-08 17:59:52 +00:00
|
|
|
|
|
|
|
///! Get the variable watch object
|
2006-03-15 16:02:08 +00:00
|
|
|
cmVariableWatch* GetVariableWatch() { return this->VariableWatch; }
|
2003-01-08 17:59:52 +00:00
|
|
|
|
2007-06-22 12:44:51 +00:00
|
|
|
/** Get the documentation entries for the supported commands.
|
|
|
|
* If withCurrentCommands is true, the documentation for the
|
|
|
|
* recommended set of commands is included.
|
|
|
|
* If withCompatCommands is true, the documentation for discouraged
|
|
|
|
* (compatibility) commands is included.
|
|
|
|
* You probably don't want to set both to false.
|
|
|
|
*/
|
|
|
|
void GetCommandDocumentation(std::vector<cmDocumentationEntry>& entries,
|
|
|
|
bool withCurrentCommands = true,
|
|
|
|
bool withCompatCommands = true) const;
|
2007-07-11 19:53:58 +00:00
|
|
|
void GetPropertiesDocumentation(std::vector<cmDocumentationEntry>&,
|
|
|
|
cmProperty::ScopeType type);
|
2003-07-08 01:52:10 +00:00
|
|
|
void GetGeneratorDocumentation(std::vector<cmDocumentationEntry>&);
|
2003-05-29 15:14:05 +00:00
|
|
|
|
2006-12-07 14:45:32 +00:00
|
|
|
///! Set/Get a property of this target file
|
|
|
|
void SetProperty(const char *prop, const char *value);
|
|
|
|
const char *GetProperty(const char *prop);
|
|
|
|
const char *GetProperty(const char *prop, cmProperty::ScopeType scope);
|
|
|
|
bool GetPropertyAsBool(const char *prop);
|
|
|
|
|
|
|
|
// Get the properties
|
|
|
|
cmPropertyMap &GetProperties() { return this->Properties; };
|
|
|
|
|
2003-05-29 15:14:05 +00:00
|
|
|
///! Do all the checks before running configure
|
|
|
|
int DoPreConfigureChecks();
|
2003-10-29 14:45:26 +00:00
|
|
|
|
|
|
|
/**
|
2006-05-12 18:36:39 +00:00
|
|
|
* Set and get the script mode option. In script mode there is no
|
|
|
|
* generator and no cache. Also, language are not enabled, so
|
|
|
|
* add_executable and things do not do anything.
|
2003-10-29 14:45:26 +00:00
|
|
|
*/
|
2006-03-15 16:02:08 +00:00
|
|
|
void SetScriptMode(bool mode) { this->ScriptMode = mode; }
|
|
|
|
bool GetScriptMode() { return this->ScriptMode; }
|
2003-02-14 15:53:37 +00:00
|
|
|
|
2003-12-23 20:01:10 +00:00
|
|
|
///! Debug the try compile stuff by not delelting the files
|
2006-03-15 16:02:08 +00:00
|
|
|
bool GetDebugTryCompile(){return this->DebugTryCompile;}
|
|
|
|
void DebugTryCompileOn(){this->DebugTryCompile = true;}
|
2004-04-18 18:41:46 +00:00
|
|
|
|
|
|
|
///! Get the list of files written by CMake using FILE(WRITE / WRITE_FILE
|
|
|
|
void AddWrittenFile(const char* file);
|
|
|
|
bool HasWrittenFile(const char* file);
|
2004-04-26 15:23:06 +00:00
|
|
|
void CleanupWrittenFiles();
|
2004-04-18 18:41:46 +00:00
|
|
|
|
2005-05-02 19:51:12 +00:00
|
|
|
/**
|
|
|
|
* Generate CMAKE_ROOT and CMAKE_COMMAND cache entries
|
|
|
|
*/
|
|
|
|
int AddCMakePaths(const char *arg0);
|
|
|
|
|
2005-10-12 17:51:15 +00:00
|
|
|
/**
|
|
|
|
* Get the file comparison class
|
|
|
|
*/
|
2006-03-15 16:02:08 +00:00
|
|
|
cmFileTimeComparison* GetFileComparison() { return this->FileComparison; }
|
2005-10-12 17:51:15 +00:00
|
|
|
|
2006-02-23 15:00:44 +00:00
|
|
|
/**
|
|
|
|
* Get the path to ctest
|
|
|
|
*/
|
|
|
|
const char* GetCTestCommand();
|
|
|
|
const char* GetCPackCommand();
|
2007-06-15 14:10:24 +00:00
|
|
|
const char* GetCMakeCommand() const { return this->CMakeCommand.c_str(); }
|
2006-02-23 15:00:44 +00:00
|
|
|
|
2006-10-06 15:11:59 +00:00
|
|
|
// Do we want debug output during the cmake run.
|
|
|
|
bool GetDebugOutput() { return this->DebugOutput; }
|
|
|
|
void DebugOutputOn() { this->DebugOutput = true;}
|
2006-10-30 20:59:54 +00:00
|
|
|
|
2006-12-07 14:45:32 +00:00
|
|
|
// Define a property
|
|
|
|
void DefineProperty(const char *name, cmProperty::ScopeType scope,
|
|
|
|
const char *ShortDescription,
|
|
|
|
const char *FullDescription,
|
|
|
|
bool chain = false);
|
|
|
|
|
|
|
|
// Is a property defined?
|
|
|
|
bool IsPropertyDefined(const char *name, cmProperty::ScopeType scope);
|
|
|
|
bool IsPropertyChained(const char *name, cmProperty::ScopeType scope);
|
|
|
|
|
2007-06-26 17:05:27 +00:00
|
|
|
// Define the properties
|
|
|
|
static void DefineProperties(cmake *cm);
|
|
|
|
|
2002-09-06 17:06:23 +00:00
|
|
|
protected:
|
2006-12-07 14:45:32 +00:00
|
|
|
cmPropertyMap Properties;
|
2007-06-25 14:34:21 +00:00
|
|
|
|
|
|
|
std::map<cmProperty::ScopeType, cmPropertyDefinitionMap>
|
|
|
|
PropertyDefinitions;
|
2007-06-08 15:57:16 +00:00
|
|
|
|
|
|
|
typedef
|
|
|
|
cmExternalMakefileProjectGenerator* (*CreateExtraGeneratorFunctionType)();
|
|
|
|
typedef std::map<cmStdString,
|
|
|
|
CreateExtraGeneratorFunctionType> RegisteredExtraGeneratorsMap;
|
|
|
|
|
2003-07-08 01:52:10 +00:00
|
|
|
typedef cmGlobalGenerator* (*CreateGeneratorFunctionType)();
|
2006-03-10 16:13:15 +00:00
|
|
|
typedef std::map<cmStdString,
|
|
|
|
CreateGeneratorFunctionType> RegisteredGeneratorsMap;
|
2006-03-15 16:02:08 +00:00
|
|
|
RegisteredCommandsMap Commands;
|
|
|
|
RegisteredGeneratorsMap Generators;
|
2007-06-08 15:57:16 +00:00
|
|
|
RegisteredExtraGeneratorsMap ExtraGenerators;
|
2002-09-10 20:51:29 +00:00
|
|
|
void AddDefaultCommands();
|
2003-07-08 01:52:10 +00:00
|
|
|
void AddDefaultGenerators();
|
2007-06-08 15:57:16 +00:00
|
|
|
void AddDefaultExtraGenerators();
|
2007-07-20 12:36:16 +00:00
|
|
|
void AddExtraGenerator(const char* name,
|
|
|
|
CreateExtraGeneratorFunctionType newFunction);
|
2002-09-10 20:51:29 +00:00
|
|
|
|
2006-03-15 16:02:08 +00:00
|
|
|
cmGlobalGenerator *GlobalGenerator;
|
|
|
|
cmCacheManager *CacheManager;
|
|
|
|
std::string cmHomeDirectory;
|
|
|
|
std::string HomeOutputDirectory;
|
|
|
|
std::string cmStartDirectory;
|
|
|
|
std::string StartOutputDirectory;
|
2002-09-06 17:06:23 +00:00
|
|
|
|
2006-03-15 16:02:08 +00:00
|
|
|
std::set<cmStdString> WrittenFiles;
|
2004-04-18 18:41:46 +00:00
|
|
|
|
2002-11-13 20:20:20 +00:00
|
|
|
///! return true if the same cmake was used to make the cache.
|
|
|
|
bool CacheVersionMatches();
|
2002-09-06 17:06:23 +00:00
|
|
|
///! read in a cmake list file to initialize the cache
|
|
|
|
void ReadListFile(const char *path);
|
2005-07-03 02:25:43 +00:00
|
|
|
|
|
|
|
///! Check if CMAKE_CACHEFILE_DIR is set. If it is not, delete the log file.
|
|
|
|
/// If it is set, truncate it to 50kb
|
|
|
|
void TruncateOutputLog(const char* fname);
|
2002-09-06 17:06:23 +00:00
|
|
|
|
2004-10-29 20:50:46 +00:00
|
|
|
/**
|
|
|
|
* Method called to check build system integrity at build time.
|
|
|
|
* Returns 1 if CMake should rerun and 0 otherwise.
|
|
|
|
*/
|
|
|
|
int CheckBuildSystem();
|
2002-08-28 18:51:10 +00:00
|
|
|
|
2003-08-05 20:36:15 +00:00
|
|
|
void SetDirectoriesFromFile(const char* arg);
|
2005-06-16 18:56:15 +00:00
|
|
|
|
2006-05-12 18:36:39 +00:00
|
|
|
//! Make sure all commands are what they say they are and there is no
|
|
|
|
//macros.
|
2005-06-16 18:56:15 +00:00
|
|
|
void CleanupCommandsAndMacros();
|
2006-03-03 19:24:31 +00:00
|
|
|
|
2007-06-15 14:10:24 +00:00
|
|
|
void GenerateGraphViz(const char* fileName) const;
|
2006-04-27 01:31:39 +00:00
|
|
|
|
|
|
|
static int ExecuteEchoColor(std::vector<std::string>& args);
|
2006-06-15 20:17:11 +00:00
|
|
|
static int ExecuteLinkScript(std::vector<std::string>& args);
|
2003-08-05 20:36:15 +00:00
|
|
|
|
2006-03-15 16:02:08 +00:00
|
|
|
cmVariableWatch* VariableWatch;
|
2006-10-06 15:11:59 +00:00
|
|
|
|
2007-06-15 14:10:24 +00:00
|
|
|
///! Find the full path to one of the cmake programs like ctest, cpack, etc.
|
|
|
|
std::string FindCMakeProgram(const char* name) const;
|
2001-09-06 21:28:24 +00:00
|
|
|
private:
|
2006-03-15 16:02:08 +00:00
|
|
|
ProgressCallbackType ProgressCallback;
|
|
|
|
void* ProgressCallbackClientData;
|
|
|
|
bool Verbose;
|
|
|
|
bool InTryCompile;
|
|
|
|
bool ScriptMode;
|
2006-10-06 15:11:59 +00:00
|
|
|
bool DebugOutput;
|
2006-03-15 16:02:08 +00:00
|
|
|
std::string CMakeCommand;
|
|
|
|
std::string CXXEnvironment;
|
|
|
|
std::string CCEnvironment;
|
|
|
|
std::string CheckBuildSystemArgument;
|
|
|
|
std::string CTestCommand;
|
|
|
|
std::string CPackCommand;
|
|
|
|
bool ClearBuildSystem;
|
|
|
|
bool DebugTryCompile;
|
|
|
|
cmFileTimeComparison* FileComparison;
|
|
|
|
std::string GraphVizFile;
|
2004-10-04 16:31:09 +00:00
|
|
|
|
|
|
|
void UpdateConversionPathTable();
|
2001-05-18 19:25:08 +00:00
|
|
|
};
|
|
|
|
|
2003-04-03 03:48:12 +00:00
|
|
|
#define CMAKE_STANDARD_OPTIONS_TABLE \
|
2005-09-21 17:31:43 +00:00
|
|
|
{"-C <initial-cache>", "Pre-load a script to populate the cache.", \
|
2003-04-03 03:48:12 +00:00
|
|
|
"When cmake is first run in an empty build tree, it creates a " \
|
|
|
|
"CMakeCache.txt file and populates it with customizable settings " \
|
|
|
|
"for the project. This option may be used to specify a file from " \
|
|
|
|
"which to load cache entries before the first pass through " \
|
|
|
|
"the project's cmake listfiles. The loaded entries take priority " \
|
2005-09-21 17:31:43 +00:00
|
|
|
"over the project's default values. The given file should be a CMake " \
|
|
|
|
"script containing SET commands that use the CACHE option, " \
|
|
|
|
"not a cache-format file."}, \
|
2005-07-19 21:16:23 +00:00
|
|
|
{"-D <var>:<type>=<value>", "Create a cmake cache entry.", \
|
2003-04-03 03:48:12 +00:00
|
|
|
"When cmake is first run in an empty build tree, it creates a " \
|
|
|
|
"CMakeCache.txt file and populates it with customizable settings " \
|
|
|
|
"for the project. This option may be used to specify a setting " \
|
|
|
|
"that takes priority over the project's default value. The option " \
|
|
|
|
"may be repeated for as many cache entries as desired."}, \
|
2007-06-04 17:48:11 +00:00
|
|
|
{"-U <globbing_expr>", "Remove matching entries from CMake cache.", \
|
2007-06-01 18:16:46 +00:00
|
|
|
"This option may be used to remove one or more variables from the " \
|
2007-06-04 17:48:11 +00:00
|
|
|
"CMakeCache.txt file, globbing expressions using * and ? are supported. "\
|
|
|
|
"The option may be repeated for as many cache entries as desired.\n" \
|
|
|
|
"Use with care, you can make your CMakeCache.txt non-working."}, \
|
2005-07-19 21:16:23 +00:00
|
|
|
{"-G <generator-name>", "Specify a makefile generator.", \
|
2003-04-03 03:48:12 +00:00
|
|
|
"CMake may support multiple native build systems on certain platforms. " \
|
|
|
|
"A makefile generator is responsible for generating a particular build " \
|
2003-07-11 03:22:09 +00:00
|
|
|
"system. Possible generator names are specified in the Generators " \
|
|
|
|
"section."}
|
2003-07-11 03:14:49 +00:00
|
|
|
|
|
|
|
#define CMAKE_STANDARD_INTRODUCTION \
|
|
|
|
{0, \
|
|
|
|
"CMake is a cross-platform build system generator. Projects " \
|
|
|
|
"specify their build process with platform-independent CMake listfiles " \
|
2006-05-12 18:36:39 +00:00
|
|
|
"included in each directory of a source tree with the name " \
|
|
|
|
"CMakeLists.txt. " \
|
2003-07-11 03:14:49 +00:00
|
|
|
"Users build a project by using CMake to generate a build system " \
|
|
|
|
"for a native tool on their platform.", 0}
|
2003-12-23 20:01:10 +00:00
|
|
|
#endif
|