[Cmake-commits] CMake branch, master, updated. v3.11.2-815-g5915c5b
Kitware Robot
kwrobot at kitware.com
Mon May 21 11:05:08 EDT 2018
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, master has been updated
via 5915c5bf554e2671af81421ab02aee9d0fe89e9a (commit)
via 64ec064212d27c91bb88967f9c242f131f2663e7 (commit)
via 7b42ffce09b589b8a7b1af348920e9c4808bd69f (commit)
via 79ca546ed2d7d0ef546533978dfc4af4023d7194 (commit)
via 963a33f4a86d8dd181446696bb5c64db91276906 (commit)
via fd0da95f6333b7a12f4f9b22e60adb429430d283 (commit)
via 790fc415b1ecb55a930130655c197e2b90df3ad8 (commit)
via 78f0dcdcc90d53f3636d511262f797585f170ae7 (commit)
via 2ae2f0ca983c52300a8d0583083756371cbeac5e (commit)
from 722056372e4ae640c1e61ac1dabfdd8a2737a35f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5915c5bf554e2671af81421ab02aee9d0fe89e9a
commit 5915c5bf554e2671af81421ab02aee9d0fe89e9a
Merge: 64ec064 78f0dcd
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon May 21 15:04:14 2018 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon May 21 11:04:56 2018 -0400
Merge topic 'cpackrpm-fix-docs'
78f0dcdcc9 CPackRPM: Fix misleading CPACK_RPM_SPEC_INSTALL_POST docs
2ae2f0ca98 CPackRPM: Minor formatting cleanup
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !2070
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=64ec064212d27c91bb88967f9c242f131f2663e7
commit 64ec064212d27c91bb88967f9c242f131f2663e7
Merge: 7b42ffc fd0da95
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon May 21 15:03:45 2018 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon May 21 11:04:04 2018 -0400
Merge topic 'eclipse-custom-content'
fd0da95f63 Eclipse: Add property to include additional contents in .cproject file
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !2088
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7b42ffce09b589b8a7b1af348920e9c4808bd69f
commit 7b42ffce09b589b8a7b1af348920e9c4808bd69f
Merge: 963a33f4 79ca546
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon May 21 15:02:33 2018 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon May 21 11:02:42 2018 -0400
Merge topic 'PDBDirectoryGenExpression'
79ca546ed2 Add generator expression support to PDB_OUTPUT_DIRECTORY target property
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !2083
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=79ca546ed2d7d0ef546533978dfc4af4023d7194
commit 79ca546ed2d7d0ef546533978dfc4af4023d7194
Author: Marian Klymov <nekto1989 at gmail.com>
AuthorDate: Thu May 17 00:19:56 2018 +0300
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon May 21 11:00:12 2018 -0400
Add generator expression support to PDB_OUTPUT_DIRECTORY target property
Fixes: #16365
diff --git a/Help/prop_tgt/PDB_OUTPUT_DIRECTORY.rst b/Help/prop_tgt/PDB_OUTPUT_DIRECTORY.rst
index 730cf57..2f667f3 100644
--- a/Help/prop_tgt/PDB_OUTPUT_DIRECTORY.rst
+++ b/Help/prop_tgt/PDB_OUTPUT_DIRECTORY.rst
@@ -5,8 +5,14 @@ Output directory for the MS debug symbols ``.pdb`` file
generated by the linker for an executable or shared library target.
This property specifies the directory into which the MS debug symbols
-will be placed by the linker. This property is initialized by the
-value of the :variable:`CMAKE_PDB_OUTPUT_DIRECTORY` variable if it is
+will be placed by the linker. The property value may use
+:manual:`generator expressions <cmake-generator-expressions(7)>`.
+Multi-configuration generators append a per-configuration
+subdirectory to the specified directory unless a generator expression
+is used.
+
+This property is initialized by the value of the
+:variable:`CMAKE_PDB_OUTPUT_DIRECTORY` variable if it is
set when a target is created.
.. |COMPILE_PDB_XXX| replace:: :prop_tgt:`COMPILE_PDB_OUTPUT_DIRECTORY`
diff --git a/Help/prop_tgt/PDB_OUTPUT_DIRECTORY_CONFIG.rst b/Help/prop_tgt/PDB_OUTPUT_DIRECTORY_CONFIG.rst
index 6037fa0..77fda90 100644
--- a/Help/prop_tgt/PDB_OUTPUT_DIRECTORY_CONFIG.rst
+++ b/Help/prop_tgt/PDB_OUTPUT_DIRECTORY_CONFIG.rst
@@ -11,5 +11,8 @@ property is initialized by the value of the
:variable:`CMAKE_PDB_OUTPUT_DIRECTORY_<CONFIG>` variable if it is
set when a target is created.
+Contents of ``PDB_OUTPUT_DIRECTORY_<CONFIG>`` may use
+:manual:`generator expressions <cmake-generator-expressions(7)>`.
+
.. |COMPILE_PDB_XXX| replace:: :prop_tgt:`COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG>`
.. include:: PDB_NOTE.txt
diff --git a/Help/release/dev/PDBDirectoryGenExpression.rst b/Help/release/dev/PDBDirectoryGenExpression.rst
new file mode 100644
index 0000000..0b93a77
--- /dev/null
+++ b/Help/release/dev/PDBDirectoryGenExpression.rst
@@ -0,0 +1,5 @@
+PDBDirectoryGenExpression
+-------------------------
+
+* The :prop_tgt:`PDB_OUTPUT_DIRECTORY` property learned to support
+ :manual:`generator expressions <cmake-generator-expressions(7)>`.
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 799ae95..0c99ed4 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -4612,13 +4612,24 @@ bool cmGeneratorTarget::ComputePDBOutputDir(const std::string& kind,
// Select an output directory.
if (const char* config_outdir = this->GetProperty(configProp)) {
// Use the user-specified per-configuration output directory.
- out = config_outdir;
+ cmGeneratorExpression ge;
+ std::unique_ptr<cmCompiledGeneratorExpression> cge =
+ ge.Parse(config_outdir);
+ out = cge->Evaluate(this->LocalGenerator, config);
// Skip per-configuration subdirectory.
conf.clear();
} else if (const char* outdir = this->GetProperty(propertyName)) {
// Use the user-specified output directory.
- out = outdir;
+ cmGeneratorExpression ge;
+ std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(outdir);
+ out = cge->Evaluate(this->LocalGenerator, config);
+
+ // Skip per-configuration subdirectory if the value contained a
+ // generator expression.
+ if (out != outdir) {
+ conf.clear();
+ }
}
if (out.empty()) {
return false;
diff --git a/Tests/PDBDirectoryAndName/CMakeLists.txt b/Tests/PDBDirectoryAndName/CMakeLists.txt
index 2fb894e..6d8d6cc 100644
--- a/Tests/PDBDirectoryAndName/CMakeLists.txt
+++ b/Tests/PDBDirectoryAndName/CMakeLists.txt
@@ -19,7 +19,7 @@ set(my_targets "")
add_library(mylibA SHARED mylibA.c)
set_target_properties(mylibA PROPERTIES
PDB_NAME "mylibA_Special"
- PDB_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/mylibA_PDB"
+ PDB_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/mylibA_PDB/$<CONFIG>"
)
list(APPEND my_targets mylibA)
@@ -87,7 +87,13 @@ foreach(t ${my_targets})
if(NOT pdb_dir)
set(pdb_dir ${CMAKE_CURRENT_BINARY_DIR})
endif()
- list(APPEND pdbs ${pdb_dir}/${CMAKE_CFG_INTDIR}/${pdb_name}.pdb)
+ if (pdb_dir MATCHES "\\$<.*>")
+ # Skip per-configuration subdirectory if the value contained
+ # a generator expression.
+ list(APPEND pdbs ${pdb_dir}/${pdb_name}.pdb)
+ else()
+ list(APPEND pdbs ${pdb_dir}/${CMAKE_CFG_INTDIR}/${pdb_name}.pdb)
+ endif()
endforeach()
add_custom_target(check_pdbs ALL VERBATIM
COMMAND ${CMAKE_COMMAND} -Dconfig=$<CONFIGURATION> "-Dpdbs=${pdbs}"
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=963a33f4a86d8dd181446696bb5c64db91276906
commit 963a33f4a86d8dd181446696bb5c64db91276906
Merge: 7220563 790fc41
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon May 21 14:58:31 2018 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon May 21 10:58:53 2018 -0400
Merge topic 'vs-remove-stream'
790fc415b1 cmVisualStudio10TargetGenerator: remove BuildFileStream member
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !2082
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fd0da95f6333b7a12f4f9b22e60adb429430d283
commit fd0da95f6333b7a12f4f9b22e60adb429430d283
Author: Melanie Cappelaere <melanie.cappelaere at barco.com>
AuthorDate: Fri May 18 10:25:37 2018 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri May 18 10:12:19 2018 -0400
Eclipse: Add property to include additional contents in .cproject file
Similar to ECLIPSE_EXTRA_NATURES which can be used to add a third party
nature to the .project, this property offers the possibility to inject
third party contents into the .cproject.
An example of where this is useful is MCUXpresso. This is an IDE based
on Eclipse. Compiling through CMake generated Eclipse projects works
fine by using a custom toolchain. However, in order to be able to debug
using such a project, an extra storageModule specific to the target
board is needed in the cproject.
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index b313f38..9f9c53f 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -40,6 +40,7 @@ Properties of Global Scope
/prop_gbl/JOB_POOLS
/prop_gbl/PREDEFINED_TARGETS_FOLDER
/prop_gbl/ECLIPSE_EXTRA_NATURES
+ /prop_gbl/ECLIPSE_EXTRA_CPROJECT_CONTENTS
/prop_gbl/REPORT_UNDEFINED_PROPERTIES
/prop_gbl/RULE_LAUNCH_COMPILE
/prop_gbl/RULE_LAUNCH_CUSTOM
diff --git a/Help/prop_gbl/ECLIPSE_EXTRA_CPROJECT_CONTENTS.rst b/Help/prop_gbl/ECLIPSE_EXTRA_CPROJECT_CONTENTS.rst
new file mode 100644
index 0000000..50c41a9
--- /dev/null
+++ b/Help/prop_gbl/ECLIPSE_EXTRA_CPROJECT_CONTENTS.rst
@@ -0,0 +1,12 @@
+ECLIPSE_EXTRA_CPROJECT_CONTENTS
+-------------------------------
+
+Additional contents to be inserted into the generated Eclipse cproject file.
+
+The cproject file defines the CDT specific information. Some third party IDE's
+are based on Eclipse with the addition of other information specific to that IDE.
+Through this property, it is possible to add this additional contents to
+the generated project.
+It is expected to contain valid XML.
+
+Also see the :prop_gbl:`ECLIPSE_EXTRA_NATURES` property.
diff --git a/Help/prop_gbl/ECLIPSE_EXTRA_NATURES.rst b/Help/prop_gbl/ECLIPSE_EXTRA_NATURES.rst
index 6d1529d..a46575f 100644
--- a/Help/prop_gbl/ECLIPSE_EXTRA_NATURES.rst
+++ b/Help/prop_gbl/ECLIPSE_EXTRA_NATURES.rst
@@ -6,3 +6,5 @@ List of natures to add to the generated Eclipse project file.
Eclipse projects specify language plugins by using natures. This property
should be set to the unique identifier for a nature (which looks like a Java
package name).
+
+Also see the :prop_gbl:`ECLIPSE_EXTRA_CPROJECT_CONTENTS` property.
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 258c9ca..e7279d9 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -1001,6 +1001,13 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
xml.EndElement(); // project
xml.EndElement(); // storageModule
+
+ // Append additional cproject contents without applying any XML formatting
+ if (const char* extraCProjectContents =
+ mf->GetState()->GetGlobalProperty("ECLIPSE_EXTRA_CPROJECT_CONTENTS")) {
+ fout << extraCProjectContents;
+ }
+
xml.EndElement(); // cproject
}
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=790fc415b1ecb55a930130655c197e2b90df3ad8
commit 790fc415b1ecb55a930130655c197e2b90df3ad8
Author: Vitaly Stakhovsky <vvs31415 at gitlab.org>
AuthorDate: Wed May 16 12:59:00 2018 -0400
Commit: Vitaly Stakhovsky <vvs31415 at gitlab.org>
CommitDate: Wed May 16 12:59:00 2018 -0400
cmVisualStudio10TargetGenerator: remove BuildFileStream member
Stream object is now local to `Generate()`
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index f613de9..99b8998 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -238,7 +238,6 @@ cmVisualStudio10TargetGenerator::cmVisualStudio10TargetGenerator(
this->MSTools = !this->NsightTegra;
this->Managed = false;
this->TargetCompileAsWinRT = false;
- this->BuildFileStream = 0;
this->IsMissingFiles = false;
this->DefaultArtifactDir =
this->LocalGenerator->GetCurrentBinaryDirectory() + std::string("/") +
@@ -250,13 +249,6 @@ cmVisualStudio10TargetGenerator::cmVisualStudio10TargetGenerator(
cmVisualStudio10TargetGenerator::~cmVisualStudio10TargetGenerator()
{
- if (!this->BuildFileStream) {
- return;
- }
- if (this->BuildFileStream->Close()) {
- this->GlobalGenerator->FileReplacedDuringGenerate(this->PathToProjectFile);
- }
- delete this->BuildFileStream;
}
std::string cmVisualStudio10TargetGenerator::CalcCondition(
@@ -314,12 +306,12 @@ void cmVisualStudio10TargetGenerator::Generate()
this->GeneratorTarget->GetProperty("EXTERNAL_MSPROJECT")) {
return;
}
- this->ProjectFileExtension = computeProjectFileExtension(
+ const std::string ProjectFileExtension = computeProjectFileExtension(
this->GeneratorTarget, *this->Configurations.begin());
- if (this->ProjectFileExtension == ".vcxproj") {
+ if (ProjectFileExtension == ".vcxproj") {
this->ProjectType = vcxproj;
this->Managed = false;
- } else if (this->ProjectFileExtension == ".csproj") {
+ } else if (ProjectFileExtension == ".csproj") {
if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY) {
std::string message = "The C# target \"" +
this->GeneratorTarget->GetName() +
@@ -334,8 +326,8 @@ void cmVisualStudio10TargetGenerator::Generate()
// Tell the global generator the name of the project file
this->GeneratorTarget->Target->SetProperty("GENERATOR_FILE_NAME",
this->Name.c_str());
- this->GeneratorTarget->Target->SetProperty(
- "GENERATOR_FILE_NAME_EXT", this->ProjectFileExtension.c_str());
+ this->GeneratorTarget->Target->SetProperty("GENERATOR_FILE_NAME_EXT",
+ ProjectFileExtension.c_str());
this->DotNetHintReferences.clear();
this->AdditionalUsingDirectories.clear();
if (this->GeneratorTarget->GetType() <= cmStateEnums::OBJECT_LIBRARY) {
@@ -367,344 +359,354 @@ void cmVisualStudio10TargetGenerator::Generate()
std::string path = this->LocalGenerator->GetCurrentBinaryDirectory();
path += "/";
path += this->Name;
- path += this->ProjectFileExtension;
- this->BuildFileStream = new cmGeneratedFileStream(path.c_str());
- this->PathToProjectFile = path;
- this->BuildFileStream->SetCopyIfDifferent(true);
+ path += ProjectFileExtension;
+ cmGeneratedFileStream BuildFileStream(path.c_str());
+ const std::string PathToProjectFile = path;
+ BuildFileStream.SetCopyIfDifferent(true);
// Write the encoding header into the file
char magic[] = { char(0xEF), char(0xBB), char(0xBF) };
- this->BuildFileStream->write(magic, 3);
- (*this->BuildFileStream) << "<?xml version=\"1.0\" encoding=\"" +
- this->GlobalGenerator->Encoding() + "\"?>\n";
-
- Elem e0(*this->BuildFileStream);
- e0.StartElement("Project");
- e0.Attribute("DefaultTargets", "Build");
- e0.Attribute("ToolsVersion", this->GlobalGenerator->GetToolsVersion());
- e0.Attribute("xmlns", "http://schemas.microsoft.com/developer/msbuild/2003");
-
- if (this->NsightTegra) {
- Elem e1(e0, "PropertyGroup");
- e1.Attribute("Label", "NsightTegraProject");
- const unsigned int nsightTegraMajorVersion = this->NsightTegraVersion[0];
- const unsigned int nsightTegraMinorVersion = this->NsightTegraVersion[1];
- if (nsightTegraMajorVersion >= 2) {
- if (nsightTegraMajorVersion > 3 ||
- (nsightTegraMajorVersion == 3 && nsightTegraMinorVersion >= 1)) {
- e1.Element("NsightTegraProjectRevisionNumber", "11");
+ BuildFileStream.write(magic, 3);
+ BuildFileStream << "<?xml version=\"1.0\" encoding=\""
+ << this->GlobalGenerator->Encoding() << "\"?>"
+ << "\n";
+ {
+ Elem e0(BuildFileStream);
+ e0.StartElement("Project");
+ e0.Attribute("DefaultTargets", "Build");
+ e0.Attribute("ToolsVersion", this->GlobalGenerator->GetToolsVersion());
+ e0.Attribute("xmlns",
+ "http://schemas.microsoft.com/developer/msbuild/2003");
+
+ if (this->NsightTegra) {
+ Elem e1(e0, "PropertyGroup");
+ e1.Attribute("Label", "NsightTegraProject");
+ const unsigned int nsightTegraMajorVersion = this->NsightTegraVersion[0];
+ const unsigned int nsightTegraMinorVersion = this->NsightTegraVersion[1];
+ if (nsightTegraMajorVersion >= 2) {
+ if (nsightTegraMajorVersion > 3 ||
+ (nsightTegraMajorVersion == 3 && nsightTegraMinorVersion >= 1)) {
+ e1.Element("NsightTegraProjectRevisionNumber", "11");
+ } else {
+ // Nsight Tegra 2.0 uses project revision 9.
+ e1.Element("NsightTegraProjectRevisionNumber", "9");
+ }
+ // Tell newer versions to upgrade silently when loading.
+ e1.Element("NsightTegraUpgradeOnceWithoutPrompt", "true");
} else {
- // Nsight Tegra 2.0 uses project revision 9.
- e1.Element("NsightTegraProjectRevisionNumber", "9");
+ // Require Nsight Tegra 1.6 for JCompile support.
+ e1.Element("NsightTegraProjectRevisionNumber", "7");
}
- // Tell newer versions to upgrade silently when loading.
- e1.Element("NsightTegraUpgradeOnceWithoutPrompt", "true");
- } else {
- // Require Nsight Tegra 1.6 for JCompile support.
- e1.Element("NsightTegraProjectRevisionNumber", "7");
+ e1.EndElement();
}
- e1.EndElement();
- }
- if (const char* hostArch =
- this->GlobalGenerator->GetPlatformToolsetHostArchitecture()) {
- Elem e1(e0, "PropertyGroup");
- e1.Element("PreferredToolArchitecture", hostArch);
- e1.EndElement();
- }
-
- if (this->ProjectType != csproj) {
- this->WriteProjectConfigurations(e0);
- }
-
- {
- Elem e1(e0, "PropertyGroup");
- e1.Attribute("Label", "Globals");
- e1.Element("ProjectGuid", "{" + this->GUID + "}");
-
- if (this->MSTools &&
- this->GeneratorTarget->GetType() <= cmStateEnums::GLOBAL_TARGET) {
- this->WriteApplicationTypeSettings(e1);
- this->VerifyNecessaryFiles();
+ if (const char* hostArch =
+ this->GlobalGenerator->GetPlatformToolsetHostArchitecture()) {
+ Elem e1(e0, "PropertyGroup");
+ e1.Element("PreferredToolArchitecture", hostArch);
+ e1.EndElement();
}
- const char* vsProjectTypes =
- this->GeneratorTarget->GetProperty("VS_GLOBAL_PROJECT_TYPES");
- if (vsProjectTypes) {
- const char* tagName = "ProjectTypes";
- if (this->ProjectType == csproj) {
- tagName = "ProjectTypeGuids";
- }
- e1.Element(tagName, vsProjectTypes);
+ if (this->ProjectType != csproj) {
+ this->WriteProjectConfigurations(e0);
}
- const char* vsProjectName =
- this->GeneratorTarget->GetProperty("VS_SCC_PROJECTNAME");
- const char* vsLocalPath =
- this->GeneratorTarget->GetProperty("VS_SCC_LOCALPATH");
- const char* vsProvider =
- this->GeneratorTarget->GetProperty("VS_SCC_PROVIDER");
+ {
+ Elem e1(e0, "PropertyGroup");
+ e1.Attribute("Label", "Globals");
+ e1.Element("ProjectGuid", "{" + this->GUID + "}");
- if (vsProjectName && vsLocalPath && vsProvider) {
- e1.Element("SccProjectName", vsProjectName);
- e1.Element("SccLocalPath", vsLocalPath);
- e1.Element("SccProvider", vsProvider);
+ if (this->MSTools &&
+ this->GeneratorTarget->GetType() <= cmStateEnums::GLOBAL_TARGET) {
+ this->WriteApplicationTypeSettings(e1);
+ this->VerifyNecessaryFiles();
+ }
- const char* vsAuxPath =
- this->GeneratorTarget->GetProperty("VS_SCC_AUXPATH");
- if (vsAuxPath) {
- e1.Element("SccAuxPath", vsAuxPath);
+ const char* vsProjectTypes =
+ this->GeneratorTarget->GetProperty("VS_GLOBAL_PROJECT_TYPES");
+ if (vsProjectTypes) {
+ const char* tagName = "ProjectTypes";
+ if (this->ProjectType == csproj) {
+ tagName = "ProjectTypeGuids";
+ }
+ e1.Element(tagName, vsProjectTypes);
}
- }
- if (this->GeneratorTarget->GetPropertyAsBool("VS_WINRT_COMPONENT")) {
- e1.Element("WinMDAssembly", "true");
- }
+ const char* vsProjectName =
+ this->GeneratorTarget->GetProperty("VS_SCC_PROJECTNAME");
+ const char* vsLocalPath =
+ this->GeneratorTarget->GetProperty("VS_SCC_LOCALPATH");
+ const char* vsProvider =
+ this->GeneratorTarget->GetProperty("VS_SCC_PROVIDER");
+
+ if (vsProjectName && vsLocalPath && vsProvider) {
+ e1.Element("SccProjectName", vsProjectName);
+ e1.Element("SccLocalPath", vsLocalPath);
+ e1.Element("SccProvider", vsProvider);
+
+ const char* vsAuxPath =
+ this->GeneratorTarget->GetProperty("VS_SCC_AUXPATH");
+ if (vsAuxPath) {
+ e1.Element("SccAuxPath", vsAuxPath);
+ }
+ }
- const char* vsGlobalKeyword =
- this->GeneratorTarget->GetProperty("VS_GLOBAL_KEYWORD");
- if (!vsGlobalKeyword) {
- e1.Element("Keyword", "Win32Proj");
- } else {
- e1.Element("Keyword", vsGlobalKeyword);
- }
+ if (this->GeneratorTarget->GetPropertyAsBool("VS_WINRT_COMPONENT")) {
+ e1.Element("WinMDAssembly", "true");
+ }
- const char* vsGlobalRootNamespace =
- this->GeneratorTarget->GetProperty("VS_GLOBAL_ROOTNAMESPACE");
- if (vsGlobalRootNamespace) {
- e1.Element("RootNamespace", vsGlobalRootNamespace);
- }
+ const char* vsGlobalKeyword =
+ this->GeneratorTarget->GetProperty("VS_GLOBAL_KEYWORD");
+ if (!vsGlobalKeyword) {
+ e1.Element("Keyword", "Win32Proj");
+ } else {
+ e1.Element("Keyword", vsGlobalKeyword);
+ }
- e1.Element("Platform", this->Platform);
- const char* projLabel =
- this->GeneratorTarget->GetProperty("PROJECT_LABEL");
- if (!projLabel) {
- projLabel = this->Name.c_str();
- }
- e1.Element("ProjectName", projLabel);
- {
- // TODO: add deprecation warning for VS_* property?
- const char* targetFrameworkVersion = this->GeneratorTarget->GetProperty(
- "VS_DOTNET_TARGET_FRAMEWORK_VERSION");
- if (!targetFrameworkVersion) {
- targetFrameworkVersion = this->GeneratorTarget->GetProperty(
- "DOTNET_TARGET_FRAMEWORK_VERSION");
+ const char* vsGlobalRootNamespace =
+ this->GeneratorTarget->GetProperty("VS_GLOBAL_ROOTNAMESPACE");
+ if (vsGlobalRootNamespace) {
+ e1.Element("RootNamespace", vsGlobalRootNamespace);
}
- if (targetFrameworkVersion) {
- e1.Element("TargetFrameworkVersion", targetFrameworkVersion);
+
+ e1.Element("Platform", this->Platform);
+ const char* projLabel =
+ this->GeneratorTarget->GetProperty("PROJECT_LABEL");
+ if (!projLabel) {
+ projLabel = this->Name.c_str();
+ }
+ e1.Element("ProjectName", projLabel);
+ {
+ // TODO: add deprecation warning for VS_* property?
+ const char* targetFrameworkVersion =
+ this->GeneratorTarget->GetProperty(
+ "VS_DOTNET_TARGET_FRAMEWORK_VERSION");
+ if (!targetFrameworkVersion) {
+ targetFrameworkVersion = this->GeneratorTarget->GetProperty(
+ "DOTNET_TARGET_FRAMEWORK_VERSION");
+ }
+ if (targetFrameworkVersion) {
+ e1.Element("TargetFrameworkVersion", targetFrameworkVersion);
+ }
}
- }
- // Disable the project upgrade prompt that is displayed the first time a
- // project using an older toolset version is opened in a newer version of
- // the IDE (respected by VS 2013 and above).
- if (this->GlobalGenerator->GetVersion() >=
- cmGlobalVisualStudioGenerator::VS12) {
- e1.Element("VCProjectUpgraderObjectName", "NoUpgrade");
- }
+ // Disable the project upgrade prompt that is displayed the first time a
+ // project using an older toolset version is opened in a newer version of
+ // the IDE (respected by VS 2013 and above).
+ if (this->GlobalGenerator->GetVersion() >=
+ cmGlobalVisualStudioGenerator::VS12) {
+ e1.Element("VCProjectUpgraderObjectName", "NoUpgrade");
+ }
- std::vector<std::string> keys = this->GeneratorTarget->GetPropertyKeys();
- for (std::string const& keyIt : keys) {
- static const char* prefix = "VS_GLOBAL_";
- if (keyIt.find(prefix) != 0)
- continue;
- std::string globalKey = keyIt.substr(strlen(prefix));
- // Skip invalid or separately-handled properties.
- if (globalKey.empty() || globalKey == "PROJECT_TYPES" ||
- globalKey == "ROOTNAMESPACE" || globalKey == "KEYWORD") {
- continue;
+ std::vector<std::string> keys = this->GeneratorTarget->GetPropertyKeys();
+ for (std::string const& keyIt : keys) {
+ static const char* prefix = "VS_GLOBAL_";
+ if (keyIt.find(prefix) != 0)
+ continue;
+ std::string globalKey = keyIt.substr(strlen(prefix));
+ // Skip invalid or separately-handled properties.
+ if (globalKey.empty() || globalKey == "PROJECT_TYPES" ||
+ globalKey == "ROOTNAMESPACE" || globalKey == "KEYWORD") {
+ continue;
+ }
+ const char* value = this->GeneratorTarget->GetProperty(keyIt);
+ if (!value)
+ continue;
+ e1.Element(globalKey.c_str(), value);
}
- const char* value = this->GeneratorTarget->GetProperty(keyIt);
- if (!value)
- continue;
- e1.Element(globalKey.c_str(), value);
- }
- if (this->Managed) {
- std::string outputType;
- switch (this->GeneratorTarget->GetType()) {
- case cmStateEnums::OBJECT_LIBRARY:
- case cmStateEnums::STATIC_LIBRARY:
- case cmStateEnums::SHARED_LIBRARY:
- outputType = "Library";
- break;
- case cmStateEnums::MODULE_LIBRARY:
- outputType = "Module";
- break;
- case cmStateEnums::EXECUTABLE:
- if (this->GeneratorTarget->Target->GetPropertyAsBool(
- "WIN32_EXECUTABLE")) {
- outputType = "WinExe";
- } else {
- outputType = "Exe";
- }
- break;
- case cmStateEnums::UTILITY:
- case cmStateEnums::GLOBAL_TARGET:
- outputType = "Utility";
- break;
- case cmStateEnums::UNKNOWN_LIBRARY:
- case cmStateEnums::INTERFACE_LIBRARY:
- break;
+ if (this->Managed) {
+ std::string outputType;
+ switch (this->GeneratorTarget->GetType()) {
+ case cmStateEnums::OBJECT_LIBRARY:
+ case cmStateEnums::STATIC_LIBRARY:
+ case cmStateEnums::SHARED_LIBRARY:
+ outputType = "Library";
+ break;
+ case cmStateEnums::MODULE_LIBRARY:
+ outputType = "Module";
+ break;
+ case cmStateEnums::EXECUTABLE:
+ if (this->GeneratorTarget->Target->GetPropertyAsBool(
+ "WIN32_EXECUTABLE")) {
+ outputType = "WinExe";
+ } else {
+ outputType = "Exe";
+ }
+ break;
+ case cmStateEnums::UTILITY:
+ case cmStateEnums::GLOBAL_TARGET:
+ outputType = "Utility";
+ break;
+ case cmStateEnums::UNKNOWN_LIBRARY:
+ case cmStateEnums::INTERFACE_LIBRARY:
+ break;
+ }
+ e1.Element("OutputType", outputType);
+ e1.Element("AppDesignerFolder", "Properties");
}
- e1.Element("OutputType", outputType);
- e1.Element("AppDesignerFolder", "Properties");
- }
- e1.EndElement();
- }
+ e1.EndElement();
+ }
- switch (this->ProjectType) {
- case vcxproj:
- Elem(e0, "Import")
- .Attribute("Project", VS10_CXX_DEFAULT_PROPS)
- .EndElement();
- break;
- case csproj:
- Elem(e0, "Import")
- .Attribute("Project", VS10_CSharp_DEFAULT_PROPS)
- .Attribute("Condition", "Exists('" VS10_CSharp_DEFAULT_PROPS "')")
- .EndElement();
- break;
- }
+ switch (this->ProjectType) {
+ case vcxproj:
+ Elem(e0, "Import")
+ .Attribute("Project", VS10_CXX_DEFAULT_PROPS)
+ .EndElement();
+ break;
+ case csproj:
+ Elem(e0, "Import")
+ .Attribute("Project", VS10_CSharp_DEFAULT_PROPS)
+ .Attribute("Condition", "Exists('" VS10_CSharp_DEFAULT_PROPS "')")
+ .EndElement();
+ break;
+ }
- this->WriteProjectConfigurationValues(e0);
+ this->WriteProjectConfigurationValues(e0);
- if (this->ProjectType == vcxproj) {
- Elem(e0, "Import").Attribute("Project", VS10_CXX_PROPS).EndElement();
- }
- {
- Elem e1(e0, "ImportGroup");
- e1.Attribute("Label", "ExtensionSettings");
- e1.SetHasElements();
-
- if (this->GlobalGenerator->IsCudaEnabled()) {
- Elem(e1, "Import")
- .Attribute("Project", "$(VCTargetsPath)\\BuildCustomizations\\CUDA " +
- this->GlobalGenerator->GetPlatformToolsetCudaString() +
- ".props")
- .EndElement();
+ if (this->ProjectType == vcxproj) {
+ Elem(e0, "Import").Attribute("Project", VS10_CXX_PROPS).EndElement();
}
- if (this->GlobalGenerator->IsMasmEnabled()) {
- Elem(e1, "Import")
- .Attribute("Project",
- "$(VCTargetsPath)\\BuildCustomizations\\masm.props")
- .EndElement();
+ {
+ Elem e1(e0, "ImportGroup");
+ e1.Attribute("Label", "ExtensionSettings");
+ e1.SetHasElements();
+
+ if (this->GlobalGenerator->IsCudaEnabled()) {
+ Elem(e1, "Import")
+ .Attribute(
+ "Project", "$(VCTargetsPath)\\BuildCustomizations\\CUDA " +
+ this->GlobalGenerator->GetPlatformToolsetCudaString() + ".props")
+ .EndElement();
+ }
+ if (this->GlobalGenerator->IsMasmEnabled()) {
+ Elem(e1, "Import")
+ .Attribute("Project",
+ "$(VCTargetsPath)\\BuildCustomizations\\masm.props")
+ .EndElement();
+ }
+ if (this->GlobalGenerator->IsNasmEnabled()) {
+ // Always search in the standard modules location.
+ std::string propsTemplate =
+ GetCMakeFilePath("Templates/MSBuild/nasm.props.in");
+
+ std::string propsLocal;
+ propsLocal += this->DefaultArtifactDir;
+ propsLocal += "\\nasm.props";
+ ConvertToWindowsSlash(propsLocal);
+ this->Makefile->ConfigureFile(propsTemplate.c_str(),
+ propsLocal.c_str(), false, true, true);
+ Elem(e1, "Import").Attribute("Project", propsLocal).EndElement();
+ }
+ e1.EndElement();
}
- if (this->GlobalGenerator->IsNasmEnabled()) {
- // Always search in the standard modules location.
- std::string propsTemplate =
- GetCMakeFilePath("Templates/MSBuild/nasm.props.in");
+ {
+ Elem e1(e0, "ImportGroup");
+ e1.Attribute("Label", "PropertySheets");
+ std::string props;
+ switch (this->ProjectType) {
+ case vcxproj:
+ props = VS10_CXX_USER_PROPS;
+ break;
+ case csproj:
+ props = VS10_CSharp_USER_PROPS;
+ break;
+ }
+ if (const char* p =
+ this->GeneratorTarget->GetProperty("VS_USER_PROPS")) {
+ props = p;
+ }
+ if (!props.empty()) {
+ ConvertToWindowsSlash(props);
+ Elem(e1, "Import")
+ .Attribute("Project", props)
+ .Attribute("Condition", "exists('" + props + "')")
+ .Attribute("Label", "LocalAppDataPlatform")
+ .EndElement();
+ }
- std::string propsLocal;
- propsLocal += this->DefaultArtifactDir;
- propsLocal += "\\nasm.props";
- ConvertToWindowsSlash(propsLocal);
- this->Makefile->ConfigureFile(propsTemplate.c_str(), propsLocal.c_str(),
- false, true, true);
- Elem(e1, "Import").Attribute("Project", propsLocal).EndElement();
+ this->WritePlatformExtensions(e1);
+ e1.EndElement();
}
- e1.EndElement();
- }
- {
- Elem e1(e0, "ImportGroup");
- e1.Attribute("Label", "PropertySheets");
- std::string props;
+ Elem(e0, "PropertyGroup").Attribute("Label", "UserMacros").EndElement();
+ this->WriteWinRTPackageCertificateKeyFile(e0);
+ this->WritePathAndIncrementalLinkOptions(e0);
+ this->WriteItemDefinitionGroups(e0);
+ this->WriteCustomCommands(e0);
+ this->WriteAllSources(e0);
+ this->WriteDotNetReferences(e0);
+ this->WriteEmbeddedResourceGroup(e0);
+ this->WriteXamlFilesGroup(e0);
+ this->WriteWinRTReferences(e0);
+ this->WriteProjectReferences(e0);
+ this->WriteSDKReferences(e0);
switch (this->ProjectType) {
case vcxproj:
- props = VS10_CXX_USER_PROPS;
+ Elem(e0, "Import").Attribute("Project", VS10_CXX_TARGETS).EndElement();
break;
case csproj:
- props = VS10_CSharp_USER_PROPS;
+ Elem(e0, "Import")
+ .Attribute("Project", VS10_CSharp_TARGETS)
+ .EndElement();
break;
}
- if (const char* p = this->GeneratorTarget->GetProperty("VS_USER_PROPS")) {
- props = p;
- }
- if (!props.empty()) {
- ConvertToWindowsSlash(props);
- Elem(e1, "Import")
- .Attribute("Project", props)
- .Attribute("Condition", "exists('" + props + "')")
- .Attribute("Label", "LocalAppDataPlatform")
- .EndElement();
- }
-
- this->WritePlatformExtensions(e1);
- e1.EndElement();
- }
- Elem(e0, "PropertyGroup").Attribute("Label", "UserMacros").EndElement();
- this->WriteWinRTPackageCertificateKeyFile(e0);
- this->WritePathAndIncrementalLinkOptions(e0);
- this->WriteItemDefinitionGroups(e0);
- this->WriteCustomCommands(e0);
- this->WriteAllSources(e0);
- this->WriteDotNetReferences(e0);
- this->WriteEmbeddedResourceGroup(e0);
- this->WriteXamlFilesGroup(e0);
- this->WriteWinRTReferences(e0);
- this->WriteProjectReferences(e0);
- this->WriteSDKReferences(e0);
- switch (this->ProjectType) {
- case vcxproj:
- Elem(e0, "Import").Attribute("Project", VS10_CXX_TARGETS).EndElement();
- break;
- case csproj:
- Elem(e0, "Import")
- .Attribute("Project", VS10_CSharp_TARGETS)
- .EndElement();
- break;
- }
- this->WriteTargetSpecificReferences(e0);
- {
- Elem e1(e0, "ImportGroup");
- e1.Attribute("Label", "ExtensionTargets");
- e1.SetHasElements();
- this->WriteTargetsFileReferences(e1);
- if (this->GlobalGenerator->IsCudaEnabled()) {
- Elem(e1, "Import")
- .Attribute("Project", "$(VCTargetsPath)\\BuildCustomizations\\CUDA " +
- this->GlobalGenerator->GetPlatformToolsetCudaString() +
- ".targets")
- .EndElement();
- }
- if (this->GlobalGenerator->IsMasmEnabled()) {
- Elem(e1, "Import")
- .Attribute("Project",
- "$(VCTargetsPath)\\BuildCustomizations\\masm.targets")
- .EndElement();
- }
- if (this->GlobalGenerator->IsNasmEnabled()) {
- std::string nasmTargets =
- GetCMakeFilePath("Templates/MSBuild/nasm.targets");
- Elem(e1, "Import").Attribute("Project", nasmTargets).EndElement();
- }
- e1.EndElement();
- }
- if (this->ProjectType == csproj) {
- for (std::string const& c : this->Configurations) {
- Elem e1(e0, "PropertyGroup");
- e1.Attribute("Condition", "'$(Configuration)' == '" + c + "'");
+ this->WriteTargetSpecificReferences(e0);
+ {
+ Elem e1(e0, "ImportGroup");
+ e1.Attribute("Label", "ExtensionTargets");
e1.SetHasElements();
- this->WriteEvents(e1, c);
+ this->WriteTargetsFileReferences(e1);
+ if (this->GlobalGenerator->IsCudaEnabled()) {
+ Elem(e1, "Import")
+ .Attribute("Project",
+ "$(VCTargetsPath)\\BuildCustomizations\\CUDA " +
+ this->GlobalGenerator->GetPlatformToolsetCudaString() +
+ ".targets")
+ .EndElement();
+ }
+ if (this->GlobalGenerator->IsMasmEnabled()) {
+ Elem(e1, "Import")
+ .Attribute("Project",
+ "$(VCTargetsPath)\\BuildCustomizations\\masm.targets")
+ .EndElement();
+ }
+ if (this->GlobalGenerator->IsNasmEnabled()) {
+ std::string nasmTargets =
+ GetCMakeFilePath("Templates/MSBuild/nasm.targets");
+ Elem(e1, "Import").Attribute("Project", nasmTargets).EndElement();
+ }
e1.EndElement();
}
- // make sure custom commands are executed before build (if necessary)
- {
- Elem e1(e0, "PropertyGroup");
- std::ostringstream oss;
- oss << "\n";
- for (std::string const& i : this->CSharpCustomCommandNames) {
- oss << " " << i << ";\n";
+ if (this->ProjectType == csproj) {
+ for (std::string const& c : this->Configurations) {
+ Elem e1(e0, "PropertyGroup");
+ e1.Attribute("Condition", "'$(Configuration)' == '" + c + "'");
+ e1.SetHasElements();
+ this->WriteEvents(e1, c);
+ e1.EndElement();
+ }
+ // make sure custom commands are executed before build (if necessary)
+ {
+ Elem e1(e0, "PropertyGroup");
+ std::ostringstream oss;
+ oss << "\n";
+ for (std::string const& i : this->CSharpCustomCommandNames) {
+ oss << " " << i << ";\n";
+ }
+ oss << " "
+ << "$(BuildDependsOn)\n";
+ e1.Element("BuildDependsOn", oss.str());
+ e1.EndElement();
}
- oss << " "
- << "$(BuildDependsOn)\n";
- e1.Element("BuildDependsOn", oss.str());
- e1.EndElement();
}
+ e0.EndElement();
+ }
+
+ if (BuildFileStream.Close()) {
+ this->GlobalGenerator->FileReplacedDuringGenerate(PathToProjectFile);
}
- e0.EndElement();
// The groups are stored in a separate file for VS 10
this->WriteGroups();
@@ -1424,98 +1426,103 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
fout.write(magic, 3);
fout << "<?xml version=\"1.0\" encoding=\""
- << this->GlobalGenerator->Encoding() << "\"?>\n";
+ << this->GlobalGenerator->Encoding() << "\"?>"
+ << "\n";
+ {
+ Elem e0(fout);
+ e0.StartElement("Project");
+ e0.Attribute("ToolsVersion", this->GlobalGenerator->GetToolsVersion());
+ e0.Attribute("xmlns",
+ "http://schemas.microsoft.com/developer/msbuild/2003");
- Elem e0(fout);
- e0.StartElement("Project");
- e0.Attribute("ToolsVersion", this->GlobalGenerator->GetToolsVersion());
- e0.Attribute("xmlns", "http://schemas.microsoft.com/developer/msbuild/2003");
+ for (auto const& ti : this->Tools) {
+ this->WriteGroupSources(e0, ti.first, ti.second, sourceGroups);
+ }
- for (auto const& ti : this->Tools) {
- this->WriteGroupSources(e0, ti.first, ti.second, sourceGroups);
- }
+ // Added files are images and the manifest.
+ if (!this->AddedFiles.empty()) {
+ Elem e1(e0, "ItemGroup");
+ e1.SetHasElements();
+ for (std::string const& oi : this->AddedFiles) {
+ std::string fileName =
+ cmSystemTools::LowerCase(cmSystemTools::GetFilenameName(oi));
+ if (fileName == "wmappmanifest.xml") {
+ Elem e2(e1, "XML");
+ e2.Attribute("Include", oi);
+ e2.Element("Filter", "Resource Files");
+ e2.EndElement();
+ } else if (cmSystemTools::GetFilenameExtension(fileName) ==
+ ".appxmanifest") {
+ Elem e2(e1, "AppxManifest");
+ e2.Attribute("Include", oi);
+ e2.Element("Filter", "Resource Files");
+ e2.EndElement();
+ } else if (cmSystemTools::GetFilenameExtension(fileName) == ".pfx") {
+ Elem e2(e1, "None");
+ e2.Attribute("Include", oi);
+ e2.Element("Filter", "Resource Files");
+ e2.EndElement();
+ } else {
+ Elem e2(e1, "Image");
+ e2.Attribute("Include", oi);
+ e2.Element("Filter", "Resource Files");
+ e2.EndElement();
+ }
+ }
+ e1.EndElement();
+ }
- // Added files are images and the manifest.
- if (!this->AddedFiles.empty()) {
- Elem e1(e0, "ItemGroup");
- e1.SetHasElements();
- for (std::string const& oi : this->AddedFiles) {
- std::string fileName =
- cmSystemTools::LowerCase(cmSystemTools::GetFilenameName(oi));
- if (fileName == "wmappmanifest.xml") {
- Elem e2(e1, "XML");
- e2.Attribute("Include", oi);
- e2.Element("Filter", "Resource Files");
- e2.EndElement();
- } else if (cmSystemTools::GetFilenameExtension(fileName) ==
- ".appxmanifest") {
- Elem e2(e1, "AppxManifest");
- e2.Attribute("Include", oi);
- e2.Element("Filter", "Resource Files");
- e2.EndElement();
- } else if (cmSystemTools::GetFilenameExtension(fileName) == ".pfx") {
- Elem e2(e1, "None");
- e2.Attribute("Include", oi);
- e2.Element("Filter", "Resource Files");
- e2.EndElement();
- } else {
- Elem e2(e1, "Image");
- e2.Attribute("Include", oi);
+ std::vector<cmSourceFile const*> resxObjs;
+ this->GeneratorTarget->GetResxSources(resxObjs, "");
+ if (!resxObjs.empty()) {
+ Elem e1(e0, "ItemGroup");
+ for (cmSourceFile const* oi : resxObjs) {
+ std::string obj = oi->GetFullPath();
+ ConvertToWindowsSlash(obj);
+ Elem e2(e1, "EmbeddedResource");
+ e2.Attribute("Include", obj);
e2.Element("Filter", "Resource Files");
e2.EndElement();
}
+ e1.EndElement();
}
- e1.EndElement();
- }
+ {
+ Elem e1(e0, "ItemGroup");
+ e1.SetHasElements();
+ std::vector<cmSourceGroup*> groupsVec(groupsUsed.begin(),
+ groupsUsed.end());
+ std::sort(groupsVec.begin(), groupsVec.end(),
+ [](cmSourceGroup* l, cmSourceGroup* r) {
+ return l->GetFullName() < r->GetFullName();
+ });
+ for (cmSourceGroup* sg : groupsVec) {
+ std::string const& name = sg->GetFullName();
+ if (!name.empty()) {
+ std::string guidName = "SG_Filter_" + name;
+ std::string guid = this->GlobalGenerator->GetGUID(guidName);
+ Elem e2(e1, "Filter");
+ e2.Attribute("Include", name);
+ e2.Element("UniqueIdentifier", "{" + guid + "}");
+ e2.EndElement();
+ }
+ }
- std::vector<cmSourceFile const*> resxObjs;
- this->GeneratorTarget->GetResxSources(resxObjs, "");
- if (!resxObjs.empty()) {
- Elem e1(e0, "ItemGroup");
- for (cmSourceFile const* oi : resxObjs) {
- std::string obj = oi->GetFullPath();
- ConvertToWindowsSlash(obj);
- Elem e2(e1, "EmbeddedResource");
- e2.Attribute("Include", obj);
- e2.Element("Filter", "Resource Files");
- e2.EndElement();
- }
- e1.EndElement();
- }
+ if (!resxObjs.empty() || !this->AddedFiles.empty()) {
+ std::string guidName = "SG_Filter_Resource Files";
+ std::string guid = this->GlobalGenerator->GetGUID(guidName);
+ Elem e2(e1, "Filter");
+ e2.Attribute("Include", "Resource Files");
+ e2.Element("UniqueIdentifier", "{" + guid + "}");
+ e2.Element("Extensions",
+ "rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;"
+ "gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms");
+ e2.EndElement();
+ }
- Elem e1(e0, "ItemGroup");
- e1.SetHasElements();
- std::vector<cmSourceGroup*> groupsVec(groupsUsed.begin(), groupsUsed.end());
- std::sort(groupsVec.begin(), groupsVec.end(),
- [](cmSourceGroup* l, cmSourceGroup* r) {
- return l->GetFullName() < r->GetFullName();
- });
- for (cmSourceGroup* sg : groupsVec) {
- std::string const& name = sg->GetFullName();
- if (!name.empty()) {
- std::string guidName = "SG_Filter_" + name;
- std::string guid = this->GlobalGenerator->GetGUID(guidName);
- Elem e2(e1, "Filter");
- e2.Attribute("Include", name);
- e2.Element("UniqueIdentifier", "{" + guid + "}");
- e2.EndElement();
+ e1.EndElement();
}
+ e0.EndElement();
}
-
- if (!resxObjs.empty() || !this->AddedFiles.empty()) {
- std::string guidName = "SG_Filter_Resource Files";
- std::string guid = this->GlobalGenerator->GetGUID(guidName);
- Elem e2(e1, "Filter");
- e2.Attribute("Include", "Resource Files");
- e2.Element("UniqueIdentifier", "{" + guid + "}");
- e2.Element("Extensions",
- "rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;"
- "gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms");
- e2.EndElement();
- }
-
- e1.EndElement();
- e0.EndElement();
fout << '\n';
if (fout.Close()) {
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index a5ea38c..15e47b4 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -186,8 +186,6 @@ private:
OptionsMap NasmOptions;
OptionsMap LinkOptions;
std::string LangForClCompile;
- std::string PathToProjectFile;
- std::string ProjectFileExtension;
enum VsProjectType
{
vcxproj,
@@ -207,7 +205,6 @@ private:
unsigned int NsightTegraVersion[4];
bool TargetCompileAsWinRT;
cmGlobalVisualStudio10Generator* const GlobalGenerator;
- cmGeneratedFileStream* BuildFileStream;
cmLocalVisualStudio10Generator* const LocalGenerator;
std::set<std::string> CSharpCustomCommandNames;
bool IsMissingFiles;
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=78f0dcdcc90d53f3636d511262f797585f170ae7
commit 78f0dcdcc90d53f3636d511262f797585f170ae7
Author: Craig Scott <craig.scott at crascit.com>
AuthorDate: Sat May 12 11:29:41 2018 +1000
Commit: Craig Scott <craig.scott at crascit.com>
CommitDate: Sat May 12 11:31:25 2018 +1000
CPackRPM: Fix misleading CPACK_RPM_SPEC_INSTALL_POST docs
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index 305af3c..60b3abe 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -410,17 +410,17 @@
#
# .. variable:: CPACK_RPM_SPEC_INSTALL_POST
#
-# Deprecated - use :variable:`CPACK_RPM_POST_INSTALL_SCRIPT_FILE` instead.
+# Deprecated - use :variable:`CPACK_RPM_SPEC_MORE_DEFINE` instead.
#
# * Mandatory : NO
# * Default : -
# * Deprecated: YES
#
-# This way of specifying post-install script is deprecated, use
-# :variable:`CPACK_RPM_POST_INSTALL_SCRIPT_FILE`.
-# May be used to set an RPM post-install command inside the spec file.
-# For example setting it to ``/bin/true`` may be used to prevent
-# rpmbuild to strip binaries.
+# May be used to override the ``__spec_install_post`` section within the
+# generated spec file. This affects the install step during package creation,
+# not during package installation. For adding operations to be performed
+# during package installation, use
+# :variable:`CPACK_RPM_POST_INSTALL_SCRIPT_FILE` instead.
#
# .. variable:: CPACK_RPM_SPEC_MORE_DEFINE
#
@@ -429,7 +429,11 @@
# * Mandatory : NO
# * Default : -
#
-# May be used to add any ``%define`` lines to the generated spec file.
+# May be used to add any ``%define`` lines to the generated spec file. An
+# example of its use is to prevent stripping of executables (but note that
+# this may also disable other default post install processing)::
+#
+# set(CPACK_RPM_SPEC_MORE_DEFINE "%define __spec_install_post /bin/true")
#
# .. variable:: CPACK_RPM_PACKAGE_DEBUG
#
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2ae2f0ca983c52300a8d0583083756371cbeac5e
commit 2ae2f0ca983c52300a8d0583083756371cbeac5e
Author: Craig Scott <craig.scott at crascit.com>
AuthorDate: Sat May 12 11:28:50 2018 +1000
Commit: Craig Scott <craig.scott at crascit.com>
CommitDate: Sat May 12 11:31:25 2018 +1000
CPackRPM: Minor formatting cleanup
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index 8d8eab3..305af3c 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -877,9 +877,9 @@
# variable while usually using :variable:`CPACK_INSTALLED_DIRECTORIES` variable
# to provide directory containing CMakeLists.txt and source files.
#
-# For CMake projects SRPM package would be product by executing:
+# For CMake projects SRPM package would be produced by executing::
#
-# ``cpack -G RPM --config ./CPackSourceConfig.cmake``
+# cpack -G RPM --config ./CPackSourceConfig.cmake
#
# .. note::
#
@@ -892,10 +892,10 @@
#
# Once the SRPM package is generated it can be used to generate binary packages
# by creating a directory structure for rpm generation and executing rpmbuild
-# tool:
+# tool::
#
-# ``mkdir -p build_dir/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}``
-# ``rpmbuild --define "_topdir <path_to_build_dir>" --rebuild <SRPM_file_name>``
+# mkdir -p build_dir/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
+# rpmbuild --define "_topdir <path_to_build_dir>" --rebuild <SRPM_file_name>
#
# Generated packages will be located in build_dir/RPMS directory or its sub
# directories.
-----------------------------------------------------------------------
Summary of changes:
Help/manual/cmake-properties.7.rst | 1 +
Help/prop_gbl/ECLIPSE_EXTRA_CPROJECT_CONTENTS.rst | 12 +
Help/prop_gbl/ECLIPSE_EXTRA_NATURES.rst | 2 +
Help/prop_tgt/PDB_OUTPUT_DIRECTORY.rst | 10 +-
Help/prop_tgt/PDB_OUTPUT_DIRECTORY_CONFIG.rst | 3 +
Help/release/dev/PDBDirectoryGenExpression.rst | 5 +
Modules/CPackRPM.cmake | 28 +-
Source/cmExtraEclipseCDT4Generator.cxx | 7 +
Source/cmGeneratorTarget.cxx | 15 +-
Source/cmVisualStudio10TargetGenerator.cxx | 779 +++++++++++----------
Source/cmVisualStudio10TargetGenerator.h | 3 -
Tests/PDBDirectoryAndName/CMakeLists.txt | 10 +-
12 files changed, 468 insertions(+), 407 deletions(-)
create mode 100644 Help/prop_gbl/ECLIPSE_EXTRA_CPROJECT_CONTENTS.rst
create mode 100644 Help/release/dev/PDBDirectoryGenExpression.rst
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list