2009-09-28 15:43:28 +00:00
|
|
|
/*============================================================================
|
|
|
|
CMake - Cross Platform Makefile Generator
|
|
|
|
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
2001-05-18 19:25:08 +00:00
|
|
|
|
2009-09-28 15:43:28 +00:00
|
|
|
Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
see accompanying file Copyright.txt for details.
|
2001-05-18 19:25:08 +00:00
|
|
|
|
2009-09-28 15:43:28 +00:00
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
See the License for more information.
|
|
|
|
============================================================================*/
|
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
|
|
|
|
2012-11-19 14:48:33 +00:00
|
|
|
class cmGlobalGeneratorFactory;
|
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;
|
2007-10-22 16:49:09 +00:00
|
|
|
class cmDocumentationSection;
|
2008-03-01 20:20:35 +00:00
|
|
|
class cmPolicies;
|
2008-03-13 17:48:57 +00:00
|
|
|
class cmListFileBacktrace;
|
2010-10-31 14:58:18 +00:00
|
|
|
class cmTarget;
|
2010-10-31 16:40:46 +00:00
|
|
|
class cmGeneratedFileStream;
|
2001-05-18 19:25:08 +00:00
|
|
|
|
2012-02-28 12:44:54 +00:00
|
|
|
/** \brief Represents a cmake invocation.
|
|
|
|
*
|
|
|
|
* This class represents a cmake invocation. It is the top level class when
|
2012-11-07 16:13:09 +00:00
|
|
|
* running cmake. Most cmake based GUIs should primarily create an instance
|
2012-02-28 12:44:54 +00:00
|
|
|
* of this class and communicate with it.
|
|
|
|
*
|
|
|
|
* The basic process for a GUI is as follows:
|
|
|
|
*
|
|
|
|
* -# Create a cmake instance
|
|
|
|
* -# 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.
|
|
|
|
* -# Load the cache by calling LoadCache (duh)
|
|
|
|
* -# 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.
|
|
|
|
* -# Finally call Configure
|
|
|
|
* -# Let the user change values and go back to step 5
|
|
|
|
* -# 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.
|
|
|
|
*/
|
|
|
|
|
2002-08-23 20:13:34 +00:00
|
|
|
class cmake
|
2001-05-18 19:25:08 +00:00
|
|
|
{
|
|
|
|
public:
|
2008-03-11 14:29:56 +00:00
|
|
|
enum MessageType
|
|
|
|
{ AUTHOR_WARNING,
|
|
|
|
FATAL_ERROR,
|
2008-03-13 01:06:32 +00:00
|
|
|
INTERNAL_ERROR,
|
2008-03-11 14:29:56 +00:00
|
|
|
MESSAGE,
|
|
|
|
WARNING,
|
2013-09-17 16:54:34 +00:00
|
|
|
LOG,
|
|
|
|
DEPRECATION_ERROR,
|
|
|
|
DEPRECATION_WARNING
|
2008-03-11 14:29:56 +00:00
|
|
|
};
|
2011-07-13 16:59:51 +00:00
|
|
|
|
|
|
|
|
2012-02-25 22:21:39 +00:00
|
|
|
/** \brief Describes the working modes of cmake */
|
2011-07-13 16:59:51 +00:00
|
|
|
enum WorkingMode
|
|
|
|
{
|
2012-02-25 22:21:39 +00:00
|
|
|
NORMAL_MODE, ///< Cmake runs to create project files
|
|
|
|
/** \brief Script mode (started by using -P).
|
|
|
|
*
|
|
|
|
* In script mode there is no generator and no cache. Also,
|
|
|
|
* languages are not enabled, so add_executable and things do
|
|
|
|
* nothing.
|
|
|
|
*/
|
2011-07-13 16:59:51 +00:00
|
|
|
SCRIPT_MODE,
|
2012-02-25 22:21:39 +00:00
|
|
|
/** \brief A pkg-config like mode
|
|
|
|
*
|
|
|
|
* In this mode cmake just searches for a package and prints the results to
|
|
|
|
* stdout. This is similar to SCRIPT_MODE, but commands like add_library()
|
|
|
|
* work too, since they may be used e.g. in exported target files. Started
|
|
|
|
* via --find-package.
|
|
|
|
*/
|
2011-07-13 16:59:51 +00:00
|
|
|
FIND_PACKAGE_MODE
|
|
|
|
};
|
2003-08-04 00:47:44 +00:00
|
|
|
typedef std::map<cmStdString, cmCommand*> RegisteredCommandsMap;
|
|
|
|
|
2012-02-25 22:36:38 +00:00
|
|
|
/// Default constructor
|
2002-09-06 17:06:23 +00:00
|
|
|
cmake();
|
2012-02-25 22:36:38 +00:00
|
|
|
/// Destructor
|
2002-09-06 17:06:23 +00:00
|
|
|
~cmake();
|
2001-05-18 19:25:08 +00:00
|
|
|
|
2006-06-14 16:28:32 +00:00
|
|
|
static const char *GetCMakeFilesDirectory() {return "/CMakeFiles";};
|
2006-06-15 15:51:51 +00:00
|
|
|
static const char *GetCMakeFilesDirectoryPostSlash() {
|
|
|
|
return "CMakeFiles/";};
|
2010-10-31 14:58:18 +00:00
|
|
|
|
2002-09-06 17:06:23 +00:00
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
* Set/Get the home directory (or output directory) in the project. The
|
2012-03-19 22:05:21 +00:00
|
|
|
* home directory is the top directory of the project. It is the
|
|
|
|
* path-to-source cmake was run with. Remember that CMake processes
|
2002-09-06 17:06:23 +00:00
|
|
|
* CMakeLists files by recursing up the tree starting at the StartDirectory
|
2010-10-31 14:58:18 +00:00
|
|
|
* and going up until it reaches the HomeDirectory.
|
2002-09-06 17:06:23 +00:00
|
|
|
*/
|
|
|
|
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
|
2010-10-31 14:58:18 +00:00
|
|
|
* it reaches the HomeDirectory.
|
2002-09-06 17:06:23 +00:00
|
|
|
*/
|
2010-10-31 14:58:18 +00:00
|
|
|
void SetStartDirectory(const char* dir)
|
2002-09-06 17:06:23 +00:00
|
|
|
{
|
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
|
|
|
}
|
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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();
|
2007-12-13 20:54:29 +00:00
|
|
|
int ActualConfigure();
|
2002-09-17 17:59:58 +00:00
|
|
|
|
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
|
2010-10-31 14:58:18 +00:00
|
|
|
const cmGlobalGenerator* GetGlobalGenerator() const
|
2007-06-15 14:10:24 +00:00
|
|
|
{ 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);
|
|
|
|
|
2012-12-10 15:42:33 +00:00
|
|
|
///! Set the name of the selected generator-specific toolset.
|
|
|
|
void SetGeneratorToolset(std::string const& ts)
|
|
|
|
{ this->GeneratorToolset = ts; }
|
|
|
|
|
|
|
|
///! Get the name of the selected generator-specific toolset.
|
|
|
|
std::string const& GetGeneratorToolset() const
|
|
|
|
{ return this->GeneratorToolset; }
|
|
|
|
|
2002-09-06 17:06:23 +00:00
|
|
|
///! get the cmCachemManager used by this invocation of cmake
|
2006-03-15 16:02:08 +00:00
|
|
|
cmCacheManager *GetCacheManager() { return this->CacheManager; }
|
2010-10-31 14:58:18 +00:00
|
|
|
|
2002-09-06 17:06:23 +00:00
|
|
|
/**
|
|
|
|
* Given a variable name, return its value (as a string).
|
|
|
|
*/
|
2014-02-04 21:06:56 +00:00
|
|
|
const char* GetCacheDefinition(const std::string&) const;
|
2002-12-04 15:57:22 +00:00
|
|
|
///! Add an entry into the cache
|
2014-02-04 21:06:56 +00:00
|
|
|
void AddCacheEntry(const std::string& key, const char* value,
|
2010-10-31 14:58:18 +00:00
|
|
|
const char* helpString,
|
2002-12-04 15:57:22 +00:00
|
|
|
int type);
|
2002-06-03 17:08:52 +00:00
|
|
|
|
2010-10-31 14:58:18 +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);
|
2007-07-27 12:59:59 +00:00
|
|
|
void RemoveUnscriptableCommands();
|
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;
|
2010-10-31 14:58:18 +00:00
|
|
|
|
2001-11-20 22:51:03 +00:00
|
|
|
///! Parse command line arguments
|
2010-10-06 19:00:52 +00:00
|
|
|
void SetArgs(const std::vector<std::string>&,
|
|
|
|
bool directoriesSetBefore = false);
|
2002-09-06 17:06:23 +00:00
|
|
|
|
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; }
|
2010-10-31 14:58:18 +00:00
|
|
|
|
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; }
|
2010-10-31 14:58:18 +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
|
|
|
/**
|
2012-11-07 16:13:09 +00:00
|
|
|
* Set the function used by GUIs to receive progress updates
|
2010-10-31 14:58:18 +00:00
|
|
|
* Function gets passed: message as a const char*, a progress
|
2002-09-26 19:14:20 +00:00
|
|
|
* amount ranging from 0 to 1.0 and client data. The progress
|
2010-10-31 14:58:18 +00:00
|
|
|
* number provided may be negative in cases where a message is
|
2002-09-26 19:14:20 +00:00
|
|
|
* 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);
|
|
|
|
|
2008-03-01 20:20:35 +00:00
|
|
|
///! get the cmake policies instance
|
|
|
|
cmPolicies *GetPolicies() {return this->Policies;} ;
|
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
|
|
|
|
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
|
2013-09-02 20:27:32 +00:00
|
|
|
void SetProperty(const std::string& prop, const char *value);
|
|
|
|
void AppendProperty(const std::string& prop,
|
|
|
|
const char *value,bool asString=false);
|
|
|
|
const char *GetProperty(const std::string& prop);
|
|
|
|
const char *GetProperty(const std::string& prop,
|
|
|
|
cmProperty::ScopeType scope);
|
|
|
|
bool GetPropertyAsBool(const std::string& prop);
|
2006-12-07 14:45:32 +00:00
|
|
|
|
|
|
|
// 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
|
|
|
|
2011-07-13 16:59:51 +00:00
|
|
|
void SetWorkingMode(WorkingMode mode) { this->CurrentWorkingMode = mode; }
|
|
|
|
WorkingMode GetWorkingMode() { return this->CurrentWorkingMode; }
|
2010-10-31 14:58:18 +00:00
|
|
|
|
2012-03-19 22:05:21 +00:00
|
|
|
///! Debug the try compile stuff by not deleting 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
|
|
|
|
2005-05-02 19:51:12 +00:00
|
|
|
/**
|
|
|
|
* Generate CMAKE_ROOT and CMAKE_COMMAND cache entries
|
|
|
|
*/
|
2007-12-13 22:56:50 +00:00
|
|
|
int AddCMakePaths();
|
2005-05-02 19:51:12 +00:00
|
|
|
|
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-10-06 15:11:59 +00:00
|
|
|
// Do we want debug output during the cmake run.
|
|
|
|
bool GetDebugOutput() { return this->DebugOutput; }
|
2008-04-02 21:29:25 +00:00
|
|
|
void SetDebugOutputOn(bool b) { this->DebugOutput = b;}
|
2006-10-30 20:59:54 +00:00
|
|
|
|
2008-07-31 14:33:25 +00:00
|
|
|
// Do we want trace output during the cmake run.
|
|
|
|
bool GetTrace() { return this->Trace;}
|
|
|
|
void SetTrace(bool b) { this->Trace = b;}
|
2010-08-25 16:35:40 +00:00
|
|
|
bool GetWarnUninitialized() { return this->WarnUninitialized;}
|
|
|
|
void SetWarnUninitialized(bool b) { this->WarnUninitialized = b;}
|
2010-08-25 16:36:21 +00:00
|
|
|
bool GetWarnUnused() { return this->WarnUnused;}
|
|
|
|
void SetWarnUnused(bool b) { this->WarnUnused = b;}
|
2010-09-01 14:22:08 +00:00
|
|
|
bool GetWarnUnusedCli() { return this->WarnUnusedCli;}
|
|
|
|
void SetWarnUnusedCli(bool b) { this->WarnUnusedCli = b;}
|
2010-09-01 15:24:20 +00:00
|
|
|
bool GetCheckSystemVars() { return this->CheckSystemVars;}
|
|
|
|
void SetCheckSystemVars(bool b) { this->CheckSystemVars = b;}
|
2010-09-01 14:22:08 +00:00
|
|
|
|
|
|
|
void MarkCliAsUsed(const std::string& variable);
|
|
|
|
|
2006-12-07 14:45:32 +00:00
|
|
|
// Define a property
|
2013-09-02 20:27:32 +00:00
|
|
|
void DefineProperty(const std::string& name, cmProperty::ScopeType scope,
|
2006-12-07 14:45:32 +00:00
|
|
|
const char *ShortDescription,
|
|
|
|
const char *FullDescription,
|
2013-09-17 13:08:58 +00:00
|
|
|
bool chain = false);
|
2006-12-07 14:45:32 +00:00
|
|
|
|
2007-10-24 18:43:10 +00:00
|
|
|
// get property definition
|
|
|
|
cmPropertyDefinition *GetPropertyDefinition
|
2013-09-02 20:27:32 +00:00
|
|
|
(const std::string& name, cmProperty::ScopeType scope);
|
2007-10-24 18:43:10 +00:00
|
|
|
|
2006-12-07 14:45:32 +00:00
|
|
|
// Is a property defined?
|
2013-09-02 20:27:32 +00:00
|
|
|
bool IsPropertyDefined(const std::string& name, cmProperty::ScopeType scope);
|
|
|
|
bool IsPropertyChained(const std::string& name, cmProperty::ScopeType scope);
|
2006-12-07 14:45:32 +00:00
|
|
|
|
2008-09-04 21:34:25 +00:00
|
|
|
/** Get the list of configurations (in upper case) considered to be
|
|
|
|
debugging configurations.*/
|
|
|
|
std::vector<std::string> const& GetDebugConfigs();
|
|
|
|
|
2013-11-07 20:30:59 +00:00
|
|
|
void SetCMakeEditCommand(std::string const& s)
|
2013-11-12 13:44:08 +00:00
|
|
|
{ this->CMakeEditCommand = s; }
|
|
|
|
std::string const& GetCMakeEditCommand() const
|
|
|
|
{ return this->CMakeEditCommand; }
|
|
|
|
|
2008-03-12 02:50:35 +00:00
|
|
|
void SetSuppressDevWarnings(bool v)
|
|
|
|
{
|
2010-10-31 14:58:18 +00:00
|
|
|
this->SuppressDevWarnings = v;
|
2008-03-29 17:16:02 +00:00
|
|
|
this->DoSuppressDevWarnings = true;
|
2008-03-12 02:50:35 +00:00
|
|
|
}
|
2008-03-13 17:48:57 +00:00
|
|
|
|
|
|
|
/** Display a message to the user. */
|
|
|
|
void IssueMessage(cmake::MessageType t, std::string const& text,
|
|
|
|
cmListFileBacktrace const& backtrace);
|
2012-03-19 22:05:21 +00:00
|
|
|
///! run the --build option
|
2008-10-15 17:56:07 +00:00
|
|
|
int Build(const std::string& dir,
|
|
|
|
const std::string& target,
|
|
|
|
const std::string& config,
|
2009-03-04 20:39:27 +00:00
|
|
|
const std::vector<std::string>& nativeOptions,
|
2013-10-18 17:38:36 +00:00
|
|
|
bool clean);
|
2010-09-02 15:29:05 +00:00
|
|
|
|
2014-02-04 21:06:56 +00:00
|
|
|
void UnwatchUnusedCli(const std::string& var);
|
|
|
|
void WatchUnusedCli(const std::string& var);
|
2009-03-04 20:39:27 +00:00
|
|
|
protected:
|
2011-03-24 13:24:27 +00:00
|
|
|
void RunCheckForUnusedVariables();
|
2008-03-12 21:02:30 +00:00
|
|
|
void InitializeProperties();
|
2014-02-04 21:06:56 +00:00
|
|
|
int HandleDeleteCacheVariables(const std::string& var);
|
2006-12-07 14:45:32 +00:00
|
|
|
cmPropertyMap Properties;
|
2007-11-06 19:16:00 +00:00
|
|
|
std::set<std::pair<cmStdString,cmProperty::ScopeType> > AccessedProperties;
|
2007-06-25 14:34:21 +00:00
|
|
|
|
2010-10-31 14:58:18 +00:00
|
|
|
std::map<cmProperty::ScopeType, cmPropertyDefinitionMap>
|
2007-06-25 14:34:21 +00:00
|
|
|
PropertyDefinitions;
|
2007-06-08 15:57:16 +00:00
|
|
|
|
2010-10-31 14:58:18 +00:00
|
|
|
typedef
|
2007-06-08 15:57:16 +00:00
|
|
|
cmExternalMakefileProjectGenerator* (*CreateExtraGeneratorFunctionType)();
|
|
|
|
typedef std::map<cmStdString,
|
|
|
|
CreateExtraGeneratorFunctionType> RegisteredExtraGeneratorsMap;
|
2012-11-19 15:13:54 +00:00
|
|
|
typedef std::vector<cmGlobalGeneratorFactory*> RegisteredGeneratorsVector;
|
2006-03-15 16:02:08 +00:00
|
|
|
RegisteredCommandsMap Commands;
|
2012-11-19 15:13:54 +00:00
|
|
|
RegisteredGeneratorsVector 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();
|
2010-10-31 14:58:18 +00:00
|
|
|
void AddExtraGenerator(const char* name,
|
2007-07-20 12:36:16 +00:00
|
|
|
CreateExtraGeneratorFunctionType newFunction);
|
2002-09-10 20:51:29 +00:00
|
|
|
|
2010-10-31 14:58:18 +00:00
|
|
|
cmPolicies *Policies;
|
2006-03-15 16:02:08 +00:00
|
|
|
cmGlobalGenerator *GlobalGenerator;
|
|
|
|
cmCacheManager *CacheManager;
|
2010-10-31 14:58:18 +00:00
|
|
|
std::string cmHomeDirectory;
|
2006-03-15 16:02:08 +00:00
|
|
|
std::string HomeOutputDirectory;
|
2010-10-31 14:58:18 +00:00
|
|
|
std::string cmStartDirectory;
|
2006-03-15 16:02:08 +00:00
|
|
|
std::string StartOutputDirectory;
|
2008-03-12 02:50:35 +00:00
|
|
|
bool SuppressDevWarnings;
|
2008-03-22 14:24:06 +00:00
|
|
|
bool DoSuppressDevWarnings;
|
2012-12-10 15:42:33 +00:00
|
|
|
std::string GeneratorToolset;
|
2004-04-18 18:41:46 +00:00
|
|
|
|
2002-09-06 17:06:23 +00:00
|
|
|
///! read in a cmake list file to initialize the cache
|
2011-02-03 02:17:23 +00:00
|
|
|
void ReadListFile(const std::vector<std::string>& args, const char *path);
|
2011-07-02 15:50:05 +00:00
|
|
|
bool FindPackage(const std::vector<std::string>& args);
|
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);
|
2010-10-31 14:58:18 +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
|
2012-03-19 22:05:21 +00:00
|
|
|
/// 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
|
|
|
|
2006-03-15 16:02:08 +00:00
|
|
|
cmVariableWatch* VariableWatch;
|
2010-10-31 14:58:18 +00:00
|
|
|
|
|
|
|
private:
|
2008-06-20 20:25:02 +00:00
|
|
|
cmake(const cmake&); // Not implemented.
|
|
|
|
void operator=(const cmake&); // Not implemented.
|
2006-03-15 16:02:08 +00:00
|
|
|
ProgressCallbackType ProgressCallback;
|
|
|
|
void* ProgressCallbackClientData;
|
|
|
|
bool Verbose;
|
|
|
|
bool InTryCompile;
|
2011-07-13 16:59:51 +00:00
|
|
|
WorkingMode CurrentWorkingMode;
|
2006-10-06 15:11:59 +00:00
|
|
|
bool DebugOutput;
|
2008-07-31 14:33:25 +00:00
|
|
|
bool Trace;
|
2010-08-25 16:35:40 +00:00
|
|
|
bool WarnUninitialized;
|
2010-08-25 16:36:21 +00:00
|
|
|
bool WarnUnused;
|
2010-09-01 14:22:08 +00:00
|
|
|
bool WarnUnusedCli;
|
2010-09-01 15:24:20 +00:00
|
|
|
bool CheckSystemVars;
|
2011-03-24 13:24:27 +00:00
|
|
|
std::map<cmStdString, bool> UsedCliVariables;
|
2008-02-12 14:49:42 +00:00
|
|
|
std::string CMakeEditCommand;
|
2006-03-15 16:02:08 +00:00
|
|
|
std::string CXXEnvironment;
|
|
|
|
std::string CCEnvironment;
|
|
|
|
std::string CheckBuildSystemArgument;
|
2007-11-10 13:15:13 +00:00
|
|
|
std::string CheckStampFile;
|
2008-03-11 21:25:49 +00:00
|
|
|
std::string CheckStampList;
|
2007-11-19 18:45:16 +00:00
|
|
|
std::string VSSolutionFile;
|
2006-03-15 16:02:08 +00:00
|
|
|
bool ClearBuildSystem;
|
|
|
|
bool DebugTryCompile;
|
|
|
|
cmFileTimeComparison* FileComparison;
|
|
|
|
std::string GraphVizFile;
|
2008-09-04 21:34:25 +00:00
|
|
|
std::vector<std::string> DebugConfigs;
|
2010-10-31 14:58:18 +00:00
|
|
|
|
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 \
|
2013-09-16 18:04:39 +00:00
|
|
|
{"-C <initial-cache>", "Pre-load a script to populate the cache."}, \
|
|
|
|
{"-D <var>:<type>=<value>", "Create a cmake cache entry."}, \
|
|
|
|
{"-U <globbing_expr>", "Remove matching entries from CMake cache."}, \
|
|
|
|
{"-G <generator-name>", "Specify a build system generator."},\
|
|
|
|
{"-T <toolset-name>", "Specify toolset name if supported by generator."}, \
|
|
|
|
{"-Wno-dev", "Suppress developer warnings."},\
|
|
|
|
{"-Wdev", "Enable developer warnings."}
|
2008-03-11 20:02:10 +00:00
|
|
|
|
2003-12-23 20:01:10 +00:00
|
|
|
#endif
|