summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/generator/Visual Studio 10 2010.rst12
-rw-r--r--Help/generator/Visual Studio 10.rst9
-rw-r--r--Help/generator/Visual Studio 11 2012.rst12
-rw-r--r--Help/generator/Visual Studio 11.rst9
-rw-r--r--Help/generator/Visual Studio 12 2013.rst12
-rw-r--r--Help/generator/Visual Studio 12.rst9
-rw-r--r--Help/index.rst2
-rw-r--r--Help/manual/ccmake.1.rst2
-rw-r--r--Help/manual/cmake-commands.7.rst2
-rw-r--r--Help/manual/cmake-developer.7.rst2
-rw-r--r--Help/manual/cmake-generator-expressions.7.rst2
-rw-r--r--Help/manual/cmake-generators.7.rst8
-rw-r--r--Help/manual/cmake-gui.1.rst2
-rw-r--r--Help/manual/cmake-modules.7.rst2
-rw-r--r--Help/manual/cmake-policies.7.rst2
-rw-r--r--Help/manual/cmake-properties.7.rst2
-rw-r--r--Help/manual/cmake-variables.7.rst2
-rw-r--r--Help/manual/cmake.1.rst2
-rw-r--r--Help/manual/cpack.1.rst2
-rw-r--r--Help/manual/ctest.1.rst2
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx1
-rw-r--r--Source/cmGeneratorTarget.cxx78
-rw-r--r--Source/cmGeneratorTarget.h5
-rw-r--r--Source/cmGlobalGenerator.cxx26
-rw-r--r--Source/cmGlobalGenerator.h5
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx67
-rw-r--r--Source/cmGlobalVisualStudio10Generator.h2
-rw-r--r--Source/cmGlobalVisualStudio11Generator.cxx80
-rw-r--r--Source/cmGlobalVisualStudio11Generator.h2
-rw-r--r--Source/cmGlobalVisualStudio12Generator.cxx67
-rw-r--r--Source/cmGlobalVisualStudio12Generator.h2
-rw-r--r--Source/cmLocalGenerator.cxx7
-rw-r--r--Source/cmTarget.cxx101
-rw-r--r--Source/cmTarget.h4
-rw-r--r--Source/cmake.cxx8
-rw-r--r--Tests/RunCMake/Syntax/BracketComment5.cmake5
-rw-r--r--Tests/RunCMake/Syntax/Escape1-stderr.txt3
-rw-r--r--Tests/RunCMake/Syntax/Escape1.cmake3
-rw-r--r--Tests/RunCMake/Syntax/RunCMakeTest.cmake1
-rw-r--r--Utilities/Sphinx/CMakeLists.txt2
-rw-r--r--Utilities/Sphinx/conf.py.in39
42 files changed, 403 insertions, 204 deletions
diff --git a/Help/generator/Visual Studio 10 2010.rst b/Help/generator/Visual Studio 10 2010.rst
new file mode 100644
index 0000000..000677a
--- /dev/null
+++ b/Help/generator/Visual Studio 10 2010.rst
@@ -0,0 +1,12 @@
+Visual Studio 10 2010
+---------------------
+
+Generates Visual Studio 10 (VS 2010) project files.
+
+It is possible to append a space followed by the platform name to
+create project files for a specific target platform. E.g.
+"Visual Studio 10 2010 Win64" will create project files for the
+x64 processor; "Visual Studio 10 2010 IA64" for Itanium.
+
+For compatibility with CMake versions prior to 3.0, one may specify this
+generator using the name "Visual Studio 10" without the year component.
diff --git a/Help/generator/Visual Studio 10.rst b/Help/generator/Visual Studio 10.rst
deleted file mode 100644
index 9ea7970..0000000
--- a/Help/generator/Visual Studio 10.rst
+++ /dev/null
@@ -1,9 +0,0 @@
-Visual Studio 10
-----------------
-
-Generates Visual Studio 10 (2010) project files.
-
-It is possible to append a space followed by the platform name to
-create project files for a specific target platform. E.g. "Visual
-Studio 10 Win64" will create project files for the x64 processor;
-"Visual Studio 10 IA64" for Itanium.
diff --git a/Help/generator/Visual Studio 11 2012.rst b/Help/generator/Visual Studio 11 2012.rst
new file mode 100644
index 0000000..42f6f91
--- /dev/null
+++ b/Help/generator/Visual Studio 11 2012.rst
@@ -0,0 +1,12 @@
+Visual Studio 11 2012
+---------------------
+
+Generates Visual Studio 11 (VS 2012) project files.
+
+It is possible to append a space followed by the platform name to
+create project files for a specific target platform. E.g.
+"Visual Studio 11 2012 Win64" will create project files for the
+x64 processor; "Visual Studio 11 2012 ARM" for ARM.
+
+For compatibility with CMake versions prior to 3.0, one may specify this
+generator using the name "Visual Studio 11" without the year component.
diff --git a/Help/generator/Visual Studio 11.rst b/Help/generator/Visual Studio 11.rst
deleted file mode 100644
index 4115c8d..0000000
--- a/Help/generator/Visual Studio 11.rst
+++ /dev/null
@@ -1,9 +0,0 @@
-Visual Studio 11
-----------------
-
-Generates Visual Studio 11 (2012) project files.
-
-It is possible to append a space followed by the platform name to
-create project files for a specific target platform. E.g. "Visual
-Studio 11 Win64" will create project files for the x64 processor;
-"Visual Studio 11 ARM" for ARM.
diff --git a/Help/generator/Visual Studio 12 2013.rst b/Help/generator/Visual Studio 12 2013.rst
new file mode 100644
index 0000000..d2f4912
--- /dev/null
+++ b/Help/generator/Visual Studio 12 2013.rst
@@ -0,0 +1,12 @@
+Visual Studio 12 2013
+---------------------
+
+Generates Visual Studio 12 (VS 2013) project files.
+
+It is possible to append a space followed by the platform name to
+create project files for a specific target platform. E.g.
+"Visual Studio 12 2013 Win64" will create project files for the
+x64 processor; "Visual Studio 12 2013 ARM" for ARM.
+
+For compatibility with CMake versions prior to 3.0, one may specify this
+generator using the name "Visual Studio 12" without the year component.
diff --git a/Help/generator/Visual Studio 12.rst b/Help/generator/Visual Studio 12.rst
deleted file mode 100644
index 51bcab7..0000000
--- a/Help/generator/Visual Studio 12.rst
+++ /dev/null
@@ -1,9 +0,0 @@
-Visual Studio 12
-----------------
-
-Generates Visual Studio 12 (2013) project files.
-
-It is possible to append a space followed by the platform name to
-create project files for a specific target platform. E.g. "Visual
-Studio 12 Win64" will create project files for the x64 processor;
-"Visual Studio 12 ARM" for ARM.
diff --git a/Help/index.rst b/Help/index.rst
index b313706..dea1463 100644
--- a/Help/index.rst
+++ b/Help/index.rst
@@ -1,3 +1,5 @@
+.. title:: CMake Reference Documentation
+
Command-Line Tools
##################
diff --git a/Help/manual/ccmake.1.rst b/Help/manual/ccmake.1.rst
index 62a7dcf..0c4f47e 100644
--- a/Help/manual/ccmake.1.rst
+++ b/Help/manual/ccmake.1.rst
@@ -1,3 +1,5 @@
+.. cmake-manual-description: CMake Curses Dialog Command-Line Reference
+
ccmake(1)
*********
diff --git a/Help/manual/cmake-commands.7.rst b/Help/manual/cmake-commands.7.rst
index 71d7375..9b23efa 100644
--- a/Help/manual/cmake-commands.7.rst
+++ b/Help/manual/cmake-commands.7.rst
@@ -1,3 +1,5 @@
+.. cmake-manual-description: CMake Language Command Reference
+
cmake-commands(7)
*****************
diff --git a/Help/manual/cmake-developer.7.rst b/Help/manual/cmake-developer.7.rst
index 198a240..ee2016f 100644
--- a/Help/manual/cmake-developer.7.rst
+++ b/Help/manual/cmake-developer.7.rst
@@ -1,3 +1,5 @@
+.. cmake-manual-description: CMake Developer Reference
+
cmake-developer(7)
******************
diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst
index 849ee36..ddde183 100644
--- a/Help/manual/cmake-generator-expressions.7.rst
+++ b/Help/manual/cmake-generator-expressions.7.rst
@@ -1,3 +1,5 @@
+.. cmake-manual-description: CMake Generator Expressions
+
cmake-generator-expressions(7)
******************************
diff --git a/Help/manual/cmake-generators.7.rst b/Help/manual/cmake-generators.7.rst
index c73d587..a290d1a 100644
--- a/Help/manual/cmake-generators.7.rst
+++ b/Help/manual/cmake-generators.7.rst
@@ -1,3 +1,5 @@
+.. cmake-manual-description: CMake Generators Reference
+
cmake-generators(7)
*******************
@@ -30,9 +32,9 @@ All Generators
/generator/Sublime Text 2 - NMake Makefiles
/generator/Sublime Text 2 - Unix Makefiles
/generator/Unix Makefiles
- /generator/Visual Studio 10
- /generator/Visual Studio 11
- /generator/Visual Studio 12
+ /generator/Visual Studio 10 2010
+ /generator/Visual Studio 11 2012
+ /generator/Visual Studio 12 2013
/generator/Visual Studio 6
/generator/Visual Studio 7 .NET 2003
/generator/Visual Studio 7
diff --git a/Help/manual/cmake-gui.1.rst b/Help/manual/cmake-gui.1.rst
index e773ee1..ff01332 100644
--- a/Help/manual/cmake-gui.1.rst
+++ b/Help/manual/cmake-gui.1.rst
@@ -1,3 +1,5 @@
+.. cmake-manual-description: CMake GUI Command-Line Reference
+
cmake-gui(1)
************
diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst
index da518d3..1f3e59f 100644
--- a/Help/manual/cmake-modules.7.rst
+++ b/Help/manual/cmake-modules.7.rst
@@ -1,3 +1,5 @@
+.. cmake-manual-description: CMake Modules Reference
+
cmake-modules(7)
****************
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index fcbccba..e3cf74d 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -1,3 +1,5 @@
+.. cmake-manual-description: CMake Policies Reference
+
cmake-policies(7)
*****************
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index 6fbde74..7fe1bf2 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -1,3 +1,5 @@
+.. cmake-manual-description: CMake Properties Reference
+
cmake-properties(7)
*******************
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index 22a1c4d..dccaf64 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -1,3 +1,5 @@
+.. cmake-manual-description: CMake Variables Reference
+
cmake-variables(7)
******************
diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst
index d2a45aa..f74402e 100644
--- a/Help/manual/cmake.1.rst
+++ b/Help/manual/cmake.1.rst
@@ -1,3 +1,5 @@
+.. cmake-manual-description: CMake Command-Line Reference
+
cmake(1)
********
diff --git a/Help/manual/cpack.1.rst b/Help/manual/cpack.1.rst
index 5c6567c..22e5d5a 100644
--- a/Help/manual/cpack.1.rst
+++ b/Help/manual/cpack.1.rst
@@ -1,3 +1,5 @@
+.. cmake-manual-description: CPack Command-Line Reference
+
cpack(1)
********
diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst
index 43fb961..4a5f12e 100644
--- a/Help/manual/ctest.1.rst
+++ b/Help/manual/ctest.1.rst
@@ -1,3 +1,5 @@
+.. cmake-manual-description: CTest Command-Line Reference
+
ctest(1)
********
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 3028463..785fc87 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -2,5 +2,5 @@
set(CMake_VERSION_MAJOR 2)
set(CMake_VERSION_MINOR 8)
set(CMake_VERSION_PATCH 12)
-set(CMake_VERSION_TWEAK 20131029)
+set(CMake_VERSION_TWEAK 20131031)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index ef071b9..33b084e 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -142,6 +142,7 @@ void cmCTestCoverageHandler::Initialize()
this->Superclass::Initialize();
this->CustomCoverageExclude.clear();
this->SourceLabels.clear();
+ this->TargetDirs.clear();
this->LabelIdMap.clear();
this->Labels.clear();
this->LabelFilter.clear();
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 511ae8a..6217955 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -25,8 +25,6 @@ cmGeneratorTarget::cmGeneratorTarget(cmTarget* t): Target(t)
this->Makefile = this->Target->GetMakefile();
this->LocalGenerator = this->Makefile->GetLocalGenerator();
this->GlobalGenerator = this->LocalGenerator->GetGlobalGenerator();
- this->ClassifySources();
- this->LookupObjectLibraries();
}
//----------------------------------------------------------------------------
@@ -324,3 +322,79 @@ std::vector<std::string> cmGeneratorTarget::GetIncludeDirectories(
{
return this->Target->GetIncludeDirectories(config);
}
+
+//----------------------------------------------------------------------------
+void cmGeneratorTarget::GenerateTargetManifest(const char* config)
+{
+ if (this->Target->IsImported())
+ {
+ return;
+ }
+ cmMakefile* mf = this->Target->GetMakefile();
+ cmLocalGenerator* lg = mf->GetLocalGenerator();
+ cmGlobalGenerator* gg = lg->GetGlobalGenerator();
+
+ // Get the names.
+ std::string name;
+ std::string soName;
+ std::string realName;
+ std::string impName;
+ std::string pdbName;
+ if(this->GetType() == cmTarget::EXECUTABLE)
+ {
+ this->Target->GetExecutableNames(name, realName, impName, pdbName,
+ config);
+ }
+ else if(this->GetType() == cmTarget::STATIC_LIBRARY ||
+ this->GetType() == cmTarget::SHARED_LIBRARY ||
+ this->GetType() == cmTarget::MODULE_LIBRARY)
+ {
+ this->Target->GetLibraryNames(name, soName, realName, impName, pdbName,
+ config);
+ }
+ else
+ {
+ return;
+ }
+
+ // Get the directory.
+ std::string dir = this->Target->GetDirectory(config, false);
+
+ // Add each name.
+ std::string f;
+ if(!name.empty())
+ {
+ f = dir;
+ f += "/";
+ f += name;
+ gg->AddToManifest(config? config:"", f);
+ }
+ if(!soName.empty())
+ {
+ f = dir;
+ f += "/";
+ f += soName;
+ gg->AddToManifest(config? config:"", f);
+ }
+ if(!realName.empty())
+ {
+ f = dir;
+ f += "/";
+ f += realName;
+ gg->AddToManifest(config? config:"", f);
+ }
+ if(!pdbName.empty())
+ {
+ f = dir;
+ f += "/";
+ f += pdbName;
+ gg->AddToManifest(config? config:"", f);
+ }
+ if(!impName.empty())
+ {
+ f = this->Target->GetDirectory(config, true);
+ f += "/";
+ f += impName;
+ gg->AddToManifest(config? config:"", f);
+ }
+}
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index dedfa60..9723f72 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -74,10 +74,13 @@ public:
bool IsSystemIncludeDirectory(const char *dir, const char *config);
-private:
+ /** Add the target output files to the global generator manifest. */
+ void GenerateTargetManifest(const char* config);
+
void ClassifySources();
void LookupObjectLibraries();
+private:
std::map<std::string, std::vector<std::string> > SystemIncludesCache;
cmGeneratorTarget(cmGeneratorTarget const&);
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 465763d..8a8d61a 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1128,6 +1128,9 @@ void cmGlobalGenerator::Generate()
this->LocalGenerators[i]->AddHelperCommands();
}
+ // Create per-target generator information.
+ this->CreateGeneratorTargets();
+
// Trace the dependencies, after that no custom commands should be added
// because their dependencies might not be handled correctly
for (i = 0; i < this->LocalGenerators.size(); ++i)
@@ -1141,8 +1144,7 @@ void cmGlobalGenerator::Generate()
this->LocalGenerators[i]->GenerateTargetManifest();
}
- // Create per-target generator information.
- this->CreateGeneratorTargets();
+ this->ComputeGeneratorTargetObjects();
this->ProcessEvaluationFiles();
@@ -1336,7 +1338,6 @@ void cmGlobalGenerator::CreateGeneratorTargets()
cmGeneratorTarget* gt = new cmGeneratorTarget(t);
this->GeneratorTargets[t] = gt;
- this->ComputeTargetObjects(gt);
generatorTargets[t] = gt;
}
@@ -1354,6 +1355,25 @@ void cmGlobalGenerator::CreateGeneratorTargets()
}
//----------------------------------------------------------------------------
+void cmGlobalGenerator::ComputeGeneratorTargetObjects()
+{
+ // Construct per-target generator information.
+ for(unsigned int i=0; i < this->LocalGenerators.size(); ++i)
+ {
+ cmMakefile *mf = this->LocalGenerators[i]->GetMakefile();
+ cmGeneratorTargetsType targets = mf->GetGeneratorTargets();
+ for(cmGeneratorTargetsType::iterator ti = targets.begin();
+ ti != targets.end(); ++ti)
+ {
+ cmGeneratorTarget* gt = ti->second;
+ gt->ClassifySources();
+ gt->LookupObjectLibraries();
+ this->ComputeTargetObjects(gt);
+ }
+ }
+}
+
+//----------------------------------------------------------------------------
void cmGlobalGenerator::ClearGeneratorTargets()
{
for(cmGeneratorTargetsType::iterator i = this->GeneratorTargets.begin();
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 1538cb5..4d6e10f 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -52,6 +52,10 @@ public:
///! Get the name for this generator
virtual const char *GetName() const { return "Generic"; };
+ /** Check whether the given name matches the current generator. */
+ virtual bool MatchesGeneratorName(const char* name) const
+ { return strcmp(this->GetName(), name) == 0; }
+
/** Set the generator-specific toolset name. Returns true if toolset
is supported and false otherwise. */
virtual bool SetGeneratorToolset(std::string const& ts);
@@ -408,6 +412,7 @@ private:
// Per-target generator information.
cmGeneratorTargetsType GeneratorTargets;
void CreateGeneratorTargets();
+ void ComputeGeneratorTargetObjects();
void ClearGeneratorTargets();
virtual void ComputeTargetObjects(cmGeneratorTarget* gt) const;
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 07ccc33..5e29fd7 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -18,42 +18,65 @@
#include "cmVisualStudioSlnParser.h"
#include "cmake.h"
-static const char vs10Win32generatorName[] = "Visual Studio 10";
-static const char vs10Win64generatorName[] = "Visual Studio 10 Win64";
-static const char vs10IA64generatorName[] = "Visual Studio 10 IA64";
+static const char vs10generatorName[] = "Visual Studio 10 2010";
+
+// Map generator name without year to name with year.
+static const char* cmVS10GenName(const char* name, std::string& genName)
+{
+ if(strncmp(name, vs10generatorName, sizeof(vs10generatorName)-6) != 0)
+ {
+ return 0;
+ }
+ const char* p = name + sizeof(vs10generatorName) - 6;
+ if(strncmp(p, " 2010", 5) == 0)
+ {
+ p += 5;
+ }
+ genName = std::string(vs10generatorName) + p;
+ return p;
+}
class cmGlobalVisualStudio10Generator::Factory
: public cmGlobalGeneratorFactory
{
public:
- virtual cmGlobalGenerator* CreateGlobalGenerator(const char* name) const {
- if(!strcmp(name, vs10Win32generatorName))
+ virtual cmGlobalGenerator* CreateGlobalGenerator(const char* name) const
+ {
+ std::string genName;
+ const char* p = cmVS10GenName(name, genName);
+ if(!p)
+ { return 0; }
+ name = genName.c_str();
+ if(strcmp(p, "") == 0)
{
return new cmGlobalVisualStudio10Generator(
name, NULL, NULL);
}
- if(!strcmp(name, vs10Win64generatorName))
+ if(strcmp(p, " Win64") == 0)
{
return new cmGlobalVisualStudio10Generator(
name, "x64", "CMAKE_FORCE_WIN64");
}
- if(!strcmp(name, vs10IA64generatorName))
+ if(strcmp(p, " IA64") == 0)
{
return new cmGlobalVisualStudio10Generator(
name, "Itanium", "CMAKE_FORCE_IA64");
}
return 0;
- }
+ }
- virtual void GetDocumentation(cmDocumentationEntry& entry) const {
- entry.Name = "Visual Studio 10";
- entry.Brief = "Generates Visual Studio 10 (2010) project files.";
- }
+ virtual void GetDocumentation(cmDocumentationEntry& entry) const
+ {
+ entry.Name = vs10generatorName;
+ entry.Brief = "Generates Visual Studio 10 (VS 2010) project files.";
+ }
- virtual void GetGenerators(std::vector<std::string>& names) const {
- names.push_back(vs10Win32generatorName);
- names.push_back(vs10Win64generatorName);
- names.push_back(vs10IA64generatorName); }
+ virtual void GetGenerators(std::vector<std::string>& names) const
+ {
+ names.push_back(vs10generatorName);
+ names.push_back(vs10generatorName + std::string(" IA64"));
+ names.push_back(vs10generatorName + std::string(" Win64"));
+ }
};
//----------------------------------------------------------------------------
@@ -79,6 +102,18 @@ cmGlobalVisualStudio10Generator::cmGlobalVisualStudio10Generator(
//----------------------------------------------------------------------------
bool
+cmGlobalVisualStudio10Generator::MatchesGeneratorName(const char* name) const
+{
+ std::string genName;
+ if(cmVS10GenName(name, genName))
+ {
+ return genName == this->GetName();
+ }
+ return false;
+}
+
+//----------------------------------------------------------------------------
+bool
cmGlobalVisualStudio10Generator::SetGeneratorToolset(std::string const& ts)
{
this->PlatformToolset = ts;
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index 31e122e..e9e7cb1 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -28,6 +28,8 @@ public:
const char* platformName, const char* additionalPlatformDefinition);
static cmGlobalGeneratorFactory* NewFactory();
+ virtual bool MatchesGeneratorName(const char* name) const;
+
virtual bool SetGeneratorToolset(std::string const& ts);
virtual std::string
diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx
index 41a349e..d968c6d 100644
--- a/Source/cmGlobalVisualStudio11Generator.cxx
+++ b/Source/cmGlobalVisualStudio11Generator.cxx
@@ -13,42 +13,54 @@
#include "cmLocalVisualStudio10Generator.h"
#include "cmMakefile.h"
-static const char vs11generatorName[] = "Visual Studio 11";
+static const char vs11generatorName[] = "Visual Studio 11 2012";
+
+// Map generator name without year to name with year.
+static const char* cmVS11GenName(const char* name, std::string& genName)
+{
+ if(strncmp(name, vs11generatorName, sizeof(vs11generatorName)-6) != 0)
+ {
+ return 0;
+ }
+ const char* p = name + sizeof(vs11generatorName) - 6;
+ if(strncmp(p, " 2012", 5) == 0)
+ {
+ p += 5;
+ }
+ genName = std::string(vs11generatorName) + p;
+ return p;
+}
class cmGlobalVisualStudio11Generator::Factory
: public cmGlobalGeneratorFactory
{
public:
- virtual cmGlobalGenerator* CreateGlobalGenerator(const char* name) const {
- if(strstr(name, vs11generatorName) != name)
- {
- return 0;
- }
-
- const char* p = name + sizeof(vs11generatorName) - 1;
- if(p[0] == '\0')
+ virtual cmGlobalGenerator* CreateGlobalGenerator(const char* name) const
+ {
+ std::string genName;
+ const char* p = cmVS11GenName(name, genName);
+ if(!p)
+ { return 0; }
+ name = genName.c_str();
+ if(strcmp(p, "") == 0)
{
return new cmGlobalVisualStudio11Generator(
name, NULL, NULL);
}
-
- if(p[0] != ' ')
+ if(strcmp(p, " Win64") == 0)
{
- return 0;
+ return new cmGlobalVisualStudio11Generator(
+ name, "x64", "CMAKE_FORCE_WIN64");
}
-
- ++p;
-
- if(!strcmp(p, "ARM"))
+ if(strcmp(p, " ARM") == 0)
{
return new cmGlobalVisualStudio11Generator(
name, "ARM", NULL);
}
- if(!strcmp(p, "Win64"))
+ if(*p++ != ' ')
{
- return new cmGlobalVisualStudio11Generator(
- name, "x64", "CMAKE_FORCE_WIN64");
+ return 0;
}
std::set<std::string> installedSDKs =
@@ -63,14 +75,16 @@ public:
new cmGlobalVisualStudio11Generator(name, p, NULL);
ret->WindowsCEVersion = "8.00";
return ret;
- }
+ }
- virtual void GetDocumentation(cmDocumentationEntry& entry) const {
- entry.Name = "Visual Studio 11";
- entry.Brief = "Generates Visual Studio 11 (2012) project files.";
- }
+ virtual void GetDocumentation(cmDocumentationEntry& entry) const
+ {
+ entry.Name = vs11generatorName;
+ entry.Brief = "Generates Visual Studio 11 (VS 2012) project files.";
+ }
- virtual void GetGenerators(std::vector<std::string>& names) const {
+ virtual void GetGenerators(std::vector<std::string>& names) const
+ {
names.push_back(vs11generatorName);
names.push_back(vs11generatorName + std::string(" ARM"));
names.push_back(vs11generatorName + std::string(" Win64"));
@@ -80,9 +94,9 @@ public:
for(std::set<std::string>::const_iterator i =
installedSDKs.begin(); i != installedSDKs.end(); ++i)
{
- names.push_back("Visual Studio 11 " + *i);
+ names.push_back(std::string(vs11generatorName) + " " + *i);
}
- }
+ }
};
//----------------------------------------------------------------------------
@@ -107,6 +121,18 @@ cmGlobalVisualStudio11Generator::cmGlobalVisualStudio11Generator(
}
//----------------------------------------------------------------------------
+bool
+cmGlobalVisualStudio11Generator::MatchesGeneratorName(const char* name) const
+{
+ std::string genName;
+ if(cmVS11GenName(name, genName))
+ {
+ return genName == this->GetName();
+ }
+ return false;
+}
+
+//----------------------------------------------------------------------------
void cmGlobalVisualStudio11Generator::WriteSLNHeader(std::ostream& fout)
{
fout << "Microsoft Visual Studio Solution File, Format Version 12.00\n";
diff --git a/Source/cmGlobalVisualStudio11Generator.h b/Source/cmGlobalVisualStudio11Generator.h
index 7cc7e69..7ef77e7 100644
--- a/Source/cmGlobalVisualStudio11Generator.h
+++ b/Source/cmGlobalVisualStudio11Generator.h
@@ -24,6 +24,8 @@ public:
const char* platformName, const char* additionalPlatformDefinition);
static cmGlobalGeneratorFactory* NewFactory();
+ virtual bool MatchesGeneratorName(const char* name) const;
+
virtual void WriteSLNHeader(std::ostream& fout);
///! create the correct local generator
diff --git a/Source/cmGlobalVisualStudio12Generator.cxx b/Source/cmGlobalVisualStudio12Generator.cxx
index c2cdc0b..f3806df 100644
--- a/Source/cmGlobalVisualStudio12Generator.cxx
+++ b/Source/cmGlobalVisualStudio12Generator.cxx
@@ -13,42 +13,65 @@
#include "cmLocalVisualStudio10Generator.h"
#include "cmMakefile.h"
-static const char vs12Win32generatorName[] = "Visual Studio 12";
-static const char vs12Win64generatorName[] = "Visual Studio 12 Win64";
-static const char vs12ARMgeneratorName[] = "Visual Studio 12 ARM";
+static const char vs12generatorName[] = "Visual Studio 12 2013";
+
+// Map generator name without year to name with year.
+static const char* cmVS12GenName(const char* name, std::string& genName)
+{
+ if(strncmp(name, vs12generatorName, sizeof(vs12generatorName)-6) != 0)
+ {
+ return 0;
+ }
+ const char* p = name + sizeof(vs12generatorName) - 6;
+ if(strncmp(p, " 2013", 5) == 0)
+ {
+ p += 5;
+ }
+ genName = std::string(vs12generatorName) + p;
+ return p;
+}
class cmGlobalVisualStudio12Generator::Factory
: public cmGlobalGeneratorFactory
{
public:
- virtual cmGlobalGenerator* CreateGlobalGenerator(const char* name) const {
- if(!strcmp(name, vs12Win32generatorName))
+ virtual cmGlobalGenerator* CreateGlobalGenerator(const char* name) const
+ {
+ std::string genName;
+ const char* p = cmVS12GenName(name, genName);
+ if(!p)
+ { return 0; }
+ name = genName.c_str();
+ if(strcmp(p, "") == 0)
{
return new cmGlobalVisualStudio12Generator(
name, NULL, NULL);
}
- if(!strcmp(name, vs12Win64generatorName))
+ if(strcmp(p, " Win64") == 0)
{
return new cmGlobalVisualStudio12Generator(
name, "x64", "CMAKE_FORCE_WIN64");
}
- if(!strcmp(name, vs12ARMgeneratorName))
+ if(strcmp(p, " ARM") == 0)
{
return new cmGlobalVisualStudio12Generator(
name, "ARM", NULL);
}
return 0;
- }
+ }
- virtual void GetDocumentation(cmDocumentationEntry& entry) const {
- entry.Name = "Visual Studio 12";
- entry.Brief = "Generates Visual Studio 12 (2013) project files.";
- }
+ virtual void GetDocumentation(cmDocumentationEntry& entry) const
+ {
+ entry.Name = vs12generatorName;
+ entry.Brief = "Generates Visual Studio 12 (VS 2013) project files.";
+ }
- virtual void GetGenerators(std::vector<std::string>& names) const {
- names.push_back(vs12Win32generatorName);
- names.push_back(vs12Win64generatorName);
- names.push_back(vs12ARMgeneratorName); }
+ virtual void GetGenerators(std::vector<std::string>& names) const
+ {
+ names.push_back(vs12generatorName);
+ names.push_back(vs12generatorName + std::string(" ARM"));
+ names.push_back(vs12generatorName + std::string(" Win64"));
+ }
};
//----------------------------------------------------------------------------
@@ -73,6 +96,18 @@ cmGlobalVisualStudio12Generator::cmGlobalVisualStudio12Generator(
}
//----------------------------------------------------------------------------
+bool
+cmGlobalVisualStudio12Generator::MatchesGeneratorName(const char* name) const
+{
+ std::string genName;
+ if(cmVS12GenName(name, genName))
+ {
+ return genName == this->GetName();
+ }
+ return false;
+}
+
+//----------------------------------------------------------------------------
void cmGlobalVisualStudio12Generator::WriteSLNHeader(std::ostream& fout)
{
fout << "Microsoft Visual Studio Solution File, Format Version 12.00\n";
diff --git a/Source/cmGlobalVisualStudio12Generator.h b/Source/cmGlobalVisualStudio12Generator.h
index 8c8aeb1..5a4a78d 100644
--- a/Source/cmGlobalVisualStudio12Generator.h
+++ b/Source/cmGlobalVisualStudio12Generator.h
@@ -24,6 +24,8 @@ public:
const char* platformName, const char* additionalPlatformDefinition);
static cmGlobalGeneratorFactory* NewFactory();
+ virtual bool MatchesGeneratorName(const char* name) const;
+
virtual void WriteSLNHeader(std::ostream& fout);
///! create the correct local generator
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index edf80e6..2a29061 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -530,10 +530,11 @@ void cmLocalGenerator::GenerateTargetManifest()
this->Makefile->GetConfigurations(configNames);
// Add our targets to the manifest for each configuration.
- cmTargets& targets = this->Makefile->GetTargets();
- for(cmTargets::iterator t = targets.begin(); t != targets.end(); ++t)
+ cmGeneratorTargetsType targets = this->Makefile->GetGeneratorTargets();
+ for(cmGeneratorTargetsType::iterator t = targets.begin();
+ t != targets.end(); ++t)
{
- cmTarget& target = t->second;
+ cmGeneratorTarget& target = *t->second;
if(configNames.empty())
{
target.GenerateTargetManifest(0);
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 59c407b..6d6d2d8 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2725,27 +2725,34 @@ const char* cmTarget::GetLocation(const char* config)
//----------------------------------------------------------------------------
const char* cmTarget::ImportedGetLocation(const char* config)
{
- this->Location = this->ImportedGetFullPath(config, false);
- return this->Location.c_str();
+ static std::string location;
+ location = this->ImportedGetFullPath(config, false);
+ return location.c_str();
}
//----------------------------------------------------------------------------
const char* cmTarget::NormalGetLocation(const char* config)
{
+ static std::string location;
// Handle the configuration-specific case first.
if(config)
{
- this->Location = this->GetFullPath(config, false);
- return this->Location.c_str();
+ location = this->GetFullPath(config, false);
+ return location.c_str();
}
// Now handle the deprecated build-time configuration location.
- this->Location = this->GetDirectory();
+ location = this->GetDirectory();
+ if(!location.empty())
+ {
+ location += "/";
+ }
const char* cfgid = this->Makefile->GetDefinition("CMAKE_CFG_INTDIR");
if(cfgid && strcmp(cfgid, ".") != 0)
{
- this->Location += "/";
- this->Location += cfgid;
+ location += "/";
+ location += cfgid;
+ location += "/";
}
if(this->IsAppBundleOnApple())
@@ -2753,13 +2760,13 @@ const char* cmTarget::NormalGetLocation(const char* config)
std::string macdir = this->BuildMacContentDirectory("", config, false);
if(!macdir.empty())
{
- this->Location += "/";
- this->Location += macdir;
+ location += "/";
+ location += macdir;
}
}
- this->Location += "/";
- this->Location += this->GetFullName(config, false);
- return this->Location.c_str();
+ location += "/";
+ location += this->GetFullName(config, false);
+ return location.c_str();
}
//----------------------------------------------------------------------------
@@ -3917,76 +3924,6 @@ bool cmTarget::GetImplibGNUtoMS(std::string const& gnuName,
}
//----------------------------------------------------------------------------
-void cmTarget::GenerateTargetManifest(const char* config)
-{
- cmMakefile* mf = this->Makefile;
- cmLocalGenerator* lg = mf->GetLocalGenerator();
- cmGlobalGenerator* gg = lg->GetGlobalGenerator();
-
- // Get the names.
- std::string name;
- std::string soName;
- std::string realName;
- std::string impName;
- std::string pdbName;
- if(this->GetType() == cmTarget::EXECUTABLE)
- {
- this->GetExecutableNames(name, realName, impName, pdbName, config);
- }
- else if(this->GetType() == cmTarget::STATIC_LIBRARY ||
- this->GetType() == cmTarget::SHARED_LIBRARY ||
- this->GetType() == cmTarget::MODULE_LIBRARY)
- {
- this->GetLibraryNames(name, soName, realName, impName, pdbName, config);
- }
- else
- {
- return;
- }
-
- // Get the directory.
- std::string dir = this->GetDirectory(config, false);
-
- // Add each name.
- std::string f;
- if(!name.empty())
- {
- f = dir;
- f += "/";
- f += name;
- gg->AddToManifest(config? config:"", f);
- }
- if(!soName.empty())
- {
- f = dir;
- f += "/";
- f += soName;
- gg->AddToManifest(config? config:"", f);
- }
- if(!realName.empty())
- {
- f = dir;
- f += "/";
- f += realName;
- gg->AddToManifest(config? config:"", f);
- }
- if(!pdbName.empty())
- {
- f = this->GetPDBDirectory(config);
- f += "/";
- f += pdbName;
- gg->AddToManifest(config? config:"", f);
- }
- if(!impName.empty())
- {
- f = this->GetDirectory(config, true);
- f += "/";
- f += impName;
- gg->AddToManifest(config? config:"", f);
- }
-}
-
-//----------------------------------------------------------------------------
void cmTarget::SetPropertyDefault(const char* property,
const char* default_value)
{
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 9d62f5f..41af8ab 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -410,9 +410,6 @@ public:
bool GetImplibGNUtoMS(std::string const& gnuName, std::string& out,
const char* newExt = 0);
- /** Add the target output files to the global generator manifest. */
- void GenerateTargetManifest(const char* config);
-
/**
* Compute whether this target must be relinked before installing.
*/
@@ -677,7 +674,6 @@ private:
bool HaveInstallRule;
std::string InstallPath;
std::string RuntimeInstallPath;
- std::string Location;
std::string ExportMacro;
std::set<cmStdString> Utilities;
bool RecordDependencies;
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 186d4e6..f786691 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -1468,9 +1468,9 @@ int cmake::ActualConfigure()
{"7.1", "Visual Studio 7 .NET 2003"},
{"8.0", "Visual Studio 8 2005"},
{"9.0", "Visual Studio 9 2008"},
- {"10.0", "Visual Studio 10"},
- {"11.0", "Visual Studio 11"},
- {"12.0", "Visual Studio 12"},
+ {"10.0", "Visual Studio 10 2010"},
+ {"11.0", "Visual Studio 11 2012"},
+ {"12.0", "Visual Studio 12 2013"},
{0, 0}};
for(int i=0; version[i].MSVersion != 0; i++)
{
@@ -1509,7 +1509,7 @@ int cmake::ActualConfigure()
const char* genName = this->CacheManager->GetCacheValue("CMAKE_GENERATOR");
if(genName)
{
- if(strcmp(this->GlobalGenerator->GetName(), genName) != 0)
+ if(!this->GlobalGenerator->MatchesGeneratorName(genName))
{
std::string message = "Error: generator : ";
message += this->GlobalGenerator->GetName();
diff --git a/Tests/RunCMake/Syntax/BracketComment5.cmake b/Tests/RunCMake/Syntax/BracketComment5.cmake
index bb6d9f3..dc9e6b4 100644
--- a/Tests/RunCMake/Syntax/BracketComment5.cmake
+++ b/Tests/RunCMake/Syntax/BracketComment5.cmake
@@ -2,5 +2,10 @@
message(FATAL_ERROR "This is commented out.")
#]] #[[
message(FATAL_ERROR "This is commented out.")
+#]]#[[
+message(FATAL_ERROR "This is commented out.")
#]] #message(FATAL_ERROR "This is commented out.")
+#[[
+message(FATAL_ERROR "This is commented out.")
+#]]#message(FATAL_ERROR "This is commented out.")
message(STATUS "The above FATAL_ERROR did not occur.")
diff --git a/Tests/RunCMake/Syntax/Escape1-stderr.txt b/Tests/RunCMake/Syntax/Escape1-stderr.txt
new file mode 100644
index 0000000..6601ce7
--- /dev/null
+++ b/Tests/RunCMake/Syntax/Escape1-stderr.txt
@@ -0,0 +1,3 @@
+^\\##\[\[#\]\]#\[\[\]\]x#\\"
+\$\@\^\\; \(\)#\\"
+\$\@\^; \(\)$
diff --git a/Tests/RunCMake/Syntax/Escape1.cmake b/Tests/RunCMake/Syntax/Escape1.cmake
new file mode 100644
index 0000000..3bf801e
--- /dev/null
+++ b/Tests/RunCMake/Syntax/Escape1.cmake
@@ -0,0 +1,3 @@
+message([[\#]] \#[[ \#]] "#[[]]" x#comment
+ "\#\\\"\n\$\@\^\;\ \t\(\)"#comment
+ \#\\\"\n\$\@\^\;\ \t\(\))
diff --git a/Tests/RunCMake/Syntax/RunCMakeTest.cmake b/Tests/RunCMake/Syntax/RunCMakeTest.cmake
index 2d49f76..4f42a07 100644
--- a/Tests/RunCMake/Syntax/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Syntax/RunCMakeTest.cmake
@@ -39,6 +39,7 @@ run_cmake(BracketNoSpace2)
run_cmake(BracketNoSpace3)
run_cmake(BracketNoSpace4)
run_cmake(BracketNoSpace5)
+run_cmake(Escape1)
run_cmake(ParenNoSpace0)
run_cmake(ParenNoSpace1)
run_cmake(ParenNoSpace2)
diff --git a/Utilities/Sphinx/CMakeLists.txt b/Utilities/Sphinx/CMakeLists.txt
index 16d9aac..35c62fb 100644
--- a/Utilities/Sphinx/CMakeLists.txt
+++ b/Utilities/Sphinx/CMakeLists.txt
@@ -15,6 +15,7 @@ if(NOT CMake_SOURCE_DIR)
set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required
get_filename_component(tmp "${CMAKE_CURRENT_SOURCE_DIR}" PATH)
get_filename_component(CMake_SOURCE_DIR "${tmp}" PATH)
+ include(${CMake_SOURCE_DIR}/Modules/CTestUseLaunchers.cmake)
include(${CMake_SOURCE_DIR}/Source/CMakeVersionCompute.cmake)
include(${CMake_SOURCE_DIR}/Source/CMakeInstallDestinations.cmake)
unset(CMAKE_DATA_DIR)
@@ -35,6 +36,7 @@ elseif(NOT SPHINX_EXECUTABLE)
message(FATAL_ERROR "SPHINX_EXECUTABLE (sphinx-build) is not found!")
endif()
+set(conf_docs "${CMake_SOURCE_DIR}/Help")
set(conf_path "${CMAKE_CURRENT_SOURCE_DIR}")
set(conf_copyright "2000-2013 Kitware, Inc.")
set(conf_version "${CMake_MAJOR_VERSION}.${CMake_MINOR_VERSION}.${CMake_PATCH_VERSION}")
diff --git a/Utilities/Sphinx/conf.py.in b/Utilities/Sphinx/conf.py.in
index 5dbdede..ea00b78 100644
--- a/Utilities/Sphinx/conf.py.in
+++ b/Utilities/Sphinx/conf.py.in
@@ -10,6 +10,9 @@
# See the License for more information.
#=============================================================================
import sys
+import os
+import re
+import glob
sys.path.insert(0, r'@conf_path@')
@@ -27,21 +30,27 @@ exclude_patterns = []
extensions = ['cmake']
-man_pages = [
- ('manual/cmake.1', 'cmake', 'CMake Command-Line Reference', [], 1),
- ('manual/ccmake.1', 'ccmake', 'CMake Curses Dialog Command-Line Reference', [], 1),
- ('manual/cmake-gui.1', 'cmake-gui', 'CMake GUI Command-Line Reference', [], 1),
- ('manual/cpack.1', 'cpack', 'CPack Command-Line Reference', [], 1),
- ('manual/ctest.1', 'ctest', 'CTest Command-Line Reference', [], 1),
- ('manual/cmake-commands.7', 'cmake-commands', 'CMake Language Command Reference', [], 7),
- ('manual/cmake-generators.7', 'cmake-generators', 'CMake Generators Reference', [], 7),
- ('manual/cmake-modules.7', 'cmake-modules', 'CMake Modules Reference', [], 7),
- ('manual/cmake-policies.7', 'cmake-policies', 'CMake Policies Reference', [], 7),
- ('manual/cmake-properties.7', 'cmake-properties', 'CMake Properties Reference', [], 7),
- ('manual/cmake-variables.7', 'cmake-variables', 'CMake Variables Reference', [], 7),
- ('manual/cmake-generator-expressions.7', 'cmake-generator-expressions', 'CMake Generator Expressions', [], 7),
- ('manual/cmake-developer.7', 'cmake-developer', 'CMake Developer Reference', [], 7),
-]
+cmake_manuals = sorted(glob.glob(r'@conf_docs@/manual/*.rst'))
+cmake_manual_description = re.compile('^\.\. cmake-manual-description:(.*)$')
+man_pages = []
+for fpath in cmake_manuals:
+ try:
+ name, sec, rst = os.path.basename(fpath).split('.')
+ desc = None
+ f = open(fpath, 'r')
+ for l in f:
+ m = cmake_manual_description.match(l)
+ if m:
+ desc = m.group(1).strip()
+ break
+ f.close()
+ if desc:
+ man_pages.append(('manual/%s.%s' % (name, sec),
+ name, desc, [], int(sec)))
+ else:
+ sys.stderr.write("ERROR: No cmake-manual-description in '%s'\n" % fpath)
+ except Exception, e:
+ sys.stderr.write("ERROR: %s\n" % str(e))
man_show_urls = False
html_show_sourcelink = True