summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/CMakeExpandImportedTargets.cmake16
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/cmGetCMakePropertyCommand.cxx5
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx6
-rw-r--r--Source/cmMakefile.cxx45
-rw-r--r--Source/cmMakefile.h3
-rw-r--r--Source/cmState.cxx2
7 files changed, 45 insertions, 34 deletions
diff --git a/Modules/CMakeExpandImportedTargets.cmake b/Modules/CMakeExpandImportedTargets.cmake
index 8ac3364..28f2e46 100644
--- a/Modules/CMakeExpandImportedTargets.cmake
+++ b/Modules/CMakeExpandImportedTargets.cmake
@@ -2,6 +2,19 @@
# CMakeExpandImportedTargets
# --------------------------
#
+# Deprecated. Do not use.
+#
+# This module was once needed to expand imported targets to the underlying
+# libraries they reference on disk for use with the :command:`try_compile`
+# and :command:`try_run` commands. These commands now support imported
+# libraries in their ``LINK_LIBRARIES`` options (since CMake 2.8.11
+# for :command:`try_compile` and since CMake 3.2 for :command:`try_run`).
+#
+# This module does not support the policy :policy:`CMP0022` ``NEW``
+# behavior or use of the :prop_tgt:`INTERFACE_LINK_LIBRARIES` property
+# because :manual:`generator expressions <cmake-generator-expressions(7)>`
+# cannot be evaluated during configuration.
+#
# ::
#
# CMAKE_EXPAND_IMPORTED_TARGETS(<var> LIBRARIES lib1 lib2...libN
@@ -14,9 +27,6 @@
# respective configuration of the imported targets if it exists. If no
# CONFIGURATION is given, it uses the first configuration from
# ${CMAKE_CONFIGURATION_TYPES} if set, otherwise ${CMAKE_BUILD_TYPE}.
-# This macro is used by all Check*.cmake files which use try_compile()
-# or try_run() and support CMAKE_REQUIRED_LIBRARIES , so that these
-# checks support imported targets in CMAKE_REQUIRED_LIBRARIES:
#
# ::
#
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index afa6357..ebceff9 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 3)
-set(CMake_VERSION_PATCH 20150717)
+set(CMake_VERSION_PATCH 20150721)
#set(CMake_VERSION_RC 1)
diff --git a/Source/cmGetCMakePropertyCommand.cxx b/Source/cmGetCMakePropertyCommand.cxx
index a460ca6..5a1644c 100644
--- a/Source/cmGetCMakePropertyCommand.cxx
+++ b/Source/cmGetCMakePropertyCommand.cxx
@@ -32,10 +32,9 @@ bool cmGetCMakePropertyCommand
if ( args[1] == "VARIABLES" )
{
- std::vector<std::string> vars = this->Makefile->GetDefinitions();
- if (!vars.empty())
+ if (const char* varsProp = this->Makefile->GetProperty("VARIABLES"))
{
- output = cmJoin(vars, ";");
+ output = varsProp;
}
}
else if ( args[1] == "MACROS" )
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 5d17a40..64f8bb8 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -256,7 +256,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefile()
return;
}
// always write the top makefile
- if (this->Parent)
+ if (!this->GetMakefile()->IsRootMakefile())
{
ruleFileStream.SetCopyIfDifferent(true);
}
@@ -267,7 +267,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefile()
// only write local targets unless at the top Keep track of targets already
// listed.
std::set<std::string> emittedTargets;
- if (this->Parent)
+ if (!this->GetMakefile()->IsRootMakefile())
{
// write our targets, and while doing it collect up the object
// file rules
@@ -888,7 +888,7 @@ void cmLocalUnixMakefileGenerator3
std::vector<std::string> no_depends;
std::vector<std::string> commands;
commands.push_back(runRule);
- if(this->Parent)
+ if(!this->GetMakefile()->IsRootMakefile())
{
this->CreateCDCommand(commands,
this->Makefile->GetHomeOutputDirectory(),
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 155c306..5790b75 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -19,6 +19,7 @@
#include "cmLocalGenerator.h"
#include "cmCommands.h"
#include "cmState.h"
+#include "cmOutputConverter.h"
#include "cmFunctionBlocker.h"
#include "cmListFileCache.h"
#include "cmCommandArgumentParserHelper.h"
@@ -260,7 +261,7 @@ void cmMakefile::IssueMessage(cmake::MessageType t,
cmListFileContext lfc;
// We are not currently executing a command. Add whatever context
// information we have.
- lfc.FilePath = this->ListFileStack.back();
+ lfc.FilePath = this->GetExecutionFilePath();
if(!this->GetCMakeInstance()->GetIsInTryCompile())
{
@@ -455,7 +456,6 @@ cmMakefile::IncludeScope::IncludeScope(cmMakefile* mf,
// The included file cannot pop our policy scope.
this->Makefile->PushPolicyBarrier();
- this->Makefile->ListFileStack.push_back(filenametoread);
this->Makefile->PushFunctionBlockerBarrier();
this->Makefile->StateSnapshot =
@@ -498,7 +498,6 @@ cmMakefile::IncludeScope::~IncludeScope()
this->EnforceCMP0011();
}
}
- this->Makefile->ListFileStack.pop_back();
}
//----------------------------------------------------------------------------
@@ -514,7 +513,7 @@ void cmMakefile::IncludeScope::EnforceCMP0011()
std::ostringstream w;
w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0011) << "\n"
<< "The included script\n "
- << this->Makefile->ListFileStack.back() << "\n"
+ << this->Makefile->GetExecutionFilePath() << "\n"
<< "affects policy settings. "
<< "CMake is implying the NO_POLICY_SCOPE option for compatibility, "
<< "so the effects are applied to the including context.";
@@ -527,7 +526,7 @@ void cmMakefile::IncludeScope::EnforceCMP0011()
std::ostringstream e;
e << cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0011) << "\n"
<< "The included script\n "
- << this->Makefile->ListFileStack.back() << "\n"
+ << this->Makefile->GetExecutionFilePath() << "\n"
<< "affects policy settings, so it requires this policy to be set.";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
}
@@ -593,7 +592,6 @@ public:
ListFileScope(cmMakefile* mf, std::string const& filenametoread)
: Makefile(mf), ReportError(true)
{
- this->Makefile->ListFileStack.push_back(filenametoread);
this->Makefile->PushPolicyBarrier();
long line = 0;
@@ -618,7 +616,6 @@ public:
this->Makefile->PopFunctionBlockerBarrier(this->ReportError);
this->Makefile->PopPolicyBarrier(this->ReportError);
- this->Makefile->ListFileStack.pop_back();
}
void Quiet() { this->ReportError = false; }
@@ -1706,15 +1703,13 @@ public:
this->Makefile->StateSnapshot.GetCurrentSourceDirectory();
currentStart += "/CMakeLists.txt";
this->Makefile->StateSnapshot.SetListFile(currentStart);
- this->Makefile->ListFileStack.push_back(currentStart);
this->Makefile->PushPolicyBarrier();
this->Makefile->PushFunctionBlockerBarrier();
this->GG = mf->GetGlobalGenerator();
this->CurrentMakefile = this->GG->GetCurrentMakefile();
this->Snapshot = this->GG->GetCMakeInstance()->GetCurrentSnapshot();
- this->GG->GetCMakeInstance()->SetCurrentSnapshot(
- this->GG->GetCMakeInstance()->GetCurrentSnapshot());
+ this->GG->GetCMakeInstance()->SetCurrentSnapshot(this->Snapshot);
this->GG->SetCurrentMakefile(mf);
#if defined(CMAKE_BUILD_WITH_CMAKE)
this->GG->GetFileLockPool().PushFileScope();
@@ -3436,10 +3431,6 @@ bool cmMakefile::IsLoopBlock() const
std::string cmMakefile::GetExecutionFilePath() const
{
- if (this->ContextStack.empty())
- {
- return std::string();
- }
assert(this->StateSnapshot.IsValid());
return this->StateSnapshot.GetExecutionListFile();
}
@@ -4260,7 +4251,15 @@ const char *cmMakefile::GetProperty(const std::string& prop,
}
else if (prop == "LISTFILE_STACK")
{
- output = cmJoin(this->ListFileStack, ";");
+ std::vector<std::string> listFiles;
+ cmState::Snapshot snp = this->StateSnapshot;
+ while (snp.IsValid())
+ {
+ listFiles.push_back(snp.GetExecutionListFile());
+ snp = snp.GetCallStackParent();
+ }
+ std::reverse(listFiles.begin(), listFiles.end());
+ output = cmJoin(listFiles, ";");
return output.c_str();
}
else if ( prop == "CACHE_VARIABLES" )
@@ -4417,14 +4416,22 @@ void cmMakefile::AddCMakeDependFilesFromUser()
std::string cmMakefile::FormatListFileStack() const
{
+ std::vector<std::string> listFiles;
+ cmState::Snapshot snp = this->StateSnapshot;
+ while (snp.IsValid())
+ {
+ listFiles.push_back(snp.GetExecutionListFile());
+ snp = snp.GetCallStackParent();
+ }
+ std::reverse(listFiles.begin(), listFiles.end());
std::ostringstream tmp;
- size_t depth = this->ListFileStack.size();
+ size_t depth = listFiles.size();
if (depth > 0)
{
- std::vector<std::string>::const_iterator it = this->ListFileStack.end();
+ std::vector<std::string>::const_iterator it = listFiles.end();
do
{
- if (depth != this->ListFileStack.size())
+ if (depth != listFiles.size())
{
tmp << "\n ";
}
@@ -4435,7 +4442,7 @@ std::string cmMakefile::FormatListFileStack() const
tmp << *it;
depth--;
}
- while (it != this->ListFileStack.begin());
+ while (it != listFiles.begin());
}
return tmp.str();
}
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 585880e..76f3fbe 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -933,9 +933,6 @@ private:
cmPropertyMap Properties;
- // stack of list files being read
- std::vector<std::string> ListFileStack;
-
std::vector<cmCommandContext const*> ContextStack;
std::vector<cmExecutionStatus*> ExecutionStatusStack;
friend class cmMakefileCall;
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index 2d8b935..bd37e61 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -470,8 +470,6 @@ void cmState::AppendGlobalProperty(const std::string& prop,
const char *cmState::GetGlobalProperty(const std::string& prop)
{
- // watch for special properties
- std::string output = "";
if ( prop == "CACHE_VARIABLES" )
{
std::vector<std::string> cacheKeys = this->GetCacheEntryKeys();