summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/release/3.11.rst6
-rw-r--r--Modules/Qt4Macros.cmake25
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/cmCustomCommandGenerator.cxx8
-rw-r--r--Source/cmQtAutoGenInitializer.cxx3
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx142
-rw-r--r--Source/cmVisualStudio10TargetGenerator.h2
-rw-r--r--Tests/RunCMake/add_custom_target/CommandExpandsEmpty.cmake1
-rw-r--r--Tests/RunCMake/add_custom_target/RunCMakeTest.cmake1
9 files changed, 107 insertions, 83 deletions
diff --git a/Help/release/3.11.rst b/Help/release/3.11.rst
index 184497c..971b3e2 100644
--- a/Help/release/3.11.rst
+++ b/Help/release/3.11.rst
@@ -292,3 +292,9 @@ Changes made since CMake 3.11.0 include the following.
it did prior to 3.11.0. This diagnostic was accidentally dropped
from CMake 3.11.0 and 3.11.1 by the change to allow globally visible
imported targets to be aliased.
+
+* The :module:`FindQt4` module ``qt4_wrap_cpp``, ``qt4_wrap_ui`` and
+ ``qt4_add_resources`` macros now set :prop_sf:`SKIP_AUTOMOC` and
+ :prop_sf:`SKIP_AUTOUIC` on their generated files. These files never
+ need to be processed by moc or uic, and we must say so explicitly to
+ account for policy :policy:`CMP0071`.
diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake
index aee4028..a2c8d85 100644
--- a/Modules/Qt4Macros.cmake
+++ b/Modules/Qt4Macros.cmake
@@ -151,7 +151,8 @@ macro (QT4_GENERATE_MOC infile outfile )
set(moc_target ${ARGV3})
endif()
QT4_CREATE_MOC_COMMAND(${abs_infile} ${_outfile} "${moc_flags}" "" "${moc_target}")
- set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOMOC TRUE) # don't run automoc on this file
+ set_property(SOURCE ${outfile} PROPERTY SKIP_AUTOMOC TRUE) # don't run automoc on this file
+ set_property(SOURCE ${outfile} PROPERTY SKIP_AUTOUIC TRUE) # don't run autouic on this file
endmacro ()
@@ -166,6 +167,8 @@ macro (QT4_WRAP_CPP outfiles )
get_filename_component(it ${it} ABSOLUTE)
QT4_MAKE_OUTPUT_FILE(${it} moc_ cxx outfile)
QT4_CREATE_MOC_COMMAND(${it} ${outfile} "${moc_flags}" "${moc_options}" "${moc_target}")
+ set_property(SOURCE ${outfile} PROPERTY SKIP_AUTOMOC TRUE) # don't run automoc on this file
+ set_property(SOURCE ${outfile} PROPERTY SKIP_AUTOUIC TRUE) # don't run autouic on this file
set(${outfiles} ${${outfiles}} ${outfile})
endforeach()
@@ -185,6 +188,8 @@ macro (QT4_WRAP_UI outfiles )
COMMAND Qt4::uic
ARGS ${ui_options} -o ${outfile} ${infile}
MAIN_DEPENDENCY ${infile} VERBATIM)
+ set_property(SOURCE ${outfile} PROPERTY SKIP_AUTOMOC TRUE) # don't run automoc on this file
+ set_property(SOURCE ${outfile} PROPERTY SKIP_AUTOUIC TRUE) # don't run autouic on this file
set(${outfiles} ${${outfiles}} ${outfile})
endforeach ()
@@ -233,6 +238,8 @@ macro (QT4_ADD_RESOURCES outfiles )
ARGS ${rcc_options} -name ${outfilename} -o ${outfile} ${infile}
MAIN_DEPENDENCY ${infile}
DEPENDS ${_RC_DEPENDS} "${out_depends}" VERBATIM)
+ set_property(SOURCE ${outfile} PROPERTY SKIP_AUTOMOC TRUE) # don't run automoc on this file
+ set_property(SOURCE ${outfile} PROPERTY SKIP_AUTOUIC TRUE) # don't run autouic on this file
set(${outfiles} ${${outfiles}} ${outfile})
endforeach ()
@@ -245,19 +252,19 @@ macro(QT4_ADD_DBUS_INTERFACE _sources _interface _basename)
set(_impl "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp")
set(_moc "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc")
- get_source_file_property(_nonamespace ${_interface} NO_NAMESPACE)
+ get_property(_nonamespace SOURCE ${_interface} PROPERTY NO_NAMESPACE)
if(_nonamespace)
set(_params -N -m)
else()
set(_params -m)
endif()
- get_source_file_property(_classname ${_interface} CLASSNAME)
+ get_property(_classname SOURCE ${_interface} PROPERTY CLASSNAME)
if(_classname)
set(_params ${_params} -c ${_classname})
endif()
- get_source_file_property(_include ${_interface} INCLUDE)
+ get_property(_include SOURCE ${_interface} PROPERTY INCLUDE)
if(_include)
set(_params ${_params} -i ${_include})
endif()
@@ -266,7 +273,8 @@ macro(QT4_ADD_DBUS_INTERFACE _sources _interface _basename)
COMMAND Qt4::qdbusxml2cpp ${_params} -p ${_basename} ${_infile}
DEPENDS ${_infile} VERBATIM)
- set_source_files_properties("${_impl}" PROPERTIES SKIP_AUTOMOC TRUE)
+ set_property(SOURCE ${_impl} PROPERTY SKIP_AUTOMOC TRUE) # don't run automoc on this file
+ set_property(SOURCE ${_impl} PROPERTY SKIP_AUTOUIC TRUE) # don't run autouic on this file
QT4_GENERATE_MOC("${_header}" "${_moc}")
@@ -350,7 +358,8 @@ macro(QT4_ADD_DBUS_ADAPTOR _sources _xml_file _include _parentClass) # _optional
endif()
QT4_GENERATE_MOC("${_header}" "${_moc}")
- set_source_files_properties("${_impl}" PROPERTIES SKIP_AUTOMOC TRUE)
+ set_property(SOURCE ${_impl} PROPERTY SKIP_AUTOMOC TRUE) # don't run automoc on this file
+ set_property(SOURCE ${_impl} PROPERTY SKIP_AUTOUIC TRUE) # don't run autouic on this file
MACRO_ADD_FILE_DEPENDENCIES("${_impl}" "${_moc}")
list(APPEND ${_sources} "${_impl}" "${_header}" "${_moc}")
@@ -374,7 +383,7 @@ macro(QT4_AUTOMOC)
# cmake is run for the very first time on them -> however the .cpp files might
# exist at a later run. at that time we need to skip them, so that we don't add two
# different rules for the same moc file
- get_source_file_property(_skip ${_abs_FILE} SKIP_AUTOMOC)
+ get_property(_skip SOURCE ${_abs_FILE} PROPERTY SKIP_AUTOMOC)
if ( NOT _skip AND EXISTS ${_abs_FILE} )
@@ -454,7 +463,7 @@ macro(QT4_ADD_TRANSLATION _qm_files)
foreach (_current_FILE ${ARGN})
get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE)
get_filename_component(qm ${_abs_FILE} NAME_WE)
- get_source_file_property(output_location ${_abs_FILE} OUTPUT_LOCATION)
+ get_property(output_location SOURCE ${_abs_FILE} PROPERTY OUTPUT_LOCATION)
if(output_location)
file(MAKE_DIRECTORY "${output_location}")
set(qm "${output_location}/${qm}.qm")
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index f669b7c..6f9e5f0 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 11)
-set(CMake_VERSION_PATCH 20180515)
+set(CMake_VERSION_PATCH 20180516)
#set(CMake_VERSION_RC 1)
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index 136cf39..6c9f9d6 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -40,6 +40,14 @@ cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc,
argv.push_back(std::move(parsed_arg));
}
}
+
+ // Later code assumes at least one entry exists, but expanding
+ // lists on an empty command may have left this empty.
+ // FIXME: Should we define behavior for removing empty commands?
+ if (argv.empty()) {
+ argv.push_back(std::string());
+ }
+
this->CommandLines.push_back(std::move(argv));
}
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index 93c78b5..566a2a9 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -994,6 +994,9 @@ void cmQtAutoGenInitializer::SetupCustomTargets()
// Generate auto RCC info files
if (this->RccEnabled) {
for (Qrc const& qrc : this->Qrcs) {
+ // Register rcc info file as generated
+ makefile->AddCMakeOutputFile(qrc.InfoFile);
+
cmGeneratedFileStream ofs;
ofs.SetCopyIfDifferent(true);
ofs.Open(qrc.InfoFile.c_str(), false, true);
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 839c7d3..f613de9 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -40,13 +40,13 @@ static std::string cmVS10EscapeAttr(std::string arg)
struct cmVisualStudio10TargetGenerator::Elem
{
std::ostream& S;
- int Indent;
+ const int Indent;
bool HasElements = false;
std::string Tag;
- Elem(std::ostream& s, int i)
+ Elem(std::ostream& s)
: S(s)
- , Indent(i)
+ , Indent(0)
{
}
Elem(const Elem&) = delete;
@@ -94,15 +94,19 @@ struct cmVisualStudio10TargetGenerator::Elem
{
S << ">" << cmVS10EscapeXML(val) << "</" << this->Tag << ">\n";
}
- void WriteEndTag(const std::string& tag)
+ void EndElement()
{
if (HasElements) {
- this->WriteString("</") << tag << ">\n";
+ this->WriteString("</") << this->Tag << ">";
+ if (this->Indent > 0) {
+ this->S << '\n';
+ } else {
+ // special case: don't print EOL at EOF
+ }
} else {
this->S << " />\n";
}
}
- void EndElement() { this->WriteEndTag(this->Tag); }
void WritePlatformConfigTag(const char* tag, const std::string& cond,
const std::string& content);
@@ -374,14 +378,11 @@ void cmVisualStudio10TargetGenerator::Generate()
(*this->BuildFileStream) << "<?xml version=\"1.0\" encoding=\"" +
this->GlobalGenerator->Encoding() + "\"?>\n";
- Elem e0(*this->BuildFileStream, 0);
+ Elem e0(*this->BuildFileStream);
e0.StartElement("Project");
e0.Attribute("DefaultTargets", "Build");
- // get the tools version to use
- const std::string toolsVer(this->GlobalGenerator->GetToolsVersion());
- e0.Attribute("ToolsVersion", toolsVer);
+ e0.Attribute("ToolsVersion", this->GlobalGenerator->GetToolsVersion());
e0.Attribute("xmlns", "http://schemas.microsoft.com/developer/msbuild/2003");
- e0.SetHasElements();
if (this->NsightTegra) {
Elem e1(e0, "PropertyGroup");
@@ -430,11 +431,11 @@ void cmVisualStudio10TargetGenerator::Generate()
const char* vsProjectTypes =
this->GeneratorTarget->GetProperty("VS_GLOBAL_PROJECT_TYPES");
if (vsProjectTypes) {
- std::string tagName = "ProjectTypes";
+ const char* tagName = "ProjectTypes";
if (this->ProjectType == csproj) {
tagName = "ProjectTypeGuids";
}
- e1.Element(tagName.c_str(), vsProjectTypes);
+ e1.Element(tagName, vsProjectTypes);
}
const char* vsProjectName =
@@ -682,16 +683,16 @@ void cmVisualStudio10TargetGenerator::Generate()
e1.EndElement();
}
if (this->ProjectType == csproj) {
- for (std::string const& i : this->Configurations) {
+ for (std::string const& c : this->Configurations) {
Elem e1(e0, "PropertyGroup");
- e1.Attribute("Condition", "'$(Configuration)' == '" + i + "'");
+ e1.Attribute("Condition", "'$(Configuration)' == '" + c + "'");
e1.SetHasElements();
- this->WriteEvents(e1, i);
+ this->WriteEvents(e1, c);
e1.EndElement();
}
// make sure custom commands are executed before build (if necessary)
- Elem e1(e0, "PropertyGroup");
{
+ Elem e1(e0, "PropertyGroup");
std::ostringstream oss;
oss << "\n";
for (std::string const& i : this->CSharpCustomCommandNames) {
@@ -700,10 +701,11 @@ void cmVisualStudio10TargetGenerator::Generate()
oss << " "
<< "$(BuildDependsOn)\n";
e1.Element("BuildDependsOn", oss.str());
+ e1.EndElement();
}
- e1.EndElement();
}
- e0.WriteString("</Project>");
+ e0.EndElement();
+
// The groups are stored in a separate file for VS 10
this->WriteGroups();
}
@@ -840,7 +842,7 @@ void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup(Elem& e0)
std::string hFileName = obj.substr(0, obj.find_last_of(".")) + ".h";
e2.Element("DependentUpon", hFileName);
- for (std::string const& i : this->Configurations) {
+ for (std::string const& c : this->Configurations) {
std::string s;
if (this->GeneratorTarget->GetProperty("VS_GLOBAL_ROOTNAMESPACE") ||
// Handle variant of VS_GLOBAL_<variable> for RootNamespace.
@@ -848,7 +850,7 @@ void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup(Elem& e0)
s = "$(RootNamespace).";
}
s += "%(Filename).resources";
- e2.WritePlatformConfigTag("LogicalName", CalcCondition(i), s);
+ e2.WritePlatformConfigTag("LogicalName", this->CalcCondition(c), s);
}
} else {
std::string binDir = this->Makefile->GetCurrentBinaryDirectory();
@@ -918,8 +920,7 @@ void cmVisualStudio10TargetGenerator::WriteXamlFilesGroup(Elem& e0)
std::vector<cmSourceFile const*> xamlObjs;
this->GeneratorTarget->GetXamlSources(xamlObjs, "");
if (!xamlObjs.empty()) {
- Elem e1(e0);
- e1.StartElement("ItemGroup");
+ Elem e1(e0, "ItemGroup");
for (cmSourceFile const* oi : xamlObjs) {
std::string obj = oi->GetFullPath();
const char* xamlType;
@@ -1039,8 +1040,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurations(Elem& e0)
void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues(Elem& e0)
{
for (std::string const& c : this->Configurations) {
- Elem e1(e0);
- e1.StartElement("PropertyGroup");
+ Elem e1(e0, "PropertyGroup");
e1.Attribute("Condition", this->CalcCondition(c));
e1.Attribute("Label", "Configuration");
@@ -1048,7 +1048,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues(Elem& e0)
std::string configType;
if (const char* vsConfigurationType =
this->GeneratorTarget->GetProperty("VS_CONFIGURATION_TYPE")) {
- configType = cmVS10EscapeXML(vsConfigurationType);
+ configType = vsConfigurationType;
} else {
switch (this->GeneratorTarget->GetType()) {
case cmStateEnums::SHARED_LIBRARY:
@@ -1423,16 +1423,13 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
char magic[] = { char(0xEF), char(0xBB), char(0xBF) };
fout.write(magic, 3);
- // get the tools version to use
- const std::string toolsVer(this->GlobalGenerator->GetToolsVersion());
fout << "<?xml version=\"1.0\" encoding=\""
<< this->GlobalGenerator->Encoding() << "\"?>\n";
- Elem e0(fout, 0);
+ Elem e0(fout);
e0.StartElement("Project");
- e0.Attribute("ToolsVersion", toolsVer);
+ e0.Attribute("ToolsVersion", this->GlobalGenerator->GetToolsVersion());
e0.Attribute("xmlns", "http://schemas.microsoft.com/developer/msbuild/2003");
- e0.SetHasElements();
for (auto const& ti : this->Tools) {
this->WriteGroupSources(e0, ti.first, ti.second, sourceGroups);
@@ -1519,6 +1516,7 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
e1.EndElement();
e0.EndElement();
+ fout << '\n';
if (fout.Close()) {
this->GlobalGenerator->FileReplacedDuringGenerate(path);
@@ -1873,7 +1871,7 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(Elem& e1,
// write source file specific tags
this->WriteCSharpSourceProperties(e2, sourceFileTags);
}
- e2.WriteEndTag(tool);
+ e2.EndElement();
}
void cmVisualStudio10TargetGenerator::WriteSource(Elem& e2,
@@ -1926,6 +1924,7 @@ void cmVisualStudio10TargetGenerator::WriteAllSources(Elem& e0)
return;
}
Elem e1(e0, "ItemGroup");
+ e1.SetHasElements();
std::vector<size_t> all_configs;
for (size_t ci = 0; ci < this->Configurations.size(); ++ci) {
@@ -2103,7 +2102,6 @@ void cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
// for the first time we need a new line if there is something
// produced here.
if (!objectName.empty()) {
- e2.SetHasElements();
if (lang == "CUDA") {
e2.Element("CompileOut", "$(IntDir)/" + objectName);
} else {
@@ -2200,7 +2198,6 @@ void cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
}
}
if (this->IsXamlSource(source->GetFullPath())) {
- e2.SetHasElements();
const std::string& fileName = source->GetFullPath();
std::string xamlFileName = fileName.substr(0, fileName.find_last_of("."));
e2.Element("DependentUpon", xamlFileName);
@@ -2398,8 +2395,8 @@ std::vector<std::string> cmVisualStudio10TargetGenerator::GetIncludes(
bool cmVisualStudio10TargetGenerator::ComputeClOptions()
{
- for (std::string const& i : this->Configurations) {
- if (!this->ComputeClOptions(i)) {
+ for (std::string const& c : this->Configurations) {
+ if (!this->ComputeClOptions(c)) {
return false;
}
}
@@ -2665,8 +2662,8 @@ void cmVisualStudio10TargetGenerator::WriteClOptions(
bool cmVisualStudio10TargetGenerator::ComputeRcOptions()
{
- for (std::string const& i : this->Configurations) {
- if (!this->ComputeRcOptions(i)) {
+ for (std::string const& c : this->Configurations) {
+ if (!this->ComputeRcOptions(c)) {
return false;
}
}
@@ -2723,8 +2720,8 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaOptions()
if (!this->GlobalGenerator->IsCudaEnabled()) {
return true;
}
- for (std::string const& i : this->Configurations) {
- if (!this->ComputeCudaOptions(i)) {
+ for (std::string const& c : this->Configurations) {
+ if (!this->ComputeCudaOptions(c)) {
return false;
}
}
@@ -2871,8 +2868,8 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaLinkOptions()
if (!this->GlobalGenerator->IsCudaEnabled()) {
return true;
}
- for (std::string const& i : this->Configurations) {
- if (!this->ComputeCudaLinkOptions(i)) {
+ for (std::string const& c : this->Configurations) {
+ if (!this->ComputeCudaLinkOptions(c)) {
return false;
}
}
@@ -2939,8 +2936,8 @@ bool cmVisualStudio10TargetGenerator::ComputeMasmOptions()
if (!this->GlobalGenerator->IsMasmEnabled()) {
return true;
}
- for (std::string const& i : this->Configurations) {
- if (!this->ComputeMasmOptions(i)) {
+ for (std::string const& c : this->Configurations) {
+ if (!this->ComputeMasmOptions(c)) {
return false;
}
}
@@ -2996,8 +2993,8 @@ bool cmVisualStudio10TargetGenerator::ComputeNasmOptions()
if (!this->GlobalGenerator->IsNasmEnabled()) {
return true;
}
- for (std::string const& i : this->Configurations) {
- if (!this->ComputeNasmOptions(i)) {
+ for (std::string const& c : this->Configurations) {
+ if (!this->ComputeNasmOptions(c)) {
return false;
}
}
@@ -3128,8 +3125,8 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
}
}
- Elem e2(e1, "AntBuild");
// Tell MSBuild to launch Ant.
+ Elem e2(e1, "AntBuild");
{
std::string antBuildPath = rootDir;
ConvertToWindowsSlash(antBuildPath);
@@ -3220,8 +3217,8 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions()
if (this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE ||
this->GeneratorTarget->GetType() == cmStateEnums::SHARED_LIBRARY ||
this->GeneratorTarget->GetType() == cmStateEnums::MODULE_LIBRARY) {
- for (std::string const& i : this->Configurations) {
- if (!this->ComputeLinkOptions(i)) {
+ for (std::string const& c : this->Configurations) {
+ if (!this->ComputeLinkOptions(c)) {
return false;
}
}
@@ -3455,8 +3452,8 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
bool cmVisualStudio10TargetGenerator::ComputeLibOptions()
{
if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY) {
- for (std::string const& i : this->Configurations) {
- if (!this->ComputeLibOptions(i)) {
+ for (std::string const& c : this->Configurations) {
+ if (!this->ComputeLibOptions(c)) {
return false;
}
}
@@ -3633,10 +3630,10 @@ void cmVisualStudio10TargetGenerator::WriteMidlOptions(
for (std::string const& i : includes) {
oss << i << ";";
}
+ oss << "%(AdditionalIncludeDirectories)";
Elem e2(e1, "Midl");
- e2.Element("AdditionalIncludeDirectories",
- oss.str() + "%(AdditionalIncludeDirectories)");
+ e2.Element("AdditionalIncludeDirectories", oss.str());
e2.Element("OutputDirectory", "$(ProjectDir)/$(IntDir)");
e2.Element("HeaderFileName", "%(Filename).h");
e2.Element("TypeLibraryName", "%(Filename).tlb");
@@ -3650,36 +3647,36 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups(Elem& e0)
if (this->ProjectType == csproj) {
return;
}
- for (const auto& i : this->Configurations) {
+ for (const std::string& c : this->Configurations) {
Elem e1(e0, "ItemDefinitionGroup");
- e1.Attribute("Condition", this->CalcCondition(i));
+ e1.Attribute("Condition", this->CalcCondition(c));
// output cl compile flags <ClCompile></ClCompile>
if (this->GeneratorTarget->GetType() <= cmStateEnums::OBJECT_LIBRARY) {
- this->WriteClOptions(e1, i);
+ this->WriteClOptions(e1, c);
// output rc compile flags <ResourceCompile></ResourceCompile>
- this->WriteRCOptions(e1, i);
- this->WriteCudaOptions(e1, i);
- this->WriteMasmOptions(e1, i);
- this->WriteNasmOptions(e1, i);
+ this->WriteRCOptions(e1, c);
+ this->WriteCudaOptions(e1, c);
+ this->WriteMasmOptions(e1, c);
+ this->WriteNasmOptions(e1, c);
}
// output midl flags <Midl></Midl>
- this->WriteMidlOptions(e1, i);
+ this->WriteMidlOptions(e1, c);
// write events
if (this->ProjectType != csproj) {
- this->WriteEvents(e1, i);
+ this->WriteEvents(e1, c);
}
// output link flags <Link></Link>
- this->WriteLinkOptions(e1, i);
- this->WriteCudaLinkOptions(e1, i);
+ this->WriteLinkOptions(e1, c);
+ this->WriteCudaLinkOptions(e1, c);
// output lib flags <Lib></Lib>
- this->WriteLibOptions(e1, i);
+ this->WriteLibOptions(e1, c);
// output manifest flags <Manifest></Manifest>
- this->WriteManifestOptions(e1, i);
+ this->WriteManifestOptions(e1, c);
if (this->NsightTegra &&
this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE &&
this->GeneratorTarget->GetPropertyAsBool("ANDROID_GUI")) {
- this->WriteAntBuildOptions(e1, i);
+ this->WriteAntBuildOptions(e1, c);
}
e1.EndElement();
}
@@ -3716,13 +3713,12 @@ void cmVisualStudio10TargetGenerator::WriteEvent(
if (commands.empty()) {
return;
}
- Elem e2(e1, name);
cmLocalVisualStudio7Generator* lg = this->LocalGenerator;
std::string script;
const char* pre = "";
std::string comment;
- for (cmCustomCommand const& i : commands) {
- cmCustomCommandGenerator ccg(i, configName, this->LocalGenerator);
+ for (cmCustomCommand const& cc : commands) {
+ cmCustomCommandGenerator ccg(cc, configName, lg);
if (!ccg.HasOnlyEmptyCommandLines()) {
comment += pre;
comment += lg->ConstructComment(ccg);
@@ -3733,6 +3729,7 @@ void cmVisualStudio10TargetGenerator::WriteEvent(
}
comment = cmVS10EscapeComment(comment);
if (this->ProjectType != csproj) {
+ Elem e2(e1, name);
e2.Element("Message", comment);
e2.Element("Command", script);
e2.EndElement();
@@ -3746,7 +3743,7 @@ void cmVisualStudio10TargetGenerator::WriteEvent(
oss << "echo " << comment << "\n";
}
oss << script << "\n";
- e2.Content(oss.str());
+ e1.Element(name, oss.str());
}
}
@@ -3759,8 +3756,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences(Elem& e0)
OrderedTargetDependSet depends(unordered, CMAKE_CHECK_BUILD_SYSTEM_TARGET);
Elem e1(e0, "ItemGroup");
e1.SetHasElements();
- for (cmTargetDepend const& i : depends) {
- cmGeneratorTarget const* dt = i;
+ for (cmGeneratorTarget const* dt : depends) {
if (dt->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
continue;
}
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 8c0b6ca..a5ea38c 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -144,7 +144,7 @@ private:
void WriteGroups();
void WriteProjectReferences(Elem& e0);
void WriteApplicationTypeSettings(Elem& e1);
- void OutputSourceSpecificFlags(Elem&, cmSourceFile const* source);
+ void OutputSourceSpecificFlags(Elem& e2, cmSourceFile const* source);
void AddLibraries(const cmComputeLinkInformation& cli,
std::vector<std::string>& libVec,
std::vector<std::string>& vsTargetVec,
diff --git a/Tests/RunCMake/add_custom_target/CommandExpandsEmpty.cmake b/Tests/RunCMake/add_custom_target/CommandExpandsEmpty.cmake
new file mode 100644
index 0000000..bc899a4
--- /dev/null
+++ b/Tests/RunCMake/add_custom_target/CommandExpandsEmpty.cmake
@@ -0,0 +1 @@
+add_custom_target(EmptyCustom COMMAND "" COMMAND_EXPAND_LISTS)
diff --git a/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake b/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake
index 6c4e91b..2caed03 100644
--- a/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake
+++ b/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake
@@ -1,5 +1,6 @@
include(RunCMake)
+run_cmake(CommandExpandsEmpty)
run_cmake(NoArguments)
run_cmake(BadTargetName)
run_cmake(ByproductsNoCommand)