Port Global property interaction to cmState.
This commit is contained in:
parent
de722d7d63
commit
5d056c0dd8
|
@ -17,6 +17,7 @@
|
||||||
#include "cmGeneratedFileStream.h"
|
#include "cmGeneratedFileStream.h"
|
||||||
#include "cmCTest.h"
|
#include "cmCTest.h"
|
||||||
#include "cmXMLParser.h"
|
#include "cmXMLParser.h"
|
||||||
|
#include "cmState.h"
|
||||||
|
|
||||||
#include <cmsys/Process.h>
|
#include <cmsys/Process.h>
|
||||||
#include <cmsys/Base64.h>
|
#include <cmsys/Base64.h>
|
||||||
|
@ -1132,7 +1133,7 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
|
||||||
cmCTestScriptHandler* ch =
|
cmCTestScriptHandler* ch =
|
||||||
static_cast<cmCTestScriptHandler*>(this->CTest->GetHandler("script"));
|
static_cast<cmCTestScriptHandler*>(this->CTest->GetHandler("script"));
|
||||||
cmake* cm = ch->GetCMake();
|
cmake* cm = ch->GetCMake();
|
||||||
const char* subproject = cm->GetProperty("SubProject");
|
const char* subproject = cm->GetState()->GetGlobalProperty("SubProject");
|
||||||
// TODO: Encode values for a URL instead of trusting caller.
|
// TODO: Encode values for a URL instead of trusting caller.
|
||||||
std::ostringstream str;
|
std::ostringstream str;
|
||||||
str << "project="
|
str << "project="
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include "cmAddLibraryCommand.h"
|
#include "cmAddLibraryCommand.h"
|
||||||
|
|
||||||
#include "cmake.h"
|
#include "cmake.h"
|
||||||
|
#include "cmState.h"
|
||||||
|
|
||||||
// cmLibraryCommand
|
// cmLibraryCommand
|
||||||
bool cmAddLibraryCommand
|
bool cmAddLibraryCommand
|
||||||
|
@ -330,7 +331,7 @@ bool cmAddLibraryCommand
|
||||||
yet its linker language. */
|
yet its linker language. */
|
||||||
if ((type == cmTarget::SHARED_LIBRARY ||
|
if ((type == cmTarget::SHARED_LIBRARY ||
|
||||||
type == cmTarget::MODULE_LIBRARY) &&
|
type == cmTarget::MODULE_LIBRARY) &&
|
||||||
(this->Makefile->GetCMakeInstance()->GetPropertyAsBool(
|
(this->Makefile->GetState()->GetGlobalPropertyAsBool(
|
||||||
"TARGET_SUPPORTS_SHARED_LIBS") == false))
|
"TARGET_SUPPORTS_SHARED_LIBS") == false))
|
||||||
{
|
{
|
||||||
std::ostringstream w;
|
std::ostringstream w;
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include "cmCTestCommand.h"
|
#include "cmCTestCommand.h"
|
||||||
#include "cmCTestStartCommand.h"
|
#include "cmCTestStartCommand.h"
|
||||||
#include "cmAlgorithms.h"
|
#include "cmAlgorithms.h"
|
||||||
|
#include "cmState.h"
|
||||||
|
|
||||||
#include "cmCTestBuildHandler.h"
|
#include "cmCTestBuildHandler.h"
|
||||||
#include "cmCTestBuildAndTestHandler.h"
|
#include "cmCTestBuildAndTestHandler.h"
|
||||||
|
@ -1558,12 +1559,14 @@ void cmCTest::AddSiteProperties(std::ostream& ostr)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// This code should go when cdash is changed to use labels only
|
// This code should go when cdash is changed to use labels only
|
||||||
const char* subproject = cm->GetProperty("SubProject");
|
const char* subproject = cm->GetState()
|
||||||
|
->GetGlobalProperty("SubProject");
|
||||||
if(subproject)
|
if(subproject)
|
||||||
{
|
{
|
||||||
ostr << "<Subproject name=\"" << subproject << "\">\n";
|
ostr << "<Subproject name=\"" << subproject << "\">\n";
|
||||||
const char* labels =
|
const char* labels =
|
||||||
ch->GetCMake()->GetProperty("SubProjectLabels");
|
ch->GetCMake()->GetState()
|
||||||
|
->GetGlobalProperty("SubProjectLabels");
|
||||||
if(labels)
|
if(labels)
|
||||||
{
|
{
|
||||||
ostr << " <Labels>\n";
|
ostr << " <Labels>\n";
|
||||||
|
@ -1581,7 +1584,7 @@ void cmCTest::AddSiteProperties(std::ostream& ostr)
|
||||||
}
|
}
|
||||||
|
|
||||||
// This code should stay when cdash only does label based sub-projects
|
// This code should stay when cdash only does label based sub-projects
|
||||||
const char* label = cm->GetProperty("Label");
|
const char* label = cm->GetState()->GetGlobalProperty("Label");
|
||||||
if(label)
|
if(label)
|
||||||
{
|
{
|
||||||
ostr << "<Labels>\n";
|
ostr << "<Labels>\n";
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include "cmOrderDirectories.h"
|
#include "cmOrderDirectories.h"
|
||||||
|
|
||||||
#include "cmGlobalGenerator.h"
|
#include "cmGlobalGenerator.h"
|
||||||
|
#include "cmState.h"
|
||||||
#include "cmLocalGenerator.h"
|
#include "cmLocalGenerator.h"
|
||||||
#include "cmMakefile.h"
|
#include "cmMakefile.h"
|
||||||
#include "cmTarget.h"
|
#include "cmTarget.h"
|
||||||
|
@ -250,8 +251,8 @@ cmComputeLinkInformation
|
||||||
this->CMakeInstance = this->GlobalGenerator->GetCMakeInstance();
|
this->CMakeInstance = this->GlobalGenerator->GetCMakeInstance();
|
||||||
|
|
||||||
// Check whether to recognize OpenBSD-style library versioned names.
|
// Check whether to recognize OpenBSD-style library versioned names.
|
||||||
this->OpenBSD = this->Makefile->GetCMakeInstance()
|
this->OpenBSD = this->Makefile->GetState()
|
||||||
->GetPropertyAsBool("FIND_LIBRARY_USE_OPENBSD_VERSIONING");
|
->GetGlobalPropertyAsBool("FIND_LIBRARY_USE_OPENBSD_VERSIONING");
|
||||||
|
|
||||||
// The configuration being linked.
|
// The configuration being linked.
|
||||||
this->Config = config;
|
this->Config = config;
|
||||||
|
@ -796,9 +797,8 @@ void cmComputeLinkInformation::AddSharedDepItem(std::string const& item,
|
||||||
void cmComputeLinkInformation::ComputeLinkTypeInfo()
|
void cmComputeLinkInformation::ComputeLinkTypeInfo()
|
||||||
{
|
{
|
||||||
// Check whether archives may actually be shared libraries.
|
// Check whether archives may actually be shared libraries.
|
||||||
this->ArchivesMayBeShared =
|
this->ArchivesMayBeShared = this->CMakeInstance->GetState()
|
||||||
this->CMakeInstance->GetPropertyAsBool(
|
->GetGlobalPropertyAsBool("TARGET_ARCHIVES_MAY_BE_SHARED_LIBS");
|
||||||
"TARGET_ARCHIVES_MAY_BE_SHARED_LIBS");
|
|
||||||
|
|
||||||
// First assume we cannot do link type stuff.
|
// First assume we cannot do link type stuff.
|
||||||
this->LinkTypeEnabled = false;
|
this->LinkTypeEnabled = false;
|
||||||
|
@ -1527,9 +1527,10 @@ void cmComputeLinkInformation::HandleBadFullItem(std::string const& item,
|
||||||
// Print the warning at most once for this item.
|
// Print the warning at most once for this item.
|
||||||
std::string wid = "CMP0008-WARNING-GIVEN-";
|
std::string wid = "CMP0008-WARNING-GIVEN-";
|
||||||
wid += item;
|
wid += item;
|
||||||
if(!this->CMakeInstance->GetPropertyAsBool(wid))
|
if(!this->CMakeInstance->GetState()
|
||||||
|
->GetGlobalPropertyAsBool(wid))
|
||||||
{
|
{
|
||||||
this->CMakeInstance->SetProperty(wid, "1");
|
this->CMakeInstance->GetState()->SetGlobalProperty(wid, "1");
|
||||||
std::ostringstream w;
|
std::ostringstream w;
|
||||||
w << (this->Makefile->GetPolicies()
|
w << (this->Makefile->GetPolicies()
|
||||||
->GetPolicyWarning(cmPolicies::CMP0008)) << "\n"
|
->GetPolicyWarning(cmPolicies::CMP0008)) << "\n"
|
||||||
|
@ -1576,9 +1577,11 @@ bool cmComputeLinkInformation::FinishLinkerSearchDirectories()
|
||||||
switch(this->Target->GetPolicyStatusCMP0003())
|
switch(this->Target->GetPolicyStatusCMP0003())
|
||||||
{
|
{
|
||||||
case cmPolicies::WARN:
|
case cmPolicies::WARN:
|
||||||
if(!this->CMakeInstance->GetPropertyAsBool("CMP0003-WARNING-GIVEN"))
|
if(!this->CMakeInstance->GetState()
|
||||||
|
->GetGlobalPropertyAsBool("CMP0003-WARNING-GIVEN"))
|
||||||
{
|
{
|
||||||
this->CMakeInstance->SetProperty("CMP0003-WARNING-GIVEN", "1");
|
this->CMakeInstance->GetState()
|
||||||
|
->SetGlobalProperty("CMP0003-WARNING-GIVEN", "1");
|
||||||
std::ostringstream w;
|
std::ostringstream w;
|
||||||
this->PrintLinkPolicyDiagnosis(w);
|
this->PrintLinkPolicyDiagnosis(w);
|
||||||
this->CMakeInstance->IssueMessage(cmake::AUTHOR_WARNING, w.str(),
|
this->CMakeInstance->IssueMessage(cmake::AUTHOR_WARNING, w.str(),
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include "cmGlobalGenerator.h"
|
#include "cmGlobalGenerator.h"
|
||||||
#include "cmLocalGenerator.h"
|
#include "cmLocalGenerator.h"
|
||||||
#include "cmMakefile.h"
|
#include "cmMakefile.h"
|
||||||
|
#include "cmState.h"
|
||||||
#include "cmSystemTools.h"
|
#include "cmSystemTools.h"
|
||||||
#include "cmSourceFile.h"
|
#include "cmSourceFile.h"
|
||||||
#include "cmTarget.h"
|
#include "cmTarget.h"
|
||||||
|
@ -98,8 +99,10 @@ cmComputeTargetDepends::cmComputeTargetDepends(cmGlobalGenerator* gg)
|
||||||
{
|
{
|
||||||
this->GlobalGenerator = gg;
|
this->GlobalGenerator = gg;
|
||||||
cmake* cm = this->GlobalGenerator->GetCMakeInstance();
|
cmake* cm = this->GlobalGenerator->GetCMakeInstance();
|
||||||
this->DebugMode = cm->GetPropertyAsBool("GLOBAL_DEPENDS_DEBUG_MODE");
|
this->DebugMode = cm->GetState()
|
||||||
this->NoCycles = cm->GetPropertyAsBool("GLOBAL_DEPENDS_NO_CYCLES");
|
->GetGlobalPropertyAsBool("GLOBAL_DEPENDS_DEBUG_MODE");
|
||||||
|
this->NoCycles = cm->GetState()
|
||||||
|
->GetGlobalPropertyAsBool("GLOBAL_DEPENDS_NO_CYCLES");
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
|
|
@ -469,8 +469,8 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
|
||||||
fout << "\t\t<nature>" << *nit << "</nature>\n";
|
fout << "\t\t<nature>" << *nit << "</nature>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (const char *extraNaturesProp = mf->GetCMakeInstance()->
|
if (const char *extraNaturesProp = mf->GetState()
|
||||||
GetProperty("ECLIPSE_EXTRA_NATURES"))
|
->GetGlobalProperty("ECLIPSE_EXTRA_NATURES"))
|
||||||
{
|
{
|
||||||
std::vector<std::string> extraNatures;
|
std::vector<std::string> extraNatures;
|
||||||
cmSystemTools::ExpandListArgument(extraNaturesProp, extraNatures);
|
cmSystemTools::ExpandListArgument(extraNaturesProp, extraNatures);
|
||||||
|
|
|
@ -54,8 +54,8 @@ bool cmFindLibraryCommand
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this->Makefile->GetCMakeInstance()
|
if(this->Makefile->GetState()
|
||||||
->GetPropertyAsBool("FIND_LIBRARY_USE_LIB64_PATHS"))
|
->GetGlobalPropertyAsBool("FIND_LIBRARY_USE_LIB64_PATHS"))
|
||||||
{
|
{
|
||||||
// add special 64 bit paths if this is a 64 bit compile.
|
// add special 64 bit paths if this is a 64 bit compile.
|
||||||
if(this->Makefile->PlatformIs64Bit())
|
if(this->Makefile->PlatformIs64Bit())
|
||||||
|
@ -226,8 +226,8 @@ cmFindLibraryHelper::cmFindLibraryHelper(cmMakefile* mf):
|
||||||
|
|
||||||
// Check whether to use OpenBSD-style library version comparisons.
|
// Check whether to use OpenBSD-style library version comparisons.
|
||||||
this->OpenBSD =
|
this->OpenBSD =
|
||||||
this->Makefile->GetCMakeInstance()
|
this->Makefile->GetState()
|
||||||
->GetPropertyAsBool("FIND_LIBRARY_USE_OPENBSD_VERSIONING");
|
->GetGlobalPropertyAsBool("FIND_LIBRARY_USE_OPENBSD_VERSIONING");
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
|
|
@ -120,8 +120,8 @@ bool cmFindPackageCommand
|
||||||
|
|
||||||
// Lookup whether lib64 paths should be used.
|
// Lookup whether lib64 paths should be used.
|
||||||
if(this->Makefile->PlatformIs64Bit() &&
|
if(this->Makefile->PlatformIs64Bit() &&
|
||||||
this->Makefile->GetCMakeInstance()
|
this->Makefile->GetState()
|
||||||
->GetPropertyAsBool("FIND_LIBRARY_USE_LIB64_PATHS"))
|
->GetGlobalPropertyAsBool("FIND_LIBRARY_USE_LIB64_PATHS"))
|
||||||
{
|
{
|
||||||
this->UseLib64Paths = true;
|
this->UseLib64Paths = true;
|
||||||
}
|
}
|
||||||
|
@ -1015,8 +1015,8 @@ bool cmFindPackageCommand::ReadListFile(const char* f, PolicyScopeRule psr)
|
||||||
void cmFindPackageCommand::AppendToFoundProperty(bool found)
|
void cmFindPackageCommand::AppendToFoundProperty(bool found)
|
||||||
{
|
{
|
||||||
std::vector<std::string> foundContents;
|
std::vector<std::string> foundContents;
|
||||||
const char *foundProp =
|
const char *foundProp = this->Makefile->GetState()
|
||||||
this->Makefile->GetCMakeInstance()->GetProperty("PACKAGES_FOUND");
|
->GetGlobalProperty("PACKAGES_FOUND");
|
||||||
if (foundProp && *foundProp)
|
if (foundProp && *foundProp)
|
||||||
{
|
{
|
||||||
std::string tmp = foundProp;
|
std::string tmp = foundProp;
|
||||||
|
@ -1032,7 +1032,8 @@ void cmFindPackageCommand::AppendToFoundProperty(bool found)
|
||||||
|
|
||||||
std::vector<std::string> notFoundContents;
|
std::vector<std::string> notFoundContents;
|
||||||
const char *notFoundProp =
|
const char *notFoundProp =
|
||||||
this->Makefile->GetCMakeInstance()->GetProperty("PACKAGES_NOT_FOUND");
|
this->Makefile->GetState()
|
||||||
|
->GetGlobalProperty("PACKAGES_NOT_FOUND");
|
||||||
if (notFoundProp && *notFoundProp)
|
if (notFoundProp && *notFoundProp)
|
||||||
{
|
{
|
||||||
std::string tmp = notFoundProp;
|
std::string tmp = notFoundProp;
|
||||||
|
@ -1057,12 +1058,12 @@ void cmFindPackageCommand::AppendToFoundProperty(bool found)
|
||||||
|
|
||||||
|
|
||||||
std::string tmp = cmJoin(foundContents, ";");
|
std::string tmp = cmJoin(foundContents, ";");
|
||||||
this->Makefile->GetCMakeInstance()->SetProperty("PACKAGES_FOUND",
|
this->Makefile->GetState()
|
||||||
tmp.c_str());
|
->SetGlobalProperty("PACKAGES_FOUND", tmp.c_str());
|
||||||
|
|
||||||
tmp = cmJoin(notFoundContents, ";");
|
tmp = cmJoin(notFoundContents, ";");
|
||||||
this->Makefile->GetCMakeInstance()->SetProperty("PACKAGES_NOT_FOUND",
|
this->Makefile->GetState()
|
||||||
tmp.c_str());
|
->SetGlobalProperty("PACKAGES_NOT_FOUND", tmp.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
@ -1071,8 +1072,8 @@ void cmFindPackageCommand::AppendSuccessInformation()
|
||||||
{
|
{
|
||||||
std::string transitivePropName = "_CMAKE_";
|
std::string transitivePropName = "_CMAKE_";
|
||||||
transitivePropName += this->Name + "_TRANSITIVE_DEPENDENCY";
|
transitivePropName += this->Name + "_TRANSITIVE_DEPENDENCY";
|
||||||
this->Makefile->GetCMakeInstance()
|
this->Makefile->GetState()
|
||||||
->SetProperty(transitivePropName, "False");
|
->SetGlobalProperty(transitivePropName, "False");
|
||||||
}
|
}
|
||||||
std::string found = this->Name;
|
std::string found = this->Name;
|
||||||
found += "_FOUND";
|
found += "_FOUND";
|
||||||
|
@ -1090,8 +1091,8 @@ void cmFindPackageCommand::AppendSuccessInformation()
|
||||||
std::string quietInfoPropName = "_CMAKE_";
|
std::string quietInfoPropName = "_CMAKE_";
|
||||||
quietInfoPropName += this->Name;
|
quietInfoPropName += this->Name;
|
||||||
quietInfoPropName += "_QUIET";
|
quietInfoPropName += "_QUIET";
|
||||||
this->Makefile->GetCMakeInstance()->SetProperty(quietInfoPropName,
|
this->Makefile->GetState()
|
||||||
this->Quiet ? "TRUE" : "FALSE");
|
->SetGlobalProperty(quietInfoPropName, this->Quiet ? "TRUE" : "FALSE");
|
||||||
|
|
||||||
// set a global property to record the required version of this package
|
// set a global property to record the required version of this package
|
||||||
std::string versionInfoPropName = "_CMAKE_";
|
std::string versionInfoPropName = "_CMAKE_";
|
||||||
|
@ -1104,15 +1105,15 @@ void cmFindPackageCommand::AppendSuccessInformation()
|
||||||
versionInfo += " ";
|
versionInfo += " ";
|
||||||
versionInfo += this->Version;
|
versionInfo += this->Version;
|
||||||
}
|
}
|
||||||
this->Makefile->GetCMakeInstance()->SetProperty(versionInfoPropName,
|
this->Makefile->GetState()
|
||||||
versionInfo.c_str());
|
->SetGlobalProperty(versionInfoPropName, versionInfo.c_str());
|
||||||
if (this->Required)
|
if (this->Required)
|
||||||
{
|
{
|
||||||
std::string requiredInfoPropName = "_CMAKE_";
|
std::string requiredInfoPropName = "_CMAKE_";
|
||||||
requiredInfoPropName += this->Name;
|
requiredInfoPropName += this->Name;
|
||||||
requiredInfoPropName += "_TYPE";
|
requiredInfoPropName += "_TYPE";
|
||||||
this->Makefile->GetCMakeInstance()->SetProperty(
|
this->Makefile->GetState()
|
||||||
requiredInfoPropName, "REQUIRED");
|
->SetGlobalProperty(requiredInfoPropName, "REQUIRED");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include "cmGlobalGenerator.h"
|
#include "cmGlobalGenerator.h"
|
||||||
#include "cmLocalGenerator.h"
|
#include "cmLocalGenerator.h"
|
||||||
#include "cmake.h"
|
#include "cmake.h"
|
||||||
|
#include "cmState.h"
|
||||||
#include "cmAlgorithms.h"
|
#include "cmAlgorithms.h"
|
||||||
|
|
||||||
// cmGetCMakePropertyCommand
|
// cmGetCMakePropertyCommand
|
||||||
|
@ -53,7 +54,8 @@ bool cmGetCMakePropertyCommand
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const char *prop =
|
const char *prop =
|
||||||
this->Makefile->GetCMakeInstance()->GetProperty(args[1]);
|
this->Makefile->GetState()
|
||||||
|
->GetGlobalProperty(args[1]);
|
||||||
if (prop)
|
if (prop)
|
||||||
{
|
{
|
||||||
output = prop;
|
output = prop;
|
||||||
|
|
|
@ -237,7 +237,8 @@ bool cmGetPropertyCommand::HandleGlobalMode()
|
||||||
|
|
||||||
// Get the property.
|
// Get the property.
|
||||||
cmake* cm = this->Makefile->GetCMakeInstance();
|
cmake* cm = this->Makefile->GetCMakeInstance();
|
||||||
return this->StoreResult(cm->GetProperty(this->PropertyName));
|
return this->StoreResult(cm->GetState()
|
||||||
|
->GetGlobalProperty(this->PropertyName));
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
|
|
@ -200,7 +200,7 @@ void cmGlobalGenerator::ResolveLanguageCompiler(const std::string &lang,
|
||||||
if (cnameString != pathString)
|
if (cnameString != pathString)
|
||||||
{
|
{
|
||||||
const char* cvars =
|
const char* cvars =
|
||||||
this->GetCMakeInstance()->GetProperty(
|
this->GetCMakeInstance()->GetState()->GetGlobalProperty(
|
||||||
"__CMAKE_DELETE_CACHE_CHANGE_VARS_");
|
"__CMAKE_DELETE_CACHE_CHANGE_VARS_");
|
||||||
if(cvars)
|
if(cvars)
|
||||||
{
|
{
|
||||||
|
@ -210,7 +210,7 @@ void cmGlobalGenerator::ResolveLanguageCompiler(const std::string &lang,
|
||||||
changeVars += langComp;
|
changeVars += langComp;
|
||||||
changeVars += ";";
|
changeVars += ";";
|
||||||
changeVars += cname;
|
changeVars += cname;
|
||||||
this->GetCMakeInstance()->SetProperty(
|
this->GetCMakeInstance()->GetState()->SetGlobalProperty(
|
||||||
"__CMAKE_DELETE_CACHE_CHANGE_VARS_",
|
"__CMAKE_DELETE_CACHE_CHANGE_VARS_",
|
||||||
changeVars.c_str());
|
changeVars.c_str());
|
||||||
}
|
}
|
||||||
|
@ -1170,8 +1170,8 @@ void cmGlobalGenerator::AddCMP0042WarnTarget(const std::string& target)
|
||||||
bool cmGlobalGenerator::CheckALLOW_DUPLICATE_CUSTOM_TARGETS() const
|
bool cmGlobalGenerator::CheckALLOW_DUPLICATE_CUSTOM_TARGETS() const
|
||||||
{
|
{
|
||||||
// If the property is not enabled then okay.
|
// If the property is not enabled then okay.
|
||||||
if(!this->CMakeInstance
|
if(!this->CMakeInstance->GetState()
|
||||||
->GetPropertyAsBool("ALLOW_DUPLICATE_CUSTOM_TARGETS"))
|
->GetGlobalPropertyAsBool("ALLOW_DUPLICATE_CUSTOM_TARGETS"))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -2391,8 +2391,8 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
const char* cmGlobalGenerator::GetPredefinedTargetsFolder()
|
const char* cmGlobalGenerator::GetPredefinedTargetsFolder()
|
||||||
{
|
{
|
||||||
const char* prop =
|
const char* prop = this->GetCMakeInstance()->GetState()
|
||||||
this->GetCMakeInstance()->GetProperty("PREDEFINED_TARGETS_FOLDER");
|
->GetGlobalProperty("PREDEFINED_TARGETS_FOLDER");
|
||||||
|
|
||||||
if (prop)
|
if (prop)
|
||||||
{
|
{
|
||||||
|
@ -2405,7 +2405,8 @@ const char* cmGlobalGenerator::GetPredefinedTargetsFolder()
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
bool cmGlobalGenerator::UseFolderProperty()
|
bool cmGlobalGenerator::UseFolderProperty()
|
||||||
{
|
{
|
||||||
const char* prop = this->GetCMakeInstance()->GetProperty("USE_FOLDERS");
|
const char* prop = this->GetCMakeInstance()->GetState()
|
||||||
|
->GetGlobalProperty("USE_FOLDERS");
|
||||||
|
|
||||||
// If this property is defined, let the setter turn this on or off...
|
// If this property is defined, let the setter turn this on or off...
|
||||||
//
|
//
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#include "cmGeneratedFileStream.h"
|
#include "cmGeneratedFileStream.h"
|
||||||
#include "cmSourceFile.h"
|
#include "cmSourceFile.h"
|
||||||
#include "cmake.h"
|
#include "cmake.h"
|
||||||
|
#include "cmState.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
@ -234,7 +235,8 @@ void cmLocalNinjaGenerator::WritePools(std::ostream& os)
|
||||||
{
|
{
|
||||||
cmGlobalNinjaGenerator::WriteDivider(os);
|
cmGlobalNinjaGenerator::WriteDivider(os);
|
||||||
|
|
||||||
const char* jobpools = this->GetCMakeInstance()->GetProperty("JOB_POOLS");
|
const char* jobpools = this->GetCMakeInstance()->GetState()
|
||||||
|
->GetGlobalProperty("JOB_POOLS");
|
||||||
if (jobpools)
|
if (jobpools)
|
||||||
{
|
{
|
||||||
cmGlobalNinjaGenerator::WriteComment(os,
|
cmGlobalNinjaGenerator::WriteComment(os,
|
||||||
|
|
|
@ -4239,7 +4239,7 @@ const char *cmMakefile::GetProperty(const std::string& prop,
|
||||||
return this->LocalGenerator->GetParent()->GetMakefile()->
|
return this->LocalGenerator->GetParent()->GetMakefile()->
|
||||||
GetProperty(prop, scope);
|
GetProperty(prop, scope);
|
||||||
}
|
}
|
||||||
return this->GetCMakeInstance()->GetProperty(prop);
|
return this->GetState()->GetGlobalProperty(prop);
|
||||||
}
|
}
|
||||||
|
|
||||||
return retVal;
|
return retVal;
|
||||||
|
@ -4585,7 +4585,8 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg,
|
||||||
this->LocalGenerator->GetGlobalGenerator()->GetCMakeInstance();
|
this->LocalGenerator->GetGlobalGenerator()->GetCMakeInstance();
|
||||||
if(isCustom && existing->GetType() == cmTarget::UTILITY &&
|
if(isCustom && existing->GetType() == cmTarget::UTILITY &&
|
||||||
this != existing->GetMakefile() &&
|
this != existing->GetMakefile() &&
|
||||||
cm->GetPropertyAsBool("ALLOW_DUPLICATE_CUSTOM_TARGETS"))
|
cm->GetState()
|
||||||
|
->GetGlobalPropertyAsBool("ALLOW_DUPLICATE_CUSTOM_TARGETS"))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#include "cmSourceFile.h"
|
#include "cmSourceFile.h"
|
||||||
#include "cmTarget.h"
|
#include "cmTarget.h"
|
||||||
#include "cmake.h"
|
#include "cmake.h"
|
||||||
|
#include "cmState.h"
|
||||||
#include "cmComputeLinkInformation.h"
|
#include "cmComputeLinkInformation.h"
|
||||||
#include "cmCustomCommandGenerator.h"
|
#include "cmCustomCommandGenerator.h"
|
||||||
#include "cmGeneratorExpression.h"
|
#include "cmGeneratorExpression.h"
|
||||||
|
@ -51,7 +52,8 @@ cmMakefileTargetGenerator::cmMakefileTargetGenerator(cmTarget* target)
|
||||||
this->GeneratorTarget = this->GlobalGenerator->GetGeneratorTarget(target);
|
this->GeneratorTarget = this->GlobalGenerator->GetGeneratorTarget(target);
|
||||||
cmake* cm = this->GlobalGenerator->GetCMakeInstance();
|
cmake* cm = this->GlobalGenerator->GetCMakeInstance();
|
||||||
this->NoRuleMessages = false;
|
this->NoRuleMessages = false;
|
||||||
if(const char* ruleStatus = cm->GetProperty("RULE_MESSAGES"))
|
if(const char* ruleStatus = cm->GetState()
|
||||||
|
->GetGlobalProperty("RULE_MESSAGES"))
|
||||||
{
|
{
|
||||||
this->NoRuleMessages = cmSystemTools::IsOff(ruleStatus);
|
this->NoRuleMessages = cmSystemTools::IsOff(ruleStatus);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include "cmMakefile.h"
|
#include "cmMakefile.h"
|
||||||
#include "cmSourceFile.h"
|
#include "cmSourceFile.h"
|
||||||
#include "cmSystemTools.h"
|
#include "cmSystemTools.h"
|
||||||
|
#include "cmState.h"
|
||||||
#include "cmAlgorithms.h"
|
#include "cmAlgorithms.h"
|
||||||
|
|
||||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
|
@ -472,12 +473,12 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmTarget* target)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set target folder
|
// Set target folder
|
||||||
const char* autogenFolder = makefile->GetCMakeInstance()->GetProperty(
|
const char* autogenFolder = makefile->GetState()
|
||||||
"AUTOMOC_TARGETS_FOLDER");
|
->GetGlobalProperty("AUTOMOC_TARGETS_FOLDER");
|
||||||
if (!autogenFolder)
|
if (!autogenFolder)
|
||||||
{
|
{
|
||||||
autogenFolder = makefile->GetCMakeInstance()->GetProperty(
|
autogenFolder = makefile->GetState()
|
||||||
"AUTOGEN_TARGETS_FOLDER");
|
->GetGlobalProperty("AUTOGEN_TARGETS_FOLDER");
|
||||||
}
|
}
|
||||||
if (autogenFolder && *autogenFolder)
|
if (autogenFolder && *autogenFolder)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1152,7 +1152,8 @@ int cmake::HandleDeleteCacheVariables(const std::string& var)
|
||||||
std::vector<std::string> argsSplit;
|
std::vector<std::string> argsSplit;
|
||||||
cmSystemTools::ExpandListArgument(std::string(var), argsSplit, true);
|
cmSystemTools::ExpandListArgument(std::string(var), argsSplit, true);
|
||||||
// erase the property to avoid infinite recursion
|
// erase the property to avoid infinite recursion
|
||||||
this->SetProperty("__CMAKE_DELETE_CACHE_CHANGE_VARS_", "");
|
this->State
|
||||||
|
->SetGlobalProperty("__CMAKE_DELETE_CACHE_CHANGE_VARS_", "");
|
||||||
if(this->State->GetIsInTryCompile())
|
if(this->State->GetIsInTryCompile())
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1229,8 +1230,8 @@ int cmake::Configure()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int ret = this->ActualConfigure();
|
int ret = this->ActualConfigure();
|
||||||
const char* delCacheVars =
|
const char* delCacheVars = this->State
|
||||||
this->GetProperty("__CMAKE_DELETE_CACHE_CHANGE_VARS_");
|
->GetGlobalProperty("__CMAKE_DELETE_CACHE_CHANGE_VARS_");
|
||||||
if(delCacheVars && delCacheVars[0] != 0)
|
if(delCacheVars && delCacheVars[0] != 0)
|
||||||
{
|
{
|
||||||
return this->HandleDeleteCacheVariables(delCacheVars);
|
return this->HandleDeleteCacheVariables(delCacheVars);
|
||||||
|
@ -1505,7 +1506,7 @@ int cmake::ActualConfigure()
|
||||||
|
|
||||||
cmMakefile* mf=this->GlobalGenerator->GetLocalGenerators()[0]->GetMakefile();
|
cmMakefile* mf=this->GlobalGenerator->GetLocalGenerators()[0]->GetMakefile();
|
||||||
if (mf->IsOn("CTEST_USE_LAUNCHERS")
|
if (mf->IsOn("CTEST_USE_LAUNCHERS")
|
||||||
&& !this->GetProperty("RULE_LAUNCH_COMPILE"))
|
&& !this->State->GetGlobalProperty("RULE_LAUNCH_COMPILE"))
|
||||||
{
|
{
|
||||||
cmSystemTools::Error("CTEST_USE_LAUNCHERS is enabled, but the "
|
cmSystemTools::Error("CTEST_USE_LAUNCHERS is enabled, but the "
|
||||||
"RULE_LAUNCH_COMPILE global property is not defined.\n"
|
"RULE_LAUNCH_COMPILE global property is not defined.\n"
|
||||||
|
@ -2194,7 +2195,7 @@ const char *cmake::GetProperty(const std::string& prop)
|
||||||
|
|
||||||
bool cmake::GetPropertyAsBool(const std::string& prop)
|
bool cmake::GetPropertyAsBool(const std::string& prop)
|
||||||
{
|
{
|
||||||
return cmSystemTools::IsOn(this->GetProperty(prop));
|
return this->State->GetGlobalPropertyAsBool(prop);
|
||||||
}
|
}
|
||||||
|
|
||||||
cmInstalledFile *cmake::GetOrCreateInstalledFile(
|
cmInstalledFile *cmake::GetOrCreateInstalledFile(
|
||||||
|
@ -2590,7 +2591,8 @@ void cmake::IssueMessage(cmake::MessageType t, std::string const& text,
|
||||||
std::vector<std::string> cmake::GetDebugConfigs()
|
std::vector<std::string> cmake::GetDebugConfigs()
|
||||||
{
|
{
|
||||||
std::vector<std::string> configs;
|
std::vector<std::string> configs;
|
||||||
if(const char* config_list = this->GetProperty("DEBUG_CONFIGURATIONS"))
|
if(const char* config_list =
|
||||||
|
this->State->GetGlobalProperty("DEBUG_CONFIGURATIONS"))
|
||||||
{
|
{
|
||||||
// Expand the specified list and convert to upper-case.
|
// Expand the specified list and convert to upper-case.
|
||||||
cmSystemTools::ExpandListArgument(config_list, configs);
|
cmSystemTools::ExpandListArgument(config_list, configs);
|
||||||
|
|
Loading…
Reference in New Issue