diff options
-rw-r--r-- | Help/manual/OPTIONS_BUILD.txt | 2 | ||||
-rw-r--r-- | Modules/FindDoxygen.cmake | 12 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 172 | ||||
-rw-r--r-- | Source/cmake.h | 2 | ||||
-rw-r--r-- | Tests/FindDoxygen/AllTarget/CMakeLists.txt | 42 | ||||
-rw-r--r-- | Tests/FindDoxygen/CMakeLists.txt | 10 | ||||
-rwxr-xr-x | bootstrap | 10 |
8 files changed, 113 insertions, 139 deletions
diff --git a/Help/manual/OPTIONS_BUILD.txt b/Help/manual/OPTIONS_BUILD.txt index e8b87c9..33d27af 100644 --- a/Help/manual/OPTIONS_BUILD.txt +++ b/Help/manual/OPTIONS_BUILD.txt @@ -11,7 +11,7 @@ cache-format file. ``-D <var>:<type>=<value>, -D <var>=<value>`` - Create a cmake cache entry. + Create or update a cmake cache entry. When cmake is first run in an empty build tree, it creates a CMakeCache.txt file and populates it with customizable settings for diff --git a/Modules/FindDoxygen.cmake b/Modules/FindDoxygen.cmake index 599d799..945ee0e 100644 --- a/Modules/FindDoxygen.cmake +++ b/Modules/FindDoxygen.cmake @@ -69,6 +69,7 @@ Functions doxygen_add_docs(targetName [filesOrDirs...] + [ALL] [WORKING_DIRECTORY dir] [COMMENT comment]) @@ -91,6 +92,8 @@ Functions the :command:`add_custom_target` command used to create the custom target internally. + If ALL is set, the target will be added to the default build target. + The contents of the generated ``Doxyfile`` can be customized by setting CMake variables before calling ``doxygen_add_docs()``. Any variable with a name of the form ``DOXYGEN_<tag>`` will have its value substituted for the @@ -788,7 +791,7 @@ function(doxygen_list_to_quoted_strings LIST_VARIABLE) endfunction() function(doxygen_add_docs targetName) - set(_options) + set(_options ALL) set(_one_value_args WORKING_DIRECTORY COMMENT) set(_multi_value_args) cmake_parse_arguments(_args @@ -1089,8 +1092,13 @@ doxygen_add_docs() for target ${targetName}") set(_target_doxyfile "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.${targetName}") configure_file("${_doxyfile_template}" "${_target_doxyfile}") + unset(_all) + if(${_args_ALL}) + set(_all ALL) + endif() + # Add the target - add_custom_target( ${targetName} VERBATIM + add_custom_target( ${targetName} ${_all} VERBATIM COMMAND ${CMAKE_COMMAND} -E make_directory ${_original_doxygen_output_dir} COMMAND "${DOXYGEN_EXECUTABLE}" "${_target_doxyfile}" WORKING_DIRECTORY "${_args_WORKING_DIRECTORY}" diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 36f8c7e..d3930be 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 20180525) +set(CMake_VERSION_PATCH 20180529) #set(CMake_VERSION_RC 1) diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index fa6c8ad..f3b9c84 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -42,6 +42,7 @@ struct cmVisualStudio10TargetGenerator::Elem std::ostream& S; const int Indent; bool HasElements = false; + bool HasContent = false; std::string Tag; Elem(std::ostream& s) @@ -79,8 +80,7 @@ struct cmVisualStudio10TargetGenerator::Elem } void Element(const char* tag, const std::string& val) { - Elem(*this).WriteString("<") << tag << ">" << cmVS10EscapeXML(val) << "</" - << tag << ">\n"; + Elem(*this, tag).Content(val); } Elem& Attribute(const char* an, const std::string& av) { @@ -88,13 +88,16 @@ struct cmVisualStudio10TargetGenerator::Elem return *this; } // This method for now assumes that this->Tag has been set, e.g. by calling - // StartElement(). Also, it finishes the element so it should be the last - // one called + // StartElement(). void Content(const std::string& val) { - S << ">" << cmVS10EscapeXML(val) << "</" << this->Tag << ">\n"; + if (!this->HasContent) { + this->S << ">"; + this->HasContent = true; + } + this->S << cmVS10EscapeXML(val); } - void EndElement() + ~Elem() { // Do not emit element which has not been started if (Tag.empty()) { @@ -108,6 +111,8 @@ struct cmVisualStudio10TargetGenerator::Elem } else { // special case: don't print EOL at EOF } + } else if (HasContent) { + this->S << "</" << this->Tag << ">\n"; } else { this->S << " />\n"; } @@ -402,14 +407,12 @@ void cmVisualStudio10TargetGenerator::Generate() // Require Nsight Tegra 1.6 for JCompile support. e1.Element("NsightTegraProjectRevisionNumber", "7"); } - e1.EndElement(); } if (const char* hostArch = this->GlobalGenerator->GetPlatformToolsetHostArchitecture()) { Elem e1(e0, "PropertyGroup"); e1.Element("PreferredToolArchitecture", hostArch); - e1.EndElement(); } if (this->ProjectType != csproj) { @@ -550,28 +553,23 @@ void cmVisualStudio10TargetGenerator::Generate() e1.Element("OutputType", outputType); e1.Element("AppDesignerFolder", "Properties"); } - - e1.EndElement(); } switch (this->ProjectType) { case vcxproj: - Elem(e0, "Import") - .Attribute("Project", VS10_CXX_DEFAULT_PROPS) - .EndElement(); + Elem(e0, "Import").Attribute("Project", VS10_CXX_DEFAULT_PROPS); break; case csproj: Elem(e0, "Import") .Attribute("Project", VS10_CSharp_DEFAULT_PROPS) - .Attribute("Condition", "Exists('" VS10_CSharp_DEFAULT_PROPS "')") - .EndElement(); + .Attribute("Condition", "Exists('" VS10_CSharp_DEFAULT_PROPS "')"); break; } this->WriteProjectConfigurationValues(e0); if (this->ProjectType == vcxproj) { - Elem(e0, "Import").Attribute("Project", VS10_CXX_PROPS).EndElement(); + Elem(e0, "Import").Attribute("Project", VS10_CXX_PROPS); } { Elem e1(e0, "ImportGroup"); @@ -580,16 +578,15 @@ void cmVisualStudio10TargetGenerator::Generate() if (this->GlobalGenerator->IsCudaEnabled()) { Elem(e1, "Import") - .Attribute( - "Project", "$(VCTargetsPath)\\BuildCustomizations\\CUDA " + - this->GlobalGenerator->GetPlatformToolsetCudaString() + ".props") - .EndElement(); + .Attribute("Project", + "$(VCTargetsPath)\\BuildCustomizations\\CUDA " + + this->GlobalGenerator->GetPlatformToolsetCudaString() + + ".props"); } if (this->GlobalGenerator->IsMasmEnabled()) { Elem(e1, "Import") .Attribute("Project", - "$(VCTargetsPath)\\BuildCustomizations\\masm.props") - .EndElement(); + "$(VCTargetsPath)\\BuildCustomizations\\masm.props"); } if (this->GlobalGenerator->IsNasmEnabled()) { // Always search in the standard modules location. @@ -602,9 +599,8 @@ void cmVisualStudio10TargetGenerator::Generate() ConvertToWindowsSlash(propsLocal); this->Makefile->ConfigureFile(propsTemplate.c_str(), propsLocal.c_str(), false, true, true); - Elem(e1, "Import").Attribute("Project", propsLocal).EndElement(); + Elem(e1, "Import").Attribute("Project", propsLocal); } - e1.EndElement(); } { Elem e1(e0, "ImportGroup"); @@ -627,14 +623,12 @@ void cmVisualStudio10TargetGenerator::Generate() Elem(e1, "Import") .Attribute("Project", props) .Attribute("Condition", "exists('" + props + "')") - .Attribute("Label", "LocalAppDataPlatform") - .EndElement(); + .Attribute("Label", "LocalAppDataPlatform"); } this->WritePlatformExtensions(e1); - e1.EndElement(); } - Elem(e0, "PropertyGroup").Attribute("Label", "UserMacros").EndElement(); + Elem(e0, "PropertyGroup").Attribute("Label", "UserMacros"); this->WriteWinRTPackageCertificateKeyFile(e0); this->WritePathAndIncrementalLinkOptions(e0); this->WriteItemDefinitionGroups(e0); @@ -648,12 +642,10 @@ void cmVisualStudio10TargetGenerator::Generate() this->WriteSDKReferences(e0); switch (this->ProjectType) { case vcxproj: - Elem(e0, "Import").Attribute("Project", VS10_CXX_TARGETS).EndElement(); + Elem(e0, "Import").Attribute("Project", VS10_CXX_TARGETS); break; case csproj: - Elem(e0, "Import") - .Attribute("Project", VS10_CSharp_TARGETS) - .EndElement(); + Elem(e0, "Import").Attribute("Project", VS10_CSharp_TARGETS); break; } @@ -668,21 +660,18 @@ void cmVisualStudio10TargetGenerator::Generate() .Attribute("Project", "$(VCTargetsPath)\\BuildCustomizations\\CUDA " + this->GlobalGenerator->GetPlatformToolsetCudaString() + - ".targets") - .EndElement(); + ".targets"); } if (this->GlobalGenerator->IsMasmEnabled()) { Elem(e1, "Import") .Attribute("Project", - "$(VCTargetsPath)\\BuildCustomizations\\masm.targets") - .EndElement(); + "$(VCTargetsPath)\\BuildCustomizations\\masm.targets"); } if (this->GlobalGenerator->IsNasmEnabled()) { std::string nasmTargets = GetCMakeFilePath("Templates/MSBuild/nasm.targets"); - Elem(e1, "Import").Attribute("Project", nasmTargets).EndElement(); + Elem(e1, "Import").Attribute("Project", nasmTargets); } - e1.EndElement(); } if (this->ProjectType == csproj) { for (std::string const& c : this->Configurations) { @@ -690,7 +679,6 @@ void cmVisualStudio10TargetGenerator::Generate() e1.Attribute("Condition", "'$(Configuration)' == '" + c + "'"); e1.SetHasElements(); this->WriteEvents(e1, c); - e1.EndElement(); } // make sure custom commands are executed before build (if necessary) { @@ -703,10 +691,8 @@ void cmVisualStudio10TargetGenerator::Generate() oss << " " << "$(BuildDependsOn)\n"; e1.Element("BuildDependsOn", oss.str()); - e1.EndElement(); } } - e0.EndElement(); } if (BuildFileStream.Close()) { @@ -762,7 +748,6 @@ void cmVisualStudio10TargetGenerator::WriteDotNetReferences(Elem& e0) this->WriteDotNetReference(e1, i.first, i.second, h.first); } } - e1.EndElement(); } } @@ -792,7 +777,6 @@ void cmVisualStudio10TargetGenerator::WriteDotNetReference( e2.Element("HintPath", hint); } this->WriteDotNetReferenceCustomTags(e2, ref); - e2.EndElement(); } void cmVisualStudio10TargetGenerator::WriteDotNetReferenceCustomTags( @@ -915,10 +899,7 @@ void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup(Elem& e0) } } } - - e2.EndElement(); } - e1.EndElement(); } } @@ -959,9 +940,7 @@ void cmVisualStudio10TargetGenerator::WriteXamlFilesGroup(Elem& e0) } } e2.Element("SubType", "Designer"); - e2.EndElement(); } - e1.EndElement(); } } @@ -974,8 +953,7 @@ void cmVisualStudio10TargetGenerator::WriteTargetSpecificReferences(Elem& e0) .Attribute("Project", "$(MSBuildExtensionsPath)\\Microsoft\\WindowsPhone\\v" "$(TargetPlatformVersion)\\Microsoft.Cpp.WindowsPhone." - "$(TargetPlatformVersion).targets") - .EndElement(); + "$(TargetPlatformVersion).targets"); } } } @@ -998,8 +976,7 @@ void cmVisualStudio10TargetGenerator::WriteTargetsFileReferences(Elem& e1) Elem(e1, "Import") .Attribute("Project", tac.File) - .Attribute("Condition", oss.str()) - .EndElement(); + .Attribute("Condition", oss.str()); } } @@ -1022,9 +999,7 @@ void cmVisualStudio10TargetGenerator::WriteWinRTReferences(Elem& e0) Elem e2(e1, "Reference"); e2.Attribute("Include", ri); e2.Element("IsWinMDFile", "true"); - e2.EndElement(); } - e1.EndElement(); } } @@ -1039,9 +1014,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurations(Elem& e0) e2.Attribute("Include", c + "|" + this->Platform); e2.Element("Configuration", c); e2.Element("Platform", this->Platform); - e2.EndElement(); } - e1.EndElement(); } void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues(Elem& e0) @@ -1101,8 +1074,6 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues(Elem& e0) } else if (this->NsightTegra) { this->WriteNsightTegraConfigurationValues(e1, c); } - - e1.EndElement(); } } @@ -1302,8 +1273,6 @@ void cmVisualStudio10TargetGenerator::WriteCustomRule( if (!link.empty()) { e2.Element("Link", link); } - e2.EndElement(); - e1.EndElement(); } for (std::string const& c : this->Configurations) { cmCustomCommandGenerator ccg(command, c, lg); @@ -1339,10 +1308,6 @@ void cmVisualStudio10TargetGenerator::WriteCustomRule( comment); } } - if (this->ProjectType != csproj) { - spe2->EndElement(); - spe1->EndElement(); - } } void cmVisualStudio10TargetGenerator::WriteCustomRuleCpp( @@ -1375,10 +1340,9 @@ void cmVisualStudio10TargetGenerator::WriteCustomRuleCSharp( e1.S << "\n Inputs=\"" << cmVS10EscapeAttr(inputs) << "\""; e1.S << "\n Outputs=\"" << cmVS10EscapeAttr(outputs) << "\""; if (!comment.empty()) { - Elem(e1, "Exec").Attribute("Command", "echo " + comment).EndElement(); + Elem(e1, "Exec").Attribute("Command", "echo " + comment); } - Elem(e1, "Exec").Attribute("Command", script).EndElement(); - e1.EndElement(); + Elem(e1, "Exec").Attribute("Command", script); } std::string cmVisualStudio10TargetGenerator::ConvertPath( @@ -1459,26 +1423,21 @@ void cmVisualStudio10TargetGenerator::WriteGroups() 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(); } std::vector<cmSourceFile const*> resxObjs; @@ -1491,9 +1450,7 @@ void cmVisualStudio10TargetGenerator::WriteGroups() Elem e2(e1, "EmbeddedResource"); e2.Attribute("Include", obj); e2.Element("Filter", "Resource Files"); - e2.EndElement(); } - e1.EndElement(); } { Elem e1(e0, "ItemGroup"); @@ -1512,7 +1469,6 @@ void cmVisualStudio10TargetGenerator::WriteGroups() Elem e2(e1, "Filter"); e2.Attribute("Include", name); e2.Element("UniqueIdentifier", "{" + guid + "}"); - e2.EndElement(); } } @@ -1525,12 +1481,8 @@ void cmVisualStudio10TargetGenerator::WriteGroups() 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'; @@ -1595,9 +1547,7 @@ void cmVisualStudio10TargetGenerator::WriteGroupSources( if (!filter.empty()) { e2.Element("Filter", filter); } - e2.EndElement(); } - e1.EndElement(); } void cmVisualStudio10TargetGenerator::WriteHeaderSource(Elem& e1, @@ -1612,7 +1562,6 @@ void cmVisualStudio10TargetGenerator::WriteHeaderSource(Elem& e1, std::string xamlFileName = fileName.substr(0, fileName.find_last_of(".")); e2.Element("DependentUpon", xamlFileName); } - e2.EndElement(); } void cmVisualStudio10TargetGenerator::WriteExtraSource(Elem& e1, @@ -1887,7 +1836,6 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(Elem& e1, // write source file specific tags this->WriteCSharpSourceProperties(e2, sourceFileTags); } - e2.EndElement(); } void cmVisualStudio10TargetGenerator::WriteSource(Elem& e2, @@ -2043,15 +1991,12 @@ void cmVisualStudio10TargetGenerator::WriteAllSources(Elem& e0) if (!exclude_configs.empty()) { this->WriteExcludeFromBuild(e2, exclude_configs); } - e2.EndElement(); } } if (this->IsMissingFiles) { this->WriteMissingFiles(e1); } - - e1.EndElement(); } void cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( @@ -2354,7 +2299,6 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions( this->OutputLinkIncremental(e1, config); } } - e1.EndElement(); } void cmVisualStudio10TargetGenerator::OutputLinkIncremental( @@ -2650,7 +2594,6 @@ void cmVisualStudio10TargetGenerator::WriteClOptions( if (!clOptions.IsDebug()) { Elem e3(e2, "DebugInformationFormat"); e3.SetHasElements(); - e3.EndElement(); } // Specify the compiler program database file if configured. @@ -2672,8 +2615,6 @@ void cmVisualStudio10TargetGenerator::WriteClOptions( e2.Element("AdditionalUsingDirectories", dirs); } } - - e2.EndElement(); } bool cmVisualStudio10TargetGenerator::ComputeRcOptions() @@ -2727,8 +2668,6 @@ void cmVisualStudio10TargetGenerator::WriteRCOptions( rcOptions.OutputAdditionalIncludeDirectories("RC"); rcOptions.PrependInheritedString("AdditionalOptions"); rcOptions.OutputFlagMap(); - - e2.EndElement(); } bool cmVisualStudio10TargetGenerator::ComputeCudaOptions() @@ -2875,8 +2814,6 @@ void cmVisualStudio10TargetGenerator::WriteCudaOptions( cudaOptions.OutputPreprocessorDefinitions("CUDA"); cudaOptions.PrependInheritedString("AdditionalOptions"); cudaOptions.OutputFlagMap(); - - e2.EndElement(); } bool cmVisualStudio10TargetGenerator::ComputeCudaLinkOptions() @@ -2944,7 +2881,6 @@ void cmVisualStudio10TargetGenerator::WriteCudaLinkOptions( Elem e2(e1, "CudaLink"); OptionsHelper cudaLinkOptions(*(this->CudaLinkOptions[configName]), e2); cudaLinkOptions.OutputFlagMap(); - e2.EndElement(); } bool cmVisualStudio10TargetGenerator::ComputeMasmOptions() @@ -3000,8 +2936,6 @@ void cmVisualStudio10TargetGenerator::WriteMasmOptions( masmOptions.OutputAdditionalIncludeDirectories("ASM_MASM"); masmOptions.PrependInheritedString("AdditionalOptions"); masmOptions.OutputFlagMap(); - - e2.EndElement(); } bool cmVisualStudio10TargetGenerator::ComputeNasmOptions() @@ -3061,8 +2995,6 @@ void cmVisualStudio10TargetGenerator::WriteNasmOptions( // Preprocessor definitions and includes are shared with clOptions. OptionsHelper clOptions(*(this->ClOptions[configName]), e2); clOptions.OutputPreprocessorDefinitions("ASM_NASM"); - - e2.EndElement(); } void cmVisualStudio10TargetGenerator::WriteLibOptions( @@ -3085,7 +3017,6 @@ void cmVisualStudio10TargetGenerator::WriteLibOptions( OptionsHelper oh(libOptions, e2); oh.PrependInheritedString("AdditionalOptions"); oh.OutputFlagMap(); - e2.EndElement(); } // We cannot generate metadata for static libraries. WindowsPhone @@ -3095,7 +3026,6 @@ void cmVisualStudio10TargetGenerator::WriteLibOptions( this->GlobalGenerator->TargetsWindowsStore()) { Elem e2(e1, "Link"); e2.Element("GenerateWindowsMetadata", "false"); - e2.EndElement(); } } @@ -3119,7 +3049,6 @@ void cmVisualStudio10TargetGenerator::WriteManifestOptions( } Elem e2(e1, "Manifest"); e2.Element("AdditionalManifestFiles", oss.str()); - e2.EndElement(); } } @@ -3224,8 +3153,6 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions( e2.Element("AdditionalOptions", std::string(antAdditionalOptions) + " %(AdditionalOptions)"); } - - e2.EndElement(); } bool cmVisualStudio10TargetGenerator::ComputeLinkOptions() @@ -3522,14 +3449,12 @@ void cmVisualStudio10TargetGenerator::WriteLinkOptions( OptionsHelper linkOptions(*(this->LinkOptions[config]), e2); linkOptions.PrependInheritedString("AdditionalOptions"); linkOptions.OutputFlagMap(); - e2.EndElement(); } if (!this->GlobalGenerator->NeedLinkLibraryDependencies( this->GeneratorTarget)) { Elem e2(e1, "ProjectReference"); e2.Element("LinkLibraryDependencies", "false"); - e2.EndElement(); } } @@ -3655,7 +3580,6 @@ void cmVisualStudio10TargetGenerator::WriteMidlOptions( e2.Element("TypeLibraryName", "%(Filename).tlb"); e2.Element("InterfaceIdentifierFileName", "%(Filename)_i.c"); e2.Element("ProxyFileName", "%(Filename)_p.c"); - e2.EndElement(); } void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups(Elem& e0) @@ -3694,7 +3618,6 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups(Elem& e0) this->GeneratorTarget->GetPropertyAsBool("ANDROID_GUI")) { this->WriteAntBuildOptions(e1, c); } - e1.EndElement(); } } @@ -3748,7 +3671,6 @@ void cmVisualStudio10TargetGenerator::WriteEvent( Elem e2(e1, name); e2.Element("Message", comment); e2.Element("Command", script); - e2.EndElement(); } else { std::string strippedComment = comment; strippedComment.erase( @@ -3825,9 +3747,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences(Elem& e0) e2.Element("CopyToOutputDirectory", "Never"); } } - e2.EndElement(); } - e1.EndElement(); } void cmVisualStudio10TargetGenerator::WritePlatformExtensions(Elem& e1) @@ -3864,7 +3784,6 @@ void cmVisualStudio10TargetGenerator::WriteSinglePlatformExtension( Elem e2(e1, "Import"); e2.Attribute("Project", s); e2.Attribute("Condition", "exists('" + s + "')"); - e2.EndElement(); } void cmVisualStudio10TargetGenerator::WriteSDKReferences(Elem& e0) @@ -3878,7 +3797,7 @@ void cmVisualStudio10TargetGenerator::WriteSDKReferences(Elem& e0) e1.StartElement("ItemGroup"); hasWrittenItemGroup = true; for (std::string const& ri : sdkReferences) { - Elem(e1, "SDKReference").Attribute("Include", ri).EndElement(); + Elem(e1, "SDKReference").Attribute("Include", ri); } } @@ -3910,16 +3829,13 @@ void cmVisualStudio10TargetGenerator::WriteSDKReferences(Elem& e0) } } } - - e1.EndElement(); } void cmVisualStudio10TargetGenerator::WriteSingleSDKReference( Elem& e1, std::string const& extension, std::string const& version) { Elem(e1, "SDKReference") - .Attribute("Include", extension + ", Version=" + version) - .EndElement(); + .Attribute("Include", extension + ", Version=" + version); } void cmVisualStudio10TargetGenerator::WriteWinRTPackageCertificateKeyFile( @@ -3969,7 +3885,6 @@ void cmVisualStudio10TargetGenerator::WriteWinRTPackageCertificateKeyFile( if (!thumb.empty()) { e1.Element("PackageCertificateThumbprint", thumb); } - e1.EndElement(); } else if (!pfxFile.empty()) { Elem e1(e0, "PropertyGroup"); e1.Element("PackageCertificateKeyFile", pfxFile); @@ -3977,7 +3892,6 @@ void cmVisualStudio10TargetGenerator::WriteWinRTPackageCertificateKeyFile( if (!thumb.empty()) { e1.Element("PackageCertificateThumbprint", thumb); } - e1.EndElement(); } } } @@ -4217,7 +4131,6 @@ void cmVisualStudio10TargetGenerator::WriteMissingFilesWP80(Elem& e1) Elem e2(e1, "Xml"); e2.Attribute("Include", sourceFile); e2.Element("SubType", "Designer"); - e2.EndElement(); } this->AddedFiles.push_back(sourceFile); @@ -4225,13 +4138,13 @@ void cmVisualStudio10TargetGenerator::WriteMissingFilesWP80(Elem& e1) cmSystemTools::CopyAFile(templateFolder + "/SmallLogo.png", smallLogo, false); ConvertToWindowsSlash(smallLogo); - Elem(e1, "Image").Attribute("Include", smallLogo).EndElement(); + Elem(e1, "Image").Attribute("Include", smallLogo); this->AddedFiles.push_back(smallLogo); std::string logo = this->DefaultArtifactDir + "/Logo.png"; cmSystemTools::CopyAFile(templateFolder + "/Logo.png", logo, false); ConvertToWindowsSlash(logo); - Elem(e1, "Image").Attribute("Include", logo).EndElement(); + Elem(e1, "Image").Attribute("Include", logo); this->AddedFiles.push_back(logo); std::string applicationIcon = @@ -4239,7 +4152,7 @@ void cmVisualStudio10TargetGenerator::WriteMissingFilesWP80(Elem& e1) cmSystemTools::CopyAFile(templateFolder + "/ApplicationIcon.png", applicationIcon, false); ConvertToWindowsSlash(applicationIcon); - Elem(e1, "Image").Attribute("Include", applicationIcon).EndElement(); + Elem(e1, "Image").Attribute("Include", applicationIcon); this->AddedFiles.push_back(applicationIcon); } @@ -4494,7 +4407,6 @@ void cmVisualStudio10TargetGenerator::WriteCommonMissingFiles( Elem e2(e1, "AppxManifest"); e2.Attribute("Include", sourceFile); e2.Element("SubType", "Designer"); - e2.EndElement(); } this->AddedFiles.push_back(sourceFile); @@ -4502,34 +4414,34 @@ void cmVisualStudio10TargetGenerator::WriteCommonMissingFiles( cmSystemTools::CopyAFile(templateFolder + "/SmallLogo.png", smallLogo, false); ConvertToWindowsSlash(smallLogo); - Elem(e1, "Image").Attribute("Include", smallLogo).EndElement(); + Elem(e1, "Image").Attribute("Include", smallLogo); this->AddedFiles.push_back(smallLogo); std::string smallLogo44 = this->DefaultArtifactDir + "/SmallLogo44x44.png"; cmSystemTools::CopyAFile(templateFolder + "/SmallLogo44x44.png", smallLogo44, false); ConvertToWindowsSlash(smallLogo44); - Elem(e1, "Image").Attribute("Include", smallLogo44).EndElement(); + Elem(e1, "Image").Attribute("Include", smallLogo44); this->AddedFiles.push_back(smallLogo44); std::string logo = this->DefaultArtifactDir + "/Logo.png"; cmSystemTools::CopyAFile(templateFolder + "/Logo.png", logo, false); ConvertToWindowsSlash(logo); - Elem(e1, "Image").Attribute("Include", logo).EndElement(); + Elem(e1, "Image").Attribute("Include", logo); this->AddedFiles.push_back(logo); std::string storeLogo = this->DefaultArtifactDir + "/StoreLogo.png"; cmSystemTools::CopyAFile(templateFolder + "/StoreLogo.png", storeLogo, false); ConvertToWindowsSlash(storeLogo); - Elem(e1, "Image").Attribute("Include", storeLogo).EndElement(); + Elem(e1, "Image").Attribute("Include", storeLogo); this->AddedFiles.push_back(storeLogo); std::string splashScreen = this->DefaultArtifactDir + "/SplashScreen.png"; cmSystemTools::CopyAFile(templateFolder + "/SplashScreen.png", splashScreen, false); ConvertToWindowsSlash(splashScreen); - Elem(e1, "Image").Attribute("Include", splashScreen).EndElement(); + Elem(e1, "Image").Attribute("Include", splashScreen); this->AddedFiles.push_back(splashScreen); if (this->AddedDefaultCertificate) { @@ -4537,7 +4449,7 @@ void cmVisualStudio10TargetGenerator::WriteCommonMissingFiles( std::string keyFile = this->DefaultArtifactDir + "/Windows_TemporaryKey.pfx"; ConvertToWindowsSlash(keyFile); - Elem(e1, "None").Attribute("Include", keyFile).EndElement(); + Elem(e1, "None").Attribute("Include", keyFile); } } diff --git a/Source/cmake.h b/Source/cmake.h index 63dbe9f..dafe622 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -550,7 +550,7 @@ private: #define CMAKE_STANDARD_OPTIONS_TABLE \ { "-C <initial-cache>", "Pre-load a script to populate the cache." }, \ - { "-D <var>[:<type>]=<value>", "Create a cmake cache entry." }, \ + { "-D <var>[:<type>]=<value>", "Create or update a cmake cache entry." }, \ { "-U <globbing_expr>", "Remove matching entries from CMake cache." }, \ { "-G <generator-name>", "Specify a build system generator." }, \ { "-T <toolset-name>", \ diff --git a/Tests/FindDoxygen/AllTarget/CMakeLists.txt b/Tests/FindDoxygen/AllTarget/CMakeLists.txt new file mode 100644 index 0000000..69aa518 --- /dev/null +++ b/Tests/FindDoxygen/AllTarget/CMakeLists.txt @@ -0,0 +1,42 @@ +cmake_minimum_required(VERSION 3.10) +project(TestFindDoxygen VERSION 1.0 LANGUAGES NONE) +enable_testing() + +find_package(Doxygen REQUIRED) + +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/main.cpp [[ +/** + * \file + * \brief One C++ file w/ sample Doxygen comment just to produce any docs... + */ +]]) + +set(DOXYGEN_OUTPUT_DIRECTORY outDirWithout) +file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/${DOXYGEN_OUTPUT_DIRECTORY}) +doxygen_add_docs(docsNoAll ${CMAKE_CURRENT_BINARY_DIR}/main.cpp) + +set(DOXYGEN_OUTPUT_DIRECTORY outDirWith) +file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/${DOXYGEN_OUTPUT_DIRECTORY}) +doxygen_add_docs(docsWithAll ALL ${CMAKE_CURRENT_BINARY_DIR}/main.cpp) + +# Define tests cases that check whether targets were built +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/dirExists.cmake [[ +cmake_minimum_required(VERSION 3.11) +if(NOT EXISTS ${dirName}) + message(FATAL_ERROR "Directory does not exist: ${dirName}") +endif() +]]) + +add_test(NAME checkWith COMMAND + ${CMAKE_COMMAND} + -D dirName=${CMAKE_CURRENT_BINARY_DIR}/outDirWith + -P dirExists.cmake +) +add_test(NAME checkWithout COMMAND + ${CMAKE_COMMAND} + -D dirName=${CMAKE_CURRENT_BINARY_DIR}/outDirWithout + -P dirExists.cmake +) +set_tests_properties(checkWithout PROPERTIES + WILL_FAIL TRUE +) diff --git a/Tests/FindDoxygen/CMakeLists.txt b/Tests/FindDoxygen/CMakeLists.txt index 69b9eed..7ce98d5 100644 --- a/Tests/FindDoxygen/CMakeLists.txt +++ b/Tests/FindDoxygen/CMakeLists.txt @@ -18,6 +18,16 @@ add_test(NAME FindDoxygen.QuotingTest COMMAND --build-options ${build_options} ) +add_test(NAME FindDoxygen.AllTarget COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindDoxygen/AllTarget" + "${CMake_BINARY_DIR}/Tests/FindDoxygen/AllTarget" + ${build_generator_args} + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> +) + if(CMake_TEST_FindDoxygen_Dot) add_test(NAME FindDoxygen.DotComponentTest COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> @@ -1250,6 +1250,12 @@ else echo "${cmake_cxx_compiler} does not have <ext/stdio_filebuf.h>" fi +if [ -n "${cmake_ccache_enabled}" ]; then + echo "Building CMake with ccache" + cmake_c_compiler="ccache ${cmake_c_compiler}" + cmake_cxx_compiler="ccache ${cmake_cxx_compiler}" +fi + # Just to be safe, let us store compiler and flags to the header file cmake_bootstrap_version='$Revision$' @@ -1536,10 +1542,6 @@ cd "${cmake_binary_dir}" # build with same compiler and make CC="${cmake_c_compiler}" CXX="${cmake_cxx_compiler}" -if [ -n "${cmake_ccache_enabled}" ]; then - CC="ccache ${CC}" - CXX="ccache ${CXX}" -fi MAKE="${cmake_make_processor}" export CC export CXX |