From 4c29297495b53e07f61a6de1f5f689ddd6bab7bd Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 7 Oct 2019 10:57:39 -0400 Subject: [PATCH 001/662] Begin post-3.16 development --- Help/release/dev/0-sample-topic.rst | 7 +++++++ Help/release/index.rst | 2 ++ Source/CMakeVersion.cmake | 4 ++-- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 Help/release/dev/0-sample-topic.rst diff --git a/Help/release/dev/0-sample-topic.rst b/Help/release/dev/0-sample-topic.rst new file mode 100644 index 00000000000..e4cc01e23fe --- /dev/null +++ b/Help/release/dev/0-sample-topic.rst @@ -0,0 +1,7 @@ +0-sample-topic +-------------- + +* This is a sample release note for the change in a topic. + Developers should add similar notes for each topic branch + making a noteworthy change. Each document should be named + and titled to match the topic name to avoid merge conflicts. diff --git a/Help/release/index.rst b/Help/release/index.rst index 0cc3f972623..a4585a5ddfa 100644 --- a/Help/release/index.rst +++ b/Help/release/index.rst @@ -7,6 +7,8 @@ CMake Release Notes This file should include the adjacent "dev.txt" file in development versions but not in release versions. +.. include:: dev.txt + Releases ======== diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 51a92170029..c068594bcb2 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,8 +1,8 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 0) -set(CMake_VERSION_RC 0) +set(CMake_VERSION_PATCH 20191007) +#set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) # Start with the full version number used in tags. It has no dev info. From 638fa41234fe2935a471377f8493718cd92f42c1 Mon Sep 17 00:00:00 2001 From: Gregor Jasny Date: Mon, 7 Oct 2019 20:45:51 +0200 Subject: [PATCH 002/662] Apple: Set Clang ASM compiler features The same is done for the C and CXX language. This initializes compiler flags like the sysroot path or deployment target. Closes: #19794 Suggested-by: Kyle Fleming --- Modules/Platform/Apple-Clang-ASM.cmake | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Modules/Platform/Apple-Clang-ASM.cmake diff --git a/Modules/Platform/Apple-Clang-ASM.cmake b/Modules/Platform/Apple-Clang-ASM.cmake new file mode 100644 index 00000000000..935cce97aee --- /dev/null +++ b/Modules/Platform/Apple-Clang-ASM.cmake @@ -0,0 +1,2 @@ +include(Platform/Apple-Clang) +__apple_compiler_clang(ASM) From 553658393c0e775efdec6b29b69c1274fb771e83 Mon Sep 17 00:00:00 2001 From: Corentin Plouet Date: Tue, 8 Oct 2019 13:45:30 +1100 Subject: [PATCH 003/662] Graphviz: added test suite, fixes, enhancements * Added a fairly comprehensive test suite * Separated the graph traversal logic from the Graphviz generation code by introducing a new class, cmLinkItemsGraphVisitor{.h,cxx} * Made the graph traversal logic less ad-hoc by using existing methods in the GlobalGenerator; this fixed a few bugs * Added support for new target types: custom targets, object and unknown libraries * Improved support for ALIAS libraries by showing the alias(es) in the graph * Introduced new flags to control those new libraries (consistent with existing flags) * Updated the documentation * Removed useless setting to set graph type in dot file * Improved the node/edge shapes (nicer, more consistent) * Added a legend to the graph * Some refactoring and cleanup of the Graphviz generation code * Added test and fix for issue 19746 --- Modules/CMakeGraphVizOptions.cmake | 146 ++-- Source/CMakeLists.txt | 2 + Source/cmGraphVizWriter.cxx | 723 ++++++++---------- Source/cmGraphVizWriter.h | 93 ++- Source/cmLinkItemGraphVisitor.cxx | 142 ++++ Source/cmLinkItemGraphVisitor.h | 75 ++ Source/cmake.cxx | 7 +- Tests/RunCMake/CMakeLists.txt | 1 + .../Graphviz/CMakeGraphVizOptions.cmake.in | 1 + Tests/RunCMake/Graphviz/CMakeLists.txt | 3 + .../Graphviz/GraphvizTestProject.cmake | 58 ++ Tests/RunCMake/Graphviz/RunCMakeTest.cmake | 82 ++ .../Graphviz/default_options-check.cmake | 5 + .../dependency_graph_custom_targets.dot | 52 ++ .../dependency_graph_default_options.dot | 50 ++ .../dependency_graph_no_dependers_files.dot | 50 ++ .../dependency_graph_no_executables.dot | 44 ++ .../dependency_graph_no_external_libs.dot | 46 ++ .../dependency_graph_no_graphic_libs.dot | 35 + .../dependency_graph_no_interface_libs.dot | 43 ++ .../dependency_graph_no_module_libs.dot | 44 ++ .../dependency_graph_no_object_libs.dot | 48 ++ .../dependency_graph_no_per_target_files.dot | 50 ++ .../dependency_graph_no_shared_libs.dot | 44 ++ .../dependency_graph_no_static_libs.dot | 42 + .../dependency_graph_no_unknown_libs.dot | 48 ++ .../dependency_graph_set_graph_header.dot | 50 ++ .../dependency_graph_set_graph_name.dot | 50 ++ .../dependency_graph_set_node_prefix.dot | 50 ++ .../Graphviz/no_dependers_files-check.cmake | 4 + .../Graphviz/no_executables-check.cmake | 5 + .../Graphviz/no_external_libs-check.cmake | 5 + .../Graphviz/no_graphic_libs-check.cmake | 5 + .../Graphviz/no_interface_libs-check.cmake | 5 + .../Graphviz/no_module_libs-check.cmake | 5 + .../Graphviz/no_object_libs-check.cmake | 5 + .../Graphviz/no_per_target_files-check.cmake | 5 + .../Graphviz/no_shared_libs-check.cmake | 5 + .../Graphviz/no_static_libs-check.cmake | 5 + .../Graphviz/no_unknown_libs-check.cmake | 5 + .../Graphviz/set_graph_header-check.cmake | 5 + .../Graphviz/set_graph_name-check.cmake | 5 + .../Graphviz/set_node_prefix-check.cmake | 5 + .../Graphviz/test_project/core_library.c | 3 + .../Graphviz/test_project/graphic_library.c | 3 + Tests/RunCMake/Graphviz/test_project/main.c | 4 + Tests/RunCMake/Graphviz/test_project/module.c | 3 + .../third_party_project/CMakeLists.txt | 3 + Tests/RunCMake/RunCMake.cmake | 23 + bootstrap | 1 + 50 files changed, 1692 insertions(+), 501 deletions(-) create mode 100644 Source/cmLinkItemGraphVisitor.cxx create mode 100644 Source/cmLinkItemGraphVisitor.h create mode 100644 Tests/RunCMake/Graphviz/CMakeGraphVizOptions.cmake.in create mode 100644 Tests/RunCMake/Graphviz/CMakeLists.txt create mode 100644 Tests/RunCMake/Graphviz/GraphvizTestProject.cmake create mode 100644 Tests/RunCMake/Graphviz/RunCMakeTest.cmake create mode 100644 Tests/RunCMake/Graphviz/default_options-check.cmake create mode 100644 Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_custom_targets.dot create mode 100644 Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_default_options.dot create mode 100644 Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_dependers_files.dot create mode 100644 Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_executables.dot create mode 100644 Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_external_libs.dot create mode 100644 Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_graphic_libs.dot create mode 100644 Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_interface_libs.dot create mode 100644 Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_module_libs.dot create mode 100644 Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_object_libs.dot create mode 100644 Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_per_target_files.dot create mode 100644 Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_shared_libs.dot create mode 100644 Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_static_libs.dot create mode 100644 Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_unknown_libs.dot create mode 100644 Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_header.dot create mode 100644 Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_name.dot create mode 100644 Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_node_prefix.dot create mode 100644 Tests/RunCMake/Graphviz/no_dependers_files-check.cmake create mode 100644 Tests/RunCMake/Graphviz/no_executables-check.cmake create mode 100644 Tests/RunCMake/Graphviz/no_external_libs-check.cmake create mode 100644 Tests/RunCMake/Graphviz/no_graphic_libs-check.cmake create mode 100644 Tests/RunCMake/Graphviz/no_interface_libs-check.cmake create mode 100644 Tests/RunCMake/Graphviz/no_module_libs-check.cmake create mode 100644 Tests/RunCMake/Graphviz/no_object_libs-check.cmake create mode 100644 Tests/RunCMake/Graphviz/no_per_target_files-check.cmake create mode 100644 Tests/RunCMake/Graphviz/no_shared_libs-check.cmake create mode 100644 Tests/RunCMake/Graphviz/no_static_libs-check.cmake create mode 100644 Tests/RunCMake/Graphviz/no_unknown_libs-check.cmake create mode 100644 Tests/RunCMake/Graphviz/set_graph_header-check.cmake create mode 100644 Tests/RunCMake/Graphviz/set_graph_name-check.cmake create mode 100644 Tests/RunCMake/Graphviz/set_node_prefix-check.cmake create mode 100644 Tests/RunCMake/Graphviz/test_project/core_library.c create mode 100644 Tests/RunCMake/Graphviz/test_project/graphic_library.c create mode 100644 Tests/RunCMake/Graphviz/test_project/main.c create mode 100644 Tests/RunCMake/Graphviz/test_project/module.c create mode 100644 Tests/RunCMake/Graphviz/test_project/third_party_project/CMakeLists.txt diff --git a/Modules/CMakeGraphVizOptions.cmake b/Modules/CMakeGraphVizOptions.cmake index 1911e7392e1..be4a3be3651 100644 --- a/Modules/CMakeGraphVizOptions.cmake +++ b/Modules/CMakeGraphVizOptions.cmake @@ -5,119 +5,145 @@ CMakeGraphVizOptions -------------------- -The builtin graphviz support of CMake. +The builtin Graphviz support of CMake. -Variables specific to the graphviz support -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Generating Graphviz files +^^^^^^^^^^^^^^^^^^^^^^^^^ -CMake -can generate `graphviz `_ files, showing the dependencies between the -targets in a project and also external libraries which are linked -against. When CMake is run with the ``--graphviz=foo.dot`` option, it will -produce: +CMake can generate `Graphviz `_ files showing the +dependencies between the targets in a project, as well as external libraries +which are linked against. -* a ``foo.dot`` file showing all dependencies in the project -* a ``foo.dot.`` file for each target, file showing on which other targets the respective target depends -* a ``foo.dot..dependers`` file, showing which other targets depend on the respective target +When running CMake with the ``--graphviz=foo.dot`` option, it produces: -The different dependency types ``PUBLIC``, ``PRIVATE`` and ``INTERFACE`` -are represented as solid, dashed and dotted edges. +* a ``foo.dot`` file, showing all dependencies in the project +* a ``foo.dot.`` file for each target, showing on which other targets + it depends +* a ``foo.dot..dependers`` file for each target, showing which other + targets depend on it -This can result in huge graphs. Using the file -``CMakeGraphVizOptions.cmake`` the look and content of the generated -graphs can be influenced. This file is searched first in -:variable:`CMAKE_BINARY_DIR` and then in :variable:`CMAKE_SOURCE_DIR`. If found, it is -read and the variables set in it are used to adjust options for the -generated graphviz files. +Those .dot files can be converted to images using the *dot* command from the +Graphviz package: -.. variable:: GRAPHVIZ_GRAPH_TYPE +.. code-block:: shell - The graph type. + dot -Tpng -o foo.png foo.dot - * Mandatory : NO - * Default : "digraph" +The different dependency types ``PUBLIC``, ``INTERFACE`` and ``PRIVATE`` +are represented as solid, dashed and dotted edges. - Valid graph types are: +Variables specific to the Graphviz support +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - * "graph" : Nodes are joined with lines - * "digraph" : Nodes are joined with arrows showing direction - * "strict graph" : Like "graph" but max one line between each node - * "strict digraph" : Like "graph" but max one line between each node in each direction +The resulting graphs can be huge. The look and content of the generated graphs +can be controlled using the file ``CMakeGraphVizOptions.cmake``. This file is +first searched in :variable:`CMAKE_BINARY_DIR`, and then in +:variable:`CMAKE_SOURCE_DIR`. If found, the variables set in it are used to +adjust options for the generated Graphviz files. .. variable:: GRAPHVIZ_GRAPH_NAME The graph name. - * Mandatory : NO - * Default : "GG" + * Mandatory: NO + * Default: value of :variable:`CMAKE_PROJECT_NAME` .. variable:: GRAPHVIZ_GRAPH_HEADER - The header written at the top of the graphviz file. + The header written at the top of the Graphviz files. - * Mandatory : NO - * Default : "node [n fontsize = "12"];" + * Mandatory: NO + * Default: "node [ fontsize = "12" ];" .. variable:: GRAPHVIZ_NODE_PREFIX - The prefix for each node in the graphviz file. + The prefix for each node in the Graphviz files. - * Mandatory : NO - * Default : "node" + * Mandatory: NO + * Default: "node" .. variable:: GRAPHVIZ_EXECUTABLES - Set this to FALSE to exclude executables from the generated graphs. + Set to FALSE to exclude executables from the generated graphs. - * Mandatory : NO - * Default : TRUE + * Mandatory: NO + * Default: TRUE .. variable:: GRAPHVIZ_STATIC_LIBS - Set this to FALSE to exclude static libraries from the generated graphs. + Set to FALSE to exclude static libraries from the generated graphs. - * Mandatory : NO - * Default : TRUE + * Mandatory: NO + * Default: TRUE .. variable:: GRAPHVIZ_SHARED_LIBS - Set this to FALSE to exclude shared libraries from the generated graphs. + Set to FALSE to exclude shared libraries from the generated graphs. - * Mandatory : NO - * Default : TRUE + * Mandatory: NO + * Default: TRUE .. variable:: GRAPHVIZ_MODULE_LIBS - Set this to FALSE to exclude module libraries from the generated graphs. + Set to FALSE to exclude module libraries from the generated graphs. + + * Mandatory: NO + * Default: TRUE + +.. variable:: GRAPHVIZ_INTERFACE_LIBS + + Set to FALSE to exclude interface libraries from the generated graphs. + + * Mandatory: NO + * Default: TRUE - * Mandatory : NO - * Default : TRUE +.. variable:: GRAPHVIZ_OBJECT_LIBS + + Set to FALSE to exclude object libraries from the generated graphs. + + * Mandatory: NO + * Default: TRUE + +.. variable:: GRAPHVIZ_UNKNOWN_LIBS + + Set to FALSE to exclude unknown libraries from the generated graphs. + + * Mandatory: NO + * Default: TRUE .. variable:: GRAPHVIZ_EXTERNAL_LIBS - Set this to FALSE to exclude external libraries from the generated graphs. + Set to FALSE to exclude external libraries from the generated graphs. + + * Mandatory: NO + * Default: TRUE + +.. variable:: GRAPHVIZ_CUSTOM_TARGETS + + Set to TRUE to include custom targets in the generated graphs. - * Mandatory : NO - * Default : TRUE + * Mandatory: NO + * Default: FALSE .. variable:: GRAPHVIZ_IGNORE_TARGETS - A list of regular expressions for ignoring targets. + A list of regular expressions for names of targets to exclude from the + generated graphs. - * Mandatory : NO - * Default : empty + * Mandatory: NO + * Default: empty .. variable:: GRAPHVIZ_GENERATE_PER_TARGET - Set this to FALSE to exclude per target graphs ``foo.dot.``. + Set to FALSE to not generate per-target graphs ``foo.dot.``. - * Mandatory : NO - * Default : TRUE + * Mandatory: NO + * Default: TRUE .. variable:: GRAPHVIZ_GENERATE_DEPENDERS - Set this to FALSE to exclude depender graphs ``foo.dot..dependers``. + Set to FALSE to not generate depender graphs ``foo.dot..dependers``. - * Mandatory : NO - * Default : TRUE + * Mandatory: NO + * Default: TRUE #]=======================================================================] diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 63e08de0f50..6087e53a29d 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -289,6 +289,8 @@ set(SRCS cmGeneratorExpression.h cmGeneratorTarget.cxx cmGeneratorTarget.h + cmLinkItemGraphVisitor.cxx + cmLinkItemGraphVisitor.h cmGetPipes.cxx cmGetPipes.h cmGlobalCommonGenerator.cxx diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx index e0d545d86d3..7759c5f9d33 100644 --- a/Source/cmGraphVizWriter.cxx +++ b/Source/cmGraphVizWriter.cxx @@ -2,174 +2,190 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGraphVizWriter.h" -#include +#include #include #include -#include +#include #include +#include + #include "cmGeneratedFileStream.h" #include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" +#include "cmLinkItem.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmState.h" #include "cmStateSnapshot.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" -#include "cmTarget.h" #include "cmake.h" namespace { -enum LinkLibraryScopeType -{ - LLT_SCOPE_PUBLIC, - LLT_SCOPE_PRIVATE, - LLT_SCOPE_INTERFACE -}; -const char* const GRAPHVIZ_PRIVATE_EDEGE_STYLE = "dashed"; -const char* const GRAPHVIZ_INTERFACE_EDEGE_STYLE = "dotted"; +char const* const GRAPHVIZ_EDGE_STYLE_PUBLIC = "solid"; +char const* const GRAPHVIZ_EDGE_STYLE_INTERFACE = "dashed"; +char const* const GRAPHVIZ_EDGE_STYLE_PRIVATE = "dotted"; -std::string getLinkLibraryStyle(const LinkLibraryScopeType& type) -{ - std::string style; - switch (type) { - case LLT_SCOPE_PRIVATE: - style = "[style = " + std::string(GRAPHVIZ_PRIVATE_EDEGE_STYLE) + "]"; - break; - case LLT_SCOPE_INTERFACE: - style = "[style = " + std::string(GRAPHVIZ_INTERFACE_EDEGE_STYLE) + "]"; - break; - default: - break; - } - return style; -} +char const* const GRAPHVIZ_NODE_SHAPE_EXECUTABLE = "egg"; // egg-xecutable + +// Normal libraries. +char const* const GRAPHVIZ_NODE_SHAPE_LIBRARY_STATIC = "octagon"; +char const* const GRAPHVIZ_NODE_SHAPE_LIBRARY_SHARED = "doubleoctagon"; +char const* const GRAPHVIZ_NODE_SHAPE_LIBRARY_MODULE = "tripleoctagon"; -const char* getShapeForTarget(const cmGeneratorTarget* target) +char const* const GRAPHVIZ_NODE_SHAPE_LIBRARY_INTERFACE = "pentagon"; +char const* const GRAPHVIZ_NODE_SHAPE_LIBRARY_OBJECT = "hexagon"; +char const* const GRAPHVIZ_NODE_SHAPE_LIBRARY_UNKNOWN = "septagon"; + +char const* const GRAPHVIZ_NODE_SHAPE_UTILITY = "box"; + +const char* getShapeForTarget(const cmLinkItem& item) { - if (!target) { - return "ellipse"; + if (item.Target == nullptr) { + return GRAPHVIZ_NODE_SHAPE_LIBRARY_UNKNOWN; } - switch (target->GetType()) { + switch (item.Target->GetType()) { case cmStateEnums::EXECUTABLE: - return "house"; + return GRAPHVIZ_NODE_SHAPE_EXECUTABLE; case cmStateEnums::STATIC_LIBRARY: - return "diamond"; + return GRAPHVIZ_NODE_SHAPE_LIBRARY_STATIC; case cmStateEnums::SHARED_LIBRARY: - return "polygon"; + return GRAPHVIZ_NODE_SHAPE_LIBRARY_SHARED; case cmStateEnums::MODULE_LIBRARY: - return "octagon"; + return GRAPHVIZ_NODE_SHAPE_LIBRARY_MODULE; + case cmStateEnums::OBJECT_LIBRARY: + return GRAPHVIZ_NODE_SHAPE_LIBRARY_OBJECT; + case cmStateEnums::UTILITY: + return GRAPHVIZ_NODE_SHAPE_UTILITY; + case cmStateEnums::INTERFACE_LIBRARY: + return GRAPHVIZ_NODE_SHAPE_LIBRARY_INTERFACE; + case cmStateEnums::UNKNOWN_LIBRARY: default: - break; + return GRAPHVIZ_NODE_SHAPE_LIBRARY_UNKNOWN; } +} +} - return "box"; +cmGraphVizWriter::cmGraphVizWriter(std::string const& fileName, + const cmGlobalGenerator* globalGenerator) + : FileName(fileName) + , GlobalFileStream(fileName) + , GraphName(globalGenerator->GetSafeGlobalSetting("CMAKE_PROJECT_NAME")) + , GraphHeader("node [\n fontsize = \"12\"\n];") + , GraphNodePrefix("node") + , GlobalGenerator(globalGenerator) + , NextNodeId(0) + , GenerateForExecutables(true) + , GenerateForStaticLibs(true) + , GenerateForSharedLibs(true) + , GenerateForModuleLibs(true) + , GenerateForInterfaceLibs(true) + , GenerateForObjectLibs(true) + , GenerateForUnknownLibs(true) + , GenerateForCustomTargets(false) + , GenerateForExternals(true) + , GeneratePerTarget(true) + , GenerateDependers(true) +{ } -std::map getScopedLinkLibrariesFromTarget( - cmTarget* Target, const cmGlobalGenerator* globalGenerator) +cmGraphVizWriter::~cmGraphVizWriter() { - char sep = ';'; - std::map tokens; - size_t start = 0; - size_t end = 0; + this->WriteFooter(this->GlobalFileStream); - const char* pInterfaceLinkLibraries = - Target->GetProperty("INTERFACE_LINK_LIBRARIES"); - const char* pLinkLibraries = Target->GetProperty("LINK_LIBRARIES"); + for (auto& fileStream : this->PerTargetFileStreams) { + this->WriteFooter(*fileStream.second); + } - if (!pInterfaceLinkLibraries && !pLinkLibraries) { - return tokens; // target is not linked against any other libraries + for (auto& fileStream : this->TargetDependersFileStreams) { + this->WriteFooter(*fileStream.second); } +} - // make sure we don't touch a null-ptr - auto interfaceLinkLibraries = - std::string(pInterfaceLinkLibraries ? pInterfaceLinkLibraries : ""); - auto linkLibraries = std::string(pLinkLibraries ? pLinkLibraries : ""); +void cmGraphVizWriter::VisitGraph(std::string const&) +{ + this->WriteHeader(GlobalFileStream, this->GraphName); + this->WriteLegend(GlobalFileStream); +} - // first extract interfaceLinkLibraries - while (start < interfaceLinkLibraries.length()) { +void cmGraphVizWriter::OnItem(cmLinkItem const& item) +{ + if (this->ItemExcluded(item)) { + return; + } - if ((end = interfaceLinkLibraries.find(sep, start)) == std::string::npos) { - end = interfaceLinkLibraries.length(); - } + NodeNames[item.AsStr()] = cmStrCat(GraphNodePrefix, NextNodeId); + ++NextNodeId; - std::string element = interfaceLinkLibraries.substr(start, end - start); - if (globalGenerator->IsAlias(element)) { - const auto tgt = globalGenerator->FindTarget(element); - if (tgt) { - element = tgt->GetName(); - } - } + this->WriteNode(this->GlobalFileStream, item); - if (std::string::npos == element.find("$GeneratePerTarget) { + this->CreateTargetFile(this->PerTargetFileStreams, item); } - // second extract linkLibraries - start = 0; - while (start < linkLibraries.length()) { - - if ((end = linkLibraries.find(sep, start)) == std::string::npos) { - end = linkLibraries.length(); - } + if (this->GenerateDependers) { + this->CreateTargetFile(this->TargetDependersFileStreams, item, + ".dependers"); + } +} - std::string element = linkLibraries.substr(start, end - start); - if (globalGenerator->IsAlias(element)) { - const auto tgt = globalGenerator->FindTarget(element); - if (tgt) { - element = tgt->GetName(); - } - } +void cmGraphVizWriter::CreateTargetFile(FileStreamMap& fileStreamMap, + cmLinkItem const& item, + std::string const& fileNameSuffix) +{ + auto const pathSafeItemName = PathSafeString(item.AsStr()); + auto const perTargetFileName = + cmStrCat(this->FileName, '.', pathSafeItemName, fileNameSuffix); + auto perTargetFileStream = + cm::make_unique(perTargetFileName); - if (tokens.find(element) == tokens.end()) { - // this library is not found in interfaceLinkLibraries but in - // linkLibraries. - // this results in a private linked library. - tokens[element] = LLT_SCOPE_PRIVATE; - } else if (LLT_SCOPE_INTERFACE == tokens[element]) { - // this library is found in interfaceLinkLibraries and linkLibraries. - // this results in a public linked library. - tokens[element] = LLT_SCOPE_PUBLIC; - } else { - // private and public linked libraries should not be changed anymore. - } + this->WriteHeader(*perTargetFileStream, item.AsStr()); + this->WriteNode(*perTargetFileStream, item); - start = end + 1; - } + fileStreamMap.emplace(item.AsStr(), std::move(perTargetFileStream)); +} - return tokens; +void cmGraphVizWriter::OnDirectLink(cmLinkItem const& depender, + cmLinkItem const& dependee, + DependencyType dt) +{ + this->VisitLink(depender, dependee, true, GetEdgeStyle(dt)); } + +void cmGraphVizWriter::OnIndirectLink(cmLinkItem const& depender, + cmLinkItem const& dependee) +{ + this->VisitLink(depender, dependee, false); } -cmGraphVizWriter::cmGraphVizWriter(const cmGlobalGenerator* globalGenerator) - : GraphType("digraph") - , GraphName("GG") - , GraphHeader("node [\n fontsize = \"12\"\n];") - , GraphNodePrefix("node") - , GlobalGenerator(globalGenerator) - , LocalGenerators(globalGenerator->GetLocalGenerators()) - , GenerateForExecutables(true) - , GenerateForStaticLibs(true) - , GenerateForSharedLibs(true) - , GenerateForModuleLibs(true) - , GenerateForInterface(true) - , GenerateForExternals(true) - , GeneratePerTarget(true) - , GenerateDependers(true) - , HaveTargetsAndLibs(false) +void cmGraphVizWriter::VisitLink(cmLinkItem const& depender, + cmLinkItem const& dependee, bool isDirectLink, + std::string const& scopeType) { + if (this->ItemExcluded(depender) || this->ItemExcluded(dependee)) { + return; + } + + if (!isDirectLink) { + return; + } + + this->WriteConnection(this->GlobalFileStream, depender, dependee, scopeType); + + if (this->GeneratePerTarget) { + auto fileStream = PerTargetFileStreams[depender.AsStr()].get(); + this->WriteNode(*fileStream, dependee); + this->WriteConnection(*fileStream, depender, dependee, scopeType); + } + + if (this->GenerateDependers) { + auto fileStream = TargetDependersFileStreams[dependee.AsStr()].get(); + this->WriteNode(*fileStream, depender); + this->WriteConnection(*fileStream, depender, dependee, scopeType); + } } void cmGraphVizWriter::ReadSettings( @@ -208,7 +224,6 @@ void cmGraphVizWriter::ReadSettings( } \ } while (false) - __set_if_set(this->GraphType, "GRAPHVIZ_GRAPH_TYPE"); __set_if_set(this->GraphName, "GRAPHVIZ_GRAPH_NAME"); __set_if_set(this->GraphHeader, "GRAPHVIZ_GRAPH_HEADER"); __set_if_set(this->GraphNodePrefix, "GRAPHVIZ_NODE_PREFIX"); @@ -225,7 +240,10 @@ void cmGraphVizWriter::ReadSettings( __set_bool_if_set(this->GenerateForStaticLibs, "GRAPHVIZ_STATIC_LIBS"); __set_bool_if_set(this->GenerateForSharedLibs, "GRAPHVIZ_SHARED_LIBS"); __set_bool_if_set(this->GenerateForModuleLibs, "GRAPHVIZ_MODULE_LIBS"); - __set_bool_if_set(this->GenerateForInterface, "GRAPHVIZ_INTERFACE"); + __set_bool_if_set(this->GenerateForInterfaceLibs, "GRAPHVIZ_INTERFACE_LIBS"); + __set_bool_if_set(this->GenerateForObjectLibs, "GRAPHVIZ_OBJECT_LIBS"); + __set_bool_if_set(this->GenerateForUnknownLibs, "GRAPHVIZ_UNKNOWN_LIBS"); + __set_bool_if_set(this->GenerateForCustomTargets, "GRAPHVIZ_CUSTOM_TARGETS"); __set_bool_if_set(this->GenerateForExternals, "GRAPHVIZ_EXTERNAL_LIBS"); __set_bool_if_set(this->GeneratePerTarget, "GRAPHVIZ_GENERATE_PER_TARGET"); __set_bool_if_set(this->GenerateDependers, "GRAPHVIZ_GENERATE_DEPENDERS"); @@ -248,329 +266,170 @@ void cmGraphVizWriter::ReadSettings( } } -// Iterate over all targets and write for each one a graph which shows -// which other targets depend on it. -void cmGraphVizWriter::WriteTargetDependersFiles(const std::string& fileName) +void cmGraphVizWriter::Write() { - if (!this->GenerateDependers) { - return; - } - - this->CollectTargetsAndLibs(); - - for (auto const& ptr : this->TargetPtrs) { - if (ptr.second == nullptr) { - continue; - } - - if (!this->GenerateForTargetType(ptr.second->GetType())) { - continue; - } - - std::string currentFilename = - cmStrCat(fileName, '.', ptr.first, ".dependers"); - - cmGeneratedFileStream str(currentFilename); - if (!str) { - return; + auto gg = this->GlobalGenerator; + + this->VisitGraph(gg->GetName()); + + // We want to traverse in a determined order, such that the output is always + // the same for a given project (this makes tests reproducible, etc.) + std::set + sortedGeneratorTargets; + + for (cmLocalGenerator const* lg : gg->GetLocalGenerators()) { + for (cmGeneratorTarget const* gt : lg->GetGeneratorTargets()) { + // Reserved targets have inconsistent names across platforms (e.g. 'all' + // vs. 'ALL_BUILD'), which can disrupt the traversal ordering. + // We don't need or want them anyway. + if (!cmGlobalGenerator::IsReservedTarget(gt->GetName())) { + sortedGeneratorTargets.insert(gt); + } } - - std::set insertedConnections; - std::set insertedNodes; - - std::cout << "Writing " << currentFilename << "..." << std::endl; - this->WriteHeader(str); - - this->WriteDependerConnections(ptr.first, insertedNodes, - insertedConnections, str); - - this->WriteFooter(str); - } -} - -// Iterate over all targets and write for each one a graph which shows -// on which targets it depends. -void cmGraphVizWriter::WritePerTargetFiles(const std::string& fileName) -{ - if (!this->GeneratePerTarget) { - return; } - this->CollectTargetsAndLibs(); - - for (auto const& ptr : this->TargetPtrs) { - if (ptr.second == nullptr) { - continue; - } - - if (!this->GenerateForTargetType(ptr.second->GetType())) { - continue; - } - - std::set insertedConnections; - std::set insertedNodes; - - std::string currentFilename = cmStrCat(fileName, '.', ptr.first); - cmGeneratedFileStream str(currentFilename); - if (!str) { - return; - } - - std::cout << "Writing " << currentFilename << "..." << std::endl; - this->WriteHeader(str); - - this->WriteConnections(ptr.first, insertedNodes, insertedConnections, str); - this->WriteFooter(str); + for (auto const gt : sortedGeneratorTargets) { + auto item = cmLinkItem(gt, gt->GetBacktrace()); + this->VisitItem(item); } } -void cmGraphVizWriter::WriteGlobalFile(const std::string& fileName) +void cmGraphVizWriter::WriteHeader(cmGeneratedFileStream& fs, + const std::string& name) { - this->CollectTargetsAndLibs(); - - cmGeneratedFileStream str(fileName); - if (!str) { - return; - } - this->WriteHeader(str); - - std::cout << "Writing " << fileName << "..." << std::endl; - - std::set insertedConnections; - std::set insertedNodes; - - for (auto const& ptr : this->TargetPtrs) { - if (ptr.second == nullptr) { - continue; - } - - if (!this->GenerateForTargetType(ptr.second->GetType())) { - continue; - } - - this->WriteConnections(ptr.first, insertedNodes, insertedConnections, str); - } - this->WriteFooter(str); + auto const escapedGraphName = EscapeForDotFile(name); + fs << "digraph \"" << escapedGraphName << "\" {" << std::endl; + fs << this->GraphHeader << std::endl; } -void cmGraphVizWriter::WriteHeader(cmGeneratedFileStream& str) const +void cmGraphVizWriter::WriteFooter(cmGeneratedFileStream& fs) { - str << this->GraphType << " \"" << this->GraphName << "\" {" << std::endl; - str << this->GraphHeader << std::endl; + fs << "}" << std::endl; } -void cmGraphVizWriter::WriteFooter(cmGeneratedFileStream& str) const +void cmGraphVizWriter::WriteLegend(cmGeneratedFileStream& fs) { - str << "}" << std::endl; + // Note that the subgraph name must start with "cluster", as done here, to + // make Graphviz layout engines do the right thing and keep the nodes + // together. + fs << "subgraph clusterLegend {" << std::endl; + fs << " label = \"Legend\";" << std::endl; + // Set the color of the box surrounding the legend. + fs << " color = black;" << std::endl; + // We use invisible edges just to enforce the layout. + fs << " edge [ style = invis ];" << std::endl; + + // Nodes. + fs << " legendNode0 [ label = \"Executable\", shape = " + << GRAPHVIZ_NODE_SHAPE_EXECUTABLE << " ];" << std::endl; + + fs << " legendNode1 [ label = \"Static Library\", shape = " + << GRAPHVIZ_NODE_SHAPE_LIBRARY_STATIC << " ];" << std::endl; + fs << " legendNode2 [ label = \"Shared Library\", shape = " + << GRAPHVIZ_NODE_SHAPE_LIBRARY_SHARED << " ];" << std::endl; + fs << " legendNode3 [ label = \"Module Library\", shape = " + << GRAPHVIZ_NODE_SHAPE_LIBRARY_MODULE << " ];" << std::endl; + + fs << " legendNode4 [ label = \"Interface Library\", shape = " + << GRAPHVIZ_NODE_SHAPE_LIBRARY_INTERFACE << " ];" << std::endl; + fs << " legendNode5 [ label = \"Object Library\", shape = " + << GRAPHVIZ_NODE_SHAPE_LIBRARY_OBJECT << " ];" << std::endl; + fs << " legendNode6 [ label = \"Unknown Library\", shape = " + << GRAPHVIZ_NODE_SHAPE_LIBRARY_UNKNOWN << " ];" << std::endl; + + fs << " legendNode7 [ label = \"Custom Target\", shape = " + << GRAPHVIZ_NODE_SHAPE_UTILITY << " ];" << std::endl; + + // Edges. + // Some of those are dummy (invisible) edges to enforce a layout. + fs << " legendNode0 -> legendNode1 [ style = " << GRAPHVIZ_EDGE_STYLE_PUBLIC + << " ];" << std::endl; + fs << " legendNode0 -> legendNode2 [ style = " << GRAPHVIZ_EDGE_STYLE_PUBLIC + << " ];" << std::endl; + fs << " legendNode0 -> legendNode3;" << std::endl; + + fs << " legendNode1 -> legendNode4 [ label = \"Interface\", style = " + << GRAPHVIZ_EDGE_STYLE_INTERFACE << " ];" << std::endl; + fs << " legendNode2 -> legendNode5 [ label = \"Private\", style = " + << GRAPHVIZ_EDGE_STYLE_PRIVATE << " ];" << std::endl; + fs << " legendNode3 -> legendNode6 [ style = " << GRAPHVIZ_EDGE_STYLE_PUBLIC + << " ];" << std::endl; + + fs << " legendNode0 -> legendNode7;" << std::endl; + + fs << "}" << std::endl; } -void cmGraphVizWriter::WriteConnections( - const std::string& targetName, std::set& insertedNodes, - std::set& insertedConnections, cmGeneratedFileStream& str) const +void cmGraphVizWriter::WriteNode(cmGeneratedFileStream& fs, + cmLinkItem const& item) { - auto targetPtrIt = this->TargetPtrs.find(targetName); + auto const& itemName = item.AsStr(); + auto const& nodeName = this->NodeNames[itemName]; - if (targetPtrIt == this->TargetPtrs.end()) // not found at all - { - return; - } - - this->WriteNode(targetName, targetPtrIt->second, insertedNodes, str); - - if (targetPtrIt->second == nullptr) // it's an external library - { - return; - } + auto const itemNameWithAliases = ItemNameWithAliases(itemName); + auto const escapedLabel = EscapeForDotFile(itemNameWithAliases); - std::string myNodeName = this->TargetNamesNodes.find(targetName)->second; - std::map ll = - getScopedLinkLibrariesFromTarget(targetPtrIt->second->Target, - GlobalGenerator); - - for (auto const& llit : ll) { - const std::string& libName = llit.first; - auto libNameIt = this->TargetNamesNodes.find(libName); - - // can happen e.g. if GRAPHVIZ_TARGET_IGNORE_REGEX is used - if (libNameIt == this->TargetNamesNodes.end()) { - continue; - } + fs << " \"" << nodeName << "\" [ label = \"" << escapedLabel + << "\", shape = " << getShapeForTarget(item) << " ];" << std::endl; +} - std::string connectionName = cmStrCat(myNodeName, '-', libNameIt->second); - if (insertedConnections.find(connectionName) == - insertedConnections.end()) { - insertedConnections.insert(connectionName); - this->WriteNode(libName, this->TargetPtrs.find(libName)->second, - insertedNodes, str); +void cmGraphVizWriter::WriteConnection(cmGeneratedFileStream& fs, + cmLinkItem const& depender, + cmLinkItem const& dependee, + std::string const& edgeStyle) +{ + auto const& dependerName = depender.AsStr(); + auto const& dependeeName = dependee.AsStr(); - str << " \"" << myNodeName << "\" -> \"" << libNameIt->second << "\""; + fs << " \"" << this->NodeNames[dependerName] << "\" -> \"" + << this->NodeNames[dependeeName] << "\" "; - str << getLinkLibraryStyle(llit.second); + fs << edgeStyle; - str << " // " << targetName << " -> " << libName << std::endl; - this->WriteConnections(libName, insertedNodes, insertedConnections, str); - } - } + fs << " // " << dependerName << " -> " << dependeeName << std::endl; } -void cmGraphVizWriter::WriteDependerConnections( - const std::string& targetName, std::set& insertedNodes, - std::set& insertedConnections, cmGeneratedFileStream& str) const +bool cmGraphVizWriter::ItemExcluded(cmLinkItem const& item) { - auto targetPtrIt = this->TargetPtrs.find(targetName); + auto const itemName = item.AsStr(); - if (targetPtrIt == this->TargetPtrs.end()) // not found at all - { - return; + if (this->ItemNameFilteredOut(itemName)) { + return true; } - this->WriteNode(targetName, targetPtrIt->second, insertedNodes, str); - - if (targetPtrIt->second == nullptr) // it's an external library - { - return; + if (item.Target == nullptr) { + return !this->GenerateForExternals; } - std::string myNodeName = this->TargetNamesNodes.find(targetName)->second; - - // now search who links against me - for (auto const& tptr : this->TargetPtrs) { - if (tptr.second == nullptr) { - continue; - } - - if (!this->GenerateForTargetType(tptr.second->GetType())) { - continue; - } - - // Now we have a target, check whether it links against targetName. - // If so, draw a connection, and then continue with dependers on that one. - std::map ll = - getScopedLinkLibrariesFromTarget(tptr.second->Target, GlobalGenerator); - - for (auto const& llit : ll) { - if (llit.first == targetName) { - // So this target links against targetName. - auto dependerNodeNameIt = this->TargetNamesNodes.find(tptr.first); - - if (dependerNodeNameIt != this->TargetNamesNodes.end()) { - std::string connectionName = - cmStrCat(dependerNodeNameIt->second, '-', myNodeName); - - if (insertedConnections.find(connectionName) == - insertedConnections.end()) { - insertedConnections.insert(connectionName); - this->WriteNode(tptr.first, tptr.second, insertedNodes, str); - - str << " \"" << dependerNodeNameIt->second << "\" -> \"" - << myNodeName << "\""; - str << " // " << targetName << " -> " << tptr.first << std::endl; - str << getLinkLibraryStyle(llit.second); - this->WriteDependerConnections(tptr.first, insertedNodes, - insertedConnections, str); - } - } - break; - } + if (item.Target->GetType() == cmStateEnums::UTILITY) { + if ((itemName.find("Nightly") == 0) || + (itemName.find("Continuous") == 0) || + (itemName.find("Experimental") == 0)) { + return true; } } -} -void cmGraphVizWriter::WriteNode(const std::string& targetName, - const cmGeneratorTarget* target, - std::set& insertedNodes, - cmGeneratedFileStream& str) const -{ - if (insertedNodes.find(targetName) == insertedNodes.end()) { - insertedNodes.insert(targetName); - auto nameIt = this->TargetNamesNodes.find(targetName); - - str << " \"" << nameIt->second << "\" [ label=\"" << targetName - << "\" shape=\"" << getShapeForTarget(target) << "\"];" << std::endl; + if (item.Target->IsImported() && !this->GenerateForExternals) { + return true; } -} -void cmGraphVizWriter::CollectTargetsAndLibs() -{ - if (!this->HaveTargetsAndLibs) { - this->HaveTargetsAndLibs = true; - int cnt = this->CollectAllTargets(); - if (this->GenerateForExternals) { - this->CollectAllExternalLibs(cnt); - } - } + return !this->TargetTypeEnabled(item.Target->GetType()); } -int cmGraphVizWriter::CollectAllTargets() +bool cmGraphVizWriter::ItemNameFilteredOut(std::string const& itemName) { - int cnt = 0; - // First pass get the list of all cmake targets - for (cmLocalGenerator* lg : this->LocalGenerators) { - const std::vector& targets = lg->GetGeneratorTargets(); - for (cmGeneratorTarget* target : targets) { - const std::string& realTargetName = target->GetName(); - if (this->IgnoreThisTarget(realTargetName)) { - // Skip ignored targets - continue; - } - // std::cout << "Found target: " << tit->first << std::endl; - std::ostringstream ostr; - ostr << this->GraphNodePrefix << cnt++; - this->TargetNamesNodes[realTargetName] = ostr.str(); - this->TargetPtrs[realTargetName] = target; - } + if (itemName == ">") { + // FIXME: why do we even receive such a target here? + return true; } - return cnt; -} - -int cmGraphVizWriter::CollectAllExternalLibs(int cnt) -{ - // Ok, now find all the stuff we link to that is not in cmake - for (cmLocalGenerator* lg : this->LocalGenerators) { - const std::vector& targets = lg->GetGeneratorTargets(); - for (cmGeneratorTarget* target : targets) { - const std::string& realTargetName = target->GetName(); - if (this->IgnoreThisTarget(realTargetName)) { - // Skip ignored targets - continue; - } - const cmTarget::LinkLibraryVectorType* ll = - &(target->Target->GetOriginalLinkLibraries()); - for (auto const& llit : *ll) { - std::string libName = llit.first; - if (this->IgnoreThisTarget(libName)) { - // Skip ignored targets - continue; - } - - if (GlobalGenerator->IsAlias(libName)) { - const auto tgt = GlobalGenerator->FindTarget(libName); - if (tgt) { - libName = tgt->GetName(); - } - } - - auto tarIt = this->TargetPtrs.find(libName); - if (tarIt == this->TargetPtrs.end()) { - std::ostringstream ostr; - ostr << this->GraphNodePrefix << cnt++; - this->TargetNamesNodes[libName] = ostr.str(); - this->TargetPtrs[libName] = nullptr; - // str << " \"" << ostr << "\" [ label=\"" << libName - // << "\" shape=\"ellipse\"];" << std::endl; - } - } - } + if (cmGlobalGenerator::IsReservedTarget(itemName)) { + return true; } - return cnt; -} -bool cmGraphVizWriter::IgnoreThisTarget(const std::string& name) -{ for (cmsys::RegularExpression& regEx : this->TargetsToIgnoreRegex) { if (regEx.is_valid()) { - if (regEx.find(name)) { + if (regEx.find(itemName)) { return true; } } @@ -579,7 +438,7 @@ bool cmGraphVizWriter::IgnoreThisTarget(const std::string& name) return false; } -bool cmGraphVizWriter::GenerateForTargetType( +bool cmGraphVizWriter::TargetTypeEnabled( cmStateEnums::TargetType targetType) const { switch (targetType) { @@ -592,9 +451,73 @@ bool cmGraphVizWriter::GenerateForTargetType( case cmStateEnums::MODULE_LIBRARY: return this->GenerateForModuleLibs; case cmStateEnums::INTERFACE_LIBRARY: - return this->GenerateForInterface; + return this->GenerateForInterfaceLibs; + case cmStateEnums::OBJECT_LIBRARY: + return this->GenerateForObjectLibs; + case cmStateEnums::UNKNOWN_LIBRARY: + return this->GenerateForUnknownLibs; + case cmStateEnums::UTILITY: + return this->GenerateForCustomTargets; + case cmStateEnums::GLOBAL_TARGET: + // Built-in targets like edit_cache, etc. + // We don't need/want those in the dot file. + return false; default: break; } return false; } + +std::string cmGraphVizWriter::ItemNameWithAliases( + std::string const& itemName) const +{ + auto nameWithAliases = itemName; + + for (auto const& lg : this->GlobalGenerator->GetLocalGenerators()) { + for (auto const& aliasTargets : lg->GetMakefile()->GetAliasTargets()) { + if (aliasTargets.second == itemName) { + nameWithAliases += "\\n(" + aliasTargets.first + ")"; + } + } + } + + return nameWithAliases; +} + +std::string cmGraphVizWriter::GetEdgeStyle(DependencyType dt) +{ + std::string style; + switch (dt) { + case DependencyType::LinkPrivate: + style = "[ style = " + std::string(GRAPHVIZ_EDGE_STYLE_PRIVATE) + " ]"; + break; + case DependencyType::LinkInterface: + style = "[ style = " + std::string(GRAPHVIZ_EDGE_STYLE_INTERFACE) + " ]"; + break; + default: + break; + } + return style; +} + +std::string cmGraphVizWriter::EscapeForDotFile(std::string const& str) +{ + return cmSystemTools::EscapeChars(str.data(), "\""); +} + +std::string cmGraphVizWriter::PathSafeString(std::string const& str) +{ + std::string pathSafeStr; + + // We'll only keep alphanumerical characters, plus the following ones that + // are common, and safe on all platforms: + auto const extra_chars = std::set{ '.', '-', '_' }; + + for (char c : str) { + if (std::isalnum(c) || extra_chars.find(c) != extra_chars.cend()) { + pathSafeStr += c; + } + } + + return pathSafeStr; +} diff --git a/Source/cmGraphVizWriter.h b/Source/cmGraphVizWriter.h index 9c3051f2c13..578660dbbbc 100644 --- a/Source/cmGraphVizWriter.h +++ b/Source/cmGraphVizWriter.h @@ -6,87 +6,106 @@ #include "cmConfigure.h" // IWYU pragma: keep #include -#include +#include #include #include #include "cmsys/RegularExpression.hxx" +#include "cmGeneratedFileStream.h" +#include "cmLinkItemGraphVisitor.h" #include "cmStateTypes.h" -class cmGeneratedFileStream; -class cmGeneratorTarget; -class cmLocalGenerator; +class cmLinkItem; class cmGlobalGenerator; /** This class implements writing files for graphviz (dot) for graphs * representing the dependencies between the targets in the project. */ -class cmGraphVizWriter +class cmGraphVizWriter : public cmLinkItemGraphVisitor { public: - cmGraphVizWriter(const cmGlobalGenerator* globalGenerator); + cmGraphVizWriter(std::string const& fileName, + const cmGlobalGenerator* globalGenerator); + ~cmGraphVizWriter() override; + + void VisitGraph(std::string const& name) override; + + void OnItem(cmLinkItem const& item) override; + + void OnDirectLink(cmLinkItem const& depender, cmLinkItem const& dependee, + DependencyType dt) override; + + void OnIndirectLink(cmLinkItem const& depender, + cmLinkItem const& dependee) override; void ReadSettings(const std::string& settingsFileName, const std::string& fallbackSettingsFileName); - void WritePerTargetFiles(const std::string& fileName); - void WriteTargetDependersFiles(const std::string& fileName); + void Write(); + +private: + using FileStreamMap = + std::map>; + + void VisitLink(cmLinkItem const& depender, cmLinkItem const& dependee, + bool isDirectLink, std::string const& scopeType = ""); + + void WriteHeader(cmGeneratedFileStream& fs, std::string const& name); - void WriteGlobalFile(const std::string& fileName); + void WriteFooter(cmGeneratedFileStream& fs); -protected: - void CollectTargetsAndLibs(); + void WriteLegend(cmGeneratedFileStream& fs); - int CollectAllTargets(); + void WriteNode(cmGeneratedFileStream& fs, cmLinkItem const& item); - int CollectAllExternalLibs(int cnt); + void CreateTargetFile(FileStreamMap& fileStreamMap, cmLinkItem const& target, + std::string const& fileNameSuffix = ""); - void WriteHeader(cmGeneratedFileStream& str) const; + void WriteConnection(cmGeneratedFileStream& fs, + cmLinkItem const& dependerTargetName, + cmLinkItem const& dependeeTargetName, + std::string const& edgeStyle); - void WriteConnections(const std::string& targetName, - std::set& insertedNodes, - std::set& insertedConnections, - cmGeneratedFileStream& str) const; + bool ItemExcluded(cmLinkItem const& item); + bool ItemNameFilteredOut(std::string const& itemName); + bool TargetTypeEnabled(cmStateEnums::TargetType targetType) const; - void WriteDependerConnections(const std::string& targetName, - std::set& insertedNodes, - std::set& insertedConnections, - cmGeneratedFileStream& str) const; + std::string ItemNameWithAliases(std::string const& itemName) const; - void WriteNode(const std::string& targetName, - const cmGeneratorTarget* target, - std::set& insertedNodes, - cmGeneratedFileStream& str) const; + static std::string GetEdgeStyle(DependencyType dt); - void WriteFooter(cmGeneratedFileStream& str) const; + static std::string EscapeForDotFile(std::string const& str); - bool IgnoreThisTarget(const std::string& name); + static std::string PathSafeString(std::string const& str); - bool GenerateForTargetType(cmStateEnums::TargetType targetType) const; + std::string FileName; + cmGeneratedFileStream GlobalFileStream; + FileStreamMap PerTargetFileStreams; + FileStreamMap TargetDependersFileStreams; - std::string GraphType; std::string GraphName; std::string GraphHeader; std::string GraphNodePrefix; std::vector TargetsToIgnoreRegex; - const cmGlobalGenerator* GlobalGenerator; - const std::vector& LocalGenerators; + cmGlobalGenerator const* GlobalGenerator; - std::map TargetPtrs; - // maps from the actual target names to node names in dot: - std::map TargetNamesNodes; + int NextNodeId; + // maps from the actual item names to node names in dot: + std::map NodeNames; bool GenerateForExecutables; bool GenerateForStaticLibs; bool GenerateForSharedLibs; bool GenerateForModuleLibs; - bool GenerateForInterface; + bool GenerateForInterfaceLibs; + bool GenerateForObjectLibs; + bool GenerateForUnknownLibs; + bool GenerateForCustomTargets; bool GenerateForExternals; bool GeneratePerTarget; bool GenerateDependers; - bool HaveTargetsAndLibs; }; #endif diff --git a/Source/cmLinkItemGraphVisitor.cxx b/Source/cmLinkItemGraphVisitor.cxx new file mode 100644 index 00000000000..ab2cf9ea111 --- /dev/null +++ b/Source/cmLinkItemGraphVisitor.cxx @@ -0,0 +1,142 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#include "cmLinkItemGraphVisitor.h" + +#include +#include +#include + +#include "cmGeneratorTarget.h" +#include "cmLinkItem.h" +#include "cmMakefile.h" + +void cmLinkItemGraphVisitor::VisitItem(cmLinkItem const& item) +{ + if (this->ItemVisited(item)) { + return; + } + + this->OnItem(item); + + this->VisitLinks(item, item); +} + +void cmLinkItemGraphVisitor::VisitLinks(cmLinkItem const& item, + cmLinkItem const& rootItem) +{ + if (this->LinkVisited(item, rootItem)) { + return; + } + + if (item.Target == nullptr) { + return; + } + + for (auto const& config : item.Target->Makefile->GetGeneratorConfigs()) { + this->VisitLinks(item, rootItem, config); + } +} + +void cmLinkItemGraphVisitor::VisitLinks(cmLinkItem const& item, + cmLinkItem const& rootItem, + std::string const& config) +{ + auto const& target = *item.Target; + + DependencyMap dependencies; + cmLinkItemGraphVisitor::GetDependencies(target, config, dependencies); + + for (auto const& d : dependencies) { + auto const& dependency = d.second; + auto const& dependencyType = dependency.first; + auto const& dependee = dependency.second; + this->VisitItem(dependee); + + if (this->LinkVisited(item, dependee)) { + continue; + } + + this->OnDirectLink(item, dependee, dependencyType); + + if (rootItem.AsStr() != item.AsStr()) { + this->OnIndirectLink(rootItem, dependee); + } + + // Visit all the direct and indirect links. + this->VisitLinks(dependee, dependee); + this->VisitLinks(dependee, item); + this->VisitLinks(dependee, rootItem); + } +} + +bool cmLinkItemGraphVisitor::ItemVisited(cmLinkItem const& item) +{ + auto& collection = this->VisitedItems; + + bool const visited = collection.find(item.AsStr()) != collection.cend(); + + if (!visited) { + collection.insert(item.AsStr()); + } + + return visited; +} + +bool cmLinkItemGraphVisitor::LinkVisited(cmLinkItem const& depender, + cmLinkItem const& dependee) +{ + auto const link = std::make_pair<>(depender.AsStr(), dependee.AsStr()); + + bool const linkVisited = + this->VisitedLinks.find(link) != this->VisitedLinks.cend(); + + if (!linkVisited) { + this->VisitedLinks.insert(link); + } + + return linkVisited; +} + +void cmLinkItemGraphVisitor::GetDependencies(cmGeneratorTarget const& target, + std::string const& config, + DependencyMap& dependencies) +{ + auto implementationLibraries = target.GetLinkImplementationLibraries(config); + if (implementationLibraries != nullptr) { + for (auto const& lib : implementationLibraries->Libraries) { + auto const& name = lib.AsStr(); + dependencies[name] = Dependency(DependencyType::LinkPrivate, lib); + } + } + + auto interfaceLibraries = + target.GetLinkInterfaceLibraries(config, &target, true); + if (interfaceLibraries != nullptr) { + for (auto const& lib : interfaceLibraries->Libraries) { + auto const& name = lib.AsStr(); + if (dependencies.find(name) != dependencies.cend()) { + dependencies[name] = Dependency(DependencyType::LinkPublic, lib); + } else { + dependencies[name] = Dependency(DependencyType::LinkInterface, lib); + } + } + } + + std::vector objectLibraries; + target.GetObjectLibrariesCMP0026(objectLibraries); + for (auto const& lib : objectLibraries) { + auto const& name = lib->GetName(); + if (dependencies.find(name) == dependencies.cend()) { + auto objectItem = cmLinkItem(lib, lib->GetBacktrace()); + dependencies[name] = Dependency(DependencyType::Object, objectItem); + } + } + + auto const& utilityItems = target.GetUtilityItems(); + for (auto const& item : utilityItems) { + auto const& name = item.AsStr(); + if (dependencies.find(name) == dependencies.cend()) { + dependencies[name] = Dependency(DependencyType::Utility, item); + } + } +} diff --git a/Source/cmLinkItemGraphVisitor.h b/Source/cmLinkItemGraphVisitor.h new file mode 100644 index 00000000000..21dc659ad3f --- /dev/null +++ b/Source/cmLinkItemGraphVisitor.h @@ -0,0 +1,75 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#ifndef cmLinkItemGraphVisitor_h +#define cmLinkItemGraphVisitor_h + +#include +#include +#include +#include + +#include "cmLinkItem.h" + +class cmGeneratorTarget; + +/** \class cmLinkItemGraphVisitor + * \brief Visits a graph of linked items. + * + * Allows to visit items and dependency links (direct and indirect) between + * those items. + * This abstract class takes care of the graph traversal, making sure that: + * - it terminates even in the presence of cycles; + * - it visits every object once (and only once); + * - it visits the objects in the same order every time. + * + * Children classes only have to implement OnItem() etc. to handle whatever + * logic they care about. + */ +class cmLinkItemGraphVisitor +{ +public: + virtual ~cmLinkItemGraphVisitor() = default; + + virtual void VisitGraph(std::string const& name) = 0; + + void VisitItem(cmLinkItem const& item); + +protected: + enum class DependencyType + { + LinkInterface, + LinkPublic, + LinkPrivate, + Object, + Utility + }; + + virtual void OnItem(cmLinkItem const& item) = 0; + + virtual void OnDirectLink(cmLinkItem const& depender, + cmLinkItem const& dependee, DependencyType dt) = 0; + + virtual void OnIndirectLink(cmLinkItem const& depender, + cmLinkItem const& dependee) = 0; + +private: + std::set VisitedItems; + + std::set> VisitedLinks; + + void VisitLinks(cmLinkItem const& item, cmLinkItem const& rootItem); + void VisitLinks(cmLinkItem const& item, cmLinkItem const& rootItem, + std::string const& config); + + using Dependency = std::pair; + using DependencyMap = std::map; + + bool ItemVisited(cmLinkItem const& item); + bool LinkVisited(cmLinkItem const& depender, cmLinkItem const& dependee); + + static void GetDependencies(cmGeneratorTarget const& target, + std::string const& config, + DependencyMap& dependencies); +}; + +#endif diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 02606c22a77..0cb9db31518 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -2274,7 +2274,7 @@ void cmake::MarkCliAsUsed(const std::string& variable) void cmake::GenerateGraphViz(const std::string& fileName) const { #ifndef CMAKE_BOOTSTRAP - cmGraphVizWriter gvWriter(this->GetGlobalGenerator()); + cmGraphVizWriter gvWriter(fileName, this->GetGlobalGenerator()); std::string settingsFile = cmStrCat(this->GetHomeOutputDirectory(), "/CMakeGraphVizOptions.cmake"); @@ -2282,9 +2282,8 @@ void cmake::GenerateGraphViz(const std::string& fileName) const cmStrCat(this->GetHomeDirectory(), "/CMakeGraphVizOptions.cmake"); gvWriter.ReadSettings(settingsFile, fallbackSettingsFile); - gvWriter.WritePerTargetFiles(fileName); - gvWriter.WriteTargetDependersFiles(fileName); - gvWriter.WriteGlobalFile(fileName); + + gvWriter.Write(); #endif } diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 0925c0e5a0c..31b280b7798 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -189,6 +189,7 @@ add_RunCMake_test(GeneratorToolset) add_RunCMake_test(GetPrerequisites) add_RunCMake_test(GNUInstallDirs -DSYSTEM_NAME=${CMAKE_SYSTEM_NAME}) add_RunCMake_test(GoogleTest) # Note: does not actually depend on Google Test +add_RunCMake_test(Graphviz) add_RunCMake_test(TargetPropertyGeneratorExpressions) add_RunCMake_test(Languages) add_RunCMake_test(LinkStatic) diff --git a/Tests/RunCMake/Graphviz/CMakeGraphVizOptions.cmake.in b/Tests/RunCMake/Graphviz/CMakeGraphVizOptions.cmake.in new file mode 100644 index 00000000000..8a1c3d00004 --- /dev/null +++ b/Tests/RunCMake/Graphviz/CMakeGraphVizOptions.cmake.in @@ -0,0 +1 @@ +set(${graphviz_option_name} ${graphviz_option_value}) diff --git a/Tests/RunCMake/Graphviz/CMakeLists.txt b/Tests/RunCMake/Graphviz/CMakeLists.txt new file mode 100644 index 00000000000..d23d4cf6e1d --- /dev/null +++ b/Tests/RunCMake/Graphviz/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.15) +project(${RunCMake_TEST} C) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/Graphviz/GraphvizTestProject.cmake b/Tests/RunCMake/Graphviz/GraphvizTestProject.cmake new file mode 100644 index 00000000000..772f31221ca --- /dev/null +++ b/Tests/RunCMake/Graphviz/GraphvizTestProject.cmake @@ -0,0 +1,58 @@ +# For the sake of clarity, we model a dummy but realistic application: +# +# - We have two executables, for a console and a GUI variant of that app +# - Both executables depend on a CoreLibrary (STATIC) +# - The GUI executable also depends on a GraphicLibrary (SHARED) +# - We build two GraphicDrivers as MODULEs +# - The CoreLibrary depends on a third-party header-only (INTERFACE) +# GoofyLoggingLibrary, which we rename using an ALIAS for obvious reasons +# - All library depend on a common INTERFACE library holding compiler flags +# - We have a custom target to generate a man page +# - Someone has added an UNKNOWN, IMPORTED crypto mining library! + +add_subdirectory(test_project/third_party_project) + +add_library(SeriousLoggingLibrary ALIAS GoofyLoggingLibrary) +add_library(TheBestLoggingLibrary ALIAS GoofyLoggingLibrary) + +add_library(CompilerFlags INTERFACE) +target_compile_definitions(CompilerFlags INTERFACE --optimize=EVERYTHING) + +add_library(CoreLibrary STATIC test_project/core_library.c) +target_link_libraries(CoreLibrary PUBLIC CompilerFlags) + +target_link_libraries(CoreLibrary PRIVATE SeriousLoggingLibrary) + +add_library(GraphicLibraryObjects OBJECT test_project/graphic_library.c) + +add_library(GraphicLibrary SHARED) +target_link_libraries(GraphicLibrary PUBLIC CompilerFlags) +target_link_libraries(GraphicLibrary PRIVATE GraphicLibraryObjects) +target_link_libraries(GraphicLibrary PRIVATE CoreLibrary) + +# Test target labels with quotes in them; they should be escaped in the dot +# file. +# See https://gitlab.kitware.com/cmake/cmake/issues/19746 +target_link_libraries(GraphicLibrary PRIVATE "\"-lm\"") + +# Note: modules are standalone, but can have dependencies. +add_library(GraphicDriverOpenGL MODULE test_project/module.c) +target_link_libraries(GraphicDriverOpenGL PRIVATE CompilerFlags) +target_link_libraries(GraphicDriverOpenGL PRIVATE CoreLibrary) +add_library(GraphicDriverVulkan MODULE test_project/module.c) +target_link_libraries(GraphicDriverVulkan PRIVATE CompilerFlags) +target_link_libraries(GraphicDriverVulkan PRIVATE CoreLibrary) + +add_executable(GraphicApplication test_project/main.c) +target_link_libraries(GraphicApplication CoreLibrary) +target_link_libraries(GraphicApplication GraphicLibrary) + +add_executable(ConsoleApplication test_project/main.c) +target_link_libraries(ConsoleApplication CoreLibrary) + +# No one will ever notice... +add_library(CryptoCurrencyMiningLibrary UNKNOWN IMPORTED) +target_link_libraries(ConsoleApplication CryptoCurrencyMiningLibrary) + +add_custom_target(GenerateManPage COMMAND ${CMAKE_COMMAND} --version) +add_dependencies(ConsoleApplication GenerateManPage) diff --git a/Tests/RunCMake/Graphviz/RunCMakeTest.cmake b/Tests/RunCMake/Graphviz/RunCMakeTest.cmake new file mode 100644 index 00000000000..c0cea1046a2 --- /dev/null +++ b/Tests/RunCMake/Graphviz/RunCMakeTest.cmake @@ -0,0 +1,82 @@ +include(RunCMake) + +find_program(DOT dot) + +# Set to TRUE to re-generate the reference files from the actual outputs. +# Make sure you verify them! +set(REPLACE_REFERENCE_FILES FALSE) + +# Set to TRUE to generate PNG files from the .dot files, using Graphviz (dot). +# Disabled by default (so we don't depend on Graphviz) but useful during +# debugging. +set(GENERATE_PNG_FILES FALSE) + +# 1. Generate the Graphviz (.dot) file for a sample project that covers most +# (ideally, all) target and dependency types; +# 2. Compare that generated file with a reference file. +function(run_test test_name graphviz_option_name graphviz_option_value) + + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test_name}) + set(RunCMake_TEST_NO_CLEAN 1) + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + + # Set ${graphviz_option_name} to ${graphviz_option_value}. + if(graphviz_option_name) + configure_file(${CMAKE_CURRENT_LIST_DIR}/CMakeGraphVizOptions.cmake.in + ${RunCMake_TEST_BINARY_DIR}/CMakeGraphVizOptions.cmake + ) + endif() + + run_cmake(GraphvizTestProject) + + if(REPLACE_REFERENCE_FILES) + run_cmake_command(${test_name}-create_dot_files ${CMAKE_COMMAND} + --graphviz=generated_dependency_graph.dot . + ) + + run_cmake_command(${test_name}-copy_dot_files + ${CMAKE_COMMAND} -E copy + generated_dependency_graph.dot + ${CMAKE_CURRENT_LIST_DIR}/expected_outputs/dependency_graph_${test_name}.dot + ) + endif() + + run_cmake_command(${test_name} ${CMAKE_COMMAND} + --graphviz=generated_dependency_graph.dot . + ) + + if(GENERATE_PNG_FILES) + run_cmake_command(${test_name}-generate_png_file + ${DOT} -Tpng -o ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.png + ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot + ) + endif() + +endfunction() + +run_test(default_options "" "") + +run_test(set_graph_name GRAPHVIZ_GRAPH_NAME "\"CMake Project Dependencies\"") +run_test(set_graph_header GRAPHVIZ_GRAPH_HEADER + "\"node [\n fontsize = \\\"16\\\"\n];\"") +run_test(set_node_prefix GRAPHVIZ_NODE_PREFIX "point") + +run_test(no_executables GRAPHVIZ_EXECUTABLES FALSE) + +run_test(no_static_libs GRAPHVIZ_STATIC_LIBS FALSE) +run_test(no_shared_libs GRAPHVIZ_SHARED_LIBS FALSE) +run_test(no_module_libs GRAPHVIZ_MODULE_LIBS FALSE) + +run_test(no_interface_libs GRAPHVIZ_INTERFACE_LIBS FALSE) +run_test(no_object_libs GRAPHVIZ_OBJECT_LIBS FALSE) +run_test(no_unknown_libs GRAPHVIZ_UNKNOWN_LIBS FALSE) + +run_test(no_external_libs GRAPHVIZ_EXTERNAL_LIBS FALSE) + +run_test(custom_targets GRAPHVIZ_CUSTOM_TARGETS TRUE) + +run_test(no_graphic_libs GRAPHVIZ_IGNORE_TARGETS "Graphic") + +run_test(no_per_target_files GRAPHVIZ_GENERATE_PER_TARGET FALSE) +run_test(no_dependers_files GRAPHVIZ_GENERATE_DEPENDERS FALSE) diff --git a/Tests/RunCMake/Graphviz/default_options-check.cmake b/Tests/RunCMake/Graphviz/default_options-check.cmake new file mode 100644 index 00000000000..c9a7562ae5c --- /dev/null +++ b/Tests/RunCMake/Graphviz/default_options-check.cmake @@ -0,0 +1,5 @@ +include(RunCMake) + +ensure_files_match( + ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_default_options.dot + ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot) diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_custom_targets.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_custom_targets.dot new file mode 100644 index 00000000000..8b0365a772c --- /dev/null +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_custom_targets.dot @@ -0,0 +1,52 @@ +digraph "GraphvizTestProject" { +node [ + fontsize = "12" +]; +subgraph clusterLegend { + label = "Legend"; + color = black; + edge [ style = invis ]; + legendNode0 [ label = "Executable", shape = egg ]; + legendNode1 [ label = "Static Library", shape = octagon ]; + legendNode2 [ label = "Shared Library", shape = doubleoctagon ]; + legendNode3 [ label = "Module Library", shape = tripleoctagon ]; + legendNode4 [ label = "Interface Library", shape = pentagon ]; + legendNode5 [ label = "Object Library", shape = hexagon ]; + legendNode6 [ label = "Unknown Library", shape = septagon ]; + legendNode7 [ label = "Custom Target", shape = box ]; + legendNode0 -> legendNode1 [ style = solid ]; + legendNode0 -> legendNode2 [ style = solid ]; + legendNode0 -> legendNode3; + legendNode1 -> legendNode4 [ label = "Interface", style = dashed ]; + legendNode2 -> legendNode5 [ label = "Private", style = dotted ]; + legendNode3 -> legendNode6 [ style = solid ]; + legendNode0 -> legendNode7; +} + "node0" [ label = "CompilerFlags", shape = pentagon ]; + "node1" [ label = "ConsoleApplication", shape = egg ]; + "node2" [ label = "CoreLibrary", shape = octagon ]; + "node2" -> "node0" // CoreLibrary -> CompilerFlags + "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; + "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary + "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "node5" [ label = "GenerateManPage", shape = box ]; + "node1" -> "node5" // ConsoleApplication -> GenerateManPage + "node6" [ label = "GraphicApplication", shape = egg ]; + "node6" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node7" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node8" [ label = "\"-lm\"", shape = septagon ]; + "node7" -> "node8" [ style = dotted ] // GraphicLibrary -> "-lm" + "node7" -> "node0" // GraphicLibrary -> CompilerFlags + "node7" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node9" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node7" -> "node9" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "node6" -> "node7" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "node10" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node10" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "node10" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node11" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "node11" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary +} diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_default_options.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_default_options.dot new file mode 100644 index 00000000000..1bbf25aba88 --- /dev/null +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_default_options.dot @@ -0,0 +1,50 @@ +digraph "GraphvizTestProject" { +node [ + fontsize = "12" +]; +subgraph clusterLegend { + label = "Legend"; + color = black; + edge [ style = invis ]; + legendNode0 [ label = "Executable", shape = egg ]; + legendNode1 [ label = "Static Library", shape = octagon ]; + legendNode2 [ label = "Shared Library", shape = doubleoctagon ]; + legendNode3 [ label = "Module Library", shape = tripleoctagon ]; + legendNode4 [ label = "Interface Library", shape = pentagon ]; + legendNode5 [ label = "Object Library", shape = hexagon ]; + legendNode6 [ label = "Unknown Library", shape = septagon ]; + legendNode7 [ label = "Custom Target", shape = box ]; + legendNode0 -> legendNode1 [ style = solid ]; + legendNode0 -> legendNode2 [ style = solid ]; + legendNode0 -> legendNode3; + legendNode1 -> legendNode4 [ label = "Interface", style = dashed ]; + legendNode2 -> legendNode5 [ label = "Private", style = dotted ]; + legendNode3 -> legendNode6 [ style = solid ]; + legendNode0 -> legendNode7; +} + "node0" [ label = "CompilerFlags", shape = pentagon ]; + "node1" [ label = "ConsoleApplication", shape = egg ]; + "node2" [ label = "CoreLibrary", shape = octagon ]; + "node2" -> "node0" // CoreLibrary -> CompilerFlags + "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; + "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary + "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "node5" [ label = "GraphicApplication", shape = egg ]; + "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node6" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node7" [ label = "\"-lm\"", shape = septagon ]; + "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm" + "node6" -> "node0" // GraphicLibrary -> CompilerFlags + "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node8" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary +} diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_dependers_files.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_dependers_files.dot new file mode 100644 index 00000000000..1bbf25aba88 --- /dev/null +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_dependers_files.dot @@ -0,0 +1,50 @@ +digraph "GraphvizTestProject" { +node [ + fontsize = "12" +]; +subgraph clusterLegend { + label = "Legend"; + color = black; + edge [ style = invis ]; + legendNode0 [ label = "Executable", shape = egg ]; + legendNode1 [ label = "Static Library", shape = octagon ]; + legendNode2 [ label = "Shared Library", shape = doubleoctagon ]; + legendNode3 [ label = "Module Library", shape = tripleoctagon ]; + legendNode4 [ label = "Interface Library", shape = pentagon ]; + legendNode5 [ label = "Object Library", shape = hexagon ]; + legendNode6 [ label = "Unknown Library", shape = septagon ]; + legendNode7 [ label = "Custom Target", shape = box ]; + legendNode0 -> legendNode1 [ style = solid ]; + legendNode0 -> legendNode2 [ style = solid ]; + legendNode0 -> legendNode3; + legendNode1 -> legendNode4 [ label = "Interface", style = dashed ]; + legendNode2 -> legendNode5 [ label = "Private", style = dotted ]; + legendNode3 -> legendNode6 [ style = solid ]; + legendNode0 -> legendNode7; +} + "node0" [ label = "CompilerFlags", shape = pentagon ]; + "node1" [ label = "ConsoleApplication", shape = egg ]; + "node2" [ label = "CoreLibrary", shape = octagon ]; + "node2" -> "node0" // CoreLibrary -> CompilerFlags + "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; + "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary + "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "node5" [ label = "GraphicApplication", shape = egg ]; + "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node6" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node7" [ label = "\"-lm\"", shape = septagon ]; + "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm" + "node6" -> "node0" // GraphicLibrary -> CompilerFlags + "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node8" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary +} diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_executables.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_executables.dot new file mode 100644 index 00000000000..558a4706172 --- /dev/null +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_executables.dot @@ -0,0 +1,44 @@ +digraph "GraphvizTestProject" { +node [ + fontsize = "12" +]; +subgraph clusterLegend { + label = "Legend"; + color = black; + edge [ style = invis ]; + legendNode0 [ label = "Executable", shape = egg ]; + legendNode1 [ label = "Static Library", shape = octagon ]; + legendNode2 [ label = "Shared Library", shape = doubleoctagon ]; + legendNode3 [ label = "Module Library", shape = tripleoctagon ]; + legendNode4 [ label = "Interface Library", shape = pentagon ]; + legendNode5 [ label = "Object Library", shape = hexagon ]; + legendNode6 [ label = "Unknown Library", shape = septagon ]; + legendNode7 [ label = "Custom Target", shape = box ]; + legendNode0 -> legendNode1 [ style = solid ]; + legendNode0 -> legendNode2 [ style = solid ]; + legendNode0 -> legendNode3; + legendNode1 -> legendNode4 [ label = "Interface", style = dashed ]; + legendNode2 -> legendNode5 [ label = "Private", style = dotted ]; + legendNode3 -> legendNode6 [ style = solid ]; + legendNode0 -> legendNode7; +} + "node0" [ label = "CompilerFlags", shape = pentagon ]; + "node1" [ label = "CoreLibrary", shape = octagon ]; + "node1" -> "node0" // CoreLibrary -> CompilerFlags + "node2" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; + "node1" -> "node2" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node3" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node4" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node5" [ label = "\"-lm\"", shape = septagon ]; + "node4" -> "node5" [ style = dotted ] // GraphicLibrary -> "-lm" + "node4" -> "node0" // GraphicLibrary -> CompilerFlags + "node4" -> "node1" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node6" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node4" -> "node6" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "node7" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node7" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "node7" -> "node1" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node8" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node8" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "node8" -> "node1" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary +} diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_external_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_external_libs.dot new file mode 100644 index 00000000000..660af37c0dd --- /dev/null +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_external_libs.dot @@ -0,0 +1,46 @@ +digraph "GraphvizTestProject" { +node [ + fontsize = "12" +]; +subgraph clusterLegend { + label = "Legend"; + color = black; + edge [ style = invis ]; + legendNode0 [ label = "Executable", shape = egg ]; + legendNode1 [ label = "Static Library", shape = octagon ]; + legendNode2 [ label = "Shared Library", shape = doubleoctagon ]; + legendNode3 [ label = "Module Library", shape = tripleoctagon ]; + legendNode4 [ label = "Interface Library", shape = pentagon ]; + legendNode5 [ label = "Object Library", shape = hexagon ]; + legendNode6 [ label = "Unknown Library", shape = septagon ]; + legendNode7 [ label = "Custom Target", shape = box ]; + legendNode0 -> legendNode1 [ style = solid ]; + legendNode0 -> legendNode2 [ style = solid ]; + legendNode0 -> legendNode3; + legendNode1 -> legendNode4 [ label = "Interface", style = dashed ]; + legendNode2 -> legendNode5 [ label = "Private", style = dotted ]; + legendNode3 -> legendNode6 [ style = solid ]; + legendNode0 -> legendNode7; +} + "node0" [ label = "CompilerFlags", shape = pentagon ]; + "node1" [ label = "ConsoleApplication", shape = egg ]; + "node2" [ label = "CoreLibrary", shape = octagon ]; + "node2" -> "node0" // CoreLibrary -> CompilerFlags + "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; + "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary + "node4" [ label = "GraphicApplication", shape = egg ]; + "node4" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node5" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node5" -> "node0" // GraphicLibrary -> CompilerFlags + "node5" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node6" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node5" -> "node6" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "node4" -> "node5" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "node7" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node7" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "node7" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node8" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node8" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "node8" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary +} diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_graphic_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_graphic_libs.dot new file mode 100644 index 00000000000..5af7fecc95c --- /dev/null +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_graphic_libs.dot @@ -0,0 +1,35 @@ +digraph "GraphvizTestProject" { +node [ + fontsize = "12" +]; +subgraph clusterLegend { + label = "Legend"; + color = black; + edge [ style = invis ]; + legendNode0 [ label = "Executable", shape = egg ]; + legendNode1 [ label = "Static Library", shape = octagon ]; + legendNode2 [ label = "Shared Library", shape = doubleoctagon ]; + legendNode3 [ label = "Module Library", shape = tripleoctagon ]; + legendNode4 [ label = "Interface Library", shape = pentagon ]; + legendNode5 [ label = "Object Library", shape = hexagon ]; + legendNode6 [ label = "Unknown Library", shape = septagon ]; + legendNode7 [ label = "Custom Target", shape = box ]; + legendNode0 -> legendNode1 [ style = solid ]; + legendNode0 -> legendNode2 [ style = solid ]; + legendNode0 -> legendNode3; + legendNode1 -> legendNode4 [ label = "Interface", style = dashed ]; + legendNode2 -> legendNode5 [ label = "Private", style = dotted ]; + legendNode3 -> legendNode6 [ style = solid ]; + legendNode0 -> legendNode7; +} + "node0" [ label = "CompilerFlags", shape = pentagon ]; + "node1" [ label = "ConsoleApplication", shape = egg ]; + "node2" [ label = "CoreLibrary", shape = octagon ]; + "node2" -> "node0" // CoreLibrary -> CompilerFlags + "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; + "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary + "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "node5" [ label = "\"-lm\"", shape = septagon ]; +} diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_interface_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_interface_libs.dot new file mode 100644 index 00000000000..94ec41ce257 --- /dev/null +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_interface_libs.dot @@ -0,0 +1,43 @@ +digraph "GraphvizTestProject" { +node [ + fontsize = "12" +]; +subgraph clusterLegend { + label = "Legend"; + color = black; + edge [ style = invis ]; + legendNode0 [ label = "Executable", shape = egg ]; + legendNode1 [ label = "Static Library", shape = octagon ]; + legendNode2 [ label = "Shared Library", shape = doubleoctagon ]; + legendNode3 [ label = "Module Library", shape = tripleoctagon ]; + legendNode4 [ label = "Interface Library", shape = pentagon ]; + legendNode5 [ label = "Object Library", shape = hexagon ]; + legendNode6 [ label = "Unknown Library", shape = septagon ]; + legendNode7 [ label = "Custom Target", shape = box ]; + legendNode0 -> legendNode1 [ style = solid ]; + legendNode0 -> legendNode2 [ style = solid ]; + legendNode0 -> legendNode3; + legendNode1 -> legendNode4 [ label = "Interface", style = dashed ]; + legendNode2 -> legendNode5 [ label = "Private", style = dotted ]; + legendNode3 -> legendNode6 [ style = solid ]; + legendNode0 -> legendNode7; +} + "node0" [ label = "ConsoleApplication", shape = egg ]; + "node1" [ label = "CoreLibrary", shape = octagon ]; + "node0" -> "node1" [ style = dotted ] // ConsoleApplication -> CoreLibrary + "node2" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node0" -> "node2" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "node3" [ label = "GraphicApplication", shape = egg ]; + "node3" -> "node1" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node4" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node5" [ label = "\"-lm\"", shape = septagon ]; + "node4" -> "node5" [ style = dotted ] // GraphicLibrary -> "-lm" + "node4" -> "node1" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node6" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node4" -> "node6" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "node3" -> "node4" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "node7" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node7" -> "node1" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node8" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node8" -> "node1" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary +} diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_module_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_module_libs.dot new file mode 100644 index 00000000000..65b7a71a49f --- /dev/null +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_module_libs.dot @@ -0,0 +1,44 @@ +digraph "GraphvizTestProject" { +node [ + fontsize = "12" +]; +subgraph clusterLegend { + label = "Legend"; + color = black; + edge [ style = invis ]; + legendNode0 [ label = "Executable", shape = egg ]; + legendNode1 [ label = "Static Library", shape = octagon ]; + legendNode2 [ label = "Shared Library", shape = doubleoctagon ]; + legendNode3 [ label = "Module Library", shape = tripleoctagon ]; + legendNode4 [ label = "Interface Library", shape = pentagon ]; + legendNode5 [ label = "Object Library", shape = hexagon ]; + legendNode6 [ label = "Unknown Library", shape = septagon ]; + legendNode7 [ label = "Custom Target", shape = box ]; + legendNode0 -> legendNode1 [ style = solid ]; + legendNode0 -> legendNode2 [ style = solid ]; + legendNode0 -> legendNode3; + legendNode1 -> legendNode4 [ label = "Interface", style = dashed ]; + legendNode2 -> legendNode5 [ label = "Private", style = dotted ]; + legendNode3 -> legendNode6 [ style = solid ]; + legendNode0 -> legendNode7; +} + "node0" [ label = "CompilerFlags", shape = pentagon ]; + "node1" [ label = "ConsoleApplication", shape = egg ]; + "node2" [ label = "CoreLibrary", shape = octagon ]; + "node2" -> "node0" // CoreLibrary -> CompilerFlags + "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; + "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary + "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "node5" [ label = "GraphicApplication", shape = egg ]; + "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node6" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node7" [ label = "\"-lm\"", shape = septagon ]; + "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm" + "node6" -> "node0" // GraphicLibrary -> CompilerFlags + "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node8" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary +} diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_object_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_object_libs.dot new file mode 100644 index 00000000000..8116bc98190 --- /dev/null +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_object_libs.dot @@ -0,0 +1,48 @@ +digraph "GraphvizTestProject" { +node [ + fontsize = "12" +]; +subgraph clusterLegend { + label = "Legend"; + color = black; + edge [ style = invis ]; + legendNode0 [ label = "Executable", shape = egg ]; + legendNode1 [ label = "Static Library", shape = octagon ]; + legendNode2 [ label = "Shared Library", shape = doubleoctagon ]; + legendNode3 [ label = "Module Library", shape = tripleoctagon ]; + legendNode4 [ label = "Interface Library", shape = pentagon ]; + legendNode5 [ label = "Object Library", shape = hexagon ]; + legendNode6 [ label = "Unknown Library", shape = septagon ]; + legendNode7 [ label = "Custom Target", shape = box ]; + legendNode0 -> legendNode1 [ style = solid ]; + legendNode0 -> legendNode2 [ style = solid ]; + legendNode0 -> legendNode3; + legendNode1 -> legendNode4 [ label = "Interface", style = dashed ]; + legendNode2 -> legendNode5 [ label = "Private", style = dotted ]; + legendNode3 -> legendNode6 [ style = solid ]; + legendNode0 -> legendNode7; +} + "node0" [ label = "CompilerFlags", shape = pentagon ]; + "node1" [ label = "ConsoleApplication", shape = egg ]; + "node2" [ label = "CoreLibrary", shape = octagon ]; + "node2" -> "node0" // CoreLibrary -> CompilerFlags + "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; + "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary + "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "node5" [ label = "GraphicApplication", shape = egg ]; + "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node6" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node7" [ label = "\"-lm\"", shape = septagon ]; + "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm" + "node6" -> "node0" // GraphicLibrary -> CompilerFlags + "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "node8" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node8" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "node8" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "node9" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary +} diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_per_target_files.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_per_target_files.dot new file mode 100644 index 00000000000..1bbf25aba88 --- /dev/null +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_per_target_files.dot @@ -0,0 +1,50 @@ +digraph "GraphvizTestProject" { +node [ + fontsize = "12" +]; +subgraph clusterLegend { + label = "Legend"; + color = black; + edge [ style = invis ]; + legendNode0 [ label = "Executable", shape = egg ]; + legendNode1 [ label = "Static Library", shape = octagon ]; + legendNode2 [ label = "Shared Library", shape = doubleoctagon ]; + legendNode3 [ label = "Module Library", shape = tripleoctagon ]; + legendNode4 [ label = "Interface Library", shape = pentagon ]; + legendNode5 [ label = "Object Library", shape = hexagon ]; + legendNode6 [ label = "Unknown Library", shape = septagon ]; + legendNode7 [ label = "Custom Target", shape = box ]; + legendNode0 -> legendNode1 [ style = solid ]; + legendNode0 -> legendNode2 [ style = solid ]; + legendNode0 -> legendNode3; + legendNode1 -> legendNode4 [ label = "Interface", style = dashed ]; + legendNode2 -> legendNode5 [ label = "Private", style = dotted ]; + legendNode3 -> legendNode6 [ style = solid ]; + legendNode0 -> legendNode7; +} + "node0" [ label = "CompilerFlags", shape = pentagon ]; + "node1" [ label = "ConsoleApplication", shape = egg ]; + "node2" [ label = "CoreLibrary", shape = octagon ]; + "node2" -> "node0" // CoreLibrary -> CompilerFlags + "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; + "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary + "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "node5" [ label = "GraphicApplication", shape = egg ]; + "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node6" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node7" [ label = "\"-lm\"", shape = septagon ]; + "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm" + "node6" -> "node0" // GraphicLibrary -> CompilerFlags + "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node8" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary +} diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_shared_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_shared_libs.dot new file mode 100644 index 00000000000..439d1f76f8f --- /dev/null +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_shared_libs.dot @@ -0,0 +1,44 @@ +digraph "GraphvizTestProject" { +node [ + fontsize = "12" +]; +subgraph clusterLegend { + label = "Legend"; + color = black; + edge [ style = invis ]; + legendNode0 [ label = "Executable", shape = egg ]; + legendNode1 [ label = "Static Library", shape = octagon ]; + legendNode2 [ label = "Shared Library", shape = doubleoctagon ]; + legendNode3 [ label = "Module Library", shape = tripleoctagon ]; + legendNode4 [ label = "Interface Library", shape = pentagon ]; + legendNode5 [ label = "Object Library", shape = hexagon ]; + legendNode6 [ label = "Unknown Library", shape = septagon ]; + legendNode7 [ label = "Custom Target", shape = box ]; + legendNode0 -> legendNode1 [ style = solid ]; + legendNode0 -> legendNode2 [ style = solid ]; + legendNode0 -> legendNode3; + legendNode1 -> legendNode4 [ label = "Interface", style = dashed ]; + legendNode2 -> legendNode5 [ label = "Private", style = dotted ]; + legendNode3 -> legendNode6 [ style = solid ]; + legendNode0 -> legendNode7; +} + "node0" [ label = "CompilerFlags", shape = pentagon ]; + "node1" [ label = "ConsoleApplication", shape = egg ]; + "node2" [ label = "CoreLibrary", shape = octagon ]; + "node2" -> "node0" // CoreLibrary -> CompilerFlags + "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; + "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary + "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "node5" [ label = "GraphicApplication", shape = egg ]; + "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node6" [ label = "\"-lm\"", shape = septagon ]; + "node7" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node8" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node8" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "node8" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "node9" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary +} diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_static_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_static_libs.dot new file mode 100644 index 00000000000..81199a245a6 --- /dev/null +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_static_libs.dot @@ -0,0 +1,42 @@ +digraph "GraphvizTestProject" { +node [ + fontsize = "12" +]; +subgraph clusterLegend { + label = "Legend"; + color = black; + edge [ style = invis ]; + legendNode0 [ label = "Executable", shape = egg ]; + legendNode1 [ label = "Static Library", shape = octagon ]; + legendNode2 [ label = "Shared Library", shape = doubleoctagon ]; + legendNode3 [ label = "Module Library", shape = tripleoctagon ]; + legendNode4 [ label = "Interface Library", shape = pentagon ]; + legendNode5 [ label = "Object Library", shape = hexagon ]; + legendNode6 [ label = "Unknown Library", shape = septagon ]; + legendNode7 [ label = "Custom Target", shape = box ]; + legendNode0 -> legendNode1 [ style = solid ]; + legendNode0 -> legendNode2 [ style = solid ]; + legendNode0 -> legendNode3; + legendNode1 -> legendNode4 [ label = "Interface", style = dashed ]; + legendNode2 -> legendNode5 [ label = "Private", style = dotted ]; + legendNode3 -> legendNode6 [ style = solid ]; + legendNode0 -> legendNode7; +} + "node0" [ label = "CompilerFlags", shape = pentagon ]; + "node1" [ label = "ConsoleApplication", shape = egg ]; + "node2" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; + "node3" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node1" -> "node3" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "node4" [ label = "GraphicApplication", shape = egg ]; + "node5" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node6" [ label = "\"-lm\"", shape = septagon ]; + "node5" -> "node6" [ style = dotted ] // GraphicLibrary -> "-lm" + "node5" -> "node0" // GraphicLibrary -> CompilerFlags + "node7" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node5" -> "node7" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "node4" -> "node5" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "node8" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node8" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags +} diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_unknown_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_unknown_libs.dot new file mode 100644 index 00000000000..1be65501642 --- /dev/null +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_unknown_libs.dot @@ -0,0 +1,48 @@ +digraph "GraphvizTestProject" { +node [ + fontsize = "12" +]; +subgraph clusterLegend { + label = "Legend"; + color = black; + edge [ style = invis ]; + legendNode0 [ label = "Executable", shape = egg ]; + legendNode1 [ label = "Static Library", shape = octagon ]; + legendNode2 [ label = "Shared Library", shape = doubleoctagon ]; + legendNode3 [ label = "Module Library", shape = tripleoctagon ]; + legendNode4 [ label = "Interface Library", shape = pentagon ]; + legendNode5 [ label = "Object Library", shape = hexagon ]; + legendNode6 [ label = "Unknown Library", shape = septagon ]; + legendNode7 [ label = "Custom Target", shape = box ]; + legendNode0 -> legendNode1 [ style = solid ]; + legendNode0 -> legendNode2 [ style = solid ]; + legendNode0 -> legendNode3; + legendNode1 -> legendNode4 [ label = "Interface", style = dashed ]; + legendNode2 -> legendNode5 [ label = "Private", style = dotted ]; + legendNode3 -> legendNode6 [ style = solid ]; + legendNode0 -> legendNode7; +} + "node0" [ label = "CompilerFlags", shape = pentagon ]; + "node1" [ label = "ConsoleApplication", shape = egg ]; + "node2" [ label = "CoreLibrary", shape = octagon ]; + "node2" -> "node0" // CoreLibrary -> CompilerFlags + "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; + "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary + "node4" [ label = "GraphicApplication", shape = egg ]; + "node4" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node5" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node6" [ label = "\"-lm\"", shape = septagon ]; + "node5" -> "node6" [ style = dotted ] // GraphicLibrary -> "-lm" + "node5" -> "node0" // GraphicLibrary -> CompilerFlags + "node5" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node7" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node5" -> "node7" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "node4" -> "node5" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "node8" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node8" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "node8" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "node9" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary +} diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_header.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_header.dot new file mode 100644 index 00000000000..1cfbe0f6b1f --- /dev/null +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_header.dot @@ -0,0 +1,50 @@ +digraph "GraphvizTestProject" { +node [ + fontsize = "16" +]; +subgraph clusterLegend { + label = "Legend"; + color = black; + edge [ style = invis ]; + legendNode0 [ label = "Executable", shape = egg ]; + legendNode1 [ label = "Static Library", shape = octagon ]; + legendNode2 [ label = "Shared Library", shape = doubleoctagon ]; + legendNode3 [ label = "Module Library", shape = tripleoctagon ]; + legendNode4 [ label = "Interface Library", shape = pentagon ]; + legendNode5 [ label = "Object Library", shape = hexagon ]; + legendNode6 [ label = "Unknown Library", shape = septagon ]; + legendNode7 [ label = "Custom Target", shape = box ]; + legendNode0 -> legendNode1 [ style = solid ]; + legendNode0 -> legendNode2 [ style = solid ]; + legendNode0 -> legendNode3; + legendNode1 -> legendNode4 [ label = "Interface", style = dashed ]; + legendNode2 -> legendNode5 [ label = "Private", style = dotted ]; + legendNode3 -> legendNode6 [ style = solid ]; + legendNode0 -> legendNode7; +} + "node0" [ label = "CompilerFlags", shape = pentagon ]; + "node1" [ label = "ConsoleApplication", shape = egg ]; + "node2" [ label = "CoreLibrary", shape = octagon ]; + "node2" -> "node0" // CoreLibrary -> CompilerFlags + "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; + "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary + "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "node5" [ label = "GraphicApplication", shape = egg ]; + "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node6" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node7" [ label = "\"-lm\"", shape = septagon ]; + "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm" + "node6" -> "node0" // GraphicLibrary -> CompilerFlags + "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node8" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary +} diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_name.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_name.dot new file mode 100644 index 00000000000..9653c330280 --- /dev/null +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_name.dot @@ -0,0 +1,50 @@ +digraph "CMake Project Dependencies" { +node [ + fontsize = "12" +]; +subgraph clusterLegend { + label = "Legend"; + color = black; + edge [ style = invis ]; + legendNode0 [ label = "Executable", shape = egg ]; + legendNode1 [ label = "Static Library", shape = octagon ]; + legendNode2 [ label = "Shared Library", shape = doubleoctagon ]; + legendNode3 [ label = "Module Library", shape = tripleoctagon ]; + legendNode4 [ label = "Interface Library", shape = pentagon ]; + legendNode5 [ label = "Object Library", shape = hexagon ]; + legendNode6 [ label = "Unknown Library", shape = septagon ]; + legendNode7 [ label = "Custom Target", shape = box ]; + legendNode0 -> legendNode1 [ style = solid ]; + legendNode0 -> legendNode2 [ style = solid ]; + legendNode0 -> legendNode3; + legendNode1 -> legendNode4 [ label = "Interface", style = dashed ]; + legendNode2 -> legendNode5 [ label = "Private", style = dotted ]; + legendNode3 -> legendNode6 [ style = solid ]; + legendNode0 -> legendNode7; +} + "node0" [ label = "CompilerFlags", shape = pentagon ]; + "node1" [ label = "ConsoleApplication", shape = egg ]; + "node2" [ label = "CoreLibrary", shape = octagon ]; + "node2" -> "node0" // CoreLibrary -> CompilerFlags + "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; + "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary + "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "node5" [ label = "GraphicApplication", shape = egg ]; + "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node6" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node7" [ label = "\"-lm\"", shape = septagon ]; + "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm" + "node6" -> "node0" // GraphicLibrary -> CompilerFlags + "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node8" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary +} diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_node_prefix.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_node_prefix.dot new file mode 100644 index 00000000000..82d96d07711 --- /dev/null +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_node_prefix.dot @@ -0,0 +1,50 @@ +digraph "GraphvizTestProject" { +node [ + fontsize = "12" +]; +subgraph clusterLegend { + label = "Legend"; + color = black; + edge [ style = invis ]; + legendNode0 [ label = "Executable", shape = egg ]; + legendNode1 [ label = "Static Library", shape = octagon ]; + legendNode2 [ label = "Shared Library", shape = doubleoctagon ]; + legendNode3 [ label = "Module Library", shape = tripleoctagon ]; + legendNode4 [ label = "Interface Library", shape = pentagon ]; + legendNode5 [ label = "Object Library", shape = hexagon ]; + legendNode6 [ label = "Unknown Library", shape = septagon ]; + legendNode7 [ label = "Custom Target", shape = box ]; + legendNode0 -> legendNode1 [ style = solid ]; + legendNode0 -> legendNode2 [ style = solid ]; + legendNode0 -> legendNode3; + legendNode1 -> legendNode4 [ label = "Interface", style = dashed ]; + legendNode2 -> legendNode5 [ label = "Private", style = dotted ]; + legendNode3 -> legendNode6 [ style = solid ]; + legendNode0 -> legendNode7; +} + "point0" [ label = "CompilerFlags", shape = pentagon ]; + "point1" [ label = "ConsoleApplication", shape = egg ]; + "point2" [ label = "CoreLibrary", shape = octagon ]; + "point2" -> "point0" // CoreLibrary -> CompilerFlags + "point3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; + "point2" -> "point3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "point1" -> "point2" [ style = dotted ] // ConsoleApplication -> CoreLibrary + "point4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "point1" -> "point4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "point5" [ label = "GraphicApplication", shape = egg ]; + "point5" -> "point2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "point6" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "point7" [ label = "\"-lm\"", shape = septagon ]; + "point6" -> "point7" [ style = dotted ] // GraphicLibrary -> "-lm" + "point6" -> "point0" // GraphicLibrary -> CompilerFlags + "point6" -> "point2" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "point8" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "point6" -> "point8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "point5" -> "point6" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "point9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "point9" -> "point0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "point9" -> "point2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "point10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "point10" -> "point0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "point10" -> "point2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary +} diff --git a/Tests/RunCMake/Graphviz/no_dependers_files-check.cmake b/Tests/RunCMake/Graphviz/no_dependers_files-check.cmake new file mode 100644 index 00000000000..f4a43b69b73 --- /dev/null +++ b/Tests/RunCMake/Graphviz/no_dependers_files-check.cmake @@ -0,0 +1,4 @@ +file(GLOB dependers_files ${RunCMake_TEST_BINARY_DIR}/*.dependers) +if(${dependers_files}) + set(RunCMake_TEST_FAILED "Found *.dependers files despite GRAPHVIZ_GENERATE_DEPENDERS set to FALSE.") +endif() diff --git a/Tests/RunCMake/Graphviz/no_executables-check.cmake b/Tests/RunCMake/Graphviz/no_executables-check.cmake new file mode 100644 index 00000000000..be29a4f0a78 --- /dev/null +++ b/Tests/RunCMake/Graphviz/no_executables-check.cmake @@ -0,0 +1,5 @@ +include(RunCMake) + +ensure_files_match( + ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_executables.dot + ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot) diff --git a/Tests/RunCMake/Graphviz/no_external_libs-check.cmake b/Tests/RunCMake/Graphviz/no_external_libs-check.cmake new file mode 100644 index 00000000000..518ef7b0cb1 --- /dev/null +++ b/Tests/RunCMake/Graphviz/no_external_libs-check.cmake @@ -0,0 +1,5 @@ +include(RunCMake) + +ensure_files_match( + ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_external_libs.dot + ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot) diff --git a/Tests/RunCMake/Graphviz/no_graphic_libs-check.cmake b/Tests/RunCMake/Graphviz/no_graphic_libs-check.cmake new file mode 100644 index 00000000000..0f5aa477a24 --- /dev/null +++ b/Tests/RunCMake/Graphviz/no_graphic_libs-check.cmake @@ -0,0 +1,5 @@ +include(RunCMake) + +ensure_files_match( + ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_graphic_libs.dot + ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot) diff --git a/Tests/RunCMake/Graphviz/no_interface_libs-check.cmake b/Tests/RunCMake/Graphviz/no_interface_libs-check.cmake new file mode 100644 index 00000000000..018fef01907 --- /dev/null +++ b/Tests/RunCMake/Graphviz/no_interface_libs-check.cmake @@ -0,0 +1,5 @@ +include(RunCMake) + +ensure_files_match( + ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_interface_libs.dot + ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot) diff --git a/Tests/RunCMake/Graphviz/no_module_libs-check.cmake b/Tests/RunCMake/Graphviz/no_module_libs-check.cmake new file mode 100644 index 00000000000..e185cb15082 --- /dev/null +++ b/Tests/RunCMake/Graphviz/no_module_libs-check.cmake @@ -0,0 +1,5 @@ +include(RunCMake) + +ensure_files_match( + ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_module_libs.dot + ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot) diff --git a/Tests/RunCMake/Graphviz/no_object_libs-check.cmake b/Tests/RunCMake/Graphviz/no_object_libs-check.cmake new file mode 100644 index 00000000000..90e7ecbf157 --- /dev/null +++ b/Tests/RunCMake/Graphviz/no_object_libs-check.cmake @@ -0,0 +1,5 @@ +include(RunCMake) + +ensure_files_match( + ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_object_libs.dot + ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot) diff --git a/Tests/RunCMake/Graphviz/no_per_target_files-check.cmake b/Tests/RunCMake/Graphviz/no_per_target_files-check.cmake new file mode 100644 index 00000000000..95d05a1be39 --- /dev/null +++ b/Tests/RunCMake/Graphviz/no_per_target_files-check.cmake @@ -0,0 +1,5 @@ +file(GLOB per_target_files ${RunCMake_TEST_BINARY_DIR}/*.dot.*) +list(FILTER per_target_files EXCLUDE REGEX ".*\\.dependers$") +if(per_target_files) + set(RunCMake_TEST_FAILED "Found per-target .dot files despite GRAPHVIZ_GENERATE_PER_TARGET set to FALSE.") +endif() diff --git a/Tests/RunCMake/Graphviz/no_shared_libs-check.cmake b/Tests/RunCMake/Graphviz/no_shared_libs-check.cmake new file mode 100644 index 00000000000..b45da2e3602 --- /dev/null +++ b/Tests/RunCMake/Graphviz/no_shared_libs-check.cmake @@ -0,0 +1,5 @@ +include(RunCMake) + +ensure_files_match( + ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_shared_libs.dot + ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot) diff --git a/Tests/RunCMake/Graphviz/no_static_libs-check.cmake b/Tests/RunCMake/Graphviz/no_static_libs-check.cmake new file mode 100644 index 00000000000..befc11b2bbd --- /dev/null +++ b/Tests/RunCMake/Graphviz/no_static_libs-check.cmake @@ -0,0 +1,5 @@ +include(RunCMake) + +ensure_files_match( + ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_static_libs.dot + ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot) diff --git a/Tests/RunCMake/Graphviz/no_unknown_libs-check.cmake b/Tests/RunCMake/Graphviz/no_unknown_libs-check.cmake new file mode 100644 index 00000000000..95286bc2067 --- /dev/null +++ b/Tests/RunCMake/Graphviz/no_unknown_libs-check.cmake @@ -0,0 +1,5 @@ +include(RunCMake) + +ensure_files_match( + ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_unknown_libs.dot + ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot) diff --git a/Tests/RunCMake/Graphviz/set_graph_header-check.cmake b/Tests/RunCMake/Graphviz/set_graph_header-check.cmake new file mode 100644 index 00000000000..13964847cda --- /dev/null +++ b/Tests/RunCMake/Graphviz/set_graph_header-check.cmake @@ -0,0 +1,5 @@ +include(RunCMake) + +ensure_files_match( + ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_set_graph_header.dot + ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot) diff --git a/Tests/RunCMake/Graphviz/set_graph_name-check.cmake b/Tests/RunCMake/Graphviz/set_graph_name-check.cmake new file mode 100644 index 00000000000..0c522e91d0a --- /dev/null +++ b/Tests/RunCMake/Graphviz/set_graph_name-check.cmake @@ -0,0 +1,5 @@ +include(RunCMake) + +ensure_files_match( + ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_set_graph_name.dot + ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot) diff --git a/Tests/RunCMake/Graphviz/set_node_prefix-check.cmake b/Tests/RunCMake/Graphviz/set_node_prefix-check.cmake new file mode 100644 index 00000000000..61e9b243efa --- /dev/null +++ b/Tests/RunCMake/Graphviz/set_node_prefix-check.cmake @@ -0,0 +1,5 @@ +include(RunCMake) + +ensure_files_match( + ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_set_node_prefix.dot + ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot) diff --git a/Tests/RunCMake/Graphviz/test_project/core_library.c b/Tests/RunCMake/Graphviz/test_project/core_library.c new file mode 100644 index 00000000000..e8a88447eac --- /dev/null +++ b/Tests/RunCMake/Graphviz/test_project/core_library.c @@ -0,0 +1,3 @@ +void log_something() +{ +} diff --git a/Tests/RunCMake/Graphviz/test_project/graphic_library.c b/Tests/RunCMake/Graphviz/test_project/graphic_library.c new file mode 100644 index 00000000000..958c8abb2b3 --- /dev/null +++ b/Tests/RunCMake/Graphviz/test_project/graphic_library.c @@ -0,0 +1,3 @@ +void initialize_graphics() +{ +} diff --git a/Tests/RunCMake/Graphviz/test_project/main.c b/Tests/RunCMake/Graphviz/test_project/main.c new file mode 100644 index 00000000000..d123e0977a0 --- /dev/null +++ b/Tests/RunCMake/Graphviz/test_project/main.c @@ -0,0 +1,4 @@ +int main(int argc, char** argv) +{ + return 0; +} diff --git a/Tests/RunCMake/Graphviz/test_project/module.c b/Tests/RunCMake/Graphviz/test_project/module.c new file mode 100644 index 00000000000..a508b09a552 --- /dev/null +++ b/Tests/RunCMake/Graphviz/test_project/module.c @@ -0,0 +1,3 @@ +static void some_function() +{ +} diff --git a/Tests/RunCMake/Graphviz/test_project/third_party_project/CMakeLists.txt b/Tests/RunCMake/Graphviz/test_project/third_party_project/CMakeLists.txt new file mode 100644 index 00000000000..e381750dd50 --- /dev/null +++ b/Tests/RunCMake/Graphviz/test_project/third_party_project/CMakeLists.txt @@ -0,0 +1,3 @@ +project(ThirdPartyProject) + +add_library(GoofyLoggingLibrary INTERFACE) diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index da4d1e53220..f24cfab62a5 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -204,5 +204,28 @@ function(run_cmake_with_options test) run_cmake(${test}) endfunction() +function(ensure_files_match expected_file actual_file) + if(NOT EXISTS "${expected_file}") + message(FATAL_ERROR "Expected file does not exist:\n ${expected_file}") + endif() + if(NOT EXISTS "${actual_file}") + message(FATAL_ERROR "Actual file does not exist:\n ${actual_file}") + endif() + file(READ "${expected_file}" expected_file_content) + file(READ "${actual_file}" actual_file_content) + if(NOT "${expected_file_content}" STREQUAL "${actual_file_content}") + message(FATAL_ERROR "Actual file content does not match expected:\n + \n + expected file: ${expected_file}\n + expected content:\n + ${expected_file_content}\n + \n + actual file: ${actual_file}\n + actual content:\n + ${actual_file_content}\n + ") + endif() +endfunction() + # Protect RunCMake tests from calling environment. unset(ENV{MAKEFLAGS}) diff --git a/bootstrap b/bootstrap index 1f5f0662975..599d930b608 100755 --- a/bootstrap +++ b/bootstrap @@ -372,6 +372,7 @@ CMAKE_CXX_SOURCES="\ cmLDConfigTool \ cmLinkDirectoriesCommand \ cmLinkItem \ + cmLinkItemGraphVisitor \ cmLinkLineComputer \ cmLinkLineDeviceComputer \ cmListCommand \ From ab54653afd8f6671c462742dee089a2e12b2d7dc Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Tue, 8 Oct 2019 00:01:06 -0400 Subject: [PATCH 004/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index c068594bcb2..2580bd2ce69 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191007) +set(CMake_VERSION_PATCH 20191008) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From 6050eca0a416f8ad8278a3c4797236721aeb237a Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Wed, 9 Oct 2019 00:01:06 -0400 Subject: [PATCH 005/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 2580bd2ce69..6e83c83c62b 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191008) +set(CMake_VERSION_PATCH 20191009) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From 0d1bf3f660faebd8b73d638d0359db5502e2f3d6 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Thu, 10 Oct 2019 00:01:06 -0400 Subject: [PATCH 006/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 6e83c83c62b..404b47517fd 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191009) +set(CMake_VERSION_PATCH 20191010) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From d00bb419ca5ccbecee892ce1f3e5fdd455c11ff0 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 7 Oct 2019 13:26:23 -0400 Subject: [PATCH 007/662] Add deprecation warnings for policies CMP0069 and below The OLD behaviors of all policies are deprecated, but only by documentation. Add an explicit deprecation diagnostic for policies introduced in CMake 3.9 and below to encourage projects to port away from setting policies to OLD. --- Help/release/dev/deprecate-policy-old.rst | 8 ++++++++ Source/cmMakefile.cxx | 2 +- Tests/RunCMake/CMP0068/CMP0068-OLD-stderr.txt | 10 ++++++++++ Tests/RunCMake/CMP0069/CMP0069-OLD-stderr.txt | 10 ++++++++++ .../CheckIPOSupported/cmp0069-is-old-stderr.txt | 13 ++++++++++++- 5 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 Help/release/dev/deprecate-policy-old.rst create mode 100644 Tests/RunCMake/CMP0068/CMP0068-OLD-stderr.txt create mode 100644 Tests/RunCMake/CMP0069/CMP0069-OLD-stderr.txt diff --git a/Help/release/dev/deprecate-policy-old.rst b/Help/release/dev/deprecate-policy-old.rst new file mode 100644 index 00000000000..401f4b235fe --- /dev/null +++ b/Help/release/dev/deprecate-policy-old.rst @@ -0,0 +1,8 @@ +deprecate-policy-old +-------------------- + +* An explicit deprecation diagnostic was added for policy ``CMP0068`` + and policy ``CMP0069`` (``CMP0067`` and below were already deprecated). + The :manual:`cmake-policies(7)` manual explains that the OLD behaviors + of all policies are deprecated and that projects should port to the + NEW behaviors. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index f143ef704f6..bf488b11a57 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -4487,7 +4487,7 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id, // Deprecate old policies, especially those that require a lot // of code to maintain the old behavior. - if (status == cmPolicies::OLD && id <= cmPolicies::CMP0067 && + if (status == cmPolicies::OLD && id <= cmPolicies::CMP0069 && !(this->GetCMakeInstance()->GetIsInTryCompile() && ( // Policies set by cmCoreTryCompile::TryCompileCode. diff --git a/Tests/RunCMake/CMP0068/CMP0068-OLD-stderr.txt b/Tests/RunCMake/CMP0068/CMP0068-OLD-stderr.txt new file mode 100644 index 00000000000..a736129fe64 --- /dev/null +++ b/Tests/RunCMake/CMP0068/CMP0068-OLD-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0068-OLD.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0068 will be removed from a future version + of CMake. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/CMP0069/CMP0069-OLD-stderr.txt b/Tests/RunCMake/CMP0069/CMP0069-OLD-stderr.txt new file mode 100644 index 00000000000..f51a6f43500 --- /dev/null +++ b/Tests/RunCMake/CMP0069/CMP0069-OLD-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0069-OLD.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0069 will be removed from a future version + of CMake. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/CheckIPOSupported/cmp0069-is-old-stderr.txt b/Tests/RunCMake/CheckIPOSupported/cmp0069-is-old-stderr.txt index f183594e530..1baa63a3141 100644 --- a/Tests/RunCMake/CheckIPOSupported/cmp0069-is-old-stderr.txt +++ b/Tests/RunCMake/CheckIPOSupported/cmp0069-is-old-stderr.txt @@ -1,4 +1,15 @@ -^CMake Error at .*/Modules/CheckIPOSupported\.cmake:[0-9]+ \(message\): +^CMake Deprecation Warning at cmp0069-is-old.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0069 will be removed from a future version + of CMake. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Error at .*/Modules/CheckIPOSupported\.cmake:[0-9]+ \(message\): Policy CMP0069 set to OLD Call Stack \(most recent call first\): cmp0069-is-old\.cmake:[0-9]+ \(check_ipo_supported\) From b7509dd674d9e0a1e428c5f4ceff7b78b47ac296 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 10 Oct 2019 13:28:08 -0400 Subject: [PATCH 008/662] Add option to configure Ninja link job pool for CMake's own binaries Create an undocumented `CMake_JOB_POOL_LINK_BIN` option that builders can set to avoid linking too many of our binaries at once. --- Source/CMakeLists.txt | 5 +++++ Source/CursesDialog/CMakeLists.txt | 4 ++++ Source/QtDialog/CMakeLists.txt | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 63e08de0f50..d89a69d9f5c 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -1193,6 +1193,11 @@ if(WIN32) endforeach() endif() +if(CMake_JOB_POOL_LINK_BIN) + set_property(TARGET ${_tools} PROPERTY JOB_POOL_LINK "link-bin") + set_property(GLOBAL APPEND PROPERTY JOB_POOLS "link-bin=${CMake_JOB_POOL_LINK_BIN}") +endif() + # Install tools foreach(_tool ${_tools}) diff --git a/Source/CursesDialog/CMakeLists.txt b/Source/CursesDialog/CMakeLists.txt index 70097175113..a9e46fd58f4 100644 --- a/Source/CursesDialog/CMakeLists.txt +++ b/Source/CursesDialog/CMakeLists.txt @@ -34,5 +34,9 @@ else() target_link_libraries(ccmake cmForm) endif() +if(CMake_JOB_POOL_LINK_BIN) + set_property(TARGET ccmake PROPERTY JOB_POOL_LINK "link-bin") +endif() + CMake_OPTIONAL_COMPONENT(ccmake) install(TARGETS ccmake DESTINATION ${CMAKE_BIN_DIR} ${COMPONENT}) diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index cb89d19fd9a..98dd0e212bd 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -178,6 +178,10 @@ if(WIN32) target_sources(cmake-gui PRIVATE $) endif() +if(CMake_JOB_POOL_LINK_BIN) + set_property(TARGET cmake-gui PROPERTY JOB_POOL_LINK "link-bin") +endif() + # cmake-gui has not been updated for `include-what-you-use`. # Block the tool until this is done. set_target_properties(cmake-gui PROPERTIES From 1529f4a9308a1c808b5ac48083ca0c365c589021 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 10 Oct 2019 14:24:32 -0400 Subject: [PATCH 009/662] Utilities/Release: Teach "push" script to create destination subdirectory Extend the script added by commit 9bf97363b0 (Utilities/Release: Replace upload step with a "push" script, 2019-05-24, v3.15.0-rc1~56^2) to create the destination subdirectory for the CMake version being pushed. --- Utilities/Release/push.bash | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Utilities/Release/push.bash b/Utilities/Release/push.bash index 1c8efe90049..a1c6651a689 100755 --- a/Utilities/Release/push.bash +++ b/Utilities/Release/push.bash @@ -50,6 +50,9 @@ if test -z "$dir"; then dir="v${version}" fi readonly dir +if ! test -d "${dest}/${dir}"; then + mkdir "${dest}/${dir}" +fi for f in cmake-${version}*; do if ! test -f "${f}"; then From 696b2d40d4bdf5a8094f7d7c3e9ac66b039f34bf Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Fri, 11 Oct 2019 00:01:07 -0400 Subject: [PATCH 010/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 404b47517fd..f7646c9b39b 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191010) +set(CMake_VERSION_PATCH 20191011) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From 4b021bd3e9f0d8b5ab5f8a8dc961441a7a063e25 Mon Sep 17 00:00:00 2001 From: Alex Turbov Date: Thu, 10 Oct 2019 22:42:23 +1100 Subject: [PATCH 011/662] message: Minor refactor to make code less verbose --- Source/cmMessageCommand.cxx | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Source/cmMessageCommand.cxx b/Source/cmMessageCommand.cxx index 96a6386bf19..15c007c07b4 100644 --- a/Source/cmMessageCommand.cxx +++ b/Source/cmMessageCommand.cxx @@ -21,6 +21,9 @@ bool cmMessageCommand(std::vector const& args, status.SetError("called with incorrect number of arguments"); return false; } + + auto& mf = status.GetMakefile(); + auto i = args.cbegin(); auto type = MessageType::MESSAGE; @@ -40,13 +43,12 @@ bool cmMessageCommand(std::vector const& args, level = cmake::LogLevel::LOG_WARNING; ++i; } else if (*i == "AUTHOR_WARNING") { - if (status.GetMakefile().IsSet("CMAKE_SUPPRESS_DEVELOPER_ERRORS") && - !status.GetMakefile().IsOn("CMAKE_SUPPRESS_DEVELOPER_ERRORS")) { + if (mf.IsSet("CMAKE_SUPPRESS_DEVELOPER_ERRORS") && + !mf.IsOn("CMAKE_SUPPRESS_DEVELOPER_ERRORS")) { fatal = true; type = MessageType::AUTHOR_ERROR; level = cmake::LogLevel::LOG_ERROR; - } else if (!status.GetMakefile().IsOn( - "CMAKE_SUPPRESS_DEVELOPER_WARNINGS")) { + } else if (!mf.IsOn("CMAKE_SUPPRESS_DEVELOPER_WARNINGS")) { type = MessageType::AUTHOR_WARNING; level = cmake::LogLevel::LOG_WARNING; } else { @@ -66,12 +68,12 @@ bool cmMessageCommand(std::vector const& args, level = cmake::LogLevel::LOG_TRACE; ++i; } else if (*i == "DEPRECATION") { - if (status.GetMakefile().IsOn("CMAKE_ERROR_DEPRECATED")) { + if (mf.IsOn("CMAKE_ERROR_DEPRECATED")) { fatal = true; type = MessageType::DEPRECATION_ERROR; level = cmake::LogLevel::LOG_ERROR; - } else if (!status.GetMakefile().IsSet("CMAKE_WARN_DEPRECATED") || - status.GetMakefile().IsOn("CMAKE_WARN_DEPRECATED")) { + } else if (!mf.IsSet("CMAKE_WARN_DEPRECATED") || + mf.IsOn("CMAKE_WARN_DEPRECATED")) { type = MessageType::DEPRECATION_WARNING; level = cmake::LogLevel::LOG_WARNING; } else { @@ -89,7 +91,7 @@ bool cmMessageCommand(std::vector const& args, assert("Message log level expected to be set" && level != cmake::LogLevel::LOG_UNDEFINED); - auto desiredLevel = status.GetMakefile().GetCMakeInstance()->GetLogLevel(); + auto desiredLevel = mf.GetCMakeInstance()->GetLogLevel(); assert("Expected a valid log level here" && desiredLevel != cmake::LogLevel::LOG_UNDEFINED); @@ -104,9 +106,8 @@ bool cmMessageCommand(std::vector const& args, // Check if any indentation has requested: // `CMAKE_MESSAGE_INDENT` is a list of "padding" pieces // to be joined and prepended to the message lines. - auto indent = cmJoin(cmExpandedList(status.GetMakefile().GetSafeDefinition( - "CMAKE_MESSAGE_INDENT")), - ""); + auto indent = + cmJoin(cmExpandedList(mf.GetSafeDefinition("CMAKE_MESSAGE_INDENT")), ""); // Make every line of the `message` indented // NOTE Can't reuse `cmDocumentationFormatter::PrintPreformatted` // here cuz it appends `\n` to the EOM ;-( @@ -118,8 +119,7 @@ bool cmMessageCommand(std::vector const& args, case cmake::LogLevel::LOG_ERROR: case cmake::LogLevel::LOG_WARNING: // we've overridden the message type, above, so display it directly - status.GetMakefile().GetMessenger()->DisplayMessage( - type, message, status.GetMakefile().GetBacktrace()); + mf.GetMessenger()->DisplayMessage(type, message, mf.GetBacktrace()); break; case cmake::LogLevel::LOG_NOTICE: @@ -130,7 +130,7 @@ bool cmMessageCommand(std::vector const& args, case cmake::LogLevel::LOG_VERBOSE: case cmake::LogLevel::LOG_DEBUG: case cmake::LogLevel::LOG_TRACE: - status.GetMakefile().DisplayStatus(message, -1); + mf.DisplayStatus(message, -1); break; default: From 7c579f0a03266e37bc0fcaaad4e3322068f65fdd Mon Sep 17 00:00:00 2001 From: Alex Turbov Date: Thu, 10 Oct 2019 23:34:35 +1100 Subject: [PATCH 012/662] Help: Move CMAKE_MESSAGE_INDENT variable to correct section --- Help/manual/cmake-variables.7.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index 0442d8930d7..9b24b5a8898 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -70,7 +70,6 @@ Variables that Provide Information /variable/CMAKE_MAKE_PROGRAM /variable/CMAKE_MATCH_COUNT /variable/CMAKE_MATCH_n - /variable/CMAKE_MESSAGE_INDENT /variable/CMAKE_MINIMUM_REQUIRED_VERSION /variable/CMAKE_MINOR_VERSION /variable/CMAKE_NETRC @@ -205,6 +204,7 @@ Variables that Change Behavior /variable/CMAKE_LINK_DIRECTORIES_BEFORE /variable/CMAKE_MFC_FLAG /variable/CMAKE_MAXIMUM_RECURSION_DEPTH + /variable/CMAKE_MESSAGE_INDENT /variable/CMAKE_MODULE_PATH /variable/CMAKE_POLICY_DEFAULT_CMPNNNN /variable/CMAKE_POLICY_WARNING_CMPNNNN From a8d42ecb8dddc615e93559889994390bd10daf88 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Sat, 12 Oct 2019 00:01:14 -0400 Subject: [PATCH 013/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index f7646c9b39b..567062271c3 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191011) +set(CMake_VERSION_PATCH 20191012) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From aa59badd6f1ab3c40d3674c26e1e55271d25225c Mon Sep 17 00:00:00 2001 From: Craig Scott Date: Sat, 12 Oct 2019 16:58:54 +1100 Subject: [PATCH 014/662] Tests: Message log level tests must fail on unwanted output The previous regular expressions were allowing output from lower log levels. The tests still pass after these changes but will now catch regressions (previously they would not have). --- Tests/RunCMake/message/message-log-level-debug-stdout.txt | 2 +- Tests/RunCMake/message/message-log-level-default-stdout.txt | 2 +- Tests/RunCMake/message/message-log-level-status-stdout.txt | 2 +- Tests/RunCMake/message/message-log-level-trace-stdout.txt | 2 +- Tests/RunCMake/message/message-log-level-verbose-stdout.txt | 2 +- Tests/RunCMake/message/message-loglevel-debug-stdout.txt | 2 +- Tests/RunCMake/message/message-loglevel-default-stdout.txt | 2 +- Tests/RunCMake/message/message-loglevel-status-stdout.txt | 2 +- Tests/RunCMake/message/message-loglevel-trace-stdout.txt | 2 +- Tests/RunCMake/message/message-loglevel-verbose-stdout.txt | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Tests/RunCMake/message/message-log-level-debug-stdout.txt b/Tests/RunCMake/message/message-log-level-debug-stdout.txt index 14521370361..feee110915a 100644 --- a/Tests/RunCMake/message/message-log-level-debug-stdout.txt +++ b/Tests/RunCMake/message/message-log-level-debug-stdout.txt @@ -1,3 +1,3 @@ -- STATUS message -- VERBOSE message --- DEBUG message +-- DEBUG message$ diff --git a/Tests/RunCMake/message/message-log-level-default-stdout.txt b/Tests/RunCMake/message/message-log-level-default-stdout.txt index 809f4cc4a44..b5d6acbd8fc 100644 --- a/Tests/RunCMake/message/message-log-level-default-stdout.txt +++ b/Tests/RunCMake/message/message-log-level-default-stdout.txt @@ -1 +1 @@ --- STATUS message +-- STATUS message$ diff --git a/Tests/RunCMake/message/message-log-level-status-stdout.txt b/Tests/RunCMake/message/message-log-level-status-stdout.txt index 809f4cc4a44..b5d6acbd8fc 100644 --- a/Tests/RunCMake/message/message-log-level-status-stdout.txt +++ b/Tests/RunCMake/message/message-log-level-status-stdout.txt @@ -1 +1 @@ --- STATUS message +-- STATUS message$ diff --git a/Tests/RunCMake/message/message-log-level-trace-stdout.txt b/Tests/RunCMake/message/message-log-level-trace-stdout.txt index 1cfce6f11c4..3d36a7fe980 100644 --- a/Tests/RunCMake/message/message-log-level-trace-stdout.txt +++ b/Tests/RunCMake/message/message-log-level-trace-stdout.txt @@ -1,4 +1,4 @@ -- STATUS message -- VERBOSE message -- DEBUG message --- TRACE message +-- TRACE message$ diff --git a/Tests/RunCMake/message/message-log-level-verbose-stdout.txt b/Tests/RunCMake/message/message-log-level-verbose-stdout.txt index c15d43fc493..47c0846f4be 100644 --- a/Tests/RunCMake/message/message-log-level-verbose-stdout.txt +++ b/Tests/RunCMake/message/message-log-level-verbose-stdout.txt @@ -1,2 +1,2 @@ -- STATUS message --- VERBOSE message +-- VERBOSE message$ diff --git a/Tests/RunCMake/message/message-loglevel-debug-stdout.txt b/Tests/RunCMake/message/message-loglevel-debug-stdout.txt index 14521370361..feee110915a 100644 --- a/Tests/RunCMake/message/message-loglevel-debug-stdout.txt +++ b/Tests/RunCMake/message/message-loglevel-debug-stdout.txt @@ -1,3 +1,3 @@ -- STATUS message -- VERBOSE message --- DEBUG message +-- DEBUG message$ diff --git a/Tests/RunCMake/message/message-loglevel-default-stdout.txt b/Tests/RunCMake/message/message-loglevel-default-stdout.txt index 809f4cc4a44..b5d6acbd8fc 100644 --- a/Tests/RunCMake/message/message-loglevel-default-stdout.txt +++ b/Tests/RunCMake/message/message-loglevel-default-stdout.txt @@ -1 +1 @@ --- STATUS message +-- STATUS message$ diff --git a/Tests/RunCMake/message/message-loglevel-status-stdout.txt b/Tests/RunCMake/message/message-loglevel-status-stdout.txt index 809f4cc4a44..b5d6acbd8fc 100644 --- a/Tests/RunCMake/message/message-loglevel-status-stdout.txt +++ b/Tests/RunCMake/message/message-loglevel-status-stdout.txt @@ -1 +1 @@ --- STATUS message +-- STATUS message$ diff --git a/Tests/RunCMake/message/message-loglevel-trace-stdout.txt b/Tests/RunCMake/message/message-loglevel-trace-stdout.txt index 1cfce6f11c4..3d36a7fe980 100644 --- a/Tests/RunCMake/message/message-loglevel-trace-stdout.txt +++ b/Tests/RunCMake/message/message-loglevel-trace-stdout.txt @@ -1,4 +1,4 @@ -- STATUS message -- VERBOSE message -- DEBUG message --- TRACE message +-- TRACE message$ diff --git a/Tests/RunCMake/message/message-loglevel-verbose-stdout.txt b/Tests/RunCMake/message/message-loglevel-verbose-stdout.txt index c15d43fc493..47c0846f4be 100644 --- a/Tests/RunCMake/message/message-loglevel-verbose-stdout.txt +++ b/Tests/RunCMake/message/message-loglevel-verbose-stdout.txt @@ -1,2 +1,2 @@ -- STATUS message --- VERBOSE message +-- VERBOSE message$ From 5bf85e25178f5d9f19d2f30cf66f088c21e1114a Mon Sep 17 00:00:00 2001 From: Alex Turbov Date: Thu, 10 Oct 2019 23:28:12 +1100 Subject: [PATCH 015/662] message: Add new CMAKE_MESSAGE_LOG_LEVEL variable --- Help/command/message.rst | 3 +++ Help/manual/cmake-variables.7.rst | 1 + Help/manual/cmake.1.rst | 5 +++++ Help/release/dev/feature-CMAKE_MESSAGE_CONTEXT | 6 ++++++ Help/variable/CMAKE_MESSAGE_LOG_LEVEL.rst | 15 +++++++++++++++ Source/cmMessageCommand.cxx | 9 +++++++++ Source/cmake.cxx | 2 ++ Source/cmake.h | 3 +++ Tests/RunCMake/message/RunCMakeTest.cmake | 5 +++++ .../message/message-log-level-override-stderr.txt | 12 ++++++++++++ .../message/message-log-level-override-stdout.txt | 3 +++ 11 files changed, 64 insertions(+) create mode 100644 Help/release/dev/feature-CMAKE_MESSAGE_CONTEXT create mode 100644 Help/variable/CMAKE_MESSAGE_LOG_LEVEL.rst create mode 100644 Tests/RunCMake/message/message-log-level-override-stderr.txt create mode 100644 Tests/RunCMake/message/message-log-level-override-stdout.txt diff --git a/Help/command/message.rst b/Help/command/message.rst index c614286c110..1acf30a00fe 100644 --- a/Help/command/message.rst +++ b/Help/command/message.rst @@ -59,6 +59,9 @@ The :manual:`curses interface ` shows ``STATUS`` to ``TRACE`` messages one at a time on a status line and other messages in an interactive pop-up box. The ``--log-level`` command-line option to each of these tools can be used to control which messages will be shown. +To make a log level persist between CMake runs, the +:variable:`CMAKE_MESSAGE_LOG_LEVEL` variable can be set instead. +Note that the command line option takes precedence over the cache variable. Messages of log levels ``NOTICE`` and below will also have each line preceded by the content of the :variable:`CMAKE_MESSAGE_INDENT` variable (converted to diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index 9b24b5a8898..782a0f06974 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -205,6 +205,7 @@ Variables that Change Behavior /variable/CMAKE_MFC_FLAG /variable/CMAKE_MAXIMUM_RECURSION_DEPTH /variable/CMAKE_MESSAGE_INDENT + /variable/CMAKE_MESSAGE_LOG_LEVEL /variable/CMAKE_MODULE_PATH /variable/CMAKE_POLICY_DEFAULT_CMPNNNN /variable/CMAKE_POLICY_WARNING_CMPNNNN diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index 4ab55a0d0f4..08b7534dd5f 100644 --- a/Help/manual/cmake.1.rst +++ b/Help/manual/cmake.1.rst @@ -206,6 +206,11 @@ Options The :command:`message` command will only output messages of the specified log level or higher. The default log level is ``STATUS``. + To make a log level persist between CMake runs, set + :variable:`CMAKE_MESSAGE_LOG_LEVEL` as a cache variable instead. + If both the command line option and the variable are given, the command line + option takes precedence. + For backward compatibility reasons, ``--loglevel`` is also accepted as a synonym for this option. diff --git a/Help/release/dev/feature-CMAKE_MESSAGE_CONTEXT b/Help/release/dev/feature-CMAKE_MESSAGE_CONTEXT new file mode 100644 index 00000000000..eb24e201b38 --- /dev/null +++ b/Help/release/dev/feature-CMAKE_MESSAGE_CONTEXT @@ -0,0 +1,6 @@ +feature-CMAKE_MESSAGE_CONTEXT +----------------------------- + +* The :variable:`CMAKE_MESSAGE_LOG_LEVEL` variable can now be used + to persist a log level between CMake runs, unlike the ``--log-level`` + command line option which only applies to that particular run. diff --git a/Help/variable/CMAKE_MESSAGE_LOG_LEVEL.rst b/Help/variable/CMAKE_MESSAGE_LOG_LEVEL.rst new file mode 100644 index 00000000000..1d4cfe6c60d --- /dev/null +++ b/Help/variable/CMAKE_MESSAGE_LOG_LEVEL.rst @@ -0,0 +1,15 @@ +CMAKE_MESSAGE_LOG_LEVEL +----------------------- + +When set, this variable specifies the logging level used by the +:command:`message` command. Valid values are the same as those for the +``--log-level`` command line option of the :manual:`cmake(1)` program. +If this variable is set and the ``--log-level`` command line option is +given, the command line option takes precedence. + +The main advantage to using this variable is to make a log level persist +between CMake runs. Setting it as a cache variable will ensure that +subsequent CMake runs will continue to use the chosen log level. + +Projects should not set this variable, it is intended for users so that +they may control the log level according to their own needs. diff --git a/Source/cmMessageCommand.cxx b/Source/cmMessageCommand.cxx index 15c007c07b4..5fee5cac776 100644 --- a/Source/cmMessageCommand.cxx +++ b/Source/cmMessageCommand.cxx @@ -95,6 +95,15 @@ bool cmMessageCommand(std::vector const& args, assert("Expected a valid log level here" && desiredLevel != cmake::LogLevel::LOG_UNDEFINED); + // Command line option takes precedence over the cache variable + if (!mf.GetCMakeInstance()->WasLogLevelSetViaCLI()) { + const auto desiredLevelFromCache = + cmake::StringToLogLevel(mf.GetSafeDefinition("CMAKE_MESSAGE_LOG_LEVEL")); + if (desiredLevelFromCache != cmake::LogLevel::LOG_UNDEFINED) { + desiredLevel = desiredLevelFromCache; + } + } + if (desiredLevel < level) { // Suppress the message return true; diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 50f47af3f1e..eb35aba4f3d 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -733,6 +733,7 @@ void cmake::SetArgs(const std::vector& args) return; } this->SetLogLevel(logLevel); + this->LogLevelWasSetViaCLI = true; } else if (arg.find("--loglevel=", 0) == 0) { // This is supported for backward compatibility. This option only // appeared in the 3.15.x release series and was renamed to @@ -744,6 +745,7 @@ void cmake::SetArgs(const std::vector& args) return; } this->SetLogLevel(logLevel); + this->LogLevelWasSetViaCLI = true; } else if (arg.find("--trace-expand", 0) == 0) { std::cout << "Running with expanded trace output on.\n"; this->SetTrace(true); diff --git a/Source/cmake.h b/Source/cmake.h index 687c1056b17..1cf3592aa87 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -380,6 +380,8 @@ class cmake */ cmFileTimeCache* GetFileTimeCache() { return this->FileTimeCache.get(); } + bool WasLogLevelSetViaCLI() const { return this->LogLevelWasSetViaCLI; } + //! Get the selected log level for `message()` commands during the cmake run. LogLevel GetLogLevel() const { return this->MessageLogLevel; } void SetLogLevel(LogLevel level) { this->MessageLogLevel = level; } @@ -587,6 +589,7 @@ class cmake std::vector TraceOnlyThisSources; LogLevel MessageLogLevel = LogLevel::LOG_STATUS; + bool LogLevelWasSetViaCLI = false; void UpdateConversionPathTable(); diff --git a/Tests/RunCMake/message/RunCMakeTest.cmake b/Tests/RunCMake/message/RunCMakeTest.cmake index 9198a25f6e3..50271d4a5b3 100644 --- a/Tests/RunCMake/message/RunCMakeTest.cmake +++ b/Tests/RunCMake/message/RunCMakeTest.cmake @@ -55,6 +55,11 @@ foreach(opt IN ITEMS loglevel log-level) ) endforeach() +run_cmake_command( + message-log-level-override + ${CMAKE_COMMAND} --log-level=debug -DCMAKE_MESSAGE_LOG_LEVEL=TRACE -P ${RunCMake_SOURCE_DIR}/message-all-loglevels.cmake + ) + run_cmake_command( message-indent ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/message-indent.cmake diff --git a/Tests/RunCMake/message/message-log-level-override-stderr.txt b/Tests/RunCMake/message/message-log-level-override-stderr.txt new file mode 100644 index 00000000000..efec736fe6c --- /dev/null +++ b/Tests/RunCMake/message/message-log-level-override-stderr.txt @@ -0,0 +1,12 @@ +^CMake Deprecation Warning at.*/Tests/RunCMake/message/message-all-loglevels\.cmake:2 \(message\): + Deprecation warning ++ +CMake Warning \(dev\) at.*/Tests/RunCMake/message/message-all-loglevels\.cmake:3 \(message\): + Author warning message +This warning is for project developers\. Use -Wno-dev to suppress it\. ++ +CMake Warning at.*/Tests/RunCMake/message/message-all-loglevels\.cmake:4 \(message\): + Warning message ++ +Default NOTICE message +NOTICE message$ diff --git a/Tests/RunCMake/message/message-log-level-override-stdout.txt b/Tests/RunCMake/message/message-log-level-override-stdout.txt new file mode 100644 index 00000000000..feee110915a --- /dev/null +++ b/Tests/RunCMake/message/message-log-level-override-stdout.txt @@ -0,0 +1,3 @@ +-- STATUS message +-- VERBOSE message +-- DEBUG message$ From 7cf79f44195a86a907dba770f1f7a361d00e77c2 Mon Sep 17 00:00:00 2001 From: Alex Turbov Date: Sat, 12 Oct 2019 13:37:15 +1100 Subject: [PATCH 016/662] message: Support logging a context with each message --- Help/command/message.rst | 13 +++- Help/manual/cmake-variables.7.rst | 2 + Help/manual/cmake.1.rst | 10 +++ .../release/dev/feature-CMAKE_MESSAGE_CONTEXT | 5 ++ Help/variable/CMAKE_MESSAGE_CONTEXT.rst | 62 +++++++++++++++++++ Help/variable/CMAKE_MESSAGE_CONTEXT_SHOW.rst | 15 +++++ Source/cmMessageCommand.cxx | 25 +++++--- Source/cmake.cxx | 2 + Source/cmake.h | 5 ++ Source/cmakemain.cxx | 1 + Tests/RunCMake/message/RunCMakeTest.cmake | 15 +++++ .../message/message-context-cache-stdout.txt | 8 +++ .../message/message-context-cli-stdout.txt | 8 +++ .../message-context-cli-wins-cache-stdout.txt | 5 ++ Tests/RunCMake/message/message-context.cmake | 27 ++++++++ 15 files changed, 194 insertions(+), 9 deletions(-) create mode 100644 Help/variable/CMAKE_MESSAGE_CONTEXT.rst create mode 100644 Help/variable/CMAKE_MESSAGE_CONTEXT_SHOW.rst create mode 100644 Tests/RunCMake/message/message-context-cache-stdout.txt create mode 100644 Tests/RunCMake/message/message-context-cli-stdout.txt create mode 100644 Tests/RunCMake/message/message-context-cli-wins-cache-stdout.txt create mode 100644 Tests/RunCMake/message/message-context.cmake diff --git a/Help/command/message.rst b/Help/command/message.rst index 1acf30a00fe..beb820ade4a 100644 --- a/Help/command/message.rst +++ b/Help/command/message.rst @@ -63,11 +63,22 @@ To make a log level persist between CMake runs, the :variable:`CMAKE_MESSAGE_LOG_LEVEL` variable can be set instead. Note that the command line option takes precedence over the cache variable. -Messages of log levels ``NOTICE`` and below will also have each line preceded +Messages of log levels ``NOTICE`` and below will have each line preceded by the content of the :variable:`CMAKE_MESSAGE_INDENT` variable (converted to a single string by concatenating its list items). For ``STATUS`` to ``TRACE`` messages, this indenting content will be inserted after the hyphens. +Messages of log levels ``NOTICE`` and below can also have each line preceded +with context of the form ``[some.context.example]``. The content between the +square brackets is obtained by converting the :variable:`CMAKE_MESSAGE_CONTEXT` +list variable to a dot-separated string. The message context will always +appear before any indenting content but after any automatically added leading +hyphens. By default, message context is not shown, it has to be explicitly +enabled by giving the :manual:`cmake ` ``--log-context`` +command-line option or by setting the :variable:`CMAKE_MESSAGE_CONTEXT_SHOW` +variable to true. See the :variable:`CMAKE_MESSAGE_CONTEXT` documentation for +usage examples. + CMake Warning and Error message text displays using a simple markup language. Non-indented text is formatted in line-wrapped paragraphs delimited by newlines. Indented text is considered pre-formatted. diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index 782a0f06974..cad0df6dafb 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -204,6 +204,8 @@ Variables that Change Behavior /variable/CMAKE_LINK_DIRECTORIES_BEFORE /variable/CMAKE_MFC_FLAG /variable/CMAKE_MAXIMUM_RECURSION_DEPTH + /variable/CMAKE_MESSAGE_CONTEXT + /variable/CMAKE_MESSAGE_CONTEXT_SHOW /variable/CMAKE_MESSAGE_INDENT /variable/CMAKE_MESSAGE_LOG_LEVEL /variable/CMAKE_MODULE_PATH diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index 08b7534dd5f..71110d1de99 100644 --- a/Help/manual/cmake.1.rst +++ b/Help/manual/cmake.1.rst @@ -214,6 +214,16 @@ Options For backward compatibility reasons, ``--loglevel`` is also accepted as a synonym for this option. +``--log-context`` + Enable the :command:`message` command outputting context attached to each + message. + + This option turns on showing context for the current CMake run only. + To make showing the context persistent for all subsequent CMake runs, set + :variable:`CMAKE_MESSAGE_CONTEXT_SHOW` as a cache variable instead. + When this command line option is given, :variable:`CMAKE_MESSAGE_CONTEXT_SHOW` + is ignored. + ``--debug-trycompile`` Do not delete the :command:`try_compile` build tree. Only useful on one :command:`try_compile` at a time. diff --git a/Help/release/dev/feature-CMAKE_MESSAGE_CONTEXT b/Help/release/dev/feature-CMAKE_MESSAGE_CONTEXT index eb24e201b38..a6a5c71a712 100644 --- a/Help/release/dev/feature-CMAKE_MESSAGE_CONTEXT +++ b/Help/release/dev/feature-CMAKE_MESSAGE_CONTEXT @@ -4,3 +4,8 @@ feature-CMAKE_MESSAGE_CONTEXT * The :variable:`CMAKE_MESSAGE_LOG_LEVEL` variable can now be used to persist a log level between CMake runs, unlike the ``--log-level`` command line option which only applies to that particular run. + +* The :command:`message` command learned to output context provided in + the :variable:`CMAKE_MESSAGE_CONTEXT` variable for log levels + ``NOTICE`` and below. Enable this output with the new ``--log-context`` + command-line option or :variable:`CMAKE_MESSAGE_CONTEXT_SHOW` variable. diff --git a/Help/variable/CMAKE_MESSAGE_CONTEXT.rst b/Help/variable/CMAKE_MESSAGE_CONTEXT.rst new file mode 100644 index 00000000000..6b4ca403291 --- /dev/null +++ b/Help/variable/CMAKE_MESSAGE_CONTEXT.rst @@ -0,0 +1,62 @@ +CMAKE_MESSAGE_CONTEXT +--------------------- + +When enabled by the :manual:`cmake ` ``--log-context`` command line +option or the :variable:`CMAKE_MESSAGE_CONTEXT_SHOW` variable, the +:command:`message` command converts the ``CMAKE_MESSAGE_CONTEXT`` list into a +dot-separated string surrounded by square brackets and prepends it to each line +for messages of log levels ``NOTICE`` and below. + +For logging contexts to work effectively, projects should generally +``APPEND`` and ``POP_BACK`` an item to the current value of +``CMAKE_MESSAGE_CONTEXT`` rather than replace it. +Projects should not assume the message context at the top of the source tree +is empty, as there are scenarios where the context might have already been set +(e.g. hierarchical projects). + +.. warning:: + + Valid context names are restricted to anything that could be used + as a CMake variable name. All names that begin with an underscore + or the string ``cmake_`` are also reserved for use by CMake and + should not be used by projects. + +Example: + +.. code-block:: cmake + + function(bar) + list(APPEND CMAKE_MESSAGE_CONTEXT "bar") + message(VERBOSE "bar VERBOSE message") + endfunction() + + function(baz) + list(APPEND CMAKE_MESSAGE_CONTEXT "baz") + message(DEBUG "baz DEBUG message") + endfunction() + + function(foo) + list(APPEND CMAKE_MESSAGE_CONTEXT "foo") + bar() + message(TRACE "foo TRACE message") + baz() + endfunction() + + list(APPEND CMAKE_MESSAGE_CONTEXT "top") + + message(VERBOSE "Before `foo`") + foo() + message(VERBOSE "After `foo`") + + list(POP_BACK CMAKE_MESSAGE_CONTEXT) + + +Which results in the following output: + +.. code-block:: none + + -- [top] Before `foo` + -- [top.foo.bar] bar VERBOSE message + -- [top.foo] foo TRACE message + -- [top.foo.baz] baz DEBUG message + -- [top] After `foo` diff --git a/Help/variable/CMAKE_MESSAGE_CONTEXT_SHOW.rst b/Help/variable/CMAKE_MESSAGE_CONTEXT_SHOW.rst new file mode 100644 index 00000000000..7ec218e04e6 --- /dev/null +++ b/Help/variable/CMAKE_MESSAGE_CONTEXT_SHOW.rst @@ -0,0 +1,15 @@ +CMAKE_MESSAGE_CONTEXT_SHOW +-------------------------- + +Setting this variable to true enables showing a context with each line +logged by the :command:`message` command (see :variable:`CMAKE_MESSAGE_CONTEXT` +for how the context itself is specified). + +This variable is an alternative to providing the ``--log-context`` option +on the :manual:`cmake ` command line. Whereas the command line +option will apply only to that one CMake run, setting +``CMAKE_MESSAGE_CONTEXT_SHOW`` to true as a cache variable will ensure that +subsequent CMake runs will continue to show the message context. + +Projects should not set ``CMAKE_MESSAGE_CONTEXT_SHOW``. It is intended for +users so that they may control whether or not to include context with messages. diff --git a/Source/cmMessageCommand.cxx b/Source/cmMessageCommand.cxx index 5fee5cac776..24ac71a5c46 100644 --- a/Source/cmMessageCommand.cxx +++ b/Source/cmMessageCommand.cxx @@ -112,16 +112,25 @@ bool cmMessageCommand(std::vector const& args, auto message = cmJoin(cmMakeRange(i, args.cend()), ""); if (cmake::LogLevel::LOG_NOTICE <= level) { - // Check if any indentation has requested: - // `CMAKE_MESSAGE_INDENT` is a list of "padding" pieces - // to be joined and prepended to the message lines. auto indent = cmJoin(cmExpandedList(mf.GetSafeDefinition("CMAKE_MESSAGE_INDENT")), ""); - // Make every line of the `message` indented - // NOTE Can't reuse `cmDocumentationFormatter::PrintPreformatted` - // here cuz it appends `\n` to the EOM ;-( - cmSystemTools::ReplaceString(message, "\n", "\n" + indent); - message = indent + message; + if (!indent.empty()) { + cmSystemTools::ReplaceString(message, "\n", "\n" + indent); + message = indent + message; + } + + const auto showContext = mf.GetCMakeInstance()->GetShowLogContext() || + mf.IsOn("CMAKE_MESSAGE_CONTEXT_SHOW"); + if (showContext) { + // Output the current context (if any) + auto context = cmJoin( + cmExpandedList(mf.GetSafeDefinition("CMAKE_MESSAGE_CONTEXT")), "."); + if (!context.empty()) { + context = "[" + context + "] "; + cmSystemTools::ReplaceString(message, "\n", "\n" + context); + message = context + message; + } + } } switch (level) { diff --git a/Source/cmake.cxx b/Source/cmake.cxx index eb35aba4f3d..563d077d18f 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -746,6 +746,8 @@ void cmake::SetArgs(const std::vector& args) } this->SetLogLevel(logLevel); this->LogLevelWasSetViaCLI = true; + } else if (arg == "--log-context") { + this->SetShowLogContext(true); } else if (arg.find("--trace-expand", 0) == 0) { std::cout << "Running with expanded trace output on.\n"; this->SetTrace(true); diff --git a/Source/cmake.h b/Source/cmake.h index 1cf3592aa87..c2f2cce1ccd 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -391,6 +391,10 @@ class cmake bool GetDebugOutput() { return this->DebugOutput; } void SetDebugOutputOn(bool b) { this->DebugOutput = b; } + //! Should `message` command display context. + bool GetShowLogContext() const { return this->LogContext; } + void SetShowLogContext(bool b) { this->LogContext = b; } + //! Do we want trace output during the cmake run. bool GetTrace() { return this->Trace; } void SetTrace(bool b) { this->Trace = b; } @@ -590,6 +594,7 @@ class cmake LogLevel MessageLogLevel = LogLevel::LOG_STATUS; bool LogLevelWasSetViaCLI = false; + bool LogContext = false; void UpdateConversionPathTable(); diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 6d3e6ee3003..baf975ecb20 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -73,6 +73,7 @@ const char* cmDocumentationOptions[][2] = { { "--log-level=", "Set the verbosity of messages from CMake files. " "--loglevel is also accepted for backward compatibility reasons." }, + { "--log-context", "Prepend log messages with context, if given" }, { "--debug-trycompile", "Do not delete the try_compile build tree. Only " "useful on one try_compile at a time." }, diff --git a/Tests/RunCMake/message/RunCMakeTest.cmake b/Tests/RunCMake/message/RunCMakeTest.cmake index 50271d4a5b3..bf6a47e381f 100644 --- a/Tests/RunCMake/message/RunCMakeTest.cmake +++ b/Tests/RunCMake/message/RunCMakeTest.cmake @@ -68,3 +68,18 @@ run_cmake_command( message-indent-multiline ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/message-indent-multiline.cmake ) + +run_cmake_command( + message-context-cli + ${CMAKE_COMMAND} --log-level=trace --log-context -P ${RunCMake_SOURCE_DIR}/message-context.cmake + ) + +run_cmake_command( + message-context-cache + ${CMAKE_COMMAND} -DCMAKE_MESSAGE_LOG_LEVEL=TRACE -DCMAKE_MESSAGE_CONTEXT_SHOW=ON -P ${RunCMake_SOURCE_DIR}/message-context.cmake + ) + +run_cmake_command( + message-context-cli-wins-cache + ${CMAKE_COMMAND} --log-level=verbose --log-context -DCMAKE_MESSAGE_CONTEXT_SHOW=OFF -P ${RunCMake_SOURCE_DIR}/message-context.cmake + ) diff --git a/Tests/RunCMake/message/message-context-cache-stdout.txt b/Tests/RunCMake/message/message-context-cache-stdout.txt new file mode 100644 index 00000000000..af18c15d283 --- /dev/null +++ b/Tests/RunCMake/message/message-context-cache-stdout.txt @@ -0,0 +1,8 @@ +-- Begin context output test +-- \[top\] Top: before +-- \[top\.foo\.bar\] <-- indent -->bar VERBOSE message +-- \[top\.foo\] foo TRACE message +-- \[top\.foo\.baz\] This is the multi-line +\[top\.foo\.baz\] baz DEBUG message +-- \[top\] Top: after +-- End of context output test diff --git a/Tests/RunCMake/message/message-context-cli-stdout.txt b/Tests/RunCMake/message/message-context-cli-stdout.txt new file mode 100644 index 00000000000..af18c15d283 --- /dev/null +++ b/Tests/RunCMake/message/message-context-cli-stdout.txt @@ -0,0 +1,8 @@ +-- Begin context output test +-- \[top\] Top: before +-- \[top\.foo\.bar\] <-- indent -->bar VERBOSE message +-- \[top\.foo\] foo TRACE message +-- \[top\.foo\.baz\] This is the multi-line +\[top\.foo\.baz\] baz DEBUG message +-- \[top\] Top: after +-- End of context output test diff --git a/Tests/RunCMake/message/message-context-cli-wins-cache-stdout.txt b/Tests/RunCMake/message/message-context-cli-wins-cache-stdout.txt new file mode 100644 index 00000000000..157db97d11f --- /dev/null +++ b/Tests/RunCMake/message/message-context-cli-wins-cache-stdout.txt @@ -0,0 +1,5 @@ +-- Begin context output test +-- \[top\] Top: before +-- \[top\.foo\.bar\] <-- indent -->bar VERBOSE message +-- \[top\] Top: after +-- End of context output test diff --git a/Tests/RunCMake/message/message-context.cmake b/Tests/RunCMake/message/message-context.cmake new file mode 100644 index 00000000000..93d4cd9114c --- /dev/null +++ b/Tests/RunCMake/message/message-context.cmake @@ -0,0 +1,27 @@ +function(bar) + list(APPEND CMAKE_MESSAGE_CONTEXT "bar") + list(APPEND CMAKE_MESSAGE_INDENT "<-- indent -->") + message(VERBOSE "bar VERBOSE message") +endfunction() + +function(baz) + list(APPEND CMAKE_MESSAGE_CONTEXT "baz") + message(DEBUG "This is the multi-line\nbaz DEBUG message") +endfunction() + +function(foo) + list(APPEND CMAKE_MESSAGE_CONTEXT "foo") + bar() + message(TRACE "foo TRACE message") + baz() +endfunction() + +message(STATUS "Begin context output test") +list(APPEND CMAKE_MESSAGE_CONTEXT "top") + +message(STATUS "Top: before") +foo() +message(STATUS "Top: after") + +list(POP_BACK CMAKE_MESSAGE_CONTEXT) +message(STATUS "End of context output test") From 001a1d2686243698527d59a9e5d002bbbb87a259 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Sun, 13 Oct 2019 00:01:09 -0400 Subject: [PATCH 017/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index d6afa4b39f2..1d575baed41 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191012) +set(CMake_VERSION_PATCH 20191013) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From 30f0319e7f11f299cbe113b2c4db9f9c9a6ea21c Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Mon, 14 Oct 2019 00:01:06 -0400 Subject: [PATCH 018/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 1d575baed41..32b76868808 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191013) +set(CMake_VERSION_PATCH 20191014) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From daf6a6ba68a6fa1c5d1956f151104d903f3447cc Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Tue, 15 Oct 2019 00:01:05 -0400 Subject: [PATCH 019/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 32b76868808..458cc866f8f 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191014) +set(CMake_VERSION_PATCH 20191015) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From c5892e484e21f49abf2afd138dddd6720bf91adc Mon Sep 17 00:00:00 2001 From: Butta Date: Tue, 15 Oct 2019 13:24:02 +0530 Subject: [PATCH 020/662] Android: add support for native compilation, such as with the Termux app The CMake support for Android assumes cross-compilation using the NDK, so stub out that Android NDK support and use the Linux support that's already invoked. Set CMAKE_HOST_SYSTEM_NAME to "Android", rather than "Linux". Issue: #19840 --- Modules/CMakeDetermineSystem.cmake | 2 +- Modules/Platform/Android-Clang.cmake | 8 ++++++++ Modules/Platform/Android-Determine.cmake | 6 ++++++ Modules/Platform/Android-Initialize.cmake | 6 ++++++ Modules/Platform/Android.cmake | 5 +++++ Modules/Platform/Android/Determine-Compiler.cmake | 10 ++++++++++ Source/cmStateSnapshot.cxx | 4 ++++ 7 files changed, 40 insertions(+), 1 deletion(-) diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake index dc208c600d1..f3ec4da2d91 100644 --- a/Modules/CMakeDetermineSystem.cmake +++ b/Modules/CMakeDetermineSystem.cmake @@ -43,7 +43,7 @@ if(CMAKE_HOST_UNIX) else() exec_program(${CMAKE_UNAME} ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION) endif() - if(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*|Darwin|^GNU$") + if(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*|Darwin|^GNU$|Android") exec_program(${CMAKE_UNAME} ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR RETURN_VALUE val) if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin" AND diff --git a/Modules/Platform/Android-Clang.cmake b/Modules/Platform/Android-Clang.cmake index 847178fbd49..759448b8ec4 100644 --- a/Modules/Platform/Android-Clang.cmake +++ b/Modules/Platform/Android-Clang.cmake @@ -24,6 +24,14 @@ if(CMAKE_SYSTEM_VERSION EQUAL 1) return() endif() +# Natively compiling on an Android host doesn't use the NDK cross-compilation +# tools. +if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Android") + macro(__android_compiler_clang lang) + endmacro() + return() +endif() + include(Platform/Android-Common) # The NDK toolchain configuration files at: diff --git a/Modules/Platform/Android-Determine.cmake b/Modules/Platform/Android-Determine.cmake index e7c1b48a94f..2225897fab2 100644 --- a/Modules/Platform/Android-Determine.cmake +++ b/Modules/Platform/Android-Determine.cmake @@ -18,6 +18,12 @@ if(CMAKE_SYSTEM_VERSION EQUAL 1) return() endif() +# Natively compiling on an Android host doesn't use the NDK cross-compilation +# tools. +if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Android") + return() +endif() + cmake_policy(PUSH) cmake_policy(SET CMP0057 NEW) # if IN_LIST diff --git a/Modules/Platform/Android-Initialize.cmake b/Modules/Platform/Android-Initialize.cmake index a5d282085ea..b90dd7a569f 100644 --- a/Modules/Platform/Android-Initialize.cmake +++ b/Modules/Platform/Android-Initialize.cmake @@ -24,6 +24,12 @@ if(CMAKE_ANDROID_NDK_TOOLCHAIN_UNIFIED) return() endif() +# Natively compiling on an Android host doesn't use the NDK cross-compilation +# tools. +if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Android") + return() +endif() + if(NOT CMAKE_SYSROOT) if(CMAKE_ANDROID_NDK) set(CMAKE_SYSROOT "${CMAKE_ANDROID_NDK}/platforms/android-${CMAKE_SYSTEM_VERSION}/arch-${CMAKE_ANDROID_ARCH}") diff --git a/Modules/Platform/Android.cmake b/Modules/Platform/Android.cmake index f08f84176d0..8ffa1b2d3b3 100644 --- a/Modules/Platform/Android.cmake +++ b/Modules/Platform/Android.cmake @@ -2,6 +2,11 @@ include(Platform/Linux) set(ANDROID 1) +# Natively compiling on an Android host doesn't need these flags to be reset. +if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Android") + return() +endif() + # Conventionally Android does not use versioned soname # But in modern versions it is acceptable if(NOT DEFINED CMAKE_PLATFORM_NO_VERSIONED_SONAME) diff --git a/Modules/Platform/Android/Determine-Compiler.cmake b/Modules/Platform/Android/Determine-Compiler.cmake index 5c6b97b8bcb..f9c2d8968ac 100644 --- a/Modules/Platform/Android/Determine-Compiler.cmake +++ b/Modules/Platform/Android/Determine-Compiler.cmake @@ -31,6 +31,16 @@ elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") set(_ANDROID_HOST_EXT "") elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") set(_ANDROID_HOST_EXT ".exe") +elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Android") + # Natively compiling on an Android host doesn't use the NDK cross-compilation + # tools. + macro(__android_determine_compiler lang) + # Do nothing + endmacro() + if(NOT CMAKE_CXX_COMPILER_NAMES) + set(CMAKE_CXX_COMPILER_NAMES c++) + endif() + return() else() message(FATAL_ERROR "Android: Builds hosted on '${CMAKE_HOST_SYSTEM_NAME}' not supported.") endif() diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx index 645907c21e2..832e74ec7f1 100644 --- a/Source/cmStateSnapshot.cxx +++ b/Source/cmStateSnapshot.cxx @@ -315,10 +315,14 @@ void cmStateSnapshot::SetDefaultDefinitions() this->SetDefinition("UNIX", "1"); this->SetDefinition("CMAKE_HOST_UNIX", "1"); +# if defined(__ANDROID__) + this->SetDefinition("CMAKE_HOST_SYSTEM_NAME", "Android"); +# else struct utsname uts_name; if (uname(&uts_name) >= 0) { this->SetDefinition("CMAKE_HOST_SYSTEM_NAME", uts_name.sysname); } +# endif #endif #if defined(__CYGWIN__) std::string legacy; From 89ff3ee779f54e982e96b21b7d370371e639cc6f Mon Sep 17 00:00:00 2001 From: Charly Mourglia Date: Wed, 2 Oct 2019 21:06:58 +0200 Subject: [PATCH 021/662] VS: Add VS_DOTNET_DOCUMENTATION_FILE property Add a `VS_DOTNET_DOCUMENTATION_FILE` target property to tell VS generators to add a `DocumentationFile` setting in `.csproj` files. Fixes: #19784 --- Help/manual/cmake-properties.7.rst | 1 + .../prop_tgt/VS_DOTNET_DOCUMENTATION_FILE.rst | 6 +++++ .../dev/vs_dotnet_documentation_file.rst | 6 +++++ Source/cmVisualStudio10TargetGenerator.cxx | 14 ++++++++++ Source/cmVisualStudio10TargetGenerator.h | 1 + Tests/RunCMake/VS10Project/RunCMakeTest.cmake | 1 + .../VsCSharpDocumentationFile-check.cmake | 26 +++++++++++++++++++ .../VsCSharpDocumentationFile.cmake | 8 ++++++ 8 files changed, 63 insertions(+) create mode 100644 Help/prop_tgt/VS_DOTNET_DOCUMENTATION_FILE.rst create mode 100644 Help/release/dev/vs_dotnet_documentation_file.rst create mode 100644 Tests/RunCMake/VS10Project/VsCSharpDocumentationFile-check.cmake create mode 100644 Tests/RunCMake/VS10Project/VsCSharpDocumentationFile.cmake diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index 1369aa37062..02e07eb7b02 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -342,6 +342,7 @@ Properties on Targets /prop_tgt/VS_DOTNET_REFERENCES /prop_tgt/VS_DOTNET_REFERENCES_COPY_LOCAL /prop_tgt/VS_DOTNET_TARGET_FRAMEWORK_VERSION + /prop_tgt/VS_DOTNET_DOCUMENTATION_FILE /prop_tgt/VS_DPI_AWARE /prop_tgt/VS_GLOBAL_KEYWORD /prop_tgt/VS_GLOBAL_PROJECT_TYPES diff --git a/Help/prop_tgt/VS_DOTNET_DOCUMENTATION_FILE.rst b/Help/prop_tgt/VS_DOTNET_DOCUMENTATION_FILE.rst new file mode 100644 index 00000000000..1bc361c3da4 --- /dev/null +++ b/Help/prop_tgt/VS_DOTNET_DOCUMENTATION_FILE.rst @@ -0,0 +1,6 @@ +VS_DOTNET_DOCUMENTATION_FILE +---------------------------- + +Visual Studio managed project .NET documentation output + +Sets the target XML documentation file output. diff --git a/Help/release/dev/vs_dotnet_documentation_file.rst b/Help/release/dev/vs_dotnet_documentation_file.rst new file mode 100644 index 00000000000..fdffb1cfcc6 --- /dev/null +++ b/Help/release/dev/vs_dotnet_documentation_file.rst @@ -0,0 +1,6 @@ +vs_dotnet_documentation_file +---------------------------- + +* The :prop_tgt:`VS_DOTNET_DOCUMENTATION_FILE` target property was added + to tell :ref:`Visual Studio Generators` to generate a ``DocumentationFile`` + reference in ``.csproj`` files. diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 3843bf24c44..ca24a0f06d0 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -676,6 +676,8 @@ void cmVisualStudio10TargetGenerator::Generate() this->WritePlatformExtensions(e1); } + + this->WriteDotNetDocumentationFile(e0); Elem(e0, "PropertyGroup").Attribute("Label", "UserMacros"); this->WriteWinRTPackageCertificateKeyFile(e0); this->WritePathAndIncrementalLinkOptions(e0); @@ -910,6 +912,18 @@ void cmVisualStudio10TargetGenerator::WriteDotNetReferenceCustomTags( } } +void cmVisualStudio10TargetGenerator::WriteDotNetDocumentationFile(Elem& e0) +{ + std::string const documentationFile = + this->GeneratorTarget->GetSafeProperty("VS_DOTNET_DOCUMENTATION_FILE"); + + if (this->ProjectType == csproj && !documentationFile.empty()) { + Elem e1(e0, "PropertyGroup"); + Elem e2(e1, "DocumentationFile"); + e2.Content(documentationFile); + } +} + void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup(Elem& e0) { std::vector resxObjs; diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h index a18a33dd89d..0835cde9f76 100644 --- a/Source/cmVisualStudio10TargetGenerator.h +++ b/Source/cmVisualStudio10TargetGenerator.h @@ -79,6 +79,7 @@ class cmVisualStudio10TargetGenerator void WriteDotNetReference(Elem& e1, std::string const& ref, std::string const& hint, std::string const& config); + void WriteDotNetDocumentationFile(Elem& e0); void WriteImports(Elem& e0); void WriteDotNetReferenceCustomTags(Elem& e2, std::string const& ref); void WriteEmbeddedResourceGroup(Elem& e0); diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake index 44ccd6b5854..ebc4d1c9c59 100644 --- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake +++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake @@ -15,6 +15,7 @@ run_cmake(VsDebuggerCommand) run_cmake(VsDebuggerCommandArguments) run_cmake(VsDebuggerEnvironment) run_cmake(VsCSharpCustomTags) +run_cmake(VsCSharpDocumentationFile) run_cmake(VsCSharpReferenceProps) run_cmake(VsCSharpWithoutSources) run_cmake(VsCSharpDeployFiles) diff --git a/Tests/RunCMake/VS10Project/VsCSharpDocumentationFile-check.cmake b/Tests/RunCMake/VS10Project/VsCSharpDocumentationFile-check.cmake new file mode 100644 index 00000000000..0393362d628 --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsCSharpDocumentationFile-check.cmake @@ -0,0 +1,26 @@ +# +# Check C# VS project for required elements +# +set(csProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.csproj") +if(NOT EXISTS "${csProjectFile}") + set(RunCMake_TEST_FAILED "Project file ${csProjectFile} does not exist.") + return() +endif() + +file(STRINGS "${csProjectFile}" lines) + +set(HAVE_DocumentationFile 0) +foreach(line IN LISTS lines) + if(line MATCHES "^ *([^<>]+)") + if(HAVE_DocumentationFile) + set(RunCMake_TEST_FAILED "Documentation node has been generated more than once for\n ${csProjectFile}") + return() + endif() + set(HAVE_DocumentationFile 1) + endif() +endforeach() + +if(NOT HAVE_DocumentationFile) + set(RunCMake_TEST_FAILED "Documentation node has not been generated for\n ${csProjectFile}") + return() +endif() diff --git a/Tests/RunCMake/VS10Project/VsCSharpDocumentationFile.cmake b/Tests/RunCMake/VS10Project/VsCSharpDocumentationFile.cmake new file mode 100644 index 00000000000..83b6b970651 --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsCSharpDocumentationFile.cmake @@ -0,0 +1,8 @@ +set(CMAKE_CONFIGURATION_TYPES Debug) +enable_language(CSharp) + +add_library(foo SHARED + foo.cs) + +set_target_properties(foo PROPERTIES + VS_DOTNET_DOCUMENTATION_FILE foo.xml) From 99e83d423500e11a8e85c2032e8c536bce175ed1 Mon Sep 17 00:00:00 2001 From: Alexander Boczar Date: Fri, 13 Sep 2019 17:32:13 -0700 Subject: [PATCH 022/662] cmake: Teach --build mode to load CMAKE_GENERATOR_TOOLSET Extend the `cmGlobalGenerator::SetGeneratorToolset` signature to indicate when it is called from `cmake::build`. --- Source/cmGlobalGenerator.cxx | 4 ++-- Source/cmGlobalGenerator.h | 3 ++- Source/cmGlobalGhsMultiGenerator.cxx | 5 ++++- Source/cmGlobalGhsMultiGenerator.h | 3 ++- Source/cmGlobalVisualStudio10Generator.cxx | 6 +++++- Source/cmGlobalVisualStudio10Generator.h | 3 ++- Source/cmGlobalXCodeGenerator.cxx | 5 ++++- Source/cmGlobalXCodeGenerator.h | 3 ++- Source/cmake.cxx | 8 ++++++++ 9 files changed, 31 insertions(+), 9 deletions(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 96656a59978..2efafc64bad 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -165,7 +165,7 @@ bool cmGlobalGenerator::SetGeneratorPlatform(std::string const& p, return false; } -bool cmGlobalGenerator::SetGeneratorToolset(std::string const& ts, +bool cmGlobalGenerator::SetGeneratorToolset(std::string const& ts, bool, cmMakefile* mf) { if (ts.empty()) { @@ -650,7 +650,7 @@ void cmGlobalGenerator::EnableLanguage( // Tell the generator about the toolset, if any. std::string toolset = mf->GetSafeDefinition("CMAKE_GENERATOR_TOOLSET"); - if (!this->SetGeneratorToolset(toolset, mf)) { + if (!this->SetGeneratorToolset(toolset, false, mf)) { cmSystemTools::SetFatalErrorOccured(); return; } diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index f25ff7b77e2..0e8735775e2 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -128,7 +128,8 @@ class cmGlobalGenerator /** Set the generator-specific toolset name. Returns true if toolset is supported and false otherwise. */ - virtual bool SetGeneratorToolset(std::string const& ts, cmMakefile* mf); + virtual bool SetGeneratorToolset(std::string const& ts, bool build, + cmMakefile* mf); /** * Create LocalGenerators and process the CMakeLists files. This does not diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx index 5a708abbcbf..7afcd496e78 100644 --- a/Source/cmGlobalGhsMultiGenerator.cxx +++ b/Source/cmGlobalGhsMultiGenerator.cxx @@ -64,8 +64,11 @@ void cmGlobalGhsMultiGenerator::ComputeTargetObjectDirectory( } bool cmGlobalGhsMultiGenerator::SetGeneratorToolset(std::string const& ts, - cmMakefile* mf) + bool build, cmMakefile* mf) { + if (build) { + return true; + } std::string tsp; /* toolset path */ this->GetToolset(mf, tsp, ts); diff --git a/Source/cmGlobalGhsMultiGenerator.h b/Source/cmGlobalGhsMultiGenerator.h index ccfe0738209..7cd8c794cef 100644 --- a/Source/cmGlobalGhsMultiGenerator.h +++ b/Source/cmGlobalGhsMultiGenerator.h @@ -58,7 +58,8 @@ class cmGlobalGhsMultiGenerator : public cmGlobalGenerator static bool SupportsPlatform() { return true; } // Toolset / Platform Support - bool SetGeneratorToolset(std::string const& ts, cmMakefile* mf) override; + bool SetGeneratorToolset(std::string const& ts, bool build, + cmMakefile* mf) override; bool SetGeneratorPlatform(std::string const& p, cmMakefile* mf) override; /** diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 09a49e1e9db..63915c50b5c 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -193,7 +193,7 @@ static void cmCudaToolVersion(std::string& s) } bool cmGlobalVisualStudio10Generator::SetGeneratorToolset( - std::string const& ts, cmMakefile* mf) + std::string const& ts, bool build, cmMakefile* mf) { if (this->SystemIsWindowsCE && ts.empty() && this->DefaultPlatformToolset.empty()) { @@ -208,6 +208,10 @@ bool cmGlobalVisualStudio10Generator::SetGeneratorToolset( return false; } + if (build) { + return true; + } + if (!this->FindVCTargetsPath(mf)) { return false; } diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index 9adcf08ae2a..e0968ab7ef8 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -20,7 +20,8 @@ class cmGlobalVisualStudio10Generator : public cmGlobalVisualStudio8Generator bool SetSystemName(std::string const& s, cmMakefile* mf) override; bool SetGeneratorPlatform(std::string const& p, cmMakefile* mf) override; - bool SetGeneratorToolset(std::string const& ts, cmMakefile* mf) override; + bool SetGeneratorToolset(std::string const& ts, bool build, + cmMakefile* mf) override; std::vector GenerateBuildCommand( const std::string& makeProgram, const std::string& projectName, diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 67f1a461038..8a731cf37d6 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -267,7 +267,7 @@ std::string cmGlobalXCodeGenerator::FindXcodeBuildCommand() } bool cmGlobalXCodeGenerator::SetGeneratorToolset(std::string const& ts, - cmMakefile* mf) + bool build, cmMakefile* mf) { if (ts.find_first_of(",=") != std::string::npos) { std::ostringstream e; @@ -283,6 +283,9 @@ bool cmGlobalXCodeGenerator::SetGeneratorToolset(std::string const& ts, return false; } this->GeneratorToolset = ts; + if (build) { + return true; + } if (!this->GeneratorToolset.empty()) { mf->AddDefinition("CMAKE_XCODE_PLATFORM_TOOLSET", this->GeneratorToolset); } diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index af905d00c40..f60ea728d88 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -103,7 +103,8 @@ class cmGlobalXCodeGenerator : public cmGlobalGenerator bool ShouldStripResourcePath(cmMakefile*) const override; - bool SetGeneratorToolset(std::string const& ts, cmMakefile* mf) override; + bool SetGeneratorToolset(std::string const& ts, bool build, + cmMakefile* mf) override; void AppendFlag(std::string& flags, std::string const& flag) const; protected: diff --git a/Source/cmake.cxx b/Source/cmake.cxx index bbd33a75bcc..47cc59d7398 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -2620,6 +2620,14 @@ int cmake::Build(int jobs, const std::string& dir, return 1; } } + const char* cachedGeneratorToolset = + this->State->GetCacheEntryValue("CMAKE_GENERATOR_TOOLSET"); + if (cachedGeneratorToolset) { + cmMakefile mf(gen, this->GetCurrentSnapshot()); + if (!gen->SetGeneratorToolset(cachedGeneratorToolset, true, &mf)) { + return 1; + } + } std::string output; std::string projName; const char* cachedProjectName = From 548e9051a4f20657d04341107924171ea9d1bcb5 Mon Sep 17 00:00:00 2001 From: Alexander Boczar Date: Mon, 16 Sep 2019 14:14:20 -0700 Subject: [PATCH 023/662] VS: Add support to override VCTargetsPath through toolset Fixes: #19708 --- Help/release/dev/vs-vctargetspath.rst | 6 ++++ Help/variable/CMAKE_GENERATOR_TOOLSET.rst | 5 +++ Modules/CMakeDetermineCompilerId.cmake | 3 ++ Modules/CompilerId/VS-10.vcxproj.in | 1 + Source/cmGlobalVisualStudio10Generator.cxx | 30 ++++++++++++++++- Source/cmGlobalVisualStudio10Generator.h | 5 +++ Source/cmVisualStudio10TargetGenerator.cxx | 5 +++ .../GeneratorToolset/RunCMakeTest.cmake | 2 ++ .../TestToolsetVCTargetsPathOnly-stdout.txt | 2 ++ .../TestToolsetVCTargetsPathOnly.cmake | 2 ++ Tests/RunCMake/VS10Project/RunCMakeTest.cmake | 4 +++ .../VS10Project/VsVCTargetsPath-check.cmake | 32 +++++++++++++++++++ .../VS10Project/VsVCTargetsPath.cmake | 3 ++ 13 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 Help/release/dev/vs-vctargetspath.rst create mode 100644 Tests/RunCMake/GeneratorToolset/TestToolsetVCTargetsPathOnly-stdout.txt create mode 100644 Tests/RunCMake/GeneratorToolset/TestToolsetVCTargetsPathOnly.cmake create mode 100644 Tests/RunCMake/VS10Project/VsVCTargetsPath-check.cmake create mode 100644 Tests/RunCMake/VS10Project/VsVCTargetsPath.cmake diff --git a/Help/release/dev/vs-vctargetspath.rst b/Help/release/dev/vs-vctargetspath.rst new file mode 100644 index 00000000000..ff9d148134a --- /dev/null +++ b/Help/release/dev/vs-vctargetspath.rst @@ -0,0 +1,6 @@ +vs-vctargetspath +---------------- + +* With :ref:`Visual Studio Generators` for VS 2010 and above, + the :variable:`CMAKE_GENERATOR_TOOLSET` setting gained an option + to specify the ``VCTargetsPath`` value for project files. diff --git a/Help/variable/CMAKE_GENERATOR_TOOLSET.rst b/Help/variable/CMAKE_GENERATOR_TOOLSET.rst index 222824f6a9e..53ad2f3e760 100644 --- a/Help/variable/CMAKE_GENERATOR_TOOLSET.rst +++ b/Help/variable/CMAKE_GENERATOR_TOOLSET.rst @@ -58,3 +58,8 @@ Supported pairs are: Specify the toolset version to use. Supported by VS 2017 and above with the specified toolset installed. See the :variable:`CMAKE_VS_PLATFORM_TOOLSET_VERSION` variable. + +``VCTargetsPath=`` + Specify an alternative ``VCTargetsPath`` value for Visual Studio + project files. This allows use of VS platform extension configuration + files (``.props`` and ``.targets``) that are not installed with VS. diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 908e530bd30..976b2912203 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -317,6 +317,9 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} if(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION) set(id_WindowsTargetPlatformVersion "${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}") endif() + if(CMAKE_VS_PLATFORM_TOOLSET_VCTARGETS_CUSTOM_DIR) + set(id_ToolsetVCTargetsDir "${CMAKE_VS_PLATFORM_TOOLSET_VCTARGETS_CUSTOM_DIR}") + endif() if(id_platform STREQUAL ARM64) set(id_WindowsSDKDesktopARMSupport "true") elseif(id_platform STREQUAL ARM) diff --git a/Modules/CompilerId/VS-10.vcxproj.in b/Modules/CompilerId/VS-10.vcxproj.in index d742274c4cd..a3814dc0e57 100644 --- a/Modules/CompilerId/VS-10.vcxproj.in +++ b/Modules/CompilerId/VS-10.vcxproj.in @@ -15,6 +15,7 @@ @id_WindowsTargetPlatformVersion@ @id_WindowsSDKDesktopARMSupport@ @id_CudaToolkitCustomDir@ + @id_ToolsetVCTargetsDir@ @id_toolset_version_props@ diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 63915c50b5c..5b83e2fe994 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -26,6 +26,16 @@ static const char vs10generatorName[] = "Visual Studio 10 2010"; static std::map> loadedFlagJsonFiles; +static void ConvertToWindowsSlashes(std::string& s) +{ + // first convert all of the slashes + for (auto& ch : s) { + if (ch == '/') { + ch = '\\'; + } + } +} + // Map generator name without year to name with year. static const char* cmVS10GenName(const std::string& name, std::string& genName) { @@ -212,7 +222,7 @@ bool cmGlobalVisualStudio10Generator::SetGeneratorToolset( return true; } - if (!this->FindVCTargetsPath(mf)) { + if (this->CustomVCTargetsPath.empty() && !this->FindVCTargetsPath(mf)) { return false; } @@ -353,6 +363,11 @@ bool cmGlobalVisualStudio10Generator::SetGeneratorToolset( if (const char* cudaDir = this->GetPlatformToolsetCudaCustomDir()) { mf->AddDefinition("CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR", cudaDir); } + if (const char* vcTargetsDir = this->GetCustomVCTargetsPath()) { + mf->AddDefinition("CMAKE_VS_PLATFORM_TOOLSET_VCTARGETS_CUSTOM_DIR", + vcTargetsDir); + } + return true; } @@ -446,6 +461,11 @@ bool cmGlobalVisualStudio10Generator::ProcessGeneratorToolsetField( this->GeneratorToolsetVersion = value; return true; } + if (key == "VCTargetsPath") { + this->CustomVCTargetsPath = value; + ConvertToWindowsSlashes(this->CustomVCTargetsPath); + return true; + } return false; } @@ -607,6 +627,14 @@ void cmGlobalVisualStudio10Generator::EnableLanguage( cmGlobalVisualStudio8Generator::EnableLanguage(lang, mf, optional); } +const char* cmGlobalVisualStudio10Generator::GetCustomVCTargetsPath() const +{ + if (this->CustomVCTargetsPath.empty()) { + return nullptr; + } + return this->CustomVCTargetsPath.c_str(); +} + const char* cmGlobalVisualStudio10Generator::GetPlatformToolset() const { std::string const& toolset = this->GetPlatformToolsetString(); diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index e0968ab7ef8..8a760476d08 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -46,6 +46,9 @@ class cmGlobalVisualStudio10Generator : public cmGlobalVisualStudio8Generator bool IsNsightTegra() const; std::string GetNsightTegraVersion() const; + /** The vctargets path for the target platform. */ + const char* GetCustomVCTargetsPath() const; + /** The toolset name for the target platform. */ const char* GetPlatformToolset() const; std::string const& GetPlatformToolsetString() const; @@ -156,6 +159,7 @@ class cmGlobalVisualStudio10Generator : public cmGlobalVisualStudio8Generator std::string GeneratorToolset; std::string GeneratorToolsetVersion; std::string GeneratorToolsetHostArchitecture; + std::string GeneratorToolsetCustomVCTargetsDir; std::string GeneratorToolsetCuda; std::string GeneratorToolsetCudaCustomDir; std::string DefaultPlatformToolset; @@ -207,6 +211,7 @@ class cmGlobalVisualStudio10Generator : public cmGlobalVisualStudio8Generator bool ParseGeneratorToolset(std::string const& ts, cmMakefile* mf); + std::string CustomVCTargetsPath; std::string VCTargetsPath; bool FindVCTargetsPath(cmMakefile* mf); diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 3843bf24c44..40a0e067aa0 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -543,6 +543,11 @@ void cmVisualStudio10TargetGenerator::Generate() e1.Element("VCProjectUpgraderObjectName", "NoUpgrade"); } + if (const char* vcTargetsPath = + this->GlobalGenerator->GetCustomVCTargetsPath()) { + e1.Element("VCTargetsPath", vcTargetsPath); + } + std::vector keys = this->GeneratorTarget->GetPropertyKeys(); for (std::string const& keyIt : keys) { static const char* prefix = "VS_GLOBAL_"; diff --git a/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake index ae75561b11b..bb228415437 100644 --- a/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake +++ b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake @@ -30,6 +30,8 @@ if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[012456]") set(RunCMake_GENERATOR_TOOLSET "Test Toolset,host=x64,host=x86") run_cmake(BadToolsetHostArchTwice) if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[56]") + set(RunCMake_GENERATOR_TOOLSET "VCTargetsPath=Test Path") + run_cmake(TestToolsetVCTargetsPathOnly) set(RunCMake_GENERATOR_TOOLSET "Test Toolset,version=Test Toolset Version") run_cmake(TestToolsetVersionBoth) set(RunCMake_GENERATOR_TOOLSET ",version=Test Toolset Version") diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetVCTargetsPathOnly-stdout.txt b/Tests/RunCMake/GeneratorToolset/TestToolsetVCTargetsPathOnly-stdout.txt new file mode 100644 index 00000000000..c46373f2e39 --- /dev/null +++ b/Tests/RunCMake/GeneratorToolset/TestToolsetVCTargetsPathOnly-stdout.txt @@ -0,0 +1,2 @@ +-- CMAKE_VS_PLATFORM_TOOLSET='v[0-9]+' +-- CMAKE_VS_PLATFORM_TOOLSET_VCTARGETS_CUSTOM_DIR='Test Path' diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetVCTargetsPathOnly.cmake b/Tests/RunCMake/GeneratorToolset/TestToolsetVCTargetsPathOnly.cmake new file mode 100644 index 00000000000..c20a303b6ad --- /dev/null +++ b/Tests/RunCMake/GeneratorToolset/TestToolsetVCTargetsPathOnly.cmake @@ -0,0 +1,2 @@ +message(STATUS "CMAKE_VS_PLATFORM_TOOLSET='${CMAKE_VS_PLATFORM_TOOLSET}'") +message(STATUS "CMAKE_VS_PLATFORM_TOOLSET_VCTARGETS_CUSTOM_DIR='${CMAKE_VS_PLATFORM_TOOLSET_VCTARGETS_CUSTOM_DIR}'") diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake index 44ccd6b5854..32b68295e45 100644 --- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake +++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake @@ -28,6 +28,10 @@ run_cmake(VsDpiAwareBadParam) run_cmake(VsPrecompileHeaders) run_cmake(VsPrecompileHeadersReuseFromCompilePDBName) +set(RunCMake_GENERATOR_TOOLSET "VCTargetsPath=$(VCTargetsPath)") +run_cmake(VsVCTargetsPath) +unset(RunCMake_GENERATOR_TOOLSET) + if(CMAKE_C_COMPILER_ID STREQUAL "MSVC" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.05) run_cmake(VsJustMyCode) endif() diff --git a/Tests/RunCMake/VS10Project/VsVCTargetsPath-check.cmake b/Tests/RunCMake/VS10Project/VsVCTargetsPath-check.cmake new file mode 100644 index 00000000000..5b1701c85c7 --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsVCTargetsPath-check.cmake @@ -0,0 +1,32 @@ +macro(check_project_file projectFile) + set(insideGlobals FALSE) + set(pathFound FALSE) + + if(NOT EXISTS "${projectFile}") + set(RunCMake_TEST_FAILED "Project file ${projectFile} does not exist.") + return() + endif() + + string(REPLACE "${RunCMake_TEST_BINARY_DIR}/" "" projectName ${projectFile}) + + file(STRINGS "${projectFile}" lines) + foreach(line IN LISTS lines) + if(line MATCHES "^ *.*$") + set(insideGlobals TRUE) + elseif(insideGlobals) + if(line MATCHES "^ *.*$") + set(insideGlobals FALSE) + elseif(line MATCHES "^ *(.+)*$") + message(STATUS "Found VCTargetsPath = ${CMAKE_MATCH_1} in PropertyGroup 'Globals' in ${projectName}") + set(pathFound TRUE) + endif() + endif() + endforeach() + if(NOT pathFound) + set(RunCMake_TEST_FAILED "VCTargetsPath not found in \"Globals\" propertygroup in ${projectName}") + return() # This should intentionally return from the caller, not the macro + endif() +endmacro() + +check_project_file("${RunCMake_TEST_BINARY_DIR}/CMakeFiles/${CMAKE_VERSION}/CompilerIdCXX/CompilerIdCXX.vcxproj") +check_project_file("${RunCMake_TEST_BINARY_DIR}/foo.vcxproj") diff --git a/Tests/RunCMake/VS10Project/VsVCTargetsPath.cmake b/Tests/RunCMake/VS10Project/VsVCTargetsPath.cmake new file mode 100644 index 00000000000..6a6088f9e3d --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsVCTargetsPath.cmake @@ -0,0 +1,3 @@ +enable_language(CXX) + +add_library(foo foo.cpp) From c11e7c5c3d5c5e682adf761c4b0de734ff68e690 Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Thu, 10 Oct 2019 16:29:00 -0700 Subject: [PATCH 024/662] FindCURL: Try to find CURLConfig.cmake --- Help/release/dev/FindCURL-cmake-package.rst | 7 ++++++ Modules/FindCURL.cmake | 28 ++++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 Help/release/dev/FindCURL-cmake-package.rst diff --git a/Help/release/dev/FindCURL-cmake-package.rst b/Help/release/dev/FindCURL-cmake-package.rst new file mode 100644 index 00000000000..67c5bbcb853 --- /dev/null +++ b/Help/release/dev/FindCURL-cmake-package.rst @@ -0,0 +1,7 @@ +FindCURL-cmake-package +---------------------- + +* The :module:`FindCURL` module learned to find CURL using + the ``CURLConfig.cmake`` package configuration file generated by + CURL's cmake buildsystem. It also gained a new ``CURL_NO_CURL_CMAKE`` + option to disable this behavior. diff --git a/Modules/FindCURL.cmake b/Modules/FindCURL.cmake index aeebc842eb8..919babcde55 100644 --- a/Modules/FindCURL.cmake +++ b/Modules/FindCURL.cmake @@ -37,8 +37,35 @@ This module defines the following variables: ``CURL_VERSION_STRING`` The version of ``curl`` found. + +CURL CMake +^^^^^^^^^^ + +If CURL was built using the CMake buildsystem then it provides its own +``CURLConfig.cmake`` file for use with the :command:`find_package` command's +config mode. This module looks for this file and, if found, +returns its results with no further action. + +Set ``CURL_NO_CURL_CMAKE`` to ``ON`` to disable this search. + #]=======================================================================] +include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) + +if(NOT CURL_NO_CURL_CMAKE) + # do a find package call to specifically look for the CMake version + # of curl + find_package(CURL QUIET NO_MODULE) + mark_as_advanced(CURL_DIR) + + # if we found the CURL cmake package then we are done, and + # can print what we found and return. + if(CURL_FOUND) + find_package_handle_standard_args(CURL HANDLE_COMPONENTS CONFIG_MODE) + return() + endif() +endif() + find_package(PkgConfig QUIET) if(PKG_CONFIG_FOUND) pkg_check_modules(PC_CURL QUIET libcurl) @@ -139,7 +166,6 @@ if(CURL_FIND_COMPONENTS) endforeach() endif() -include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) find_package_handle_standard_args(CURL REQUIRED_VARS CURL_LIBRARY CURL_INCLUDE_DIR VERSION_VAR CURL_VERSION_STRING From 220d5995076f794e222c882963fb634169a6600b Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Wed, 16 Oct 2019 00:01:08 -0400 Subject: [PATCH 025/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 458cc866f8f..4edadd8e06e 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191015) +set(CMake_VERSION_PATCH 20191016) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From 095fc6d9d96bf9f12770f85ebf0b75d384a7d5fb Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Thu, 17 Oct 2019 00:01:09 -0400 Subject: [PATCH 026/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 4edadd8e06e..c15eda7281d 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191016) +set(CMake_VERSION_PATCH 20191017) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From 4bedf6c9fa3f55a19b09d5ab26cfd149ee2e13e6 Mon Sep 17 00:00:00 2001 From: Alex Turbov Date: Sun, 6 Oct 2019 00:23:17 +0200 Subject: [PATCH 027/662] Refactor: Modernize `cmVariableWatchCommand` a little --- Source/cmVariableWatch.cxx | 14 ++-- Source/cmVariableWatch.h | 4 +- Source/cmVariableWatchCommand.cxx | 65 +++++++++---------- .../variable_watch-default-script-stderr.txt | 4 +- .../variable_watch-default-stderr.txt | 4 +- ...riable_watch-invalid-var-script-stderr.txt | 4 +- .../variable_watch-invalid-var-stderr.txt | 4 +- .../variable_watch-var-script-stderr.txt | 10 +-- .../variable_watch-var-stderr.txt | 10 +-- 9 files changed, 58 insertions(+), 61 deletions(-) diff --git a/Source/cmVariableWatch.cxx b/Source/cmVariableWatch.cxx index 4995da972fc..35e1c8c56fe 100644 --- a/Source/cmVariableWatch.cxx +++ b/Source/cmVariableWatch.cxx @@ -2,19 +2,19 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmVariableWatch.h" +#include #include #include #include -static const char* const cmVariableWatchAccessStrings[] = { - "READ_ACCESS", "UNKNOWN_READ_ACCESS", "UNKNOWN_DEFINED_ACCESS", - "MODIFIED_ACCESS", "REMOVED_ACCESS", "NO_ACCESS" -}; - -const char* cmVariableWatch::GetAccessAsString(int access_type) +const std::string& cmVariableWatch::GetAccessAsString(int access_type) { + static const std::array cmVariableWatchAccessStrings = { + { "READ_ACCESS", "UNKNOWN_READ_ACCESS", "UNKNOWN_DEFINED_ACCESS", + "MODIFIED_ACCESS", "REMOVED_ACCESS", "NO_ACCESS" } + }; if (access_type < 0 || access_type >= cmVariableWatch::NO_ACCESS) { - return "NO_ACCESS"; + access_type = cmVariableWatch::NO_ACCESS; } return cmVariableWatchAccessStrings[access_type]; } diff --git a/Source/cmVariableWatch.h b/Source/cmVariableWatch.h index e4b3b7c47fe..6c418ed0ab1 100644 --- a/Source/cmVariableWatch.h +++ b/Source/cmVariableWatch.h @@ -46,7 +46,7 @@ class cmVariableWatch */ enum { - VARIABLE_READ_ACCESS = 0, + VARIABLE_READ_ACCESS, UNKNOWN_VARIABLE_READ_ACCESS, UNKNOWN_VARIABLE_DEFINED_ACCESS, VARIABLE_MODIFIED_ACCESS, @@ -57,7 +57,7 @@ class cmVariableWatch /** * Return the access as string */ - static const char* GetAccessAsString(int access_type); + static const std::string& GetAccessAsString(int access_type); protected: struct Pair diff --git a/Source/cmVariableWatchCommand.cxx b/Source/cmVariableWatchCommand.cxx index f2c8f3cdb90..039f1ba6baf 100644 --- a/Source/cmVariableWatchCommand.cxx +++ b/Source/cmVariableWatchCommand.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmVariableWatchCommand.h" +#include #include #include @@ -14,17 +15,17 @@ #include "cmVariableWatch.h" #include "cmake.h" +namespace { struct cmVariableWatchCallbackData { bool InCallback; std::string Command; }; -static void cmVariableWatchCommandVariableAccessed(const std::string& variable, - int access_type, - void* client_data, - const char* newValue, - const cmMakefile* mf) +void cmVariableWatchCommandVariableAccessed(const std::string& variable, + int access_type, void* client_data, + const char* newValue, + const cmMakefile* mf) { cmVariableWatchCallbackData* data = static_cast(client_data); @@ -34,40 +35,35 @@ static void cmVariableWatchCommandVariableAccessed(const std::string& variable, } data->InCallback = true; - cmListFileFunction newLFF; - cmListFileArgument arg; - bool processed = false; - const char* accessString = cmVariableWatch::GetAccessAsString(access_type); - const char* currentListFile = mf->GetDefinition("CMAKE_CURRENT_LIST_FILE"); + auto accessString = cmVariableWatch::GetAccessAsString(access_type); /// Ultra bad!! cmMakefile* makefile = const_cast(mf); std::string stack = makefile->GetProperty("LISTFILE_STACK"); if (!data->Command.empty()) { - newLFF.Arguments.clear(); - newLFF.Arguments.emplace_back(variable, cmListFileArgument::Quoted, 9999); - newLFF.Arguments.emplace_back(accessString, cmListFileArgument::Quoted, - 9999); - newLFF.Arguments.emplace_back(newValue ? newValue : "", - cmListFileArgument::Quoted, 9999); - newLFF.Arguments.emplace_back(currentListFile, cmListFileArgument::Quoted, - 9999); - newLFF.Arguments.emplace_back(stack, cmListFileArgument::Quoted, 9999); + cmListFileFunction newLFF; + const char* const currentListFile = + mf->GetDefinition("CMAKE_CURRENT_LIST_FILE"); + const auto fakeLineNo = + std::numeric_limits::max(); + newLFF.Arguments = { + { variable, cmListFileArgument::Quoted, fakeLineNo }, + { accessString, cmListFileArgument::Quoted, fakeLineNo }, + { newValue ? newValue : "", cmListFileArgument::Quoted, fakeLineNo }, + { currentListFile, cmListFileArgument::Quoted, fakeLineNo }, + { stack, cmListFileArgument::Quoted, fakeLineNo } + }; newLFF.Name = data->Command; - newLFF.Line = 9999; + newLFF.Line = fakeLineNo; cmExecutionStatus status(*makefile); if (!makefile->ExecuteCommand(newLFF, status)) { cmSystemTools::Error( cmStrCat("Error in cmake code at\nUnknown:0:\nA command failed " "during the invocation of callback \"", data->Command, "\".")); - data->InCallback = false; - return; } - processed = true; - } - if (!processed) { + } else { makefile->IssueMessage( MessageType::LOG, cmStrCat("Variable \"", variable, "\" was accessed using ", accessString, @@ -77,7 +73,7 @@ static void cmVariableWatchCommandVariableAccessed(const std::string& variable, data->InCallback = false; } -static void deleteVariableWatchCallbackData(void* client_data) +void deleteVariableWatchCallbackData(void* client_data) { cmVariableWatchCallbackData* data = static_cast(client_data); @@ -91,7 +87,7 @@ class FinalAction public: /* NOLINTNEXTLINE(performance-unnecessary-value-param) */ FinalAction(cmMakefile* makefile, std::string variable) - : Action(std::make_shared(makefile, std::move(variable))) + : Action{ std::make_shared(makefile, std::move(variable)) } { } @@ -101,8 +97,8 @@ class FinalAction struct Impl { Impl(cmMakefile* makefile, std::string variable) - : Makefile(makefile) - , Variable(std::move(variable)) + : Makefile{ makefile } + , Variable{ std::move(variable) } { } @@ -112,12 +108,13 @@ class FinalAction this->Variable, cmVariableWatchCommandVariableAccessed); } - cmMakefile* Makefile; - std::string Variable; + cmMakefile* const Makefile; + std::string const Variable; }; std::shared_ptr Action; }; +} // anonymous namespace bool cmVariableWatchCommand(std::vector const& args, cmExecutionStatus& status) @@ -136,10 +133,10 @@ bool cmVariableWatchCommand(std::vector const& args, return false; } - cmVariableWatchCallbackData* data = new cmVariableWatchCallbackData; + auto* const data = new cmVariableWatchCallbackData; data->InCallback = false; - data->Command = command; + data->Command = std::move(command); if (!status.GetMakefile().GetCMakeInstance()->GetVariableWatch()->AddWatch( variable, cmVariableWatchCommandVariableAccessed, data, @@ -149,6 +146,6 @@ bool cmVariableWatchCommand(std::vector const& args, } status.GetMakefile().AddFinalAction( - FinalAction(&status.GetMakefile(), variable)); + FinalAction{ &status.GetMakefile(), variable }); return true; } diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-script-stderr.txt index 4dddc96c8c4..07deee2eaff 100644 --- a/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-script-stderr.txt +++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-script-stderr.txt @@ -1,6 +1,6 @@ [0-9]+ -CMake Error at .*/variable_watch\.cmake:9999 \(update_x\): +CMake Error at .*/variable_watch\.cmake:[0-9]+ \(update_x\): Maximum recursion depth of [0-9]+ exceeded Call Stack \(most recent call first\): .*/variable_watch\.cmake:5 \(set\) - .*/variable_watch\.cmake:9999 \(update_x\) + .*/variable_watch\.cmake:[0-9]+ \(update_x\) diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-stderr.txt index a8b4756da16..b2395b30f37 100644 --- a/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-stderr.txt +++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-stderr.txt @@ -1,6 +1,6 @@ [0-9]+ -CMake Error at variable_watch\.cmake:9999 \(update_x\): +CMake Error at variable_watch\.cmake:[0-9]+ \(update_x\): Maximum recursion depth of [0-9]+ exceeded Call Stack \(most recent call first\): variable_watch\.cmake:5 \(set\) - variable_watch\.cmake:9999 \(update_x\) + variable_watch\.cmake:[0-9]+ \(update_x\) diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-script-stderr.txt index 4dddc96c8c4..07deee2eaff 100644 --- a/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-script-stderr.txt +++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-script-stderr.txt @@ -1,6 +1,6 @@ [0-9]+ -CMake Error at .*/variable_watch\.cmake:9999 \(update_x\): +CMake Error at .*/variable_watch\.cmake:[0-9]+ \(update_x\): Maximum recursion depth of [0-9]+ exceeded Call Stack \(most recent call first\): .*/variable_watch\.cmake:5 \(set\) - .*/variable_watch\.cmake:9999 \(update_x\) + .*/variable_watch\.cmake:[0-9]+ \(update_x\) diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-stderr.txt index a8b4756da16..b2395b30f37 100644 --- a/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-stderr.txt +++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-stderr.txt @@ -1,6 +1,6 @@ [0-9]+ -CMake Error at variable_watch\.cmake:9999 \(update_x\): +CMake Error at variable_watch\.cmake:[0-9]+ \(update_x\): Maximum recursion depth of [0-9]+ exceeded Call Stack \(most recent call first\): variable_watch\.cmake:5 \(set\) - variable_watch\.cmake:9999 \(update_x\) + variable_watch\.cmake:[0-9]+ \(update_x\) diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-script-stderr.txt index 00b2b3c111f..52fedd314c5 100644 --- a/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-script-stderr.txt +++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-script-stderr.txt @@ -2,17 +2,17 @@ 6 8 10 -CMake Error at .*/variable_watch\.cmake:9999 \(update_x\): +CMake Error at .*/variable_watch\.cmake:[0-9]+ \(update_x\): Maximum recursion depth of 10 exceeded Call Stack \(most recent call first\): .*/variable_watch\.cmake:5 \(set\) - .*/variable_watch\.cmake:9999 \(update_x\) + .*/variable_watch\.cmake:[0-9]+ \(update_x\) .*/variable_watch\.cmake:5 \(set\) - .*/variable_watch\.cmake:9999 \(update_x\) + .*/variable_watch\.cmake:[0-9]+ \(update_x\) .*/variable_watch\.cmake:5 \(set\) - .*/variable_watch\.cmake:9999 \(update_x\) + .*/variable_watch\.cmake:[0-9]+ \(update_x\) .*/variable_watch\.cmake:5 \(set\) - .*/variable_watch\.cmake:9999 \(update_x\) + .*/variable_watch\.cmake:[0-9]+ \(update_x\) .*/variable_watch\.cmake:9 \(set\) .*/CMakeLists\.txt:5 \(include\) diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-stderr.txt index 8f27bf1c298..1427f1df994 100644 --- a/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-stderr.txt +++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-stderr.txt @@ -2,17 +2,17 @@ 6 8 10 -CMake Error at variable_watch\.cmake:9999 \(update_x\): +CMake Error at variable_watch\.cmake:[0-9]+ \(update_x\): Maximum recursion depth of 10 exceeded Call Stack \(most recent call first\): variable_watch\.cmake:5 \(set\) - variable_watch\.cmake:9999 \(update_x\) + variable_watch\.cmake:[0-9]+ \(update_x\) variable_watch\.cmake:5 \(set\) - variable_watch\.cmake:9999 \(update_x\) + variable_watch\.cmake:[0-9]+ \(update_x\) variable_watch\.cmake:5 \(set\) - variable_watch\.cmake:9999 \(update_x\) + variable_watch\.cmake:[0-9]+ \(update_x\) variable_watch\.cmake:5 \(set\) - variable_watch\.cmake:9999 \(update_x\) + variable_watch\.cmake:[0-9]+ \(update_x\) variable_watch\.cmake:9 \(set\) CMakeLists\.txt:5 \(include\) From 45b4b4b93076e16281ecee628ef8ffb0aae8f3d6 Mon Sep 17 00:00:00 2001 From: Alexander Boczar Date: Thu, 26 Sep 2019 17:37:47 -0700 Subject: [PATCH 028/662] VS: Propagate CMAKE_VS_GLOBALS into compiler id projects Issue: #19708 --- Help/release/dev/vs-vctargetspath.rst | 3 + Modules/CMakeDetermineCompilerId.cmake | 6 ++ Modules/CompilerId/VS-10.vcxproj.in | 1 + .../VS10Project/VsGlobals-check.cmake | 93 ++++++++++++------- Tests/RunCMake/VS10Project/VsGlobals.cmake | 7 +- 5 files changed, 71 insertions(+), 39 deletions(-) diff --git a/Help/release/dev/vs-vctargetspath.rst b/Help/release/dev/vs-vctargetspath.rst index ff9d148134a..462d183b2ae 100644 --- a/Help/release/dev/vs-vctargetspath.rst +++ b/Help/release/dev/vs-vctargetspath.rst @@ -4,3 +4,6 @@ vs-vctargetspath * With :ref:`Visual Studio Generators` for VS 2010 and above, the :variable:`CMAKE_GENERATOR_TOOLSET` setting gained an option to specify the ``VCTargetsPath`` value for project files. + +* The :variable:`CMAKE_VS_GLOBALS` variable value now applies during + compiler identification. diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 976b2912203..f7ef755aeba 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -320,6 +320,12 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} if(CMAKE_VS_PLATFORM_TOOLSET_VCTARGETS_CUSTOM_DIR) set(id_ToolsetVCTargetsDir "${CMAKE_VS_PLATFORM_TOOLSET_VCTARGETS_CUSTOM_DIR}") endif() + set(id_CustomGlobals "") + foreach(pair IN LISTS CMAKE_VS_GLOBALS) + if("${pair}" MATCHES "([^=]+)=(.*)$") + string(APPEND id_CustomGlobals "<${CMAKE_MATCH_1}>${CMAKE_MATCH_2}\n ") + endif() + endforeach() if(id_platform STREQUAL ARM64) set(id_WindowsSDKDesktopARMSupport "true") elseif(id_platform STREQUAL ARM) diff --git a/Modules/CompilerId/VS-10.vcxproj.in b/Modules/CompilerId/VS-10.vcxproj.in index a3814dc0e57..b48a3323f90 100644 --- a/Modules/CompilerId/VS-10.vcxproj.in +++ b/Modules/CompilerId/VS-10.vcxproj.in @@ -16,6 +16,7 @@ @id_WindowsSDKDesktopARMSupport@ @id_CudaToolkitCustomDir@ @id_ToolsetVCTargetsDir@ + @id_CustomGlobals@ @id_toolset_version_props@ diff --git a/Tests/RunCMake/VS10Project/VsGlobals-check.cmake b/Tests/RunCMake/VS10Project/VsGlobals-check.cmake index 0e7fd45c107..6a300991dda 100644 --- a/Tests/RunCMake/VS10Project/VsGlobals-check.cmake +++ b/Tests/RunCMake/VS10Project/VsGlobals-check.cmake @@ -1,44 +1,65 @@ -set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.vcxproj") -if(NOT EXISTS "${vcProjectFile}") - set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.") - return() -endif() +macro(check_project_file projectFile) + if(NOT EXISTS "${projectFile}") + set(RunCMake_TEST_FAILED "Project file ${projectFile} does not exist.") + return() + endif() + + string(REPLACE "${RunCMake_TEST_BINARY_DIR}/" "" projectName ${projectFile}) -set(InsideGlobals FALSE) -set(DefaultLanguageSet FALSE) -set(MinimumVisualStudioVersionSet FALSE) + set(InsideGlobals FALSE) + set(DefaultLanguageSet FALSE) + set(MinimumVisualStudioVersionSet FALSE) + set(TestPropertySet FALSE) -file(STRINGS "${vcProjectFile}" lines) -foreach(line IN LISTS lines) - if(line MATCHES "^ * *$") - set(InsideGlobals TRUE) - elseif(line MATCHES "^ *([a-zA-Z\\-]+) *$") - if("${CMAKE_MATCH_1}" STREQUAL "en-US") - if(InsideGlobals) - message(STATUS "foo.vcxproj has correct DefaultLanguage global property") - set(DefaultLanguageSet TRUE) - else() - message(STATUS "DefaultLanguage is set but not within \"Globals\" property group") + file(STRINGS "${projectFile}" lines) + foreach(line IN LISTS lines) + if(line MATCHES "^ * *$") + set(InsideGlobals TRUE) + elseif(line MATCHES "^ *([a-zA-Z\\-]+) *$") + if("${CMAKE_MATCH_1}" STREQUAL "en-US") + if(InsideGlobals) + message(STATUS "${projectName} has correct DefaultLanguage global property") + set(DefaultLanguageSet TRUE) + else() + message(STATUS "DefaultLanguage is set but not within \"Globals\" property group") + endif() endif() - endif() - elseif(line MATCHES "^ *([0-9\\.]+) *$") - if("${CMAKE_MATCH_1}" STREQUAL "14.0") - if(InsideGlobals) - message(STATUS "foo.vcxproj has correct MinimumVisualStudioVersion global property") - set(MinimumVisualStudioVersionSet TRUE) - else() - message(STATUS "MinimumVisualStudioVersion is set but not within \"Globals\" property group") + elseif(line MATCHES "^ *([0-9\\.]+) *$") + if("${CMAKE_MATCH_1}" STREQUAL "10.0") + if(InsideGlobals) + message(STATUS "${projectName} has correct MinimumVisualStudioVersion global property") + set(MinimumVisualStudioVersionSet TRUE) + else() + message(STATUS "MinimumVisualStudioVersion is set but not within \"Globals\" property group") + endif() + endif() + elseif(line MATCHES "^ *(.+) *$") + if("${CMAKE_MATCH_1}" STREQUAL "TestValue") + if(InsideGlobals) + message(STATUS "${projectName} has correct TestProperty global property") + set(TestPropertySet TRUE) + else() + message(STATUS "TestProperty is set but not within \"Globals\" property group") + endif() endif() endif() + endforeach() + + if(NOT DefaultLanguageSet) + set(RunCMake_TEST_FAILED "DefaultLanguage not found or not set correctly in ${projectName}.") + return() + endif() + + if(NOT MinimumVisualStudioVersionSet) + set(RunCMake_TEST_FAILED "MinimumVisualStudioVersion not found or not set correctly in ${projectName}.") + return() endif() -endforeach() -if(NOT DefaultLanguageSet) - set(RunCMake_TEST_FAILED "DefaultLanguageSet not found or not set correctly.") - return() -endif() + if(NOT TestPropertySet) + set(RunCMake_TEST_FAILED "TestProperty not found or not set correctly in ${projectName}.") + return() + endif() +endmacro() -if(NOT MinimumVisualStudioVersionSet) - set(RunCMake_TEST_FAILED "MinimumVisualStudioVersionSet not found or not set correctly.") - return() -endif() +check_project_file("${RunCMake_TEST_BINARY_DIR}/CMakeFiles/${CMAKE_VERSION}/CompilerIdCXX/CompilerIdCXX.vcxproj") +check_project_file("${RunCMake_TEST_BINARY_DIR}/foo.vcxproj") diff --git a/Tests/RunCMake/VS10Project/VsGlobals.cmake b/Tests/RunCMake/VS10Project/VsGlobals.cmake index a3ed5afa9bf..09d806dfb2d 100644 --- a/Tests/RunCMake/VS10Project/VsGlobals.cmake +++ b/Tests/RunCMake/VS10Project/VsGlobals.cmake @@ -1,8 +1,9 @@ -enable_language(CXX) - set(CMAKE_VS_GLOBALS "DefaultLanguage=en-US" - "MinimumVisualStudioVersion=14.0" + "MinimumVisualStudioVersion=10.0" + "TestProperty=TestValue" ) +enable_language(CXX) + add_library(foo foo.cpp) From e7d57bc3c35e7c47746caf91591ef748b9ce3012 Mon Sep 17 00:00:00 2001 From: Alexander Boczar Date: Mon, 16 Sep 2019 16:55:26 -0700 Subject: [PATCH 029/662] VS: Propagate CMAKE_VS_GLOBALS into custom targets Issue: #19708 --- Help/release/dev/vs-vctargetspath.rst | 3 ++- Source/cmTarget.cxx | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Help/release/dev/vs-vctargetspath.rst b/Help/release/dev/vs-vctargetspath.rst index 462d183b2ae..d40af349e4d 100644 --- a/Help/release/dev/vs-vctargetspath.rst +++ b/Help/release/dev/vs-vctargetspath.rst @@ -6,4 +6,5 @@ vs-vctargetspath to specify the ``VCTargetsPath`` value for project files. * The :variable:`CMAKE_VS_GLOBALS` variable value now applies during - compiler identification. + compiler identification and in targets created by the + :command:`add_custom_target` command. diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 99c16f23744..a4f904b1558 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -511,8 +511,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, initProp("DOTNET_TARGET_FRAMEWORK_VERSION"); } - if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY && - this->GetType() != cmStateEnums::UTILITY) { + if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY) { // check for "CMAKE_VS_GLOBALS" variable and set up target properties // if any From fd2c9fac101ec6d341db5b30e9d1eba64fa23116 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 2 Oct 2019 13:48:37 -0400 Subject: [PATCH 030/662] cmGeneratorTarget: Return non-const sources from GetAllConfigSources We need a non-const pointer to `cmSourceFile` instances in order to call `GetOrDetermineLanguage` on them. --- Source/cmGeneratorTarget.h | 2 +- Source/cmLocalVisualStudio7Generator.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 1f824b1163f..c2811b2e846 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -123,7 +123,7 @@ class cmGeneratorTarget struct AllConfigSource { - cmSourceFile const* Source; + cmSourceFile* Source; cmGeneratorTarget::SourceKind Kind; std::vector Configs; }; diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index ff1eaec9350..fd346df6854 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -1329,7 +1329,7 @@ void cmLocalVisualStudio7Generator::WriteVCProjFile(std::ostream& fout, // Add CMakeLists.txt file with rule to re-run CMake for user convenience. if (target->GetType() != cmStateEnums::GLOBAL_TARGET && target->GetName() != CMAKE_CHECK_BUILD_SYSTEM_TARGET) { - if (cmSourceFile const* sf = this->CreateVCProjBuildRule()) { + if (cmSourceFile* sf = this->CreateVCProjBuildRule()) { cmGeneratorTarget::AllConfigSource acs; acs.Source = sf; acs.Kind = cmGeneratorTarget::SourceKindCustomCommand; From 324988a6b101f29d148badc32b44964aedae1163 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 2 Oct 2019 13:57:12 -0400 Subject: [PATCH 031/662] cmGeneratorTarget: Add GetAllConfigCompileLanguages method Return all languages needed to compile sources in the target in any configuration. --- Source/cmGeneratorTarget.cxx | 13 +++++++++++++ Source/cmGeneratorTarget.h | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 949d9d9128b..0cc70c7d8b5 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -1670,6 +1670,19 @@ void cmGeneratorTarget::ComputeAllConfigSources() const } } +std::set cmGeneratorTarget::GetAllConfigCompileLanguages() const +{ + std::set languages; + std::vector const& sources = this->GetAllConfigSources(); + for (AllConfigSource const& si : sources) { + std::string const& lang = si.Source->GetOrDetermineLanguage(); + if (!lang.empty()) { + languages.emplace(lang); + } + } + return languages; +} + std::string cmGeneratorTarget::GetCompilePDBName( const std::string& config) const { diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index c2811b2e846..46235131404 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -132,6 +132,10 @@ class cmGeneratorTarget per-source configurations assigned. */ std::vector const& GetAllConfigSources() const; + /** Get all languages used to compile sources in any configuration. + This excludes the languages of objects from object libraries. */ + std::set GetAllConfigCompileLanguages() const; + void GetObjectSources(std::vector&, const std::string& config) const; const std::string& GetObjectName(cmSourceFile const* file); From bcaecf6bcddfaec2b586bff870650a4a66b0ccc3 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 4 Oct 2019 10:42:03 -0400 Subject: [PATCH 032/662] Teach check for single-language targets to consider all configurations --- Source/cmGeneratorTarget.cxx | 3 +-- Source/cmGlobalVisualStudioGenerator.cxx | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 0cc70c7d8b5..d5e58b0062d 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -6356,8 +6356,7 @@ bool cmGeneratorTarget::IsCSharpOnly() const this->GetType() != cmStateEnums::EXECUTABLE) { return false; } - std::set languages; - this->GetLanguages(languages, ""); + std::set languages = this->GetAllConfigCompileLanguages(); // Consider an explicit linker language property, but *not* the // computed linker language that may depend on linked targets. const char* linkLang = this->GetProperty("LINKER_LANGUAGE"); diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index ed0cba7ddfe..6569e5ef61c 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -810,8 +810,7 @@ bool cmGlobalVisualStudioGenerator::TargetIsFortranOnly( // If there's only one source language, Fortran has to be used // in order for the sources to compile. - std::set languages; - gt->GetLanguages(languages, ""); + std::set languages = gt->GetAllConfigCompileLanguages(); // Consider an explicit linker language property, but *not* the // computed linker language that may depend on linked targets. // This allows the project to control the language choice in From 55a0bebdd3d253f81bd89782702d481ac81110b3 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 2 Oct 2019 13:59:15 -0400 Subject: [PATCH 033/662] VS: Add support for per-config sources Since commit 97cc29c766 (VS: Teach generators how to mark per-config source files, 2017-04-10, v3.9.0-rc1~268^2~2) the VS generators have known how to generate per-config sources. We've now converted most other code paths to support per-config sources, so drop the check that disallows it. This leaves only per-config support for precompiled headers and unity build transformations, but those are optional features that can be addressed later. Fixes: #18233 Issue: #19789 --- Help/release/dev/vs-per-config-sources.rst | 5 +++++ Source/cmGlobalVisualStudioGenerator.cxx | 9 --------- Tests/CMakeLists.txt | 8 ++++++-- Tests/RunCMake/TargetSources/RunCMakeTest.cmake | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) create mode 100644 Help/release/dev/vs-per-config-sources.rst diff --git a/Help/release/dev/vs-per-config-sources.rst b/Help/release/dev/vs-per-config-sources.rst new file mode 100644 index 00000000000..bf7572b6ede --- /dev/null +++ b/Help/release/dev/vs-per-config-sources.rst @@ -0,0 +1,5 @@ +vs-per-config-sources +--------------------- + +* :ref:`Visual Studio Generators` learned to support per-config sources. + Previously only :ref:`Command-Line Build Tool Generators` supported them. diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index 6569e5ef61c..54124070d79 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -799,15 +799,6 @@ void RegisterVisualStudioMacros(const std::string& macrosFile, bool cmGlobalVisualStudioGenerator::TargetIsFortranOnly( cmGeneratorTarget const* gt) { - // check to see if this is a fortran build - { - // Issue diagnostic if the source files depend on the config. - std::vector sources; - if (!gt->GetConfigCommonSourceFiles(sources)) { - return false; - } - } - // If there's only one source language, Fortran has to be used // in order for the sources to compile. std::set languages = gt->GetAllConfigCompileLanguages(); diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index b29638bafe8..185401fc436 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -451,8 +451,12 @@ if(BUILD_TESTING) ADD_TEST_MACRO(StagingPrefix StagingPrefix) ADD_TEST_MACRO(ImportedSameName ImportedSameName) ADD_TEST_MACRO(InterfaceLibrary InterfaceLibrary) - if(NOT _isMultiConfig) - set(ConfigSources_BUILD_OPTIONS -DCMAKE_BUILD_TYPE=$) + if(NOT CMAKE_GENERATOR STREQUAL "Xcode") + if(_isMultiConfig) + set(ConfigSources_CTEST_OPTIONS --build-config $) + else() + set(ConfigSources_BUILD_OPTIONS -DCMAKE_BUILD_TYPE=$) + endif() ADD_TEST_MACRO(ConfigSources ConfigSources) endif() ADD_TEST_MACRO(SourcesProperty SourcesProperty) diff --git a/Tests/RunCMake/TargetSources/RunCMakeTest.cmake b/Tests/RunCMake/TargetSources/RunCMakeTest.cmake index bee8c4e38f1..0d462ba66c7 100644 --- a/Tests/RunCMake/TargetSources/RunCMakeTest.cmake +++ b/Tests/RunCMake/TargetSources/RunCMakeTest.cmake @@ -1,6 +1,6 @@ include(RunCMake) -if(RunCMake_GENERATOR MATCHES "Visual Studio|Xcode") +if(RunCMake_GENERATOR STREQUAL "Xcode") run_cmake(ConfigNotAllowed) endif() From 154aa87ca6bd906b6422ad81f51161995c89cc14 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Fri, 18 Oct 2019 00:01:07 -0400 Subject: [PATCH 034/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index c15eda7281d..beeb0a6dac1 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191017) +set(CMake_VERSION_PATCH 20191018) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From 8065a686ddcb54b10fd6758eca24280f3e68926b Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Sat, 12 Oct 2019 18:49:04 +0200 Subject: [PATCH 035/662] Initialize CMAKE_EXPORT_COMPILE_COMMANDS from envvar of the same name Fixes: #18386 --- Help/envvar/CMAKE_EXPORT_COMPILE_COMMANDS.rst | 9 +++++++++ Help/manual/cmake-env-variables.7.rst | 1 + ...t-compile-commands-environment-variable.rst | 6 ++++++ .../variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst | 3 +++ Modules/CMakeGenericSystem.cmake | 8 ++++---- Tests/EnforceConfig.cmake.in | 1 + Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 18 ++++++++++++++++++ ...xport-compile-commands-override-check.cmake | 3 +++ ...env-export-compile-commands-set-check.cmake | 3 +++ ...v-export-compile-commands-unset-check.cmake | 3 +++ .../env-export-compile-commands/CMakeLists.txt | 7 +++++++ 11 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 Help/envvar/CMAKE_EXPORT_COMPILE_COMMANDS.rst create mode 100644 Help/release/dev/export-compile-commands-environment-variable.rst create mode 100644 Tests/RunCMake/CommandLine/env-export-compile-commands-override-check.cmake create mode 100644 Tests/RunCMake/CommandLine/env-export-compile-commands-set-check.cmake create mode 100644 Tests/RunCMake/CommandLine/env-export-compile-commands-unset-check.cmake create mode 100644 Tests/RunCMake/CommandLine/env-export-compile-commands/CMakeLists.txt diff --git a/Help/envvar/CMAKE_EXPORT_COMPILE_COMMANDS.rst b/Help/envvar/CMAKE_EXPORT_COMPILE_COMMANDS.rst new file mode 100644 index 00000000000..e9e0810650d --- /dev/null +++ b/Help/envvar/CMAKE_EXPORT_COMPILE_COMMANDS.rst @@ -0,0 +1,9 @@ +CMAKE_EXPORT_COMPILE_COMMANDS +----------------------------- + +.. include:: ENV_VAR.txt + +The default value for :variable:`CMAKE_EXPORT_COMPILE_COMMANDS` when there +is no explicit configuration given on the first run while creating a new +build tree. On later runs in an existing build tree the value persists in +the cache as :variable:`CMAKE_EXPORT_COMPILE_COMMANDS`. diff --git a/Help/manual/cmake-env-variables.7.rst b/Help/manual/cmake-env-variables.7.rst index 96ceb945a80..c98f18f681e 100644 --- a/Help/manual/cmake-env-variables.7.rst +++ b/Help/manual/cmake-env-variables.7.rst @@ -23,6 +23,7 @@ Environment Variables that Control the Build /envvar/CMAKE_BUILD_PARALLEL_LEVEL /envvar/CMAKE_CONFIG_TYPE + /envvar/CMAKE_EXPORT_COMPILE_COMMANDS /envvar/CMAKE_GENERATOR /envvar/CMAKE_GENERATOR_INSTANCE /envvar/CMAKE_GENERATOR_PLATFORM diff --git a/Help/release/dev/export-compile-commands-environment-variable.rst b/Help/release/dev/export-compile-commands-environment-variable.rst new file mode 100644 index 00000000000..da9d66b7216 --- /dev/null +++ b/Help/release/dev/export-compile-commands-environment-variable.rst @@ -0,0 +1,6 @@ +export-compile-commands-environment-variable +-------------------------------------------- + +* The :variable:`CMAKE_EXPORT_COMPILE_COMMANDS` variable now takes its + initial value from the :envvar:`CMAKE_EXPORT_COMPILE_COMMANDS` environment + variable if no explicit configuration is given. diff --git a/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst b/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst index 4548abcc732..6d2450bc701 100644 --- a/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst +++ b/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst @@ -25,6 +25,9 @@ form. The format of the JSON file looks like: } ] +This is initialized by the :envvar:`CMAKE_EXPORT_COMPILE_COMMANDS` environment +variable. + .. note:: This option is implemented only by :ref:`Makefile Generators` and the :generator:`Ninja`. It is ignored on other generators. diff --git a/Modules/CMakeGenericSystem.cmake b/Modules/CMakeGenericSystem.cmake index 77d8cfd4fc2..7efe5c4646e 100644 --- a/Modules/CMakeGenericSystem.cmake +++ b/Modules/CMakeGenericSystem.cmake @@ -51,16 +51,16 @@ if(CMAKE_GENERATOR MATCHES "Make") set_property(GLOBAL PROPERTY TARGET_MESSAGES ${CMAKE_TARGET_MESSAGES}) endif() if(CMAKE_GENERATOR MATCHES "Unix Makefiles") - set(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL - "Enable/Disable output of compile commands during generation." + set(CMAKE_EXPORT_COMPILE_COMMANDS "$ENV{CMAKE_EXPORT_COMPILE_COMMANDS}" + CACHE BOOL "Enable/Disable output of compile commands during generation." ) mark_as_advanced(CMAKE_EXPORT_COMPILE_COMMANDS) endif() endif() if(CMAKE_GENERATOR MATCHES "Ninja") - set(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL - "Enable/Disable output of compile commands during generation." + set(CMAKE_EXPORT_COMPILE_COMMANDS "$ENV{CMAKE_EXPORT_COMPILE_COMMANDS}" + CACHE BOOL "Enable/Disable output of compile commands during generation." ) mark_as_advanced(CMAKE_EXPORT_COMPILE_COMMANDS) endif() diff --git a/Tests/EnforceConfig.cmake.in b/Tests/EnforceConfig.cmake.in index b7587aa47d1..7781ded84a7 100644 --- a/Tests/EnforceConfig.cmake.in +++ b/Tests/EnforceConfig.cmake.in @@ -33,5 +33,6 @@ unset(ENV{CMAKE_GENERATOR}) unset(ENV{CMAKE_GENERATOR_INSTANCE}) unset(ENV{CMAKE_GENERATOR_PLATFORM}) unset(ENV{CMAKE_GENERATOR_TOOLSET}) +unset(ENV{CMAKE_EXPORT_COMPILE_COMMANDS}) @TEST_HOME_ENV_CODE@ diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index b608d334a7b..f903c3d84a9 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -254,6 +254,24 @@ function(run_EnvironmentGenerator) endfunction() run_EnvironmentGenerator() +function(run_EnvironmentExportCompileCommands) + set(RunCMake_TEST_SOURCE_DIR ${RunCMake_SOURCE_DIR}/env-export-compile-commands) + + run_cmake(env-export-compile-commands-unset) + + set(ENV{CMAKE_EXPORT_COMPILE_COMMANDS} ON) + run_cmake(env-export-compile-commands-set) + + set(RunCMake_TEST_OPTIONS -DCMAKE_EXPORT_COMPILE_COMMANDS=OFF) + run_cmake(env-export-compile-commands-override) + + unset(ENV{CMAKE_EXPORT_COMPILE_COMMANDS}) +endfunction(run_EnvironmentExportCompileCommands) + +if(RunCMake_GENERATOR MATCHES "Unix Makefiles" OR RunCMake_GENERATOR MATCHES "Ninja") + run_EnvironmentExportCompileCommands() +endif() + if(RunCMake_GENERATOR STREQUAL "Ninja") # Use a single build tree for a few tests without cleaning. set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Build-build) diff --git a/Tests/RunCMake/CommandLine/env-export-compile-commands-override-check.cmake b/Tests/RunCMake/CommandLine/env-export-compile-commands-override-check.cmake new file mode 100644 index 00000000000..032a1ae1e1d --- /dev/null +++ b/Tests/RunCMake/CommandLine/env-export-compile-commands-override-check.cmake @@ -0,0 +1,3 @@ +if(EXISTS "${RunCMake_TEST_BINARY_DIR}/compile_commands.json") + set(RunCMake_TEST_FAILED "compile_commands.json generated with CMAKE_EXPORT_COMPILE_COMMANDS overridden") +endif() diff --git a/Tests/RunCMake/CommandLine/env-export-compile-commands-set-check.cmake b/Tests/RunCMake/CommandLine/env-export-compile-commands-set-check.cmake new file mode 100644 index 00000000000..a749a55a473 --- /dev/null +++ b/Tests/RunCMake/CommandLine/env-export-compile-commands-set-check.cmake @@ -0,0 +1,3 @@ +if(NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/compile_commands.json") + set(RunCMake_TEST_FAILED "compile_commands.json not generated with CMAKE_EXPORT_COMPILE_COMMANDS set") +endif() diff --git a/Tests/RunCMake/CommandLine/env-export-compile-commands-unset-check.cmake b/Tests/RunCMake/CommandLine/env-export-compile-commands-unset-check.cmake new file mode 100644 index 00000000000..c5878f06342 --- /dev/null +++ b/Tests/RunCMake/CommandLine/env-export-compile-commands-unset-check.cmake @@ -0,0 +1,3 @@ +if(EXISTS "${RunCMake_TEST_BINARY_DIR}/compile_commands.json") + set(RunCMake_TEST_FAILED "compile_commands.json generated with CMAKE_EXPORT_COMPILE_COMMANDS unset") +endif() diff --git a/Tests/RunCMake/CommandLine/env-export-compile-commands/CMakeLists.txt b/Tests/RunCMake/CommandLine/env-export-compile-commands/CMakeLists.txt new file mode 100644 index 00000000000..aa6fbfd86d3 --- /dev/null +++ b/Tests/RunCMake/CommandLine/env-export-compile-commands/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.14) +project(env-export-compile-commands C) + +# Add target with a source file to make sure compile_commands.json gets +# generated. +file(TOUCH ${CMAKE_CURRENT_BINARY_DIR}/main.c) +add_executable(env-export-compile-commands ${CMAKE_CURRENT_BINARY_DIR}/main.c) From f7acc1266c64be58793cf926b41f0d58b5a55e2a Mon Sep 17 00:00:00 2001 From: Deniz Bahadir Date: Fri, 18 Oct 2019 12:51:26 +0200 Subject: [PATCH 036/662] project: Add variable CMAKE_PROJECT__INCLUDE_BEFORE Follow up commit 0761186949 (project: Add variable CMAKE_PROJECT_INCLUDE_BEFORE, 2019-03-28, v3.15.0-rc1~294^2) with a project-specific variant. This variable will be used similar to the already existing `CMAKE_PROJECT_INCLUDE_BEFORE` and `CMAKE_PROJECT__INCLUDE` variables. Fixes: #19854 --- Help/command/project.rst | 7 +++++-- Help/manual/cmake-variables.7.rst | 1 + Help/variable/CMAKE_PROJECT_INCLUDE.rst | 3 ++- Help/variable/CMAKE_PROJECT_INCLUDE_BEFORE.rst | 3 ++- Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE.rst | 3 ++- .../CMAKE_PROJECT_PROJECT-NAME_INCLUDE_BEFORE.rst | 11 +++++++++++ Source/cmProjectCommand.cxx | 5 +++++ Tests/CMakeOnly/CMakeLists.txt | 6 ++++++ .../CMakeOnly/ProjectIncludeBeforeAny/CMakeLists.txt | 5 +++++ Tests/CMakeOnly/ProjectIncludeBeforeAny/include.cmake | 9 +++++++++ 10 files changed, 48 insertions(+), 5 deletions(-) create mode 100644 Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE_BEFORE.rst create mode 100644 Tests/CMakeOnly/ProjectIncludeBeforeAny/CMakeLists.txt create mode 100644 Tests/CMakeOnly/ProjectIncludeBeforeAny/include.cmake diff --git a/Help/command/project.rst b/Help/command/project.rst index 395145619fa..b6093d3b71f 100644 --- a/Help/command/project.rst +++ b/Help/command/project.rst @@ -102,9 +102,12 @@ options are intended for use as default values in package metadata and documenta Code Injection ^^^^^^^^^^^^^^ -If the :variable:`CMAKE_PROJECT_INCLUDE_BEFORE` variable is set, the file -pointed to by that variable will be included as the first step of the +If the :variable:`CMAKE_PROJECT_INCLUDE_BEFORE` or +:variable:`CMAKE_PROJECT__INCLUDE_BEFORE` variables are set, +the files they point to will be included as the first step of the ``project()`` command. +If both are set, then :variable:`CMAKE_PROJECT_INCLUDE_BEFORE` will be +included before :variable:`CMAKE_PROJECT__INCLUDE_BEFORE`. If the :variable:`CMAKE_PROJECT_INCLUDE` or :variable:`CMAKE_PROJECT__INCLUDE` variables are set, the files diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index cad0df6dafb..73f334f5ad0 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -216,6 +216,7 @@ Variables that Change Behavior /variable/CMAKE_PROJECT_INCLUDE /variable/CMAKE_PROJECT_INCLUDE_BEFORE /variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE + /variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE_BEFORE /variable/CMAKE_SKIP_INSTALL_ALL_DEPENDENCY /variable/CMAKE_STAGING_PREFIX /variable/CMAKE_SUBLIME_TEXT_2_ENV_SETTINGS diff --git a/Help/variable/CMAKE_PROJECT_INCLUDE.rst b/Help/variable/CMAKE_PROJECT_INCLUDE.rst index 965c94ee7cc..58352644977 100644 --- a/Help/variable/CMAKE_PROJECT_INCLUDE.rst +++ b/Help/variable/CMAKE_PROJECT_INCLUDE.rst @@ -5,5 +5,6 @@ A CMake language file or module to be included as the last step of all :command:`project` command calls. This is intended for injecting custom code into project builds without modifying their source. -See also the :variable:`CMAKE_PROJECT__INCLUDE` and +See also the :variable:`CMAKE_PROJECT__INCLUDE`, +:variable:`CMAKE_PROJECT__INCLUDE_BEFORE` and :variable:`CMAKE_PROJECT_INCLUDE_BEFORE` variables. diff --git a/Help/variable/CMAKE_PROJECT_INCLUDE_BEFORE.rst b/Help/variable/CMAKE_PROJECT_INCLUDE_BEFORE.rst index 70b15e662f5..280c14a0ea7 100644 --- a/Help/variable/CMAKE_PROJECT_INCLUDE_BEFORE.rst +++ b/Help/variable/CMAKE_PROJECT_INCLUDE_BEFORE.rst @@ -5,5 +5,6 @@ A CMake language file or module to be included as the first step of all :command:`project` command calls. This is intended for injecting custom code into project builds without modifying their source. -See also the :variable:`CMAKE_PROJECT__INCLUDE` and +See also the :variable:`CMAKE_PROJECT__INCLUDE`, +:variable:`CMAKE_PROJECT__INCLUDE_BEFORE` and :variable:`CMAKE_PROJECT_INCLUDE` variables. diff --git a/Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE.rst b/Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE.rst index 3485c38e445..74247f12b72 100644 --- a/Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE.rst +++ b/Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE.rst @@ -6,5 +6,6 @@ A CMake language file or module to be included as the last step of any name. This is intended for injecting custom code into project builds without modifying their source. -See also the :variable:`CMAKE_PROJECT_INCLUDE` and +See also the :variable:`CMAKE_PROJECT__INCLUDE_BEFORE`, +:variable:`CMAKE_PROJECT_INCLUDE` and :variable:`CMAKE_PROJECT_INCLUDE_BEFORE` variables. diff --git a/Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE_BEFORE.rst b/Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE_BEFORE.rst new file mode 100644 index 00000000000..db1432de657 --- /dev/null +++ b/Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE_BEFORE.rst @@ -0,0 +1,11 @@ +CMAKE_PROJECT__INCLUDE_BEFORE +------------------------------------------- + +A CMake language file or module to be included as the first step of any +:command:`project` command calls that specify ```` as the project +name. This is intended for injecting custom code into project builds without +modifying their source. + +See also the :variable:`CMAKE_PROJECT__INCLUDE`, +:variable:`CMAKE_PROJECT_INCLUDE` and +:variable:`CMAKE_PROJECT_INCLUDE_BEFORE` variables. diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index eb59b4f65a8..1ce6c70f627 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -39,6 +39,11 @@ bool cmProjectCommand(std::vector const& args, std::string const& projectName = args[0]; + if (!IncludeByVariable(status, + "CMAKE_PROJECT_" + projectName + "_INCLUDE_BEFORE")) { + return false; + } + mf.SetProjectName(projectName); mf.AddCacheDefinition(projectName + "_BINARY_DIR", diff --git a/Tests/CMakeOnly/CMakeLists.txt b/Tests/CMakeOnly/CMakeLists.txt index 03babd263a9..85b96942ab2 100644 --- a/Tests/CMakeOnly/CMakeLists.txt +++ b/Tests/CMakeOnly/CMakeLists.txt @@ -75,6 +75,12 @@ add_test(CMakeOnly.ProjectIncludeAny ${CMAKE_CMAKE_COMMAND} add_test(CMakeOnly.ProjectIncludeBefore ${CMAKE_CMAKE_COMMAND} -DTEST=ProjectIncludeBefore + -DCMAKE_ARGS=-DCMAKE_PROJECT_ProjectInclude_INCLUDE_BEFORE=${CMAKE_CURRENT_SOURCE_DIR}/ProjectIncludeBefore/include.cmake + -P ${CMAKE_CURRENT_BINARY_DIR}/Test.cmake + ) + +add_test(CMakeOnly.ProjectIncludeBeforeAny ${CMAKE_CMAKE_COMMAND} + -DTEST=ProjectIncludeBeforeAny -DCMAKE_ARGS=-DCMAKE_PROJECT_INCLUDE_BEFORE=${CMAKE_CURRENT_SOURCE_DIR}/ProjectIncludeBefore/include.cmake -P ${CMAKE_CURRENT_BINARY_DIR}/Test.cmake ) diff --git a/Tests/CMakeOnly/ProjectIncludeBeforeAny/CMakeLists.txt b/Tests/CMakeOnly/ProjectIncludeBeforeAny/CMakeLists.txt new file mode 100644 index 00000000000..5cd9cba2c01 --- /dev/null +++ b/Tests/CMakeOnly/ProjectIncludeBeforeAny/CMakeLists.txt @@ -0,0 +1,5 @@ +set(FOO TRUE) +project(ProjectInclude LANGUAGES NONE) +if(NOT AUTO_INCLUDE) + message(FATAL_ERROR "include file not found") +endif() diff --git a/Tests/CMakeOnly/ProjectIncludeBeforeAny/include.cmake b/Tests/CMakeOnly/ProjectIncludeBeforeAny/include.cmake new file mode 100644 index 00000000000..0a4799df35d --- /dev/null +++ b/Tests/CMakeOnly/ProjectIncludeBeforeAny/include.cmake @@ -0,0 +1,9 @@ +if(NOT FOO) + message(FATAL_ERROR "FOO is not set") +endif() + +if(NOT "${PROJECT_NAME}" STREQUAL "") + message(FATAL_ERROR "PROJECT_NAME should be empty") +endif() + +set(AUTO_INCLUDE TRUE) From 0671f71d70db238b35c7cd64296e0b9f3a5e68a9 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Sat, 19 Oct 2019 00:01:07 -0400 Subject: [PATCH 037/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index beeb0a6dac1..f129c3aa18e 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191018) +set(CMake_VERSION_PATCH 20191019) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From 41854d608ba2c76f81a1488a6156606232184a5f Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Sun, 20 Oct 2019 00:01:04 -0400 Subject: [PATCH 038/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index f129c3aa18e..ed093297c27 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191019) +set(CMake_VERSION_PATCH 20191020) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From a82a96f35b3970501cd552c36819f9313734f669 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Mon, 21 Oct 2019 00:01:05 -0400 Subject: [PATCH 039/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index ed093297c27..7c3804df206 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191020) +set(CMake_VERSION_PATCH 20191021) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From 24703b11b41e2e95d566ee911f0f87bdb47d4883 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Tue, 22 Oct 2019 00:01:07 -0400 Subject: [PATCH 040/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 7c3804df206..b966de986d8 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191021) +set(CMake_VERSION_PATCH 20191022) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From 44b5f037e66e58cb4b5f9877b568bc40b9b576ca Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Wed, 23 Oct 2019 00:01:08 -0400 Subject: [PATCH 041/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index b966de986d8..3332ba2f60f 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191022) +set(CMake_VERSION_PATCH 20191023) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From 39fbbd6feaec91bcb2d31ee01ec431d0791a2baf Mon Sep 17 00:00:00 2001 From: Johnny Jazeix Date: Wed, 23 Oct 2019 14:47:45 +0200 Subject: [PATCH 042/662] Fortran: Add .F extension to Source Files group While at it, improve source layout of the regex string literal. Fixes: #8768 --- Source/cmSourceFile.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/cmSourceFile.h b/Source/cmSourceFile.h index 82a3625b8b7..19a0d291366 100644 --- a/Source/cmSourceFile.h +++ b/Source/cmSourceFile.h @@ -154,9 +154,8 @@ class cmSourceFile #define CM_HEADER_REGEX "\\.(h|hh|h\\+\\+|hm|hpp|hxx|in|txx|inl)$" #define CM_SOURCE_REGEX \ - "\\.(C|M|c|c\\+\\+|cc|cpp|cxx|cu|f|f90|for|fpp|ftn|m|mm|rc|def|r|odl|idl|" \ - "hpj" \ - "|bat)$" + "\\.(C|F|M|c|c\\+\\+|cc|cpp|cxx|cu|f|f90|for|fpp|ftn|m|mm|" \ + "rc|def|r|odl|idl|hpj|bat)$" #define CM_PCH_REGEX "cmake_pch\\.(h|hxx)$" From 490da0bd337f33c51884d7fe3bd5ac042ac0b0c5 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Thu, 24 Oct 2019 00:01:04 -0400 Subject: [PATCH 043/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 3332ba2f60f..1c8e050c59c 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191023) +set(CMake_VERSION_PATCH 20191024) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From 2d1fd3f8188176e51cc30b64b471158a36916b65 Mon Sep 17 00:00:00 2001 From: Alex Turbov Date: Thu, 24 Oct 2019 13:07:51 +0200 Subject: [PATCH 044/662] Help: Fix missed extension for `CMAKE_MESSAGE_CONTEXT` release note --- ...re-CMAKE_MESSAGE_CONTEXT => feature-CMAKE_MESSAGE_CONTEXT.rst} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Help/release/dev/{feature-CMAKE_MESSAGE_CONTEXT => feature-CMAKE_MESSAGE_CONTEXT.rst} (100%) diff --git a/Help/release/dev/feature-CMAKE_MESSAGE_CONTEXT b/Help/release/dev/feature-CMAKE_MESSAGE_CONTEXT.rst similarity index 100% rename from Help/release/dev/feature-CMAKE_MESSAGE_CONTEXT rename to Help/release/dev/feature-CMAKE_MESSAGE_CONTEXT.rst From f0005dacdeb04be2d3777735af938ff76d9e3ad5 Mon Sep 17 00:00:00 2001 From: Felix Heidrich Date: Thu, 17 Oct 2019 12:45:20 +0200 Subject: [PATCH 045/662] Xcode: Add CMAKE_XCODE_SCHEME_ENVIRONMENT variable Initialize the `XCODE_SCHEME_ENVIRONMENT` target property. This was left out of commit 6b7f1e1db0 (Xcode: Add variables and properties to configure schemes, 2018-07-29, v3.13.0-rc1~243^2). --- Help/manual/cmake-variables.7.rst | 1 + Help/release/dev/xcode-scheme-env.rst | 5 +++++ Help/variable/CMAKE_XCODE_SCHEME_ENVIRONMENT.rst | 15 +++++++++++++++ Source/cmTarget.cxx | 1 + 4 files changed, 22 insertions(+) create mode 100644 Help/release/dev/xcode-scheme-env.rst create mode 100644 Help/variable/CMAKE_XCODE_SCHEME_ENVIRONMENT.rst diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index cad0df6dafb..b5415b79ddb 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -241,6 +241,7 @@ Variables that Change Behavior /variable/CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER /variable/CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS /variable/CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE + /variable/CMAKE_XCODE_SCHEME_ENVIRONMENT /variable/CMAKE_XCODE_SCHEME_GUARD_MALLOC /variable/CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP /variable/CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES diff --git a/Help/release/dev/xcode-scheme-env.rst b/Help/release/dev/xcode-scheme-env.rst new file mode 100644 index 00000000000..238cb618faf --- /dev/null +++ b/Help/release/dev/xcode-scheme-env.rst @@ -0,0 +1,5 @@ +xcode-scheme-env +---------------- + +* The :variable:`CMAKE_XCODE_SCHEME_ENVIRONMENT` variable was added + to initialize the :prop_tgt:`XCODE_SCHEME_ENVIRONMENT` target property. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_ENVIRONMENT.rst b/Help/variable/CMAKE_XCODE_SCHEME_ENVIRONMENT.rst new file mode 100644 index 00000000000..4832659ce7c --- /dev/null +++ b/Help/variable/CMAKE_XCODE_SCHEME_ENVIRONMENT.rst @@ -0,0 +1,15 @@ +CMAKE_XCODE_SCHEME_ENVIRONMENT +------------------------------ + +Specify environment variables that should be added to the Arguments +section of the generated Xcode scheme. + +If set to a list of environment variables and values of the form +``MYVAR=value`` those environment variables will be added to the +scheme. + +This variable initializes the :prop_tgt:`XCODE_SCHEME_ENVIRONMENT` +property on all targets. + +Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property +documentation to see all Xcode schema related properties. diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 99c16f23744..472287f0e0a 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -380,6 +380,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, initProp("XCODE_SCHEME_MALLOC_STACK"); initProp("XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE"); initProp("XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS"); + initProp("XCODE_SCHEME_ENVIRONMENT"); } #endif } From 5bc6230741008257c33e849e4b84a2c30c19d37c Mon Sep 17 00:00:00 2001 From: Charis Marangos Date: Wed, 16 Oct 2019 04:19:18 +0100 Subject: [PATCH 046/662] ExternalProject: Option to turn off recursive update of git submodules Fixes: #19832 --- .../dev/ExternalProject-git-no-recurse.rst | 7 ++ Modules/ExternalProject.cmake | 27 ++++++-- Tests/ExternalProject/CMakeLists.txt | 60 ++++++++++++++++++ Tests/ExternalProject/gitrepo-sub-rec.tgz | Bin 0 -> 9008 bytes 4 files changed, 89 insertions(+), 5 deletions(-) create mode 100644 Help/release/dev/ExternalProject-git-no-recurse.rst create mode 100644 Tests/ExternalProject/gitrepo-sub-rec.tgz diff --git a/Help/release/dev/ExternalProject-git-no-recurse.rst b/Help/release/dev/ExternalProject-git-no-recurse.rst new file mode 100644 index 00000000000..b9e09d35648 --- /dev/null +++ b/Help/release/dev/ExternalProject-git-no-recurse.rst @@ -0,0 +1,7 @@ +ExternalProject-git-no-recurse +------------------------------ + +* The :module:`ExternalProject` module :command:`ExternalProject_Add` + command gained a ``GIT_SUBMODULES_RECURSE`` option to specify whether + Git submodules should be updated recursively. The default is on to + preserve existing behavior. diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 66061a137d6..cd4e22d4e6c 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -265,6 +265,11 @@ External Project Definition is set to ``NEW`` if this value is set to an empty string then no submodules are initialized or updated. + ``GIT_SUBMODULES_RECURSE `` + Specify whether git submodules (if any) should update recursively by + passing the ``--recursive`` flag to ``git submodule update``. + If not specified, the default is on. + ``GIT_SHALLOW `` When this option is enabled, the ``git clone`` operation will be given the ``--depth 1`` option. This performs a shallow clone, which avoids @@ -1065,7 +1070,7 @@ define_property(DIRECTORY PROPERTY "EP_UPDATE_DISCONNECTED" INHERITED "ExternalProject module." ) -function(_ep_write_gitclone_script script_filename source_dir git_EXECUTABLE git_repository git_tag git_remote_name init_submodules git_submodules git_shallow git_progress git_config src_name work_dir gitclone_infofile gitclone_stampfile tls_verify) +function(_ep_write_gitclone_script script_filename source_dir git_EXECUTABLE git_repository git_tag git_remote_name init_submodules git_submodules_recurse git_submodules git_shallow git_progress git_config src_name work_dir gitclone_infofile gitclone_stampfile tls_verify) if(NOT GIT_VERSION_STRING VERSION_LESS 1.8.5) # Use `git checkout --` to avoid ambiguity with a local path. set(git_checkout_explicit-- "--") @@ -1153,7 +1158,7 @@ endif() set(init_submodules ${init_submodules}) if(init_submodules) execute_process( - COMMAND \"${git_EXECUTABLE}\" ${git_options} submodule update --recursive --init ${git_submodules} + COMMAND \"${git_EXECUTABLE}\" ${git_options} submodule update ${git_submodules_recurse} --init ${git_submodules} WORKING_DIRECTORY \"${work_dir}/${src_name}\" RESULT_VARIABLE error_code ) @@ -1394,7 +1399,7 @@ if(error_code OR is_remote_ref OR NOT (\"\${tag_sha}\" STREQUAL \"\${head_sha}\" set(init_submodules ${init_submodules}) if(init_submodules) execute_process( - COMMAND \"${git_EXECUTABLE}\" submodule update --recursive --init ${git_submodules} + COMMAND \"${git_EXECUTABLE}\" submodule update ${git_submodules_recurse} --init ${git_submodules} WORKING_DIRECTORY \"${work_dir}/${src_name}\" RESULT_VARIABLE error_code ) @@ -2421,9 +2426,21 @@ function(_ep_add_download_command name) message(FATAL_ERROR "error: could not find git for clone of ${name}") endif() + get_property(git_submodules_recurse_set TARGET ${name} PROPERTY _EP_GIT_SUBMODULES_RECURSE SET) + if(NOT git_submodules_recurse_set) + set(git_submodules_recurse "--recursive") + else() + get_property(git_submodules_recurse_value TARGET ${name} PROPERTY _EP_GIT_SUBMODULES_RECURSE) + if(git_submodules_recurse_value) + set(git_submodules_recurse "--recursive") + else() + set(git_submodules_recurse "") + endif() + endif() + # The git submodule update '--recursive' flag requires git >= v1.6.5 # - if(GIT_VERSION_STRING VERSION_LESS 1.6.5) + if(git_submodules_recurse AND GIT_VERSION_STRING VERSION_LESS 1.6.5) message(FATAL_ERROR "error: git version 1.6.5 or later required for 'git submodule update --recursive': GIT_VERSION_STRING='${GIT_VERSION_STRING}'") endif() @@ -2477,7 +2494,7 @@ function(_ep_add_download_command name) # The script will delete the source directory and then call git clone. # _ep_write_gitclone_script(${tmp_dir}/${name}-gitclone.cmake ${source_dir} - ${GIT_EXECUTABLE} ${git_repository} ${git_tag} ${git_remote_name} ${git_init_submodules} "${git_submodules}" "${git_shallow}" "${git_progress}" "${git_config}" ${src_name} ${work_dir} + ${GIT_EXECUTABLE} ${git_repository} ${git_tag} ${git_remote_name} ${git_init_submodules} "${git_submodules_recurse}" "${git_submodules}" "${git_shallow}" "${git_progress}" "${git_config}" ${src_name} ${work_dir} ${stamp_dir}/${name}-gitinfo.txt ${stamp_dir}/${name}-gitclone-lastrun.txt "${tls_verify}" ) set(comment "Performing download step (git clone) for '${name}'") diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt index 093391e3fbf..ef81169ff44 100644 --- a/Tests/ExternalProject/CMakeLists.txt +++ b/Tests/ExternalProject/CMakeLists.txt @@ -482,6 +482,66 @@ if(do_git_tests) ) set_property(TARGET ${proj} PROPERTY FOLDER "GIT") + # Unzip/untar the git repository in our source folder so that other + # projects below may use it to test git args of ExternalProject_Add + # + set(proj SetupLocalGITRepositoryWithRecursiveSubmodules) + ExternalProject_Add(${proj} + SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/LocalRepositories/GIT-with-recursive-submodules + URL ${CMAKE_CURRENT_SOURCE_DIR}/gitrepo-sub-rec.tgz + BUILD_COMMAND "" + CONFIGURE_COMMAND "${GIT_EXECUTABLE}" --version + INSTALL_COMMAND "" + ) + set_property(TARGET ${proj} + PROPERTY FOLDER "SetupRepos/Local/Deeply/Nested/For/Testing") + + set(local_git_repo "../../LocalRepositories/GIT-with-recursive-submodules") + + set(proj TS1-GIT-RECURSIVE_SUBMODULES-default) + ExternalProject_Add(${proj} + GIT_REPOSITORY "${local_git_repo}" + CMAKE_GENERATOR "${CMAKE_GENERATOR}" + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH= + -DWITH_RECURSIVE:BOOL=ON + BUILD_COMMAND "" + INSTALL_COMMAND "" + DEPENDS "SetupLocalGITRepository" + "SetupLocalGITRepositoryWithSubmodules" + "SetupLocalGITRepositoryWithRecursiveSubmodules" + ) + set_property(TARGET ${proj} PROPERTY FOLDER "GIT") + + set(proj TS1-GIT-RECURSIVE_SUBMODULES-exclusive) + ExternalProject_Add(${proj} + GIT_REPOSITORY "${local_git_repo}" + GIT_SUBMODULES_RECURSE TRUE + CMAKE_GENERATOR "${CMAKE_GENERATOR}" + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH= + -DWITH_RECURSIVE:BOOL=ON + BUILD_COMMAND "" + INSTALL_COMMAND "" + DEPENDS "SetupLocalGITRepository" + "SetupLocalGITRepositoryWithSubmodules" + "SetupLocalGITRepositoryWithRecursiveSubmodules" + ) + set_property(TARGET ${proj} PROPERTY FOLDER "GIT") + + set(proj TS1-GIT-RECURSIVE_SUBMODULES-off) + ExternalProject_Add(${proj} + GIT_REPOSITORY "${local_git_repo}" + GIT_SUBMODULES_RECURSE FALSE + CMAKE_GENERATOR "${CMAKE_GENERATOR}" + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH= + -DWITH_RECURSIVE:BOOL=OFF + BUILD_COMMAND "" + INSTALL_COMMAND "" + DEPENDS "SetupLocalGITRepository" + "SetupLocalGITRepositoryWithSubmodules" + "SetupLocalGITRepositoryWithRecursiveSubmodules" + ) + set_property(TARGET ${proj} PROPERTY FOLDER "GIT") + endif() set(do_hg_tests 0) diff --git a/Tests/ExternalProject/gitrepo-sub-rec.tgz b/Tests/ExternalProject/gitrepo-sub-rec.tgz new file mode 100644 index 0000000000000000000000000000000000000000..b0f3f18b745a7586305d7290343c8a4b83afd152 GIT binary patch literal 9008 zcmV-0BhTC)iwFo;RIXhF0B31*a%FIDEpv5ZEplaJE_7jX0PS4`l=DOoMjjU2^}!Mj z`WNa4cW_5>cXvyh^e)gQB}swe?(Xkl4|jKWcXxMr=!3_DhkUb=r0v0fSg|hLf05nU z+1Z)d*_qi~*>x)R$RvMh$>npo!NI{va-y{V&J_xUN%H+mEYZLC61l;}m%#JELcV_z zmYbvtrQrvLH%YE5ef{MnLhRplyjtmc0{oXIf5k9oJdK@B{R> zv*DS(YCB1cj;j$_m;lSQIB%q-Im zSTJh)j0B%0Vmy*yfy<}`-dnLonV#7GJIiV-FTc_xe{q?Z{O1aTZR`KQ;!6~I^52c( zS(PD%fBfvIWte`ph85ZJdeZ!VDWk5tgP)z`FD<#;;$zEyRNC$TJjwqOlXRi{&*fjt zzfrGOn{^{7kEUz>NX9p6^{O?=pH(KN{|EaA+U&pn{`}%S{ojqU(1O{L?PUE?Z6R$T zw!FivUHIfPVhkqiKC=1BqgHtbZuFJiS`GGL)g56q%lC~D*n-9mmcvR-K!`YrRXn%G z3_wiR47;i-XLv^&jjA3--A2_!uK>BT9gH%^b<(?9p35*VLBnT81?v&BeZOHlBLFA* z@Z7p*8-W#~U{@GHFr2_=0X25(F>Es|>=B>{M78SfY?-Jktlg-pf=ITnLKc-Aqg1uH zQOu#Fux64O9GS@kN^g}TJ)>zEHev^9e>Ck|L8GpTKJc!n_f5bXfY~WsH#}^e(`nq} z8Z;0>De4lSq^<>)AF%W;Oz#Up=xmWiKsc-1`mk@e{9=0Fa{39Y7 znYIuvjew0B{urW|VdKyj0PzbNun`NfmN+k_4S8a!2P{sH>tmIhRJNxGU)k;dK2S3d1h4}!%njFFp(vEtPKL);U45f%m*04!)z;l$+tpWEd7X{e z?#xI1w8Ij9cAKpxWENd!t7K-;zHG}dhS*m5Y(0?#xDlYh(mVQ0-=+_sb!fG`&UW9O zS>;iXN<3R;8U9!!Dr1Zxx0XrgT0S!y^{R~}@5s_+H6nOKvfFIQrrCPYJpG$B6G@KeZrU^))nyhbu$6utk7+pn=CwV> zp`riUBJ_X7uelC6a?(2!A!~;7XRZSi(fLZA@im}sc~wno z_>lF$v&+FSzlLw#flBek-RkSDI5f0w-Es=U+OMt`wi8$*9tpsvlA}<4!e|iG{h@5O zVw9~C8e~SG!W*TG?Pe9@Ws^d$;|*8Lbqg}rs58?Fta1QM0LQU*hF&+Jm`uB3<2@-< zpKGNStz9>Kl30VOXvTzc!}FkCt4)?q0tCGa?3x91u_igLZy_FLl7T3qAOW?8@+69& zYu>_b1oehmHB8*m;vg_ki`Y)2yDf}3!qB&!vT&M?AOhm>UNdYxSbNZ~;6XIN5>Yh* zyj5!5bKL-|B*4(!&aSru*X^EVaYTGl*+#%uT|yBrF%Ro(yw-1Bg?4OMUNe+@T>=jP zBSEtuLWKC`S(#8#Fq*oo&>pSr6X?CxWE1)%(NnCC2AhP=U2gdeR^5a%&WfQqK_ED{ zc*GQHrZmm2L?BqPi1{J~yAWZ6r$KzWXb@`Vrs18TFMwp?I?M7oRfe@an1u)y!7^=& z=^HzKqh5DCBBK~bI7ES(LLs4$No2MHjWSpsQ1n$W`7|pfqr3yhqii@NFPRKgLw6bx zqYuQ|mL_mpn!RB$xNX*D#XVV~<~RKWtsm+^xjC}4?IiekTN=`^HnpAp!qCvFR^u8=odp+E+VU36RC`Nw`St zxpC@4?qV{{8E@2ZMwBEA)*|x>?a|zE1CZTte4C873BbGTStOgn8b$l41uDaO1}u-v zSU*T+@EZS<#2RH-U@#s0Q7)q?iCu$)n-4d9>bc{n`%`b;@co1CWN=)!PEsUB?J8iMM?Xy2mxzH*yzI( z@5y#Bm$q7xhaw2Sq2q>A1?j`4T!CW0vRigoPX6}3>ug)!VFdVC=#C~gRHkcexb8Yb zLz`_#3=vkO&4qfwStXBu_Tc)=9i#Pn>vgnNFLY|C@Nn@atd(8{jGbPl5mc5;FJoF| z$n=D82uW%}ON>m7Fq%|cPLL)NmWCfH;ZzB~~48oZILwOt1qiZ#c@BE*}^vIUU}Lxi1Xq0ppN3S?)a z=}WGR8H27P{TrSi$i>HZslBKw-x{(mpeg6b&gheCPZ%x%4B{rWm+lK6wH;+>S7GdsooyNAQCdChoousV zh_PhC+10aK zr0PnMEOC4#_RHV~^o~!1nuZFT#SagBQ|`I@t$*=Ei?~`+tQ0muUC@4)pxL z-6`Ys|4IiT_L+6aXG_8m8O>yZa=il}W}{XTRvhiC{NK78jqxHmMJd3+b(DC7IEsgE z(za7^d(!*IiV}$m59Q*2Bn3OC&c05k_+34}WVU_xF`{1pjQ= zABX%S*JGd~{@cGqPyV}6{!ICwSRB}K!!WSl8PnAk`VBhZ7c_vj(4VaXA(K zk|>lz%a+NS)=pWcf$d*mnMLv%x^=W^j1j|z@2f~vG;+lXf21AQMpa@pg#BKn!emXZ zE^GCmDg69yX?yIuBRE3Uj2ciw;uT8=qGs5AQmfeHVqd+&nr=h6%|ry7({=d`S6qE{ zK1$)(gFfQ}r!cN99RU0&Mn>a}(8ln~wvEoCZ~#V+08UjXxJ*mEB=x?5C0qv5HzT7Z z*t}(gMVCjElm`Ml*GHfRfe(tfFia{&MYCr)CP#ZG*EYvOdzehpoxn;WJW>;jP08Z? zVVc|((4M5uHnqtATXkgw9}x$-F!&wd@LeLOfJeSwVm=SJ@b|cb{?jQ6;|@dwx%9Ew;_U4o(xa**%|2#udfZ<3kfb~sFKjKHqiL6Zoups}!M@x>|yHmk$;&fUP|)sXI6c#q+NCEvC{4f}V#q;c*Lyqr##4RQ?Og61ks zu47!&yEG;c#49e((z~)g#q_(A4`8how_Sd%wTdg!pwlKxY{}AlZoO45fw=q5WyIf; z+yx^As|?C5z4TTque*x2GI<1s*z!R@f)nOTL`)NTu_4BkHbCBR{DA7jaG38JvL#x? zg-6@O#MUhr`jEUiE;+M9UiAqWDL_ec)UkzbGJ42ZpF^-Tcd7U(!Tuao zWGjHP(OXD55i;OG7%9POw$mcikWO!nxzXo>8qd#}zu#;A5#PY}V{N7%z|k9Bnr_@`k%|nJ#KK&|A}B39o{9!=(5w`j z6V7mIA~PwXZdR{wov4r_4JVgiqup%8J%_{n^bxMo4pi134XDg<=U{}cc1fX9Q_8WZ zSr~#p#GCcyq0rbmDuFQ?N8pl9EmM2Z5#UOD#6$)pH7!unjW<|p;&r*U=5O$fqXmM? zh^xW%u^IL|icnr;SchY^u%uTr0+d4w7LSk0sf&zaUtmIOg1|r$i7=wnh^ozVU_|B` z#dW2@5MVhlJc_}=yi>LTbtA~c*wWk!PiKpkQP(&XoX3qooZf^t;#D*+LJ!f-U}sDc z&w^C;9>))~kMO58jk=F=QbXGf@c5kSo36f|&L+^R4qR!~AEAhA66>)*pvcn-8(tL` z1>_g*x_GXb8)wlpkg!SvLW(6H>9!b~yu!fbOwmJmNl!Hs!60cahE;V6@}X~r0Io1} zV4$rAQdi0Fs)7&kWJsGvY$a540kpln0zlTLwKLgv2-T#xgkvsgL!d}VmAEZejH805 z)Qy0!G55Y=8bo9qe9{h(LhYRZx#I0A%k_3Sl;-a{n+I3Nskn%}M z0A=bX>QlNV?@HfJ5(IU^jCegxh$uZ%Uxn=Js5{QUec{xlNO36XBTS_oC2*!6E~T0X zbN#EWn`r&_tdimX72%(WtpEA^;)@qL{6D$g`Jb+oR{zh6ZoTQ*Bcn)R!gi|w*L;fp zU6QSV9B7xV2vvj_t{XaV^@wrwa4q#34n?HZYAzf>vXWHGVy{Eq8eDJhmQu92ply#- z^3ei?=X_^RP#vyyntaJu%OYU3E&8E*`FAhwd`DjQ1L*UbSnOc^Sd^^bla|`S5-4T( zk}exaZ77ydFf2@+GRIZV1n9PiC@qSs7Aq?hv&g;gTZq=Eg51XQ;S}}Q0c2WzY1xtQg!=cJwUUd3`ZOwXciVPI zn3TKQ92*A0w0$P6EmBFnMm-3Trqp4+CFL#oUYNdB0#tYpI+|!P1eRSkyC_l+hle%% z`t>e^N5IeU+LmvW$%tNu=M;(^y=72JgR)L}cVjXNnz;_WC%Z-*!6r-BC$o9oHSt1L z#Qm}wKjp#a-jX0a^docD@E!!?yu*o=-cgOSB)ireOuF8OOz z2n*-~gNX0Q<4mrvZK=Vw`BvgYwAep?Op~o5!RshKD%) z5`(NLEy>TZY3nUQQgjPjYpj`593CK^3a zW8wpyD04;xj4|jmE$1Wn=^yk{Yf5n;dz-S_x6ExlET7kWp2WAPtU;StX=O&EkC=(N z47I|LOoF5Q`GsSsQ}TSxsEfqX>^2j&%%zty(v__jOS0@RJ)3})tGEo3Q*K8U=OXMw$5Y+7$+wouf~58k^a-; zDCr&gro~$d-||Z9uDC5vqE(A>P?xBu!YeKoq_5y5R$OK~{M4QZF|i4jO#&oS zI-y2g4>i~?GU!^k!o`+VdTmHk0yV+)r3S(!u{Dq9Akq;N z!h+gchF7&o>)Jk@F85&}(gw2~qcF|B)Z}#GHVOd{tD{Z8=`utPsL*uE3|4-whlUN< zWpW&NO|D|(2x`WC+C_EUQi<@s#0%I0`X_Als&+7AJmutXxYHktH+m*77s~ z@sAi1dJMTJCCJLdT9UM!V`T-wIMV->QX#LKkOm8{kS~vHcqG+Ekd>fTY+uMZ*>Lq>8QZ z&?`xf79>HcsOjlgP-0Nb#5=15M%P5TFqvS)2UP7D9-hA2e_VC1jr%7M?-u z&l{Jk7V0)=moNld&_F%THr1vw@{}8oH#RC2ahy#w zl~E=PZ3Rq*3+a#+nooo*Q;IIF4FK{WzuDn&vPT^xoJ_(g^;Mobu06iO&^DM49jE6UEf@`!ab0gFAtpMJP$B>gV}VM)v#c1B`DMX#v6 zQZ*4NwY4lnX?a?;2p~tNm4`Huc52YGrsplPj7s>s^BT4I0|PDTr^J>Yvr<+) z`(;4tO8%4qE&O3Cbk@v3vykbYa5=U{xsAg0zI}wmsPWALS2&jI-xzRLj`4n4$ zOZbYkPis>mLX|Ji<;8UuR-MLmBb} z|GBn8YsVtkO^4GO&<9Z6#KdE6NVXBwBy@hEhA5(j*hhfs&^z+@+4*%$s8sRVvS6>8G_`&WB+Ctf1|ulP9YU*Q0r*!N#@i+6ngWr-zv z`Tt!hER-#Y;U76H-ignZGBwPqI9uU3p4)?1)>q>utQ@YTK^6-bSmhyUw;N zuDkI%8!0b|U4(yu2mF+81qoj1YVgbLrZHW0VoK+SPm5c1R0R;!k$y>DiTsjy6cT9B zWEjHI>EF=)V6ma3X~aWt1#u7yEn3_|CkG6*93IBMf`G}EkQO;E@r&~NCfIB-I1%uk z2e>Nse_Z?ZiqQY+^FM#hcfcl=|1(%<&;P;qB75I|=}H-|{+Ar`JHG%n);GUezW9aq zt)J6M$tWF%$lJueLM_3_CTJ@gVZY_Wd@aYn7?z+tw1*U6a;in&@9JzVu#yQzvN6wh z{H5%o6q<%`R9ci5{H~>_P5Q7RwPq+e`C2QFy=@`dY?46hZZc*m`hq z(0O_aSdH~zwM<5bzp+~HIGQ8BrxNejlBwK$o2!yPRfez3w@PDowGbM$ewQp24+ql= z(O$ICC0HUn5m9mip=^fHN$L&ugp(k?s*8vLx<=3RK^~9a^BiW{cZIwZhJrc4JyX$* z@`L^Hd{8aLd6XO>{OfWmvC5<`p~W1D9wx6!pWqpBUGa@IOy7#@uDv$a__a4&b=y@| zUu)%JUtT@haNUhJSP>5j+J>twpD*_HYg${3!OoNnWYPkk1b1`Gj}%O(Ww*&pY)-S8 z45}^EmrauAyA2Ee;WTMvv|y9!BV5Sjpxmw0?vzSR{+Cn|_b6i{h?yX>O%!=RoFD0C z+jZoEcW}yfXgLizYJhE)4nXyBMqX?&`r1!!EachnF!i=*Qe1GmWz6r;iG~}k{JTFz zXUiZjMTpY$<&rAGycmJ)q(PRlg-iKVeVDEjTfm7zWNq~3Z@D?S(616VqA9^zP*7-F z;?%_!ON`y;Z?xIO`u~?5{T|QyKbY%p&;Q8}EZ)oi?MfN%`d{Lo)oI|XTky&V$E-0T zqEJE=!D%~&6`-~ybZA`I0#T+a|L#0=f=K>MyH!(MAk6a{7f^LtT;wqEummpByx<~s zL?Si-ypSp!2bp*vz_&y;DS3j7|5NW_f7Hb4K&TP z;vzh2fISgRcs-E!m(ch_NbnETH7AaQLA{gfp8DpEZ1r)g@Y_q7Sf?DE9sK&(g~xTg z!8>#E^~h)V}ekz~(LqVbhS1?-RuJIrD^HTp_K4@#_yC)7u7g>npy z40j`_hHOIYv{Z_&M4pC77;iG!A@7Xfw>D;dIkvP&{ublGg&52-NmVln#7D!Blz_9v z6%Rz~=w1Nn7-oaaqM={uwY^hGPNhlO700ifgKV#w)H=BRS6X+}O=^lk$I)6Q>g!3Br59_+4OG4J zZx-o`!p76lL{9mli!RF66V2i{@D+o$oI(#+T)bOmKg{HlJfJ>Q*{oZ>Fz6(gk>uu3 zu!W*u6i-M%mX$FcxGHpN&?=YFXx~`WbK@+!VEc%ri?}8bG3FMpwk6bxqA!*56unSW zX9Q_J^mL%`Peyr=kz}RNVc1wYAbDmatvuO9Q}P=IJZZn-q+1q9JoHDg{oPh6tiIjk z)j|tJF!qQJEwsx@bV@ch$Z4VprF~pSuSh{^=`|%2J6hKUJd1dR&vz^2jeU!M>Xaao zwlTm>X`gMK;CxJox10^7ljjIO2U06`oDTpGwbD&YkD!~lCZG{1TIFw|gjh+gh+h+Pj#oT|kI%InjHlkmm|6@Yp_(MZ>;RETmKkHl*5+vZ z1{zFsswnxljmPEct|$;KIFU4_4P3TsUR3zi`CCz04~Fbv;^>bT`%X^l7(~Y^^IQ1s z&%#$&Qtk8(==gbLR&_QQdx&AXKXYp*_MFqag%Y%*LtGpA?S{}%bKVKGgBaGC^ zD-qafIFvl)(1OIBsg3Yh7O13zj^2nGadj@Ri;!zy=~j_x3;%^vO}#SSLf=vQi~s!B z@A&&)1A_y-zyH;h!sp-Gg}nTKzTQoSiCy1=#k^@QZ`!={kVrD25&u&;wU*DfL|;U&C5O;>(ae^vu{B-n*<01xiuj7u zU;7sze}n!nHlsNHUIhYU&jK!WBv!1SiCp?-6*m7&-dqZ=HOt($Stwd zk^=*U!Sdqy!eD8jV3y3nQii!y$;w%UNq&2o*!n+^FSO2oeu-S6m;ck1vdg3=9JBm} zFXv`DV7G5Be__X^UO4HTJJ$N}+2anr@a20d<`la=z2p~9O`UppwZi0gzjOQ5=Ph}| zHRs;F_Svsq|N6_MYoDLmWTw;lw>hUd<^9K< zz2xYnH{Nx`L8}F?ZMN}qb3WuQagZi=SNn#F5kt`yR!voBI0Itf!ZI z`okq&TK$dBf1353{!KH-xl0{%_qV5AwD>~LCazlUiU&^F^U%nc=KFfXk+;sR=TTSx)F>{>t!OK6LeB~*RojBWzD=hWdB0oNM+||FhRx^RWG9`sC>59t*5+`Y}H~wOMNLaAayf0ar8 zmZIc;$$yysAL#Gt|8A7n{4Y7MRM{NNErB4S0foP0$sAY;KZU}QMt`|KZyAF|X{mup zetVgi{x7u8e;$`T{oj?c%cP4X*I0Yw+~U`4ms^~^#k~F#Yd)TO@X>XXkFK7s+;By4 zVBPoje13r=UVUxK?9Q2`syAKu((D&K^5S5A_}RqOH=MKC<>#EW|MIJB_QtM1?EAoV z=ghO}*R`8=TjKf0_Wb;TCmxw(>e&um^Emci{(`l>xNe#3w!7Z`-FlC1y87jZOt#da z{YOqd$xYMbXP=~3{??-8f2sUGOaJG3{=cr2*!(YL4Gb)`gt7SIOI0eEic-IsAG9i! zQfaV%$w708!NGh!Z<&+)_A*iZU&wdZ{{#I!{ojqU%cQ40`lvS9g0mg?=5yQJ`{Gn@ z&UmCY^YRzZvGqN37yGrd4=iuJ*9u!Nf0+AK=Jdy(KXt>Y9(?x9LH&x?)_H8IyO+r9 zzx>efK@T3Wy1jmL;i;#8%qe~Q(Uk)?tX#DZnra}m!>eze`p^cK-+a{Z8*V=Nt@g$1 zZlBopt10#$C_S*nVoQ2=E;VoCmYu(Qe8&}joNuS>g^5?*nD(j}-)pRN*Cf5t&7$Pr z%>A?Uf6xEZof4b>(%=&2fR!(sl_iZzxv*rZw0NmMXDwA)%2>RNfJ_O_pv8aBoJ>Uj z<8_Dr?;q@a|FJ7&mr2)r=)rY2$PJbb&Schph}-=eueWdi38fpCoOYHq3$s;cf1|Y3 zspqb|)N+#+i+k++_)M>U`N*-;ZGD58pL3GI@8>yxl3w{Y7bX9HWgft9(Elp_yLi6m z|LICm^G^pf{z3EKKRD2v|85jyjQzF2-`_L;l>gJ4|E`oUd-N~lg5NOz(*8q>p8oGj ziOs+G^wA`Lewmp4pIf5c{>KM^dih^nDNE(Y=l1I*PW?BFIsoz)s{h}j|Hb-`+J&C~ Wr&oHVS9;|yEk6U388eyyssI20CF7R> literal 0 HcmV?d00001 From 5a3f539cd50621298d15df639c29a9c09aace443 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Fri, 25 Oct 2019 00:01:07 -0400 Subject: [PATCH 047/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 1c8e050c59c..05137c83f6f 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191024) +set(CMake_VERSION_PATCH 20191025) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From 3300070cc2e7cadcb0fe2a77d67d2099bf22e7ba Mon Sep 17 00:00:00 2001 From: Sylvain Joubert Date: Wed, 23 Oct 2019 16:32:31 +0200 Subject: [PATCH 048/662] ccmake: Display an ASCII progress bar in the status bar The status bar is now only used to display the progress. The status log are not shown anymore since for the most cases they went by too quickly to be read. As for cases when a process is long enough to display and read a log, it would probably be a previous unrelated message. --- Source/CursesDialog/cmCursesMainForm.cxx | 28 ++++++++++-------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 6b71e8a10a4..3f7ee89d542 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -469,14 +469,18 @@ void cmCursesMainForm::UpdateStatusBar(const char* message) void cmCursesMainForm::UpdateProgress(const std::string& msg, float prog) { - char tmp[1024]; - const char* cmsg = tmp; if (prog >= 0) { - sprintf(tmp, "%s %i%%", msg.c_str(), static_cast(100 * prog)); - } else { - cmsg = msg.c_str(); + constexpr int progressBarWidth = 40; + int progressBarCompleted = static_cast(progressBarWidth * prog); + int percentCompleted = static_cast(100 * prog); + std::string status = (percentCompleted < 100 ? " " : ""); + status += (percentCompleted < 10 ? " " : ""); + status += std::to_string(percentCompleted) + "% ["; + status.append(progressBarCompleted, '#'); + status.append(progressBarWidth - progressBarCompleted, ' '); + status += "] " + msg + "..."; + this->UpdateStatusBar(status.c_str()); } - this->UpdateStatusBar(cmsg); this->PrintKeys(1); curses_move(1, 1); touchwin(stdscr); @@ -489,11 +493,7 @@ int cmCursesMainForm::Configure(int noconfigure) int yi; getmaxyx(stdscr, yi, xi); - curses_move(1, 1); - this->UpdateStatusBar("Configuring, please wait..."); - this->PrintKeys(1); - touchwin(stdscr); - refresh(); + this->UpdateProgress("Configuring", 0); this->CMakeInstance->SetProgressCallback( [this](const std::string& msg, float prog) { this->UpdateProgress(msg, prog); @@ -563,11 +563,7 @@ int cmCursesMainForm::Generate() int yi; getmaxyx(stdscr, yi, xi); - curses_move(1, 1); - this->UpdateStatusBar("Generating, please wait..."); - this->PrintKeys(1); - touchwin(stdscr); - refresh(); + this->UpdateProgress("Generating", 0); this->CMakeInstance->SetProgressCallback( [this](const std::string& msg, float prog) { this->UpdateProgress(msg, prog); From c168e789dfeeb4e0bd5db96bb17e682a9fd92b1f Mon Sep 17 00:00:00 2001 From: Sylvain Joubert Date: Wed, 23 Oct 2019 17:07:15 +0200 Subject: [PATCH 049/662] ccmake: Use the error display for all the logs --- .../CursesDialog/cmCursesLongMessageForm.cxx | 7 +--- Source/CursesDialog/cmCursesMainForm.cxx | 41 +++++++++++-------- Source/CursesDialog/cmCursesMainForm.h | 11 ++++- 3 files changed, 36 insertions(+), 23 deletions(-) diff --git a/Source/CursesDialog/cmCursesLongMessageForm.cxx b/Source/CursesDialog/cmCursesLongMessageForm.cxx index e2d8d06b499..4ff3fe49020 100644 --- a/Source/CursesDialog/cmCursesLongMessageForm.cxx +++ b/Source/CursesDialog/cmCursesLongMessageForm.cxx @@ -8,6 +8,7 @@ #include "cmCursesForm.h" #include "cmCursesMainForm.h" #include "cmCursesStandardIncludes.h" +#include "cmStringAlgorithms.h" #include "cmVersion.h" inline int ctrl(int z) @@ -19,11 +20,7 @@ cmCursesLongMessageForm::cmCursesLongMessageForm( std::vector const& messages, const char* title) { // Append all messages into on big string - for (std::string const& message : messages) { - this->Messages += message; - // Add one blank line after each message - this->Messages += "\n\n"; - } + this->Messages = cmJoin(messages, "\n"); this->Title = title; this->Fields[0] = nullptr; this->Fields[1] = nullptr; diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 3f7ee89d542..c76cc42ced5 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -34,6 +34,7 @@ cmCursesMainForm::cmCursesMainForm(std::vector args, : Args(std::move(args)) , InitialWidth(initWidth) { + this->HasNonStatusOutputs = false; this->NumberOfPages = 0; this->AdvancedMode = false; this->NumberOfVisibleEntries = 0; @@ -480,6 +481,8 @@ void cmCursesMainForm::UpdateProgress(const std::string& msg, float prog) status.append(progressBarWidth - progressBarCompleted, ' '); status += "] " + msg + "..."; this->UpdateStatusBar(status.c_str()); + } else { + this->Outputs.emplace_back(msg); } this->PrintKeys(1); curses_move(1, 1); @@ -505,8 +508,7 @@ int cmCursesMainForm::Configure(int noconfigure) this->CMakeInstance->GetHomeOutputDirectory()); this->LoadCache(nullptr); - // Get rid of previous errors - this->Errors = std::vector(); + this->ResetOutputs(); // run the generate process this->OkToGenerate = true; @@ -524,7 +526,7 @@ int cmCursesMainForm::Configure(int noconfigure) keypad(stdscr, true); /* Use key symbols as KEY_DOWN */ - if (retVal != 0 || !this->Errors.empty()) { + if (retVal != 0 || this->HasNonStatusOutputs) { // see if there was an error if (cmSystemTools::GetErrorOccuredFlag()) { this->OkToGenerate = false; @@ -532,11 +534,12 @@ int cmCursesMainForm::Configure(int noconfigure) int xx; int yy; getmaxyx(stdscr, yy, xx); + const char* title = "Configure produced the following output."; + if (cmSystemTools::GetErrorOccuredFlag()) { + title = "Configure failed with the following output."; + } cmCursesLongMessageForm* msgs = - new cmCursesLongMessageForm(this->Errors, - cmSystemTools::GetErrorOccuredFlag() - ? "Errors occurred during the last pass." - : "CMake produced the following output."); + new cmCursesLongMessageForm(this->Outputs, title); // reset error condition cmSystemTools::ResetErrorOccuredFlag(); CurrentForm = msgs; @@ -569,8 +572,7 @@ int cmCursesMainForm::Generate() this->UpdateProgress(msg, prog); }); - // Get rid of previous errors - this->Errors = std::vector(); + this->ResetOutputs(); // run the generate process int retVal = this->CMakeInstance->Generate(); @@ -578,7 +580,7 @@ int cmCursesMainForm::Generate() this->CMakeInstance->SetProgressCallback(nullptr); keypad(stdscr, true); /* Use key symbols as KEY_DOWN */ - if (retVal != 0 || !this->Errors.empty()) { + if (retVal != 0 || this->HasNonStatusOutputs) { // see if there was an error if (cmSystemTools::GetErrorOccuredFlag()) { this->OkToGenerate = false; @@ -588,12 +590,12 @@ int cmCursesMainForm::Generate() int xx; int yy; getmaxyx(stdscr, yy, xx); - const char* title = "Messages during last pass."; + const char* title = "Generate produced the following output."; if (cmSystemTools::GetErrorOccuredFlag()) { - title = "Errors occurred during the last pass."; + title = "Generate failed with the following output."; } cmCursesLongMessageForm* msgs = - new cmCursesLongMessageForm(this->Errors, title); + new cmCursesLongMessageForm(this->Outputs, title); CurrentForm = msgs; msgs->Render(1, 1, xx, yy); msgs->HandleInput(); @@ -615,7 +617,8 @@ int cmCursesMainForm::Generate() void cmCursesMainForm::AddError(const std::string& message, const char* /*unused*/) { - this->Errors.emplace_back(message); + this->Outputs.emplace_back(message); + this->HasNonStatusOutputs = true; } void cmCursesMainForm::RemoveEntry(const char* value) @@ -857,7 +860,7 @@ void cmCursesMainForm::HandleInput() else if (key == 'l') { getmaxyx(stdscr, y, x); cmCursesLongMessageForm* msgs = new cmCursesLongMessageForm( - this->Errors, "Errors occurred during the last pass."); + this->Outputs, "CMake produced the following output."); CurrentForm = msgs; msgs->Render(1, 1, x, y); msgs->HandleInput(); @@ -1020,6 +1023,12 @@ void cmCursesMainForm::JumpToCacheEntry(const char* astr) } } +void cmCursesMainForm::ResetOutputs() +{ + this->Outputs.clear(); + this->HasNonStatusOutputs = false; +} + const char* cmCursesMainForm::s_ConstHelpMessage = "CMake is used to configure and generate build files for software projects. " "The basic steps for configuring a project with ccmake are as follows:\n\n" @@ -1076,7 +1085,7 @@ const char* cmCursesMainForm::s_ConstHelpMessage = " c : process the configuration files with the current options\n" " g : generate build files and exit, only available when there are no " "new options and no errors have been detected during last configuration.\n" - " l : shows last errors\n" + " l : shows cmake output\n" " d : delete an option\n" " t : toggles advanced mode. In normal mode, only the most important " "options are shown. In advanced mode, all options are shown. We recommend " diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h index b8769b7cf47..c6a02624aeb 100644 --- a/Source/CursesDialog/cmCursesMainForm.h +++ b/Source/CursesDialog/cmCursesMainForm.h @@ -122,10 +122,17 @@ class cmCursesMainForm : public cmCursesForm // Jump to the cache entry whose name matches the string. void JumpToCacheEntry(const char* str); + // Clear and reset the output log and state + void ResetOutputs(); + // Copies of cache entries stored in the user interface std::vector Entries; - // Errors produced during last run of cmake - std::vector Errors; + + // Output produced by the last pass + std::vector Outputs; + // Did the last pass produced outputs of interest (errors, warnings, ...) + bool HasNonStatusOutputs; + // Command line arguments to be passed to cmake each time // it is run std::vector Args; From 1d0e557aed926d4d11cc5cf579363bb7be058688 Mon Sep 17 00:00:00 2001 From: Sylvain Joubert Date: Fri, 25 Oct 2019 14:53:10 +0200 Subject: [PATCH 050/662] ccmake: Display output during configure and generate --- .../CursesDialog/cmCursesLongMessageForm.cxx | 13 ++++- Source/CursesDialog/cmCursesLongMessageForm.h | 4 ++ Source/CursesDialog/cmCursesMainForm.cxx | 58 ++++++++++++------- Source/CursesDialog/cmCursesMainForm.h | 8 +++ 4 files changed, 61 insertions(+), 22 deletions(-) diff --git a/Source/CursesDialog/cmCursesLongMessageForm.cxx b/Source/CursesDialog/cmCursesLongMessageForm.cxx index 4ff3fe49020..d980d8182fa 100644 --- a/Source/CursesDialog/cmCursesLongMessageForm.cxx +++ b/Source/CursesDialog/cmCursesLongMessageForm.cxx @@ -136,7 +136,6 @@ void cmCursesLongMessageForm::Render(int /*left*/, int /*top*/, int /*width*/, form_driver(this->Form, REQ_BEG_FIELD); this->UpdateStatusBar(); - this->PrintKeys(); touchwin(stdscr); refresh(); } @@ -150,6 +149,7 @@ void cmCursesLongMessageForm::HandleInput() char debugMessage[128]; for (;;) { + this->PrintKeys(); int key = getch(); sprintf(debugMessage, "Message widget handling input, key: %d", key); @@ -170,7 +170,16 @@ void cmCursesLongMessageForm::HandleInput() } this->UpdateStatusBar(); - this->PrintKeys(); + touchwin(stdscr); + wrefresh(stdscr); + } +} + +void cmCursesLongMessageForm::ScrollDown() +{ + if (this->Form) { + form_driver(this->Form, REQ_END_FIELD); + this->UpdateStatusBar(); touchwin(stdscr); wrefresh(stdscr); } diff --git a/Source/CursesDialog/cmCursesLongMessageForm.h b/Source/CursesDialog/cmCursesLongMessageForm.h index 42f9c710b75..dde5bfffafd 100644 --- a/Source/CursesDialog/cmCursesLongMessageForm.h +++ b/Source/CursesDialog/cmCursesLongMessageForm.h @@ -25,6 +25,10 @@ class cmCursesLongMessageForm : public cmCursesForm // Handle user input. void HandleInput() override; + // Description: + // Scroll down to the end of the content + void ScrollDown(); + // Description: // Display form. Use a window of size width x height, starting // at top, left. diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index c76cc42ced5..ba238ebc8f7 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -474,20 +474,17 @@ void cmCursesMainForm::UpdateProgress(const std::string& msg, float prog) constexpr int progressBarWidth = 40; int progressBarCompleted = static_cast(progressBarWidth * prog); int percentCompleted = static_cast(100 * prog); - std::string status = (percentCompleted < 100 ? " " : ""); - status += (percentCompleted < 10 ? " " : ""); - status += std::to_string(percentCompleted) + "% ["; - status.append(progressBarCompleted, '#'); - status.append(progressBarWidth - progressBarCompleted, ' '); - status += "] " + msg + "..."; - this->UpdateStatusBar(status.c_str()); + this->LastProgress = (percentCompleted < 100 ? " " : ""); + this->LastProgress += (percentCompleted < 10 ? " " : ""); + this->LastProgress += std::to_string(percentCompleted) + "% ["; + this->LastProgress.append(progressBarCompleted, '#'); + this->LastProgress.append(progressBarWidth - progressBarCompleted, ' '); + this->LastProgress += "] " + msg + "..."; } else { this->Outputs.emplace_back(msg); } - this->PrintKeys(1); - curses_move(1, 1); - touchwin(stdscr); - refresh(); + + this->DisplayOutputs(); } int cmCursesMainForm::Configure(int noconfigure) @@ -496,11 +493,15 @@ int cmCursesMainForm::Configure(int noconfigure) int yi; getmaxyx(stdscr, yi, xi); - this->UpdateProgress("Configuring", 0); - this->CMakeInstance->SetProgressCallback( - [this](const std::string& msg, float prog) { - this->UpdateProgress(msg, prog); - }); + this->ResetOutputs(); + + if (noconfigure == 0) { + this->UpdateProgress("Configuring", 0); + this->CMakeInstance->SetProgressCallback( + [this](const std::string& msg, float prog) { + this->UpdateProgress(msg, prog); + }); + } // always save the current gui values to disk this->FillCacheManagerFromUI(); @@ -508,8 +509,6 @@ int cmCursesMainForm::Configure(int noconfigure) this->CMakeInstance->GetHomeOutputDirectory()); this->LoadCache(nullptr); - this->ResetOutputs(); - // run the generate process this->OkToGenerate = true; int retVal; @@ -544,6 +543,7 @@ int cmCursesMainForm::Configure(int noconfigure) cmSystemTools::ResetErrorOccuredFlag(); CurrentForm = msgs; msgs->Render(1, 1, xx, yy); + msgs->ScrollDown(); msgs->HandleInput(); // If they typed the wrong source directory, we report // an error and exit @@ -566,14 +566,14 @@ int cmCursesMainForm::Generate() int yi; getmaxyx(stdscr, yi, xi); + this->ResetOutputs(); + this->UpdateProgress("Generating", 0); this->CMakeInstance->SetProgressCallback( [this](const std::string& msg, float prog) { this->UpdateProgress(msg, prog); }); - this->ResetOutputs(); - // run the generate process int retVal = this->CMakeInstance->Generate(); @@ -598,6 +598,7 @@ int cmCursesMainForm::Generate() new cmCursesLongMessageForm(this->Outputs, title); CurrentForm = msgs; msgs->Render(1, 1, xx, yy); + msgs->ScrollDown(); msgs->HandleInput(); // If they typed the wrong source directory, we report // an error and exit @@ -619,6 +620,7 @@ void cmCursesMainForm::AddError(const std::string& message, { this->Outputs.emplace_back(message); this->HasNonStatusOutputs = true; + this->DisplayOutputs(); } void cmCursesMainForm::RemoveEntry(const char* value) @@ -1025,8 +1027,24 @@ void cmCursesMainForm::JumpToCacheEntry(const char* astr) void cmCursesMainForm::ResetOutputs() { + this->LogForm.reset(); this->Outputs.clear(); this->HasNonStatusOutputs = false; + this->LastProgress.clear(); +} + +void cmCursesMainForm::DisplayOutputs() +{ + int xi; + int yi; + getmaxyx(stdscr, yi, xi); + + auto newLogForm = + new cmCursesLongMessageForm(this->Outputs, this->LastProgress.c_str()); + CurrentForm = newLogForm; + this->LogForm.reset(newLogForm); + this->LogForm->Render(1, 1, xi, yi); + this->LogForm->ScrollDown(); } const char* cmCursesMainForm::s_ConstHelpMessage = diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h index c6a02624aeb..598fbdfba3c 100644 --- a/Source/CursesDialog/cmCursesMainForm.h +++ b/Source/CursesDialog/cmCursesMainForm.h @@ -16,6 +16,7 @@ #include "cmStateTypes.h" class cmake; +class cmCursesLongMessageForm; /** \class cmCursesMainForm * \brief The main page of ccmake @@ -125,13 +126,20 @@ class cmCursesMainForm : public cmCursesForm // Clear and reset the output log and state void ResetOutputs(); + // Display the current progress and output + void DisplayOutputs(); + // Copies of cache entries stored in the user interface std::vector Entries; + // The form used to display logs during processing + std::unique_ptr LogForm; // Output produced by the last pass std::vector Outputs; // Did the last pass produced outputs of interest (errors, warnings, ...) bool HasNonStatusOutputs; + // Last progress bar + std::string LastProgress; // Command line arguments to be passed to cmake each time // it is run From 66d969fcc490f09297714e98d7285512fd8d91e1 Mon Sep 17 00:00:00 2001 From: Sylvain Joubert Date: Fri, 25 Oct 2019 13:13:14 +0200 Subject: [PATCH 051/662] ccmake: Don't overwrite the last character of the title --- Source/CursesDialog/cmCursesLongMessageForm.cxx | 2 +- Source/CursesDialog/cmCursesMainForm.cxx | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Source/CursesDialog/cmCursesLongMessageForm.cxx b/Source/CursesDialog/cmCursesLongMessageForm.cxx index d980d8182fa..41fceee3c65 100644 --- a/Source/CursesDialog/cmCursesLongMessageForm.cxx +++ b/Source/CursesDialog/cmCursesLongMessageForm.cxx @@ -45,7 +45,7 @@ void cmCursesLongMessageForm::UpdateStatusBar() size = cmCursesMainForm::MAX_WIDTH - 1; } strncpy(bar, this->Title.c_str(), size); - for (size_t i = size - 1; i < cmCursesMainForm::MAX_WIDTH; i++) { + for (size_t i = size; i < cmCursesMainForm::MAX_WIDTH; i++) { bar[i] = ' '; } int width; diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index ba238ebc8f7..972509f65f4 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -533,9 +533,9 @@ int cmCursesMainForm::Configure(int noconfigure) int xx; int yy; getmaxyx(stdscr, yy, xx); - const char* title = "Configure produced the following output."; + const char* title = "Configure produced the following output"; if (cmSystemTools::GetErrorOccuredFlag()) { - title = "Configure failed with the following output."; + title = "Configure failed with the following output"; } cmCursesLongMessageForm* msgs = new cmCursesLongMessageForm(this->Outputs, title); @@ -590,9 +590,9 @@ int cmCursesMainForm::Generate() int xx; int yy; getmaxyx(stdscr, yy, xx); - const char* title = "Generate produced the following output."; + const char* title = "Generate produced the following output"; if (cmSystemTools::GetErrorOccuredFlag()) { - title = "Generate failed with the following output."; + title = "Generate failed with the following output"; } cmCursesLongMessageForm* msgs = new cmCursesLongMessageForm(this->Outputs, title); @@ -850,7 +850,7 @@ void cmCursesMainForm::HandleInput() } cmCursesLongMessageForm* msgs = - new cmCursesLongMessageForm(this->HelpMessage, "Help."); + new cmCursesLongMessageForm(this->HelpMessage, "Help"); CurrentForm = msgs; msgs->Render(1, 1, x, y); msgs->HandleInput(); @@ -862,7 +862,7 @@ void cmCursesMainForm::HandleInput() else if (key == 'l') { getmaxyx(stdscr, y, x); cmCursesLongMessageForm* msgs = new cmCursesLongMessageForm( - this->Outputs, "CMake produced the following output."); + this->Outputs, "CMake produced the following output"); CurrentForm = msgs; msgs->Render(1, 1, x, y); msgs->HandleInput(); From c97abc96882caab6cba49f6ab1b00ceb88b5a757 Mon Sep 17 00:00:00 2001 From: Johnny Jazeix Date: Fri, 25 Oct 2019 12:08:58 +0200 Subject: [PATCH 052/662] CPack/NSIS: Add option for custom Uninstall filename Fixes: #10728 --- Help/cpack_gen/nsis.rst | 5 +++++ Help/release/dev/cpack-nsis-uninstaller-name.rst | 6 ++++++ Modules/CPack.cmake | 2 ++ Modules/Internal/CPack/NSIS.template.in | 8 ++++---- 4 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 Help/release/dev/cpack-nsis-uninstaller-name.rst diff --git a/Help/cpack_gen/nsis.rst b/Help/cpack_gen/nsis.rst index cd2aea682f9..38676c46597 100644 --- a/Help/cpack_gen/nsis.rst +++ b/Help/cpack_gen/nsis.rst @@ -128,3 +128,8 @@ on Windows Nullsoft Scriptable Install System. set(CPACK_NSIS_MENU_LINKS "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake.html" "CMake Help" "https://cmake.org" "CMake Web Site") + +.. variable:: CPACK_NSIS_UNINSTALL_NAME + + Specify the name of the program to uninstall the version. + Default is ``Uninstall``. diff --git a/Help/release/dev/cpack-nsis-uninstaller-name.rst b/Help/release/dev/cpack-nsis-uninstaller-name.rst new file mode 100644 index 00000000000..b7ceb4c12a1 --- /dev/null +++ b/Help/release/dev/cpack-nsis-uninstaller-name.rst @@ -0,0 +1,6 @@ +cpack-nsis-uninstaller-name +--------------------------- + +* The :cpack_gen:`CPack NSIS Generator` now supports + :variable:`CPACK_NSIS_UNINSTALL_NAME`. + This can be used to specify the name of the Uninstall program. diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake index 18098464e70..c912a0a4ae2 100644 --- a/Modules/CPack.cmake +++ b/Modules/CPack.cmake @@ -688,6 +688,8 @@ endif() # value of CPACK_NSIS_PACKAGE_NAME instead # of CPACK_PACKAGE_INSTALL_DIRECTORY _cpack_set_default(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}") +# Specify the name of the Uninstall file in NSIS +_cpack_set_default(CPACK_NSIS_UNINSTALL_NAME "Uninstall") if(CPACK_NSIS_DISPLAY_NAME_SET) _cpack_set_default(CPACK_NSIS_PACKAGE_NAME "${CPACK_NSIS_DISPLAY_NAME}") diff --git a/Modules/Internal/CPack/NSIS.template.in b/Modules/Internal/CPack/NSIS.template.in index f75ae7836ff..c1db769aca2 100644 --- a/Modules/Internal/CPack/NSIS.template.in +++ b/Modules/Internal/CPack/NSIS.template.in @@ -642,7 +642,7 @@ Section "-Core installation" WriteRegStr SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "" $INSTDIR ;Create uninstaller - WriteUninstaller "$INSTDIR\Uninstall.exe" + WriteUninstaller "$INSTDIR\@CPACK_NSIS_UNINSTALL_NAME@.exe" Push "DisplayName" Push "@CPACK_NSIS_DISPLAY_NAME@" Call ConditionalAddToRegisty @@ -653,7 +653,7 @@ Section "-Core installation" Push "@CPACK_PACKAGE_VENDOR@" Call ConditionalAddToRegisty Push "UninstallString" - Push "$INSTDIR\Uninstall.exe" + Push "$INSTDIR\@CPACK_NSIS_UNINSTALL_NAME@.exe" Call ConditionalAddToRegisty Push "NoRepair" Push "1" @@ -690,7 +690,7 @@ Section "-Core installation" CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER" @CPACK_NSIS_CREATE_ICONS@ @CPACK_NSIS_CREATE_ICONS_EXTRA@ - CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe" + CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\@CPACK_NSIS_UNINSTALL_NAME@.exe" ;Read a value from an InstallOptions INI file !insertmacro MUI_INSTALLOPTIONS_READ $DO_NOT_ADD_TO_PATH "NSIS.InstallOptions.ini" "Field 2" "State" @@ -829,7 +829,7 @@ Section "Uninstall" !endif ;Remove the uninstaller itself. - Delete "$INSTDIR\Uninstall.exe" + Delete "$INSTDIR\@CPACK_NSIS_UNINSTALL_NAME@.exe" DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" ;Remove the installation directory if it is empty. From 2086da1713f7c1626c45565c01bc6cd7967a7e25 Mon Sep 17 00:00:00 2001 From: Sylvain Joubert Date: Fri, 25 Oct 2019 15:16:04 +0200 Subject: [PATCH 053/662] ccmake: Add output and progress bar release note --- Help/release/dev/ccmake_progress_bar_and_log_display.rst | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Help/release/dev/ccmake_progress_bar_and_log_display.rst diff --git a/Help/release/dev/ccmake_progress_bar_and_log_display.rst b/Help/release/dev/ccmake_progress_bar_and_log_display.rst new file mode 100644 index 00000000000..5c67c7ddc10 --- /dev/null +++ b/Help/release/dev/ccmake_progress_bar_and_log_display.rst @@ -0,0 +1,6 @@ +ccmake_progress_bar_and_log_display +----------------------------------- + +* :manual:`ccmake(1)` now displays messages and a progress bar during + configure and generate. It will keep the output displayed if any + errors or warnings occurred. From a8943971539aeb0df60b136d07e9c820c8be6f5e Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Sat, 26 Oct 2019 00:01:09 -0400 Subject: [PATCH 054/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 05137c83f6f..dd57b09e562 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191025) +set(CMake_VERSION_PATCH 20191026) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From f3968470ce71dbef596698816423efbf5c8f62d7 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Sun, 27 Oct 2019 00:01:04 -0400 Subject: [PATCH 055/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index dd57b09e562..b94a66884bb 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191026) +set(CMake_VERSION_PATCH 20191027) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From 0e4190ba9eaa46fe009394d5c5022818ef669bd9 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Mon, 28 Oct 2019 00:01:05 -0400 Subject: [PATCH 056/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index b94a66884bb..f73cd7dd929 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191027) +set(CMake_VERSION_PATCH 20191028) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From 3cf71e8c7d7a1ed83db5ea6e5a110346807b307b Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 28 Oct 2019 15:51:52 -0400 Subject: [PATCH 057/662] cmLocalGenerator: Drop unused initializer in AddUnityBuild Fix a warning from clang-scanbuild: warning: Value stored to 'chunk' during its initialization is never read for (size_t itemsLeft = filtered_sources.size(), chunk = batchSize, ^~~~~ ~~~~~~~~~ Simply remove the initializer. --- Source/cmLocalGenerator.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index a2eb1b93e41..88790405373 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2453,8 +2453,7 @@ void cmLocalGenerator::AddUnityBuild(cmGeneratorTarget* target) batchSize = filtered_sources.size(); } - for (size_t itemsLeft = filtered_sources.size(), chunk = batchSize, - batch = 0; + for (size_t itemsLeft = filtered_sources.size(), chunk, batch = 0; itemsLeft > 0; itemsLeft -= chunk, ++batch) { chunk = std::min(itemsLeft, batchSize); From c37f4eff5e299212544089f692dc8b090992d7b8 Mon Sep 17 00:00:00 2001 From: Craig Scott Date: Mon, 28 Oct 2019 08:25:18 +1100 Subject: [PATCH 058/662] FindPackageModeMakefileTest: macOS needs isysroot flag macOS/Xcode no longer populate /usr/include. Building with the compiler directly instead of using /usr/bin/c++ can result in missing headers without the -isysroot flag. Relates: #19885 --- Tests/FindPackageModeMakefileTest/CMakeLists.txt | 8 ++++++++ Tests/FindPackageModeMakefileTest/Makefile.in | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Tests/FindPackageModeMakefileTest/CMakeLists.txt b/Tests/FindPackageModeMakefileTest/CMakeLists.txt index 23832daceed..8a87a8c97d0 100644 --- a/Tests/FindPackageModeMakefileTest/CMakeLists.txt +++ b/Tests/FindPackageModeMakefileTest/CMakeLists.txt @@ -19,6 +19,14 @@ if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Makefile" AND # configure a FindFoo.cmake so it knows where the library can be found configure_file(FindFoo.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FindFoo.cmake @ONLY) + # Need the -isysroot flag on recentish macOS after command line tools + # no longer provide headers in /usr/include + if(APPLE AND CMAKE_OSX_SYSROOT) + set(__EXTRA_OSX_SYSROOT_FLAGS "-isysroot ${CMAKE_OSX_SYSROOT}") + else() + set(__EXTRA_OSX_SYSROOT_FLAGS "") + endif() + # now set up the test: file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/cmakeExecutable.mk" CONTENT "CMAKE = \"$\"\n" diff --git a/Tests/FindPackageModeMakefileTest/Makefile.in b/Tests/FindPackageModeMakefileTest/Makefile.in index 8e7ff72aa20..5ef67d031c4 100644 --- a/Tests/FindPackageModeMakefileTest/Makefile.in +++ b/Tests/FindPackageModeMakefileTest/Makefile.in @@ -5,6 +5,7 @@ CMAKE_CURRENT_BINARY_DIR = "@CMAKE_CURRENT_BINARY_DIR@" CMAKE_CXX_COMPILER = "@CMAKE_CXX_COMPILER@" CMAKE_CXX_COMPILER_ID = "@CMAKE_CXX_COMPILER_ID@" CMAKE_CXX_FLAGS = @CMAKE_CXX_FLAGS@ +__EXTRA_OSX_SYSROOT_FLAGS = @__EXTRA_OSX_SYSROOT_FLAGS@ CMAKE_FOO = $(CMAKE) --find-package -DCMAKE_MODULE_PATH=$(CMAKE_CURRENT_BINARY_DIR) -DNAME=Foo -DLANGUAGE=CXX -DCOMPILER_ID=$(CMAKE_CXX_COMPILER_ID) @@ -15,7 +16,7 @@ all: pngtest main.o: clean main.cpp @$(CMAKE_FOO) -DMODE=COMPILE >$(tmp) @foo="`cat $(tmp)`"; \ - printf '"%s" %s %s -c main.cpp\n' $(CMAKE_CXX_COMPILER) "$(CMAKE_CXX_FLAGS)" "$$foo" >$(tmp) + printf '"%s" %s %s %s -c main.cpp\n' $(CMAKE_CXX_COMPILER) "$(CMAKE_CXX_FLAGS)" "$(__EXTRA_OSX_SYSROOT_FLAGS)" "$$foo" >$(tmp) @cat $(tmp) @sh $(tmp) @rm -f $(tmp) From cffff0f17ef14fae6652ea5fd8c3511123a8e7b7 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Tue, 29 Oct 2019 00:01:08 -0400 Subject: [PATCH 059/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index f73cd7dd929..f7009536024 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191028) +set(CMake_VERSION_PATCH 20191029) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From fe5ba71bd0dba82d8a3093217ec1fcec1dd00ac6 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 29 Oct 2019 11:20:47 -0400 Subject: [PATCH 060/662] Tests: Suppress clang scan-build warning in UTF8 test Clang scan-build 7 reports: ``` Tests/CMakeLib/testUTF8.cxx:12:3: warning: 4th function call argument is an uninitialized value printf("[0x%02X,0x%02X,0x%02X,0x%02X]", static_cast(d[0]), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` Manual tracing of all call sites shows that all values are initialized. --- Tests/CMakeLib/testUTF8.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Tests/CMakeLib/testUTF8.cxx b/Tests/CMakeLib/testUTF8.cxx index 986f5956ef4..1bf88cf4cd4 100644 --- a/Tests/CMakeLib/testUTF8.cxx +++ b/Tests/CMakeLib/testUTF8.cxx @@ -9,9 +9,11 @@ typedef char test_utf8_char[5]; static void test_utf8_char_print(test_utf8_char const c) { unsigned char const* d = reinterpret_cast(c); +#ifndef __clang_analyzer__ // somehow thinks arguments are not initialized printf("[0x%02X,0x%02X,0x%02X,0x%02X]", static_cast(d[0]), static_cast(d[1]), static_cast(d[2]), static_cast(d[3])); +#endif } static void byte_array_print(char const* s) From 0187e522448c8fe92c15d4a983afac36950d1d59 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 29 Oct 2019 13:41:52 -0400 Subject: [PATCH 061/662] cmCTestRunTest: Use inline member initializers --- Source/CTest/cmCTestRunTest.cxx | 3 --- Source/CTest/cmCTestRunTest.h | 6 +++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 7f7f736799f..2e7836a10a1 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -34,9 +34,6 @@ cmCTestRunTest::cmCTestRunTest(cmCTestMultiProcessHandler& multiHandler) this->TestResult.Status = cmCTestTestHandler::NOT_RUN; this->TestResult.TestCount = 0; this->TestResult.Properties = nullptr; - this->NumberOfRunsLeft = 1; // default to 1 run of the test - this->RunUntilFail = false; // default to run the test once - this->RunAgain = false; // default to not having to run again } void cmCTestRunTest::CheckOutput(std::string const& line) diff --git a/Source/CTest/cmCTestRunTest.h b/Source/CTest/cmCTestRunTest.h index 085a6b8f840..7b202d1e9fb 100644 --- a/Source/CTest/cmCTestRunTest.h +++ b/Source/CTest/cmCTestRunTest.h @@ -129,9 +129,9 @@ class cmCTestRunTest std::vector>> AllocatedHardware; - bool RunUntilFail; - int NumberOfRunsLeft; - bool RunAgain; + bool RunUntilFail = false; // default to run the test once + int NumberOfRunsLeft = 1; // default to 1 run of the test + bool RunAgain = false; // default to not having to run again size_t TotalNumberOfTests; }; From 80c2c9d14cf1c1a8f162e119bd00d5f483a94af2 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 29 Oct 2019 14:45:21 -0400 Subject: [PATCH 062/662] ctest: Add --repeat-until-pass option Add an option to re-run tests if they fail. This will help tolerate sporadic failures. Issue: #17010 Co-Author: Ben Boeckel Co-Author: Chuck Atkins --- Help/manual/ctest.1.rst | 5 +++ Help/release/dev/ctest-repeat-until-pass.rst | 5 +++ Source/CTest/cmCTestMultiProcessHandler.cxx | 4 +-- Source/CTest/cmCTestRunTest.cxx | 14 +++++--- Source/CTest/cmCTestRunTest.h | 15 +++++--- Source/cmCTest.cxx | 35 ++++++++++++++++--- Source/cmCTest.h | 9 +++-- Source/ctest.cxx | 5 +-- .../CTestCommandLine/RunCMakeTest.cmake | 33 ++++++++++++++--- .../repeat-until-fail-and-pass-result.txt | 1 + .../repeat-until-fail-and-pass-stderr.txt | 1 + .../repeat-until-pass-and-fail-result.txt | 1 + .../repeat-until-pass-and-fail-stderr.txt | 1 + .../repeat-until-pass-bad1-result.txt | 1 + .../repeat-until-pass-bad1-stderr.txt | 1 + .../repeat-until-pass-bad2-result.txt | 1 + .../repeat-until-pass-bad2-stderr.txt | 1 + .../repeat-until-pass-cmake.cmake | 15 ++++++++ .../repeat-until-pass-ctest-stdout.txt | 15 ++++++++ .../repeat-until-pass-good-stderr.txt | 1 + .../CTestCommandLine/test1-pass.cmake | 13 +++++++ 21 files changed, 154 insertions(+), 23 deletions(-) create mode 100644 Help/release/dev/ctest-repeat-until-pass.rst create mode 100644 Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-pass-result.txt create mode 100644 Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-pass-stderr.txt create mode 100644 Tests/RunCMake/CTestCommandLine/repeat-until-pass-and-fail-result.txt create mode 100644 Tests/RunCMake/CTestCommandLine/repeat-until-pass-and-fail-stderr.txt create mode 100644 Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad1-result.txt create mode 100644 Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad1-stderr.txt create mode 100644 Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad2-result.txt create mode 100644 Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad2-stderr.txt create mode 100644 Tests/RunCMake/CTestCommandLine/repeat-until-pass-cmake.cmake create mode 100644 Tests/RunCMake/CTestCommandLine/repeat-until-pass-ctest-stdout.txt create mode 100644 Tests/RunCMake/CTestCommandLine/repeat-until-pass-good-stderr.txt create mode 100644 Tests/RunCMake/CTestCommandLine/test1-pass.cmake diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst index a18d43f48bd..031b9a76367 100644 --- a/Help/manual/ctest.1.rst +++ b/Help/manual/ctest.1.rst @@ -266,6 +266,11 @@ Options This is useful in finding sporadic failures in test cases. +``--repeat-until-pass `` + Allow each test to run up to ```` times in order to pass. + + This is useful in tolerating sporadic failures in test cases. + ``--max-width `` Set the max width for a test name to output. diff --git a/Help/release/dev/ctest-repeat-until-pass.rst b/Help/release/dev/ctest-repeat-until-pass.rst new file mode 100644 index 00000000000..003cdf2aecb --- /dev/null +++ b/Help/release/dev/ctest-repeat-until-pass.rst @@ -0,0 +1,5 @@ +ctest-repeat-until-pass +----------------------- + +* The :manual:`ctest(1)` tool learned a new ``--repeat-until-pass `` + option to help tolerate sporadic test failures. diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 7e8d5482db5..4812f3036f0 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -171,8 +171,8 @@ bool cmCTestMultiProcessHandler::StartTestProcess(int test) this->RunningCount += GetProcessorsUsed(test); cmCTestRunTest* testRun = new cmCTestRunTest(*this); - if (this->CTest->GetRepeatUntilFail()) { - testRun->SetRunUntilFailOn(); + if (this->CTest->GetRerunMode() != cmCTest::Rerun::Never) { + testRun->SetRerunMode(this->CTest->GetRerunMode()); testRun->SetNumberOfRuns(this->CTest->GetTestRepeat()); } testRun->SetIndex(test); diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 2e7836a10a1..ce9e13bbbad 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -340,10 +340,12 @@ bool cmCTestRunTest::NeedsToRerun() return false; } // if number of runs left is not 0, and we are running until - // we find a failed test, then return true so the test can be + // we find a failed (or passed) test, then return true so the test can be // restarted - if (this->RunUntilFail && - this->TestResult.Status == cmCTestTestHandler::COMPLETED) { + if ((this->RerunMode == cmCTest::Rerun::UntilFail && + this->TestResult.Status == cmCTestTestHandler::COMPLETED) || + (this->RerunMode == cmCTest::Rerun::UntilPass && + this->TestResult.Status != cmCTestTestHandler::COMPLETED)) { this->RunAgain = true; return true; } @@ -743,7 +745,11 @@ void cmCTestRunTest::WriteLogOutputTop(size_t completed, size_t total) // then it will never print out the completed / total, same would // got for run until pass. Trick is when this is called we don't // yet know if we are passing or failing. - if (this->NumberOfRunsLeft == 1 || this->CTest->GetTestProgressOutput()) { + if ((this->RerunMode != cmCTest::Rerun::UntilPass && + this->NumberOfRunsLeft == 1) || + (this->RerunMode == cmCTest::Rerun::UntilPass && + this->NumberOfRunsLeft == this->NumberOfRunsTotal) || + this->CTest->GetTestProgressOutput()) { outputStream << std::setw(getNumWidth(total)) << completed << "/"; outputStream << std::setw(getNumWidth(total)) << total << " "; } diff --git a/Source/CTest/cmCTestRunTest.h b/Source/CTest/cmCTestRunTest.h index 7b202d1e9fb..881cbb64865 100644 --- a/Source/CTest/cmCTestRunTest.h +++ b/Source/CTest/cmCTestRunTest.h @@ -13,13 +13,12 @@ #include +#include "cmCTest.h" #include "cmCTestMultiProcessHandler.h" #include "cmCTestTestHandler.h" #include "cmDuration.h" #include "cmProcess.h" -class cmCTest; - /** \class cmRunTest * \brief represents a single test to be run * @@ -30,8 +29,13 @@ class cmCTestRunTest public: explicit cmCTestRunTest(cmCTestMultiProcessHandler& multiHandler); - void SetNumberOfRuns(int n) { this->NumberOfRunsLeft = n; } - void SetRunUntilFailOn() { this->RunUntilFail = true; } + void SetNumberOfRuns(int n) + { + this->NumberOfRunsLeft = n; + this->NumberOfRunsTotal = n; + } + + void SetRerunMode(cmCTest::Rerun r) { this->RerunMode = r; } void SetTestProperties(cmCTestTestHandler::cmCTestTestProperties* prop) { this->TestProperties = prop; @@ -129,8 +133,9 @@ class cmCTestRunTest std::vector>> AllocatedHardware; - bool RunUntilFail = false; // default to run the test once + cmCTest::Rerun RerunMode = cmCTest::Rerun::Never; int NumberOfRunsLeft = 1; // default to 1 run of the test + int NumberOfRunsTotal = 1; // default to 1 run of the test bool RunAgain = false; // default to not having to run again size_t TotalNumberOfTests; }; diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 10b76466649..7276d98fbad 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -84,7 +84,7 @@ struct cmCTest::Private }; int RepeatTests = 1; // default to run each test once - bool RepeatUntilFail = false; + cmCTest::Rerun RerunMode = cmCTest::Rerun::Never; std::string ConfigType; std::string ScheduleType; std::chrono::system_clock::time_point StopTime; @@ -1839,11 +1839,16 @@ bool cmCTest::HandleCommandLineArguments(size_t& i, this->SetParallelLevel(plevel); this->Impl->ParallelLevelSetInCli = true; } + if (this->CheckArgument(arg, "--repeat-until-fail")) { if (i >= args.size() - 1) { errormsg = "'--repeat-until-fail' requires an argument"; return false; } + if (this->Impl->RerunMode != cmCTest::Rerun::Never) { + errormsg = "At most one '--repeat-*' option may be used."; + return false; + } i++; long repeat = 1; if (!cmStrToLong(args[i], &repeat)) { @@ -1853,7 +1858,29 @@ bool cmCTest::HandleCommandLineArguments(size_t& i, } this->Impl->RepeatTests = static_cast(repeat); if (repeat > 1) { - this->Impl->RepeatUntilFail = true; + this->Impl->RerunMode = cmCTest::Rerun::UntilFail; + } + } + + if (this->CheckArgument(arg, "--repeat-until-pass")) { + if (i >= args.size() - 1) { + errormsg = "'--repeat-until-pass' requires an argument"; + return false; + } + if (this->Impl->RerunMode != cmCTest::Rerun::Never) { + errormsg = "At most one '--repeat-*' option may be used."; + return false; + } + i++; + long repeat = 1; + if (!cmStrToLong(args[i], &repeat)) { + errormsg = + "'--repeat-until-pass' given non-integer value '" + args[i] + "'"; + return false; + } + this->Impl->RepeatTests = static_cast(repeat); + if (repeat > 1) { + this->Impl->RerunMode = cmCTest::Rerun::UntilPass; } } @@ -2852,9 +2879,9 @@ int cmCTest::GetTestRepeat() const return this->Impl->RepeatTests; } -bool cmCTest::GetRepeatUntilFail() const +cmCTest::Rerun cmCTest::GetRerunMode() const { - return this->Impl->RepeatUntilFail; + return this->Impl->RerunMode; } void cmCTest::SetBuildID(const std::string& id) diff --git a/Source/cmCTest.h b/Source/cmCTest.h index 82a6f4cbd36..c6b89281d73 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -433,8 +433,13 @@ class cmCTest /** Return the number of times a test should be run */ int GetTestRepeat() const; - /** Return true if test should run until fail */ - bool GetRepeatUntilFail() const; + enum class Rerun + { + Never, + UntilFail, + UntilPass, + }; + Rerun GetRerunMode() const; void GenerateSubprojectsOutput(cmXMLWriter& xml); std::vector GetLabelsForSubprojects(); diff --git a/Source/ctest.cxx b/Source/ctest.cxx index 91ee598b253..f716d7a9412 100644 --- a/Source/ctest.cxx +++ b/Source/ctest.cxx @@ -99,8 +99,9 @@ static const char* cmDocumentationOptions[][2] = { { "-U, --union", "Take the Union of -I and -R" }, { "--rerun-failed", "Run only the tests that failed previously" }, { "--repeat-until-fail ", - "Require each test to run " - "times without failing in order to pass" }, + "Require each test to run times without failing in order to pass" }, + { "--repeat-until-pass ", + "Allow each test to run up to times in order to pass" }, { "--max-width ", "Set the max width for a test name to output" }, { "--interactive-debug-mode [0|1]", "Set the interactive mode to 0 or 1." }, { "--hardware-spec-file ", "Set the hardware spec file to use." }, diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake index fd2c97fef01..15a90fc02f7 100644 --- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake @@ -4,6 +4,16 @@ set(RunCMake_TEST_TIMEOUT 60) unset(ENV{CTEST_PARALLEL_LEVEL}) unset(ENV{CTEST_OUTPUT_ON_FAILURE}) +run_cmake_command(repeat-until-pass-bad1 + ${CMAKE_CTEST_COMMAND} --repeat-until-pass + ) +run_cmake_command(repeat-until-pass-bad2 + ${CMAKE_CTEST_COMMAND} --repeat-until-pass foo + ) +run_cmake_command(repeat-until-pass-good + ${CMAKE_CTEST_COMMAND} --repeat-until-pass 2 + ) + run_cmake_command(repeat-until-fail-bad1 ${CMAKE_CTEST_COMMAND} --repeat-until-fail ) @@ -14,14 +24,29 @@ run_cmake_command(repeat-until-fail-good ${CMAKE_CTEST_COMMAND} --repeat-until-fail 2 ) -function(run_repeat_until_fail_tests) +run_cmake_command(repeat-until-pass-and-fail + ${CMAKE_CTEST_COMMAND} --repeat-until-pass 2 --repeat-until-fail 2 + ) +run_cmake_command(repeat-until-fail-and-pass + ${CMAKE_CTEST_COMMAND} --repeat-until-fail 2 --repeat-until-pass 2 + ) + +function(run_repeat_until_pass_tests) # Use a single build tree for a few tests without cleaning. - set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/repeat-until-fail-build) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/repeat-until-pass-build) + run_cmake(repeat-until-pass-cmake) set(RunCMake_TEST_NO_CLEAN 1) - file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") - file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + run_cmake_command(repeat-until-pass-ctest + ${CMAKE_CTEST_COMMAND} -C Debug --repeat-until-pass 3 + ) +endfunction() +run_repeat_until_pass_tests() +function(run_repeat_until_fail_tests) + # Use a single build tree for a few tests without cleaning. + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/repeat-until-fail-build) run_cmake(repeat-until-fail-cmake) + set(RunCMake_TEST_NO_CLEAN 1) run_cmake_command(repeat-until-fail-ctest ${CMAKE_CTEST_COMMAND} -C Debug --repeat-until-fail 3 ) diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-pass-result.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-pass-result.txt new file mode 100644 index 00000000000..d00491fd7e5 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-pass-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-pass-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-pass-stderr.txt new file mode 100644 index 00000000000..15ee3a98ea0 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-pass-stderr.txt @@ -0,0 +1 @@ +^CMake Error: At most one '--repeat-\*' option may be used\.$ diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-pass-and-fail-result.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-and-fail-result.txt new file mode 100644 index 00000000000..d00491fd7e5 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-and-fail-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-pass-and-fail-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-and-fail-stderr.txt new file mode 100644 index 00000000000..15ee3a98ea0 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-and-fail-stderr.txt @@ -0,0 +1 @@ +^CMake Error: At most one '--repeat-\*' option may be used\.$ diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad1-result.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad1-result.txt new file mode 100644 index 00000000000..d00491fd7e5 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad1-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad1-stderr.txt new file mode 100644 index 00000000000..c6afb1d9cfb --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad1-stderr.txt @@ -0,0 +1 @@ +^CMake Error: '--repeat-until-pass' requires an argument$ diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad2-result.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad2-result.txt new file mode 100644 index 00000000000..d00491fd7e5 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad2-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad2-stderr.txt new file mode 100644 index 00000000000..cc3aed53307 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad2-stderr.txt @@ -0,0 +1 @@ +^CMake Error: '--repeat-until-pass' given non-integer value 'foo'$ diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-pass-cmake.cmake b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-cmake.cmake new file mode 100644 index 00000000000..d1095518f36 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-cmake.cmake @@ -0,0 +1,15 @@ +enable_testing() + +set(TEST_OUTPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/test_output.txt") +add_test(NAME initialization + COMMAND ${CMAKE_COMMAND} + "-DTEST_OUTPUT_FILE=${TEST_OUTPUT_FILE}" + -P "${CMAKE_CURRENT_SOURCE_DIR}/init.cmake") +add_test(NAME test1 + COMMAND ${CMAKE_COMMAND} + "-DTEST_OUTPUT_FILE=${TEST_OUTPUT_FILE}" + -P "${CMAKE_CURRENT_SOURCE_DIR}/test1-pass.cmake") +set_tests_properties(test1 PROPERTIES DEPENDS "initialization") + +add_test(hello ${CMAKE_COMMAND} -E echo hello) +add_test(goodbye ${CMAKE_COMMAND} -E echo goodbye) diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-pass-ctest-stdout.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-ctest-stdout.txt new file mode 100644 index 00000000000..3745dc252b8 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-ctest-stdout.txt @@ -0,0 +1,15 @@ +^Test project .*/Tests/RunCMake/CTestCommandLine/repeat-until-pass-build + Start 1: initialization +1/4 Test #1: initialization ................... Passed +[0-9.]+ sec + Start 2: test1 +2/4 Test #2: test1 ............................\*\*\*Failed +[0-9.]+ sec + Start 2: test1 + Test #2: test1 ............................ Passed +[0-9.]+ sec + Start 3: hello +3/4 Test #3: hello ............................ Passed +[0-9.]+ sec + Start 4: goodbye +4/4 Test #4: goodbye .......................... Passed +[0-9.]+ sec + +100% tests passed, 0 tests failed out of 4 + +Total Test time \(real\) = +[0-9.]+ sec$ diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-pass-good-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-good-stderr.txt new file mode 100644 index 00000000000..a7c4b11f762 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-good-stderr.txt @@ -0,0 +1 @@ +^No tests were found!!!$ diff --git a/Tests/RunCMake/CTestCommandLine/test1-pass.cmake b/Tests/RunCMake/CTestCommandLine/test1-pass.cmake new file mode 100644 index 00000000000..dda8deae500 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/test1-pass.cmake @@ -0,0 +1,13 @@ +# This is run by test test1 in repeat-until-pass-cmake.cmake with cmake -P. +# It reads the file TEST_OUTPUT_FILE and increments the number +# found in the file by 1. Unless the number is 2, then the +# code sends out a cmake error causing the test to pass only on +# the second time it is run. +message("TEST_OUTPUT_FILE = ${TEST_OUTPUT_FILE}") +file(READ "${TEST_OUTPUT_FILE}" COUNT) +message("COUNT= ${COUNT}") +math(EXPR COUNT "${COUNT} + 1") +file(WRITE "${TEST_OUTPUT_FILE}" "${COUNT}") +if(NOT COUNT EQUAL 2) + message(FATAL_ERROR "this test passes only on the 2nd run") +endif() From 39ac8b4eb5c5ea99cf1053bd37e76d811f5122fc Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 29 Oct 2019 14:21:38 -0400 Subject: [PATCH 063/662] ctest: Add --repeat-after-timeout option Add an option to re-run tests if they timeout. This will help tolerate sporadic timeouts on busy machines. --- Help/manual/ctest.1.rst | 8 +++++++ Help/release/dev/ctest-repeat-until-pass.rst | 5 ++-- Source/CTest/cmCTestRunTest.cxx | 13 ++++++---- Source/cmCTest.cxx | 22 +++++++++++++++++ Source/cmCTest.h | 1 + Source/ctest.cxx | 2 ++ .../CTestCommandLine/RunCMakeTest.cmake | 24 +++++++++++++++++++ .../repeat-after-timeout-bad1-result.txt | 1 + .../repeat-after-timeout-bad1-stderr.txt | 1 + .../repeat-after-timeout-bad2-result.txt | 1 + .../repeat-after-timeout-bad2-stderr.txt | 1 + .../repeat-after-timeout-cmake.cmake | 15 ++++++++++++ .../repeat-after-timeout-ctest-stdout.txt | 15 ++++++++++++ .../repeat-after-timeout-good-stderr.txt | 1 + .../repeat-until-fail-and-timeout-result.txt | 1 + .../repeat-until-fail-and-timeout-stderr.txt | 1 + .../CTestCommandLine/test1-timeout.cmake | 14 +++++++++++ 17 files changed, 119 insertions(+), 7 deletions(-) create mode 100644 Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad1-result.txt create mode 100644 Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad1-stderr.txt create mode 100644 Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad2-result.txt create mode 100644 Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad2-stderr.txt create mode 100644 Tests/RunCMake/CTestCommandLine/repeat-after-timeout-cmake.cmake create mode 100644 Tests/RunCMake/CTestCommandLine/repeat-after-timeout-ctest-stdout.txt create mode 100644 Tests/RunCMake/CTestCommandLine/repeat-after-timeout-good-stderr.txt create mode 100644 Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-timeout-result.txt create mode 100644 Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-timeout-stderr.txt create mode 100644 Tests/RunCMake/CTestCommandLine/test1-timeout.cmake diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst index 031b9a76367..0097cee1481 100644 --- a/Help/manual/ctest.1.rst +++ b/Help/manual/ctest.1.rst @@ -268,9 +268,17 @@ Options ``--repeat-until-pass `` Allow each test to run up to ```` times in order to pass. + Repeats tests if they fail for any reason. This is useful in tolerating sporadic failures in test cases. +``--repeat-after-timeout `` + Allow each test to run up to ```` times in order to pass. + Repeats tests only if they timeout. + + This is useful in tolerating sporadic timeouts in test cases + on busy machines. + ``--max-width `` Set the max width for a test name to output. diff --git a/Help/release/dev/ctest-repeat-until-pass.rst b/Help/release/dev/ctest-repeat-until-pass.rst index 003cdf2aecb..d1772471819 100644 --- a/Help/release/dev/ctest-repeat-until-pass.rst +++ b/Help/release/dev/ctest-repeat-until-pass.rst @@ -1,5 +1,6 @@ ctest-repeat-until-pass ----------------------- -* The :manual:`ctest(1)` tool learned a new ``--repeat-until-pass `` - option to help tolerate sporadic test failures. +* The :manual:`ctest(1)` tool learned new ``--repeat-until-pass `` + and ``--repeat-after-timeout `` options to help tolerate sporadic + test failures. diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index ce9e13bbbad..ba146532b69 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -345,7 +345,9 @@ bool cmCTestRunTest::NeedsToRerun() if ((this->RerunMode == cmCTest::Rerun::UntilFail && this->TestResult.Status == cmCTestTestHandler::COMPLETED) || (this->RerunMode == cmCTest::Rerun::UntilPass && - this->TestResult.Status != cmCTestTestHandler::COMPLETED)) { + this->TestResult.Status != cmCTestTestHandler::COMPLETED) || + (this->RerunMode == cmCTest::Rerun::AfterTimeout && + this->TestResult.Status == cmCTestTestHandler::TIMEOUT)) { this->RunAgain = true; return true; } @@ -745,10 +747,11 @@ void cmCTestRunTest::WriteLogOutputTop(size_t completed, size_t total) // then it will never print out the completed / total, same would // got for run until pass. Trick is when this is called we don't // yet know if we are passing or failing. - if ((this->RerunMode != cmCTest::Rerun::UntilPass && - this->NumberOfRunsLeft == 1) || - (this->RerunMode == cmCTest::Rerun::UntilPass && - this->NumberOfRunsLeft == this->NumberOfRunsTotal) || + bool const progressOnLast = + (this->RerunMode != cmCTest::Rerun::UntilPass && + this->RerunMode != cmCTest::Rerun::AfterTimeout); + if ((progressOnLast && this->NumberOfRunsLeft == 1) || + (!progressOnLast && this->NumberOfRunsLeft == this->NumberOfRunsTotal) || this->CTest->GetTestProgressOutput()) { outputStream << std::setw(getNumWidth(total)) << completed << "/"; outputStream << std::setw(getNumWidth(total)) << total << " "; diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 7276d98fbad..20445b0853a 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1884,6 +1884,28 @@ bool cmCTest::HandleCommandLineArguments(size_t& i, } } + if (this->CheckArgument(arg, "--repeat-after-timeout")) { + if (i >= args.size() - 1) { + errormsg = "'--repeat-after-timeout' requires an argument"; + return false; + } + if (this->Impl->RerunMode != cmCTest::Rerun::Never) { + errormsg = "At most one '--repeat-*' option may be used."; + return false; + } + i++; + long repeat = 1; + if (!cmStrToLong(args[i], &repeat)) { + errormsg = + "'--repeat-after-timeout' given non-integer value '" + args[i] + "'"; + return false; + } + this->Impl->RepeatTests = static_cast(repeat); + if (repeat > 1) { + this->Impl->RerunMode = cmCTest::Rerun::AfterTimeout; + } + } + if (this->CheckArgument(arg, "--test-load") && i < args.size() - 1) { i++; unsigned long load; diff --git a/Source/cmCTest.h b/Source/cmCTest.h index c6b89281d73..bef0f8d368b 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -438,6 +438,7 @@ class cmCTest Never, UntilFail, UntilPass, + AfterTimeout, }; Rerun GetRerunMode() const; diff --git a/Source/ctest.cxx b/Source/ctest.cxx index f716d7a9412..2659e3071b4 100644 --- a/Source/ctest.cxx +++ b/Source/ctest.cxx @@ -102,6 +102,8 @@ static const char* cmDocumentationOptions[][2] = { "Require each test to run times without failing in order to pass" }, { "--repeat-until-pass ", "Allow each test to run up to times in order to pass" }, + { "--repeat-after-timeout ", + "Allow each test to run up to times if it times out" }, { "--max-width ", "Set the max width for a test name to output" }, { "--interactive-debug-mode [0|1]", "Set the interactive mode to 0 or 1." }, { "--hardware-spec-file ", "Set the hardware spec file to use." }, diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake index 15a90fc02f7..d7f41336e84 100644 --- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake @@ -24,12 +24,25 @@ run_cmake_command(repeat-until-fail-good ${CMAKE_CTEST_COMMAND} --repeat-until-fail 2 ) +run_cmake_command(repeat-after-timeout-bad1 + ${CMAKE_CTEST_COMMAND} --repeat-after-timeout + ) +run_cmake_command(repeat-after-timeout-bad2 + ${CMAKE_CTEST_COMMAND} --repeat-after-timeout foo + ) +run_cmake_command(repeat-after-timeout-good + ${CMAKE_CTEST_COMMAND} --repeat-after-timeout 2 + ) + run_cmake_command(repeat-until-pass-and-fail ${CMAKE_CTEST_COMMAND} --repeat-until-pass 2 --repeat-until-fail 2 ) run_cmake_command(repeat-until-fail-and-pass ${CMAKE_CTEST_COMMAND} --repeat-until-fail 2 --repeat-until-pass 2 ) +run_cmake_command(repeat-until-fail-and-timeout + ${CMAKE_CTEST_COMMAND} --repeat-until-fail 2 --repeat-after-timeout 2 + ) function(run_repeat_until_pass_tests) # Use a single build tree for a few tests without cleaning. @@ -42,6 +55,17 @@ function(run_repeat_until_pass_tests) endfunction() run_repeat_until_pass_tests() +function(run_repeat_after_timeout_tests) + # Use a single build tree for a few tests without cleaning. + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/repeat-after-timeout-build) + run_cmake(repeat-after-timeout-cmake) + set(RunCMake_TEST_NO_CLEAN 1) + run_cmake_command(repeat-after-timeout-ctest + ${CMAKE_CTEST_COMMAND} -C Debug --repeat-after-timeout 3 + ) +endfunction() +run_repeat_after_timeout_tests() + function(run_repeat_until_fail_tests) # Use a single build tree for a few tests without cleaning. set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/repeat-until-fail-build) diff --git a/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad1-result.txt b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad1-result.txt new file mode 100644 index 00000000000..d00491fd7e5 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad1-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad1-stderr.txt new file mode 100644 index 00000000000..aea92b8bb07 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad1-stderr.txt @@ -0,0 +1 @@ +^CMake Error: '--repeat-after-timeout' requires an argument$ diff --git a/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad2-result.txt b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad2-result.txt new file mode 100644 index 00000000000..d00491fd7e5 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad2-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad2-stderr.txt new file mode 100644 index 00000000000..c5db55b65ba --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad2-stderr.txt @@ -0,0 +1 @@ +^CMake Error: '--repeat-after-timeout' given non-integer value 'foo'$ diff --git a/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-cmake.cmake b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-cmake.cmake new file mode 100644 index 00000000000..4dc9c3648f0 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-cmake.cmake @@ -0,0 +1,15 @@ +enable_testing() + +set(TEST_OUTPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/test_output.txt") +add_test(NAME initialization + COMMAND ${CMAKE_COMMAND} + "-DTEST_OUTPUT_FILE=${TEST_OUTPUT_FILE}" + -P "${CMAKE_CURRENT_SOURCE_DIR}/init.cmake") +add_test(NAME test1 + COMMAND ${CMAKE_COMMAND} + "-DTEST_OUTPUT_FILE=${TEST_OUTPUT_FILE}" + -P "${CMAKE_CURRENT_SOURCE_DIR}/test1-timeout.cmake") +set_tests_properties(test1 PROPERTIES DEPENDS "initialization" TIMEOUT 2) + +add_test(hello ${CMAKE_COMMAND} -E echo hello) +add_test(goodbye ${CMAKE_COMMAND} -E echo goodbye) diff --git a/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-ctest-stdout.txt b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-ctest-stdout.txt new file mode 100644 index 00000000000..d0a54872a9f --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-ctest-stdout.txt @@ -0,0 +1,15 @@ +^Test project .*/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-build + Start 1: initialization +1/4 Test #1: initialization ................... Passed +[0-9.]+ sec + Start 2: test1 +2/4 Test #2: test1 ............................\*\*\*Timeout +[0-9.]+ sec + Start 2: test1 + Test #2: test1 ............................ Passed +[0-9.]+ sec + Start 3: hello +3/4 Test #3: hello ............................ Passed +[0-9.]+ sec + Start 4: goodbye +4/4 Test #4: goodbye .......................... Passed +[0-9.]+ sec + +100% tests passed, 0 tests failed out of 4 + +Total Test time \(real\) = +[0-9.]+ sec$ diff --git a/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-good-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-good-stderr.txt new file mode 100644 index 00000000000..a7c4b11f762 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-good-stderr.txt @@ -0,0 +1 @@ +^No tests were found!!!$ diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-timeout-result.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-timeout-result.txt new file mode 100644 index 00000000000..d00491fd7e5 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-timeout-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-timeout-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-timeout-stderr.txt new file mode 100644 index 00000000000..15ee3a98ea0 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-timeout-stderr.txt @@ -0,0 +1 @@ +^CMake Error: At most one '--repeat-\*' option may be used\.$ diff --git a/Tests/RunCMake/CTestCommandLine/test1-timeout.cmake b/Tests/RunCMake/CTestCommandLine/test1-timeout.cmake new file mode 100644 index 00000000000..fbf2cccd46a --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/test1-timeout.cmake @@ -0,0 +1,14 @@ +# This is run by test test1 in repeat-after-timeout-cmake.cmake with cmake -P. +# It reads the file TEST_OUTPUT_FILE and increments the number +# found in the file by 1. Unless the number is 2, then the +# code sends out a cmake error causing the test to not timeout only on +# the second time it is run. +message("TEST_OUTPUT_FILE = ${TEST_OUTPUT_FILE}") +file(READ "${TEST_OUTPUT_FILE}" COUNT) +message("COUNT= ${COUNT}") +math(EXPR COUNT "${COUNT} + 1") +file(WRITE "${TEST_OUTPUT_FILE}" "${COUNT}") +if(NOT COUNT EQUAL 2) + message("this test times out except on the 2nd run") + execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 10) +endif() From 5b64788c51f7676276c0d8685003fd002b27388b Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Wed, 30 Oct 2019 00:01:07 -0400 Subject: [PATCH 064/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index f7009536024..af16e4f049d 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191029) +set(CMake_VERSION_PATCH 20191030) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From fe6725a1f7c055b920508e7179fbc21a38cd37d3 Mon Sep 17 00:00:00 2001 From: KWSys Upstream Date: Wed, 30 Oct 2019 09:16:39 -0400 Subject: [PATCH 065/662] KWSys 2019-10-30 (43131a7c) Code extracted from: https://gitlab.kitware.com/utils/kwsys.git at commit 43131a7c283dd6f198a2318a25e546a97ac356b3 (master). Upstream Shortlog ----------------- Brad King (1): cdd52ce1 RegularExpression: Initialize RegularExpressionMatch arrays fully Todd Martin (1): 569a1aed Encoding: Add ToWindowsExtendedPath support for wide string --- Encoding.hxx.in | 2 ++ EncodingCXX.cxx | 14 ++++++++++++-- RegularExpression.hxx.in | 6 +++--- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Encoding.hxx.in b/Encoding.hxx.in index b06752115ce..75a2d4d0f99 100644 --- a/Encoding.hxx.in +++ b/Encoding.hxx.in @@ -68,6 +68,8 @@ public: * absolute paths with Windows-style backslashes. **/ static std::wstring ToWindowsExtendedPath(std::string const&); + static std::wstring ToWindowsExtendedPath(const char* source); + static std::wstring ToWindowsExtendedPath(std::wstring const& wsource); # endif #endif // @KWSYS_NAMESPACE@_STL_HAS_WSTRING diff --git a/EncodingCXX.cxx b/EncodingCXX.cxx index 4593c9251cc..5cad934ec37 100644 --- a/EncodingCXX.cxx +++ b/EncodingCXX.cxx @@ -221,8 +221,18 @@ std::string Encoding::ToNarrow(const wchar_t* wcstr) // Convert local paths to UNC style paths std::wstring Encoding::ToWindowsExtendedPath(std::string const& source) { - std::wstring wsource = Encoding::ToWide(source); + return ToWindowsExtendedPath(ToWide(source)); +} +// Convert local paths to UNC style paths +std::wstring Encoding::ToWindowsExtendedPath(const char* source) +{ + return ToWindowsExtendedPath(ToWide(source)); +} + +// Convert local paths to UNC style paths +std::wstring Encoding::ToWindowsExtendedPath(std::wstring const& wsource) +{ // Resolve any relative paths DWORD wfull_len; @@ -269,7 +279,7 @@ std::wstring Encoding::ToWindowsExtendedPath(std::string const& source) // If this case has been reached, then the path is invalid. Leave it // unchanged - return Encoding::ToWide(source); + return wsource; } # endif diff --git a/RegularExpression.hxx.in b/RegularExpression.hxx.in index df7eb45589c..0c2366b8421 100644 --- a/RegularExpression.hxx.in +++ b/RegularExpression.hxx.in @@ -70,10 +70,10 @@ private: * \brief Creates an invalid match object */ inline RegularExpressionMatch::RegularExpressionMatch() + : startp{} + , endp{} + , searchstring{} { - startp[0] = nullptr; - endp[0] = nullptr; - searchstring = nullptr; } /** From e4a5215e97fedf878ec9818c18040c6c34d206f1 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Thu, 31 Oct 2019 00:01:10 -0400 Subject: [PATCH 066/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index af16e4f049d..01dbbdf4e9d 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191030) +set(CMake_VERSION_PATCH 20191031) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From b42da462333aea986576d00bf9af7449aa6e8010 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Fri, 1 Nov 2019 00:01:08 -0400 Subject: [PATCH 067/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 01dbbdf4e9d..7bb9f90075c 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191031) +set(CMake_VERSION_PATCH 20191101) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From 687a354518c8f6d5d1864ef9cd5d823b92b305bb Mon Sep 17 00:00:00 2001 From: Marc Chevrier Date: Thu, 31 Oct 2019 17:05:48 +0100 Subject: [PATCH 068/662] FindPython: customize failure message --- Modules/FindPython/Support.cmake | 50 +++++++++++- Tests/FindPython/CMakeLists.txt | 14 ++++ .../CustomFailureMessage/CMakeLists.txt | 79 +++++++++++++++++++ .../CustomFailureMessage/Check/CMakeLists.txt | 5 ++ 4 files changed, 147 insertions(+), 1 deletion(-) create mode 100644 Tests/FindPython/CustomFailureMessage/CMakeLists.txt create mode 100644 Tests/FindPython/CustomFailureMessage/Check/CMakeLists.txt diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake index b67d563b5c8..0d6d2fca16f 100644 --- a/Modules/FindPython/Support.cmake +++ b/Modules/FindPython/Support.cmake @@ -409,6 +409,7 @@ function (_PYTHON_VALIDATE_INTERPRETER) if (_PVI_CHECK_EXISTS AND NOT EXISTS "${_${_PYTHON_PREFIX}_EXECUTABLE}") # interpreter does not exist anymore + set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Cannot find the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"") set_property (CACHE _${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "_${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND") return() endif() @@ -427,6 +428,7 @@ function (_PYTHON_VALIDATE_INTERPRETER) endif() if (NOT abi IN_LIST _${_PYTHON_PREFIX}_ABIFLAGS) # incompatible ABI + set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Wrong ABI for the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"") set_property (CACHE _${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "_${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND") return() endif() @@ -444,6 +446,11 @@ function (_PYTHON_VALIDATE_INTERPRETER) OUTPUT_STRIP_TRAILING_WHITESPACE) if (result OR (_PVI_EXACT AND NOT version VERSION_EQUAL expected_version) OR (version VERSION_LESS expected_version)) # interpreter not usable or has wrong major version + if (result) + set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Cannot use the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"") + else() + set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Wrong major version for the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"") + endif() set_property (CACHE _${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "_${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND") return() endif() @@ -459,6 +466,11 @@ function (_PYTHON_VALIDATE_INTERPRETER) OUTPUT_STRIP_TRAILING_WHITESPACE) if (result OR NOT version EQUAL _${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR) # interpreter not usable or has wrong major version + if (result) + set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Cannot use the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"") + else() + set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Wrong major version for the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"") + endif() set_property (CACHE _${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "_${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND") return() endif() @@ -476,6 +488,11 @@ function (_PYTHON_VALIDATE_INTERPRETER) OUTPUT_STRIP_TRAILING_WHITESPACE) if (result OR NOT size EQUAL CMAKE_SIZEOF_VOID_P) # interpreter not usable or has wrong architecture + if (result) + set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Cannot use the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"") + else() + set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Wrong architecture for the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"") + endif() set_property (CACHE _${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "_${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND") return() endif() @@ -500,6 +517,7 @@ function (_PYTHON_VALIDATE_COMPILER expected_version) if (_PVC_CHECK_EXISTS AND NOT EXISTS "${_${_PYTHON_PREFIX}_COMPILER}") # Compiler does not exist anymore + set (_${_PYTHON_PREFIX}_Compiler_REASON_FAILURE "Cannot find the compiler \"${_${_PYTHON_PREFIX}_COMPILER}\"") set_property (CACHE _${_PYTHON_PREFIX}_COMPILER PROPERTY VALUE "_${_PYTHON_PREFIX}_COMPILER-NOTFOUND") return() endif() @@ -526,6 +544,11 @@ function (_PYTHON_VALIDATE_COMPILER expected_version) if (result OR (_PVC_EXACT AND NOT version VERSION_EQUAL expected_version) OR (version VERSION_LESS expected_version)) # Compiler not usable or has wrong version + if (result) + set (_${_PYTHON_PREFIX}_Compiler_REASON_FAILURE "Cannot use the compiler \"${_${_PYTHON_PREFIX}_COMPILER}\"") + else() + set (_${_PYTHON_PREFIX}_Compiler_REASON_FAILURE "Wrong version for the compiler \"${_${_PYTHON_PREFIX}_COMPILER}\"") + endif() set_property (CACHE _${_PYTHON_PREFIX}_COMPILER PROPERTY VALUE "_${_PYTHON_PREFIX}_COMPILER-NOTFOUND") endif() endfunction() @@ -545,6 +568,7 @@ function (_PYTHON_VALIDATE_LIBRARY) if (_PVL_CHECK_EXISTS AND NOT EXISTS "${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}") # library does not exist anymore + set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Cannot find the library \"${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}\"") set_property (CACHE _${_PYTHON_PREFIX}_LIBRARY_RELEASE PROPERTY VALUE "_${_PYTHON_PREFIX}_LIBRARY_RELEASE-NOTFOUND") if (WIN32) set_property (CACHE _${_PYTHON_PREFIX}_LIBRARY_DEBUG PROPERTY VALUE "_${_PYTHON_PREFIX}_LIBRARY_DEBUG-NOTFOUND") @@ -558,16 +582,19 @@ function (_PYTHON_VALIDATE_LIBRARY) if (DEFINED _${_PYTHON_PREFIX}_FIND_ABI AND NOT lib_ABI IN_LIST _${_PYTHON_PREFIX}_ABIFLAGS) # incompatible ABI + set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Wrong ABI for the library \"${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}\"") set_property (CACHE _${_PYTHON_PREFIX}_LIBRARY_RELEASE PROPERTY VALUE "_${_PYTHON_PREFIX}_LIBRARY_RELEASE-NOTFOUND") else() if (expected_version) if ((_PVL_EXACT AND NOT lib_VERSION VERSION_EQUAL expected_version) OR (lib_VERSION VERSION_LESS expected_version)) # library has wrong version + set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Wrong version for the library \"${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}\"") set_property (CACHE _${_PYTHON_PREFIX}_LIBRARY_RELEASE PROPERTY VALUE "_${_PYTHON_PREFIX}_LIBRARY_RELEASE-NOTFOUND") endif() else() if (NOT lib_VERSION_MAJOR VERSION_EQUAL _${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR) # library has wrong major version + set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Wrong major version for the library \"${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}\"") set_property (CACHE _${_PYTHON_PREFIX}_LIBRARY_RELEASE PROPERTY VALUE "_${_PYTHON_PREFIX}_LIBRARY_RELEASE-NOTFOUND") endif() endif() @@ -596,6 +623,7 @@ function (_PYTHON_VALIDATE_INCLUDE_DIR) if (_PVID_CHECK_EXISTS AND NOT EXISTS "${_${_PYTHON_PREFIX}_INCLUDE_DIR}") # include file does not exist anymore + set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Cannot find the directory \"${_${_PYTHON_PREFIX}_INCLUDE_DIR}\"") set_property (CACHE _${_PYTHON_PREFIX}_INCLUDE_DIR PROPERTY VALUE "_${_PYTHON_PREFIX}_INCLUDE_DIR-NOTFOUND") return() endif() @@ -605,16 +633,19 @@ function (_PYTHON_VALIDATE_INCLUDE_DIR) if (DEFINED _${_PYTHON_PREFIX}_FIND_ABI AND NOT inc_ABI IN_LIST _${_PYTHON_PREFIX}_ABIFLAGS) # incompatible ABI + set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Wrong ABI for the directory \"${_${_PYTHON_PREFIX}_INCLUDE_DIR}\"") set_property (CACHE _${_PYTHON_PREFIX}_INCLUDE_DIR PROPERTY VALUE "_${_PYTHON_PREFIX}_INCLUDE_DIR-NOTFOUND") else() if (expected_version) if ((_PVID_EXACT AND NOT inc_VERSION VERSION_EQUAL expected_version) OR (inc_VERSION VERSION_LESS expected_version)) # include dir has wrong version + set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Wrong version for the directory \"${_${_PYTHON_PREFIX}_INCLUDE_DIR}\"") set_property (CACHE _${_PYTHON_PREFIX}_INCLUDE_DIR PROPERTY VALUE "_${_PYTHON_PREFIX}_INCLUDE_DIR-NOTFOUND") endif() else() if (NOT inc_VERSION_MAJOR VERSION_EQUAL _${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR) # include dir has wrong major version + set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Wrong major version for the directory \"${_${_PYTHON_PREFIX}_INCLUDE_DIR}\"") set_property (CACHE _${_PYTHON_PREFIX}_INCLUDE_DIR PROPERTY VALUE "_${_PYTHON_PREFIX}_INCLUDE_DIR-NOTFOUND") endif() endif() @@ -836,6 +867,10 @@ endif() unset (_${_PYTHON_PREFIX}_REQUIRED_VARS) unset (_${_PYTHON_PREFIX}_CACHED_VARS) +unset (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE) +unset (_${_PYTHON_PREFIX}_Compiler_REASON_FAILURE) +unset (_${_PYTHON_PREFIX}_Development_REASON_FAILURE) +unset (_${_PYTHON_PREFIX}_NumPy_REASON_FAILURE) # first step, search for the interpreter @@ -1161,6 +1196,7 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS) # Interpreter is not usable set (_${_PYTHON_PREFIX}_EXECUTABLE_USABLE FALSE) unset (${_PYTHON_PREFIX}_VERSION) + set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Cannot run the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"") endif() endif() @@ -1416,6 +1452,7 @@ if ("Compiler" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS) else() # compiler not usable set (_${_PYTHON_PREFIX}_COMPILER_USABLE FALSE) + set (_${_PYTHON_PREFIX}_Compiler_REASON_FAILURE "Cannot run the compiler \"${_${_PYTHON_PREFIX}_COMPILER}\"") endif() file (REMOVE_RECURSE "${_${_PYTHON_PREFIX}_VERSION_DIR}") endif() @@ -1914,6 +1951,7 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS set (${_PYTHON_PREFIX}_LIBRARY_RELEASE "${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}" CACHE FILEPATH "Path to a library." FORCE) if (_${_PYTHON_PREFIX}_LIBRARY_RELEASE AND NOT EXISTS "${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}") + set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Cannot find the library \"${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}\"") set_property (CACHE _${_PYTHON_PREFIX}_LIBRARY_RELEASE PROPERTY VALUE "_${_PYTHON_PREFIX}_LIBRARY_RELEASE-NOTFOUND") endif() @@ -2046,6 +2084,7 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS set (${_PYTHON_PREFIX}_INCLUDE_DIRS "${_${_PYTHON_PREFIX}_INCLUDE_DIR}") if (_${_PYTHON_PREFIX}_INCLUDE_DIR AND NOT EXISTS "${_${_PYTHON_PREFIX}_INCLUDE_DIR}") + set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Cannot find the directory \"${_${_PYTHON_PREFIX}_INCLUDE_DIR}\"") set_property (CACHE _${_PYTHON_PREFIX}_INCLUDE_DIR PROPERTY VALUE "_${_PYTHON_PREFIX}_INCLUDE_DIR-NOTFOUND") endif() @@ -2169,6 +2208,7 @@ if ("NumPy" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS AND ${_PYTHON_PREFIX}_Inte set (${_PYTHON_PREFIX}_NumPy_INCLUDE_DIRS "${_${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR}") if(_${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR AND NOT EXISTS "${_${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR}") + set (_${_PYTHON_PREFIX}_NumPy_REASON_FAILURE "Cannot find the directory \"${_${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR}\"") set_property (CACHE _${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR PROPERTY VALUE "_${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR-NOTFOUND") endif() @@ -2207,11 +2247,19 @@ if (${_PYTHON_PREFIX}_VERSION_MAJOR AND _python_display_failure ("Could NOT find ${_PYTHON_PREFIX}: Found unsuitable major version \"${${_PYTHON_PREFIX}_VERSION_MAJOR}\", but required major version is exact version \"${_${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR}\"") endif() +unset (_${_PYTHON_PREFIX}_REASON_FAILURE) +foreach (_${_PYTHON_PREFIX}_COMPONENT IN ITEMS Interpreter Compiler Development NumPy) + if (_${_PYTHON_PREFIX}_${_${_PYTHON_PREFIX}_COMPONENT}_REASON_FAILURE) + string (APPEND _${_PYTHON_PREFIX}_REASON_FAILURE "\n ${_${_PYTHON_PREFIX}_COMPONENT}: ${_${_PYTHON_PREFIX}_${_${_PYTHON_PREFIX}_COMPONENT}_REASON_FAILURE}") + endif() +endforeach() + include (${CMAKE_CURRENT_LIST_DIR}/../FindPackageHandleStandardArgs.cmake) find_package_handle_standard_args (${_PYTHON_PREFIX} REQUIRED_VARS ${_${_PYTHON_PREFIX}_REQUIRED_VARS} VERSION_VAR ${_PYTHON_PREFIX}_VERSION - HANDLE_COMPONENTS) + HANDLE_COMPONENTS + REASON_FAILURE_MESSAGE "${_${_PYTHON_PREFIX}_REASON_FAILURE}") # Create imported targets and helper functions if(_${_PYTHON_PREFIX}_CMAKE_ROLE STREQUAL "PROJECT") diff --git a/Tests/FindPython/CMakeLists.txt b/Tests/FindPython/CMakeLists.txt index 868cfe0e135..10c98c5360a 100644 --- a/Tests/FindPython/CMakeLists.txt +++ b/Tests/FindPython/CMakeLists.txt @@ -134,6 +134,20 @@ if(CMake_TEST_FindPython) --test-command ${CMAKE_CTEST_COMMAND} -V -C $ ) + add_test(NAME FindPython.CustomFailureMessage COMMAND + ${CMAKE_CTEST_COMMAND} -C $ + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage" + "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage" + ${build_generator_args} + --build-project TestCustomFailureMessage + --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}" + "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}" + "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}" + "-DCMake_TEST_FindPython_NumPy=${CMake_TEST_FindPython_NumPy}" + --test-command ${CMAKE_CTEST_COMMAND} -V -C $ + ) + endif() if(CMake_TEST_FindPython_NumPy) diff --git a/Tests/FindPython/CustomFailureMessage/CMakeLists.txt b/Tests/FindPython/CustomFailureMessage/CMakeLists.txt new file mode 100644 index 00000000000..a0d8eb2f44f --- /dev/null +++ b/Tests/FindPython/CustomFailureMessage/CMakeLists.txt @@ -0,0 +1,79 @@ +cmake_minimum_required(VERSION 3.1) + +project(TestCustomFailureMessage LANGUAGES NONE) + +include(CTest) + +add_test(NAME FindPython.CustomFailureMessage.Interpreter COMMAND + ${CMAKE_CTEST_COMMAND} -C $ + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage/Check" + "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage/Interpreter" + ${build_generator_args} + --build-project TestCustomFailureMessage.Check + --build-options "-DCHECK_COMPONENTS=Interpreter" + "-DPython3_EXECUTABLE=/not/found/interpreter" + --test-command ${CMAKE_CTEST_COMMAND} -V -C $ + ) +set_tests_properties(FindPython.CustomFailureMessage.Interpreter PROPERTIES + PASS_REGULAR_EXPRESSION "Reason given by package:.+Interpreter: Cannot run the interpreter") + +add_test(NAME FindPython.CustomFailureMessage.Library COMMAND + ${CMAKE_CTEST_COMMAND} -C $ + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage/Check" + "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage/Library" + ${build_generator_args} + --build-project TestCustomFailureMessage.Check + --build-options "-DCHECK_COMPONENTS=Development" + "-DPython3_LIBRARY=/not/found/library" + --test-command ${CMAKE_CTEST_COMMAND} -V -C $ + ) +set_tests_properties(FindPython.CustomFailureMessage.Library PROPERTIES + PASS_REGULAR_EXPRESSION "Reason given by package:.+Development: Cannot find the library") + +add_test(NAME FindPython.CustomFailureMessage.Include COMMAND + ${CMAKE_CTEST_COMMAND} -C $ + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage/Check" + "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage/Include" + ${build_generator_args} + --build-project TestCustomFailureMessage.Check + --build-options "-DCHECK_COMPONENTS=Development" + "-DPython3_INCLUDE_DIR=/not/found/include" + --test-command ${CMAKE_CTEST_COMMAND} -V -C $ + ) +set_tests_properties(FindPython.CustomFailureMessage.Include PROPERTIES + PASS_REGULAR_EXPRESSION "Reason given by package:.+Development: Cannot find the directory") + +add_test(NAME FindPython.CustomFailureMessage.Multiple COMMAND + ${CMAKE_CTEST_COMMAND} -C $ + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage/Check" + "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage/Multiple" + ${build_generator_args} + --build-project TestCustomFailureMessage.Check + --build-options "-DCHECK_COMPONENTS=Interpreter;Development" + "-DPython3_EXECUTABLE=/not/found/interpreter" + "-DPython3_LIBRARY=/not/found/library" + --test-command ${CMAKE_CTEST_COMMAND} -V -C $ + ) +set_tests_properties(FindPython.CustomFailureMessage.Multiple PROPERTIES + PASS_REGULAR_EXPRESSION "Reason given by package:.+Interpreter: Cannot run the interpreter.+Development: Cannot find the library") + + +if (CMake_TEST_FindPython_NumPy) + add_test(NAME FindPython.CustomFailureMessage.NumPy COMMAND + ${CMAKE_CTEST_COMMAND} -C $ + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage/Check" + "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage/NumPy" + ${build_generator_args} + --build-project TestCustomFailureMessage.Check + --build-options "-DCHECK_COMPONENTS=Interpreter;Development;NumPy" + "-DPython3_NumPy_INCLUDE_DIR=/not/found/numpy/include" + --test-command ${CMAKE_CTEST_COMMAND} -V -C $ + ) + set_tests_properties(FindPython.CustomFailureMessage.NumPy PROPERTIES + PASS_REGULAR_EXPRESSION "Reason given by package:.+NumPy: Cannot find the directory") +endif() diff --git a/Tests/FindPython/CustomFailureMessage/Check/CMakeLists.txt b/Tests/FindPython/CustomFailureMessage/Check/CMakeLists.txt new file mode 100644 index 00000000000..fed963e4767 --- /dev/null +++ b/Tests/FindPython/CustomFailureMessage/Check/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 3.1) + +project(TestCustomFailureMessage.Check LANGUAGES C) + +find_package (Python3 REQUIRED COMPONENTS ${CHECK_COMPONENTS}) From 210d04bb79b961252c3685b1d7a3653beec39fe6 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 1 Nov 2019 09:15:54 -0400 Subject: [PATCH 069/662] CTestCustom: Suppress PGI Community Edition compiler license warnings These are not useful in nightly testing. --- CTestCustom.cmake.in | 1 + 1 file changed, 1 insertion(+) diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in index 823ee3cb7c3..af4bb2dc463 100644 --- a/CTestCustom.cmake.in +++ b/CTestCustom.cmake.in @@ -71,6 +71,7 @@ list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION "cm(StringCommand|CTestTestHandler)\\.cxx.*warning.*rand.*isn.*t random" # we do not do crypto "cm(StringCommand|CTestTestHandler)\\.cxx.*warning.*srand.*seed choices are.*poor" # we do not do crypto "IPA warning: function.*multiply defined in" + "LICENSE WARNING" # PGI license expiry. Not useful in nightly testing. # Ignore compiler summary warning, assuming prior text has matched some # other warning expression: From 59673bb2dc4a1336dd9028573ed33d934087f8ee Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 1 Nov 2019 09:20:41 -0400 Subject: [PATCH 070/662] Tests: Teach RunCMake to ignore PGI license expiry warnings These are not useful in nightly testing. --- Tests/RunCMake/RunCMake.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index f24cfab62a5..cb20fb1f3d4 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -146,6 +146,12 @@ function(run_cmake test) "|clang[^:]*: warning: the object size sanitizer has no effect at -O0, but is explicitly enabled:" "|Error kstat returned" "|Hit xcodebuild bug" + + "|LICENSE WARNING:" + "|Your license to use PGI[^\n]*expired" + "|Please obtain a new version at" + "|contact PGI Sales at" + "|[^\n]*xcodebuild[^\n]*warning: file type[^\n]*is based on missing file type" "|[^\n]*is a member of multiple groups" "|[^\n]*from Time Machine by path" From 067ee518f792b2babc9ae53c69bddeb5e15f3d76 Mon Sep 17 00:00:00 2001 From: Hong Xu Date: Thu, 31 Oct 2019 13:50:24 -0700 Subject: [PATCH 071/662] FindCUDA: Use find_program instead of find_path to find nvcc Otherwise nvcc is not found if it is in env PATH but a non-standard location. --- Modules/FindCUDA.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index b6859aaf41b..79d7fda6533 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -676,7 +676,7 @@ endif() # Search for the cuda distribution. if(NOT CUDA_TOOLKIT_ROOT_DIR AND NOT CMAKE_CROSSCOMPILING) # Search in the CUDA_BIN_PATH first. - find_path(CUDA_TOOLKIT_ROOT_DIR + find_program(CUDA_TOOLKIT_ROOT_DIR NAMES nvcc nvcc.exe PATHS ENV CUDA_TOOLKIT_ROOT @@ -688,7 +688,7 @@ if(NOT CUDA_TOOLKIT_ROOT_DIR AND NOT CMAKE_CROSSCOMPILING) ) # Now search default paths - find_path(CUDA_TOOLKIT_ROOT_DIR + find_program(CUDA_TOOLKIT_ROOT_DIR NAMES nvcc nvcc.exe PATHS /opt/cuda/bin PATH_SUFFIXES cuda/bin From 63c0bc929240b0dd7253cced980fea0b735eb5c3 Mon Sep 17 00:00:00 2001 From: Johnny Jazeix Date: Wed, 30 Oct 2019 18:53:21 +0100 Subject: [PATCH 072/662] CPack: Ensure CPACK_PACKAGE_DIRECTORY is an absolute path Fixes: #18133, #19412 --- Source/CPack/cpack.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index 58956522f40..d7868f34657 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -314,7 +314,7 @@ int main(int argc, char const* const* argv) else { // get a default value (current working directory) cpackProjectDirectory = cmsys::SystemTools::GetCurrentWorkingDirectory(); - // use default value iff no value has been provided by the config file + // use default value if no value has been provided by the config file if (!globalMF.IsSet("CPACK_PACKAGE_DIRECTORY")) { globalMF.AddDefinition("CPACK_PACKAGE_DIRECTORY", cpackProjectDirectory); @@ -324,6 +324,12 @@ int main(int argc, char const* const* argv) globalMF.AddDefinition(cd.first, cd.second); } + // Force CPACK_PACKAGE_DIRECTORY as absolute path + cpackProjectDirectory = globalMF.GetDefinition("CPACK_PACKAGE_DIRECTORY"); + cpackProjectDirectory = + cmSystemTools::CollapseFullPath(cpackProjectDirectory); + globalMF.AddDefinition("CPACK_PACKAGE_DIRECTORY", cpackProjectDirectory); + const char* cpackModulesPath = globalMF.GetDefinition("CPACK_MODULE_PATH"); if (cpackModulesPath) { globalMF.AddDefinition("CMAKE_MODULE_PATH", cpackModulesPath); From 2ec1156b80485fedba5b6d9b0802c21e1cbc2d8f Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Fri, 1 Nov 2019 16:50:42 -0400 Subject: [PATCH 073/662] Refactor: Generalize cmExportInstallFileGenerator::ReplaceInstallPrefix() --- Source/cmExportInstallFileGenerator.cxx | 10 +--------- Source/cmGeneratorExpression.cxx | 14 ++++++++++++++ Source/cmGeneratorExpression.h | 3 +++ 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index 6d29c9994ff..090e30f5e6a 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -258,15 +258,7 @@ void cmExportInstallFileGenerator::LoadConfigFiles(std::ostream& os) void cmExportInstallFileGenerator::ReplaceInstallPrefix(std::string& input) { - std::string::size_type pos = 0; - std::string::size_type lastPos = pos; - - while ((pos = input.find("$", lastPos)) != - std::string::npos) { - std::string::size_type endPos = pos + sizeof("$") - 1; - input.replace(pos, endPos - pos, "${_IMPORT_PREFIX}"); - lastPos = endPos; - } + cmGeneratorExpression::ReplaceInstallPrefix(input, "${_IMPORT_PREFIX}"); } bool cmExportInstallFileGenerator::GenerateImportFileConfig( diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index b7f7d1d9b68..de43d3e7321 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -385,6 +385,20 @@ bool cmGeneratorExpression::IsValidTargetName(const std::string& input) return targetNameValidator.find(input); } +void cmGeneratorExpression::ReplaceInstallPrefix( + std::string& input, const std::string& replacement) +{ + std::string::size_type pos = 0; + std::string::size_type lastPos = pos; + + while ((pos = input.find("$", lastPos)) != + std::string::npos) { + std::string::size_type endPos = pos + sizeof("$") - 1; + input.replace(pos, endPos - pos, replacement); + lastPos = endPos; + } +} + void cmCompiledGeneratorExpression::GetMaxLanguageStandard( const cmGeneratorTarget* tgt, std::map& mapping) { diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h index 4bd1c9f88a9..cd35e1e25d2 100644 --- a/Source/cmGeneratorExpression.h +++ b/Source/cmGeneratorExpression.h @@ -87,6 +87,9 @@ class cmGeneratorExpression return input != nullptr && input[0] == '$' && input[1] == '<'; } + static void ReplaceInstallPrefix(std::string& input, + const std::string& replacement); + private: cmListFileBacktrace Backtrace; }; From 60e7e5b60540dfbd1e67c415ee399e4aea59a369 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Sat, 2 Nov 2019 00:01:06 -0400 Subject: [PATCH 074/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 7bb9f90075c..17a23950bba 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191101) +set(CMake_VERSION_PATCH 20191102) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From 949a1e120a3c2d9ecac08f7240a27d307fad503f Mon Sep 17 00:00:00 2001 From: Alex Turbov Date: Tue, 13 Aug 2019 01:25:07 +0300 Subject: [PATCH 075/662] message: New message types to mark checks performed by CMake Closes #19638. Co-Authored-By: Craig Scott --- Help/command/message.rst | 104 +++++++++++++++- Help/release/dev/new-message-types.rst | 5 + Source/cmMessageCommand.cxx | 113 ++++++++++++++---- Source/cmake.h | 24 ++++ Tests/RunCMake/message/RunCMakeTest.cmake | 5 + .../message/message-checks-stderr.txt | 3 + .../message/message-checks-stdout.txt | 10 ++ Tests/RunCMake/message/message-checks.cmake | 13 ++ 8 files changed, 250 insertions(+), 27 deletions(-) create mode 100644 Help/release/dev/new-message-types.rst create mode 100644 Tests/RunCMake/message/message-checks-stderr.txt create mode 100644 Tests/RunCMake/message/message-checks-stdout.txt create mode 100644 Tests/RunCMake/message/message-checks.cmake diff --git a/Help/command/message.rst b/Help/command/message.rst index beb820ade4a..6bc0e4cfc65 100644 --- a/Help/command/message.rst +++ b/Help/command/message.rst @@ -1,13 +1,33 @@ message ------- -Display a message to the user. +Log a message. + +Synopsis +^^^^^^^^ + +.. parsed-literal:: + + `General messages`_ + message([] "message text" ...) + + `Reporting checks`_ + message( "message text" ...) + + +General messages +^^^^^^^^^^^^^^^^ .. code-block:: cmake - message([] "message to display" ...) + message([] "message text" ...) + +Record the specified message text in the log. If more than one message +string is given, they are concatenated into a single message with no +separator between the strings. -The optional ```` keyword determines the type of message: +The optional ```` keyword determines the type of message, which +influences the way the message is handled: ``FATAL_ERROR`` CMake Error, stop processing and generation. @@ -82,3 +102,81 @@ usage examples. CMake Warning and Error message text displays using a simple markup language. Non-indented text is formatted in line-wrapped paragraphs delimited by newlines. Indented text is considered pre-formatted. + + +Reporting checks +^^^^^^^^^^^^^^^^ + +A common pattern in CMake output is a message indicating the start of some +sort of check, followed by another message reporting the result of that check. +For example: + +.. code-block:: cmake + + message(STATUS "Looking for someheader.h") + #... do the checks, set checkSuccess with the result + if(checkSuccess) + message(STATUS "Looking for someheader.h - found") + else() + message(STATUS "Looking for someheader.h - not found") + endif() + +This can be more robustly and conveniently expressed using the ``CHECK_...`` +keyword form of the ``message()`` command: + +.. code-block:: cmake + + message( "message" ...) + +where ```` must be one of the following: + + ``CHECK_START`` + Record a concise message about the check about to be performed. + + ``CHECK_PASS`` + Record a successful result for a check. + + ``CHECK_FAIL`` + Record an unsuccessful result for a check. + +When recording a check result, the command repeats the message from the most +recently started check for which no result has yet been reported, then some +separator characters and then the message text provided after the +``CHECK_PASS`` or ``CHECK_FAIL`` keyword. Check messages are always reported +at ``STATUS`` log level. + +Checks may be nested and every ``CHECK_START`` should have exactly one +matching ``CHECK_PASS`` or ``CHECK_FAIL``. +The :variable:`CMAKE_MESSAGE_INDENT` variable can also be used to add +indenting to nested checks if desired. For example: + +.. code-block:: cmake + + message(CHECK_START "Finding my things") + list(APPEND CMAKE_MESSAGE_INDENT " ") + unset(missingComponents) + + message(CHECK_START "Finding partA") + # ... do check, assume we find A + message(CHECK_PASS "found") + + message(CHECK_START "Finding partB") + # ... do check, assume we don't find B + list(APPEND missingComponents B) + message(CHECK_FAIL "not found") + + list(POP_BACK CMAKE_MESSAGE_INDENT) + if(missingComponents) + message(CHECK_FAIL "missing components: ${missingComponents}") + else() + message(CHECK_PASS "all components found") + endif() + +Output from the above would appear something like the following:: + + -- Finding my things + -- Finding partA + -- Finding partA - found + -- Finding partB + -- Finding partB - not found + -- Finding my things - missing components: B diff --git a/Help/release/dev/new-message-types.rst b/Help/release/dev/new-message-types.rst new file mode 100644 index 00000000000..8f164b9e79c --- /dev/null +++ b/Help/release/dev/new-message-types.rst @@ -0,0 +1,5 @@ +new-message-types +----------------- + +* The :command:`message` command gained new keywords ``CHECK_START``, + ``CHECK_PASS`` and ``CHECK_FAIL``. diff --git a/Source/cmMessageCommand.cxx b/Source/cmMessageCommand.cxx index 24ac71a5c46..bf8183bbf14 100644 --- a/Source/cmMessageCommand.cxx +++ b/Source/cmMessageCommand.cxx @@ -3,6 +3,11 @@ #include "cmMessageCommand.h" #include +#include + +#include + +#include "cm_static_string_view.hxx" #include "cmExecutionStatus.h" #include "cmMakefile.h" @@ -13,6 +18,55 @@ #include "cmSystemTools.h" #include "cmake.h" +namespace { + +enum class CheckingType +{ + UNDEFINED, + CHECK_START, + CHECK_PASS, + CHECK_FAIL +}; + +std::string IndentText(std::string text, cmMakefile& mf) +{ + auto indent = + cmJoin(cmExpandedList(mf.GetSafeDefinition("CMAKE_MESSAGE_INDENT")), ""); + + const auto showContext = mf.GetCMakeInstance()->GetShowLogContext() || + mf.IsOn("CMAKE_MESSAGE_CONTEXT_SHOW"); + if (showContext) { + auto context = cmJoin( + cmExpandedList(mf.GetSafeDefinition("CMAKE_MESSAGE_CONTEXT")), "."); + if (!context.empty()) { + indent.insert(0u, cmStrCat("["_s, context, "] "_s)); + } + } + + if (!indent.empty()) { + cmSystemTools::ReplaceString(text, "\n", "\n" + indent); + text.insert(0u, indent); + } + return text; +} + +void ReportCheckResult(cm::string_view what, std::string result, + cmMakefile& mf) +{ + if (mf.GetCMakeInstance()->HasCheckInProgress()) { + auto text = mf.GetCMakeInstance()->GetTopCheckInProgressMessage() + " - " + + std::move(result); + mf.DisplayStatus(IndentText(std::move(text), mf), -1); + } else { + mf.GetMessenger()->DisplayMessage( + MessageType::AUTHOR_WARNING, + cmStrCat("Ignored "_s, what, " without CHECK_START"_s), + mf.GetBacktrace()); + } +} + +} // anonymous namespace + // cmLibraryCommand bool cmMessageCommand(std::vector const& args, cmExecutionStatus& status) @@ -29,6 +83,7 @@ bool cmMessageCommand(std::vector const& args, auto type = MessageType::MESSAGE; auto fatal = false; auto level = cmake::LogLevel::LOG_UNDEFINED; + auto checkingType = CheckingType::UNDEFINED; if (*i == "SEND_ERROR") { type = MessageType::FATAL_ERROR; level = cmake::LogLevel::LOG_ERROR; @@ -55,6 +110,18 @@ bool cmMessageCommand(std::vector const& args, return true; } ++i; + } else if (*i == "CHECK_START") { + level = cmake::LogLevel::LOG_STATUS; + checkingType = CheckingType::CHECK_START; + ++i; + } else if (*i == "CHECK_PASS") { + level = cmake::LogLevel::LOG_STATUS; + checkingType = CheckingType::CHECK_PASS; + ++i; + } else if (*i == "CHECK_FAIL") { + level = cmake::LogLevel::LOG_STATUS; + checkingType = CheckingType::CHECK_FAIL; + ++i; } else if (*i == "STATUS") { level = cmake::LogLevel::LOG_STATUS; ++i; @@ -111,28 +178,6 @@ bool cmMessageCommand(std::vector const& args, auto message = cmJoin(cmMakeRange(i, args.cend()), ""); - if (cmake::LogLevel::LOG_NOTICE <= level) { - auto indent = - cmJoin(cmExpandedList(mf.GetSafeDefinition("CMAKE_MESSAGE_INDENT")), ""); - if (!indent.empty()) { - cmSystemTools::ReplaceString(message, "\n", "\n" + indent); - message = indent + message; - } - - const auto showContext = mf.GetCMakeInstance()->GetShowLogContext() || - mf.IsOn("CMAKE_MESSAGE_CONTEXT_SHOW"); - if (showContext) { - // Output the current context (if any) - auto context = cmJoin( - cmExpandedList(mf.GetSafeDefinition("CMAKE_MESSAGE_CONTEXT")), "."); - if (!context.empty()) { - context = "[" + context + "] "; - cmSystemTools::ReplaceString(message, "\n", "\n" + context); - message = context + message; - } - } - } - switch (level) { case cmake::LogLevel::LOG_ERROR: case cmake::LogLevel::LOG_WARNING: @@ -141,14 +186,34 @@ bool cmMessageCommand(std::vector const& args, break; case cmake::LogLevel::LOG_NOTICE: - cmSystemTools::Message(message); + cmSystemTools::Message(IndentText(message, mf)); break; case cmake::LogLevel::LOG_STATUS: + switch (checkingType) { + case CheckingType::CHECK_START: + mf.DisplayStatus(IndentText(message, mf), -1); + mf.GetCMakeInstance()->PushCheckInProgressMessage(message); + break; + + case CheckingType::CHECK_PASS: + ReportCheckResult("CHECK_PASS"_s, message, mf); + break; + + case CheckingType::CHECK_FAIL: + ReportCheckResult("CHECK_FAIL"_s, message, mf); + break; + + default: + mf.DisplayStatus(IndentText(message, mf), -1); + break; + } + break; + case cmake::LogLevel::LOG_VERBOSE: case cmake::LogLevel::LOG_DEBUG: case cmake::LogLevel::LOG_TRACE: - mf.DisplayStatus(message, -1); + mf.DisplayStatus(IndentText(message, mf), -1); break; default: diff --git a/Source/cmake.h b/Source/cmake.h index c2f2cce1ccd..9e78436ff7c 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -5,12 +5,15 @@ #include "cmConfigure.h" // IWYU pragma: keep +#include #include #include #include #include +#include #include #include +#include #include #include "cmGeneratedFileStream.h" @@ -387,6 +390,25 @@ class cmake void SetLogLevel(LogLevel level) { this->MessageLogLevel = level; } static LogLevel StringToLogLevel(const std::string& levelStr); + bool HasCheckInProgress() const + { + return !this->CheckInProgressMessages.empty(); + } + std::size_t GetCheckInProgressSize() const + { + return this->CheckInProgressMessages.size(); + } + std::string GetTopCheckInProgressMessage() + { + auto message = this->CheckInProgressMessages.top(); + this->CheckInProgressMessages.pop(); + return message; + } + void PushCheckInProgressMessage(std::string message) + { + this->CheckInProgressMessages.emplace(std::move(message)); + } + //! Do we want debug output during the cmake run. bool GetDebugOutput() { return this->DebugOutput; } void SetDebugOutputOn(bool b) { this->DebugOutput = b; } @@ -596,6 +618,8 @@ class cmake bool LogLevelWasSetViaCLI = false; bool LogContext = false; + std::stack CheckInProgressMessages; + void UpdateConversionPathTable(); //! Print a list of valid generators to stderr. diff --git a/Tests/RunCMake/message/RunCMakeTest.cmake b/Tests/RunCMake/message/RunCMakeTest.cmake index bf6a47e381f..1f3fa12da43 100644 --- a/Tests/RunCMake/message/RunCMakeTest.cmake +++ b/Tests/RunCMake/message/RunCMakeTest.cmake @@ -83,3 +83,8 @@ run_cmake_command( message-context-cli-wins-cache ${CMAKE_COMMAND} --log-level=verbose --log-context -DCMAKE_MESSAGE_CONTEXT_SHOW=OFF -P ${RunCMake_SOURCE_DIR}/message-context.cmake ) + +run_cmake_command( + message-checks + ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/message-checks.cmake + ) diff --git a/Tests/RunCMake/message/message-checks-stderr.txt b/Tests/RunCMake/message/message-checks-stderr.txt new file mode 100644 index 00000000000..fdacdb2a22c --- /dev/null +++ b/Tests/RunCMake/message/message-checks-stderr.txt @@ -0,0 +1,3 @@ +^CMake Warning \(dev\) at.*/Tests/RunCMake/message/message-checks.cmake:13 \(message\): + Ignored CHECK_FAIL without CHECK_START +This warning is for project developers. Use -Wno-dev to suppress it.$ diff --git a/Tests/RunCMake/message/message-checks-stdout.txt b/Tests/RunCMake/message/message-checks-stdout.txt new file mode 100644 index 00000000000..4f5f2ef3b1f --- /dev/null +++ b/Tests/RunCMake/message/message-checks-stdout.txt @@ -0,0 +1,10 @@ +-- Find `libfoo` +-- Looking for `libfoo\.h` +-- Looking for `libfoo\.h` - found \[/usr/include\] +-- Looking for `libfoo\.so` +-- Looking for `libfoo\.so` - found \[/usr/lib/libfoo\.so\] +-- Getting `libfoo` version +-- Looking for `libfoo/version\.h` +-- Looking for `libfoo/version\.h` - found +-- Getting `libfoo` version - 1\.2\.3 +-- Find `libfoo` - required version 4\.5\.6 but found 1\.2\.3 diff --git a/Tests/RunCMake/message/message-checks.cmake b/Tests/RunCMake/message/message-checks.cmake new file mode 100644 index 00000000000..605846e7be1 --- /dev/null +++ b/Tests/RunCMake/message/message-checks.cmake @@ -0,0 +1,13 @@ +message(CHECK_START "Find `libfoo`") +message(CHECK_START "Looking for `libfoo.h`") +message(CHECK_PASS "found [/usr/include]") +message(CHECK_START "Looking for `libfoo.so`") +message(CHECK_PASS "found [/usr/lib/libfoo.so]") +message(CHECK_START "Getting `libfoo` version") +message(CHECK_START "Looking for `libfoo/version.h`") +message(CHECK_PASS "found") +message(CHECK_PASS "1.2.3") +message(CHECK_FAIL "required version 4.5.6 but found 1.2.3") + +# Should generate an error, no associated CHECK_START +message(CHECK_FAIL "unmatched check fail case") From 7b2dd9dedc8195d2b3bc493dd5ab48cdd2fc3a7b Mon Sep 17 00:00:00 2001 From: Alex Turbov Date: Tue, 13 Aug 2019 05:02:14 +0300 Subject: [PATCH 076/662] Refactor: Use added message types in various modules Co-Authored-By: Craig Scott --- Modules/CMakeDetermineCompileFeatures.cmake | 12 ++++++------ Modules/CMakeDetermineCompilerABI.cmake | 12 +++++------- Modules/CMakeTestCCompiler.cmake | 6 +++--- Modules/CMakeTestCSharpCompiler.cmake | 8 +++++--- Modules/CMakeTestCUDACompiler.cmake | 6 +++--- Modules/CMakeTestCXXCompiler.cmake | 6 +++--- Modules/CMakeTestCompilerCommon.cmake | 11 +++++++++-- Modules/CMakeTestFortranCompiler.cmake | 12 ++++++------ Modules/CMakeTestOBJCCompiler.cmake | 6 +++--- Modules/CMakeTestOBJCXXCompiler.cmake | 6 +++--- Modules/CMakeTestSwiftCompiler.cmake | 6 +++--- Modules/CheckCSourceCompiles.cmake | 6 +++--- Modules/CheckCSourceRuns.cmake | 6 +++--- Modules/CheckCXXSourceCompiles.cmake | 6 +++--- Modules/CheckCXXSourceRuns.cmake | 6 +++--- Modules/CheckFortranFunctionExists.cmake | 17 ++++++++--------- Modules/CheckFortranSourceCompiles.cmake | 6 +++--- Modules/CheckFortranSourceRuns.cmake | 6 +++--- Modules/CheckFunctionExists.cmake | 6 +++--- Modules/CheckIncludeFile.cmake | 6 +++--- Modules/CheckIncludeFileCXX.cmake | 6 +++--- Modules/CheckIncludeFiles.cmake | 6 +++--- Modules/CheckLanguage.cmake | 6 ++++-- Modules/CheckLibraryExists.cmake | 6 +++--- Modules/CheckOBJCSourceCompiles.cmake | 6 +++--- Modules/CheckOBJCSourceRuns.cmake | 6 +++--- Modules/CheckOBJCXXSourceCompiles.cmake | 6 +++--- Modules/CheckOBJCXXSourceRuns.cmake | 6 +++--- Modules/CheckPrototypeDefinition.cmake | 7 +++++-- Modules/CheckSymbolExists.cmake | 6 +++--- Modules/CheckTypeSize.cmake | 6 +++--- Modules/CheckVariableExists.cmake | 6 +++--- Modules/Compiler/NAG-Fortran.cmake | 6 +++--- Modules/FindDCMTK.cmake | 6 +++--- Modules/FindMFC.cmake | 6 +++--- Modules/FindThreads.cmake | 6 +++--- Modules/FortranCInterface.cmake | 6 +++--- Modules/FortranCInterface/Detect.cmake | 6 ++++-- Modules/Platform/Apple-GNU.cmake | 12 ++++++------ Modules/TestBigEndian.cmake | 17 +++++++++-------- Modules/TestCXXAcceptsFlag.cmake | 6 +++--- Modules/TestForANSIForScope.cmake | 6 +++--- Modules/TestForSSTREAM.cmake | 6 +++--- Modules/TestForSTDNamespace.cmake | 6 +++--- Source/Checks/Curses.cmake | 9 ++++++--- Source/Checks/cm_c11_thread_local.cmake | 10 +++++++--- Source/Checks/cm_cxx14_check.cmake | 10 +++++++--- Source/Checks/cm_cxx17_check.cmake | 10 +++++++--- Source/Checks/cm_cxx_features.cmake | 10 +++++++--- Source/Checks/cm_message_checks_compat.cmake | 13 +++++++++++++ 50 files changed, 213 insertions(+), 167 deletions(-) create mode 100644 Source/Checks/cm_message_checks_compat.cmake diff --git a/Modules/CMakeDetermineCompileFeatures.cmake b/Modules/CMakeDetermineCompileFeatures.cmake index 01a81a1a865..6adebaef6da 100644 --- a/Modules/CMakeDetermineCompileFeatures.cmake +++ b/Modules/CMakeDetermineCompileFeatures.cmake @@ -5,7 +5,7 @@ function(cmake_determine_compile_features lang) if(lang STREQUAL C AND COMMAND cmake_record_c_compile_features) - message(STATUS "Detecting ${lang} compile features") + message(CHECK_START "Detecting ${lang} compile features") set(CMAKE_C90_COMPILE_FEATURES) set(CMAKE_C99_COMPILE_FEATURES) @@ -16,7 +16,7 @@ function(cmake_determine_compile_features lang) cmake_record_c_compile_features() if(NOT _result EQUAL 0) - message(STATUS "Detecting ${lang} compile features - failed") + message(CHECK_FAIL "failed") return() endif() @@ -40,10 +40,10 @@ function(cmake_determine_compile_features lang) set(CMAKE_C99_COMPILE_FEATURES ${CMAKE_C99_COMPILE_FEATURES} PARENT_SCOPE) set(CMAKE_C11_COMPILE_FEATURES ${CMAKE_C11_COMPILE_FEATURES} PARENT_SCOPE) - message(STATUS "Detecting ${lang} compile features - done") + message(CHECK_PASS "done") elseif(lang STREQUAL CXX AND COMMAND cmake_record_cxx_compile_features) - message(STATUS "Detecting ${lang} compile features") + message(CHECK_START "Detecting ${lang} compile features") set(CMAKE_CXX98_COMPILE_FEATURES) set(CMAKE_CXX11_COMPILE_FEATURES) @@ -56,7 +56,7 @@ function(cmake_determine_compile_features lang) cmake_record_cxx_compile_features() if(NOT _result EQUAL 0) - message(STATUS "Detecting ${lang} compile features - failed") + message(CHECK_FAIL "failed") return() endif() @@ -90,7 +90,7 @@ function(cmake_determine_compile_features lang) set(CMAKE_CXX17_COMPILE_FEATURES ${CMAKE_CXX17_COMPILE_FEATURES} PARENT_SCOPE) set(CMAKE_CXX20_COMPILE_FEATURES ${CMAKE_CXX20_COMPILE_FEATURES} PARENT_SCOPE) - message(STATUS "Detecting ${lang} compile features - done") + message(CHECK_PASS "done") endif() endfunction() diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake index 06f3ba22dee..c5611b5be47 100644 --- a/Modules/CMakeDetermineCompilerABI.cmake +++ b/Modules/CMakeDetermineCompilerABI.cmake @@ -12,7 +12,7 @@ include(CMakeTestCompilerCommon) function(CMAKE_DETERMINE_COMPILER_ABI lang src) if(NOT DEFINED CMAKE_${lang}_ABI_COMPILED) - message(STATUS "Detecting ${lang} compiler ABI info") + message(CHECK_START "Detecting ${lang} compiler ABI info") # Compile the ABI identification source. set(BIN "${CMAKE_PLATFORM_INFO_DIR}/CMakeDetermineCompilerABI_${lang}.bin") @@ -66,7 +66,7 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src) # Load the resulting information strings. if(CMAKE_${lang}_ABI_COMPILED AND NOT _copy_error) - message(STATUS "Detecting ${lang} compiler ABI info - done") + message(CHECK_PASS "done") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Detecting ${lang} compiler ABI info compiled with the following output:\n${OUTPUT}\n\n") file(STRINGS "${BIN}" ABI_STRINGS LIMIT_COUNT 2 REGEX "INFO:[A-Za-z0-9_]+\\[[^]]*\\]") @@ -124,8 +124,7 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src) # a try-compile if("${lang}" MATCHES "Fortran" AND "${CMAKE_GENERATOR}" MATCHES "Visual Studio") - set(_desc "Determine Intel Fortran Compiler Implicit Link Path") - message(STATUS "${_desc}") + message(CHECK_START "Determine Intel Fortran Compiler Implicit Link Path") # Build a sample project which reports symbols. try_compile(IFORT_LIB_PATH_COMPILED ${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath @@ -138,8 +137,7 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src) "${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath/output.txt" "${_output}") include(${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath/output.cmake OPTIONAL) - set(_desc "Determine Intel Fortran Compiler Implicit Link Path -- done") - message(STATUS "${_desc}") + message(CHECK_PASS "done") endif() # Implicit link libraries cannot be used explicitly for multiple @@ -166,7 +164,7 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src) endif() else() - message(STATUS "Detecting ${lang} compiler ABI info - failed") + message(CHECK_FAIL "failed") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Detecting ${lang} compiler ABI info failed to compile with the following output:\n${OUTPUT}\n${_copy_error}\n\n") endif() diff --git a/Modules/CMakeTestCCompiler.cmake b/Modules/CMakeTestCCompiler.cmake index 7bf6fde3b5a..eadea89f056 100644 --- a/Modules/CMakeTestCCompiler.cmake +++ b/Modules/CMakeTestCCompiler.cmake @@ -27,7 +27,7 @@ unset(CMAKE_C_COMPILER_WORKS CACHE) # is set and cmake stops processing commands and will not generate # any makefiles or projects. if(NOT CMAKE_C_COMPILER_WORKS) - PrintTestCompilerStatus("C" "") + PrintTestCompilerStatus("C") __TestCompiler_setTryCompileTargetType() file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler.c "#ifdef __cplusplus\n" @@ -52,7 +52,7 @@ if(NOT CMAKE_C_COMPILER_WORKS) endif() if(NOT CMAKE_C_COMPILER_WORKS) - PrintTestCompilerStatus("C" " -- broken") + PrintTestCompilerResult(CHECK_FAIL "broken") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the C compiler works failed with " "the following output:\n${__CMAKE_C_COMPILER_OUTPUT}\n\n") @@ -63,7 +63,7 @@ if(NOT CMAKE_C_COMPILER_WORKS) "CMake will not be able to correctly generate this project.") else() if(C_TEST_WAS_RUN) - PrintTestCompilerStatus("C" " -- works") + PrintTestCompilerResult(CHECK_PASS "works") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the C compiler works passed with " "the following output:\n${__CMAKE_C_COMPILER_OUTPUT}\n\n") diff --git a/Modules/CMakeTestCSharpCompiler.cmake b/Modules/CMakeTestCSharpCompiler.cmake index 6715c30dbba..1119a45632c 100644 --- a/Modules/CMakeTestCSharpCompiler.cmake +++ b/Modules/CMakeTestCSharpCompiler.cmake @@ -20,7 +20,9 @@ set(test_compile_file "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/test # is set and cmake stops processing commands and will not generate # any makefiles or projects. if(NOT CMAKE_CSharp_COMPILER_WORKS) - PrintTestCompilerStatus("C#" "${CMAKE_CSharp_COMPILER}") + # Don't call PrintTestCompilerStatus() because the "C#" we want to pass + # as the LANG doesn't match with the variable name "CMAKE_CSharp_COMPILER" + message(CHECK_START "Check for working C# compiler: ${CMAKE_CSharp_COMPILER}") file(WRITE "${test_compile_file}" "namespace Test {" " public class CSharp {" @@ -38,7 +40,7 @@ if(NOT CMAKE_CSharp_COMPILER_WORKS) endif() if(NOT CMAKE_CSharp_COMPILER_WORKS) - PrintTestCompilerStatus("C#" "${CMAKE_CSharp_COMPILER} -- broken") + PrintTestCompilerResult(CHECK_FAIL "broken") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the C# compiler works failed with " "the following output:\n${__CMAKE_CSharp_COMPILER_OUTPUT}\n\n") @@ -49,7 +51,7 @@ if(NOT CMAKE_CSharp_COMPILER_WORKS) "CMake will not be able to correctly generate this project.") else() if(CSharp_TEST_WAS_RUN) - PrintTestCompilerStatus("C#" "${CMAKE_CSharp_COMPILER} -- works") + PrintTestCompilerResult(CHECK_PASS "works") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the C# compiler works passed with " "the following output:\n${__CMAKE_CSharp_COMPILER_OUTPUT}\n\n") diff --git a/Modules/CMakeTestCUDACompiler.cmake b/Modules/CMakeTestCUDACompiler.cmake index f0454da670b..c145813efbd 100644 --- a/Modules/CMakeTestCUDACompiler.cmake +++ b/Modules/CMakeTestCUDACompiler.cmake @@ -20,7 +20,7 @@ unset(CMAKE_CUDA_COMPILER_WORKS CACHE) # is set and cmake stops processing commands and will not generate # any makefiles or projects. if(NOT CMAKE_CUDA_COMPILER_WORKS) - PrintTestCompilerStatus("CUDA" "") + PrintTestCompilerStatus("CUDA") file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/main.cu "#ifndef __CUDACC__\n" "# error \"The CMAKE_CUDA_COMPILER is set to an invalid CUDA compiler\"\n" @@ -38,7 +38,7 @@ if(NOT CMAKE_CUDA_COMPILER_WORKS) endif() if(NOT CMAKE_CUDA_COMPILER_WORKS) - PrintTestCompilerStatus("CUDA" " -- broken") + PrintTestCompilerResult(CHECK_FAIL "broken") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the CUDA compiler works failed with " "the following output:\n${__CMAKE_CUDA_COMPILER_OUTPUT}\n\n") @@ -49,7 +49,7 @@ if(NOT CMAKE_CUDA_COMPILER_WORKS) "CMake will not be able to correctly generate this project.") else() if(CUDA_TEST_WAS_RUN) - PrintTestCompilerStatus("CUDA" " -- works") + PrintTestCompilerResult(CHECK_PASS "works") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the CUDA compiler works passed with " "the following output:\n${__CMAKE_CUDA_COMPILER_OUTPUT}\n\n") diff --git a/Modules/CMakeTestCXXCompiler.cmake b/Modules/CMakeTestCXXCompiler.cmake index 7e595b74f23..bd4215397d4 100644 --- a/Modules/CMakeTestCXXCompiler.cmake +++ b/Modules/CMakeTestCXXCompiler.cmake @@ -27,7 +27,7 @@ unset(CMAKE_CXX_COMPILER_WORKS CACHE) # is set and cmake stops processing commands and will not generate # any makefiles or projects. if(NOT CMAKE_CXX_COMPILER_WORKS) - PrintTestCompilerStatus("CXX" "") + PrintTestCompilerStatus("CXX") __TestCompiler_setTryCompileTargetType() file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx "#ifndef __cplusplus\n" @@ -45,7 +45,7 @@ if(NOT CMAKE_CXX_COMPILER_WORKS) endif() if(NOT CMAKE_CXX_COMPILER_WORKS) - PrintTestCompilerStatus("CXX" " -- broken") + PrintTestCompilerResult(CHECK_FAIL "broken") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the CXX compiler works failed with " "the following output:\n${__CMAKE_CXX_COMPILER_OUTPUT}\n\n") @@ -56,7 +56,7 @@ if(NOT CMAKE_CXX_COMPILER_WORKS) "CMake will not be able to correctly generate this project.") else() if(CXX_TEST_WAS_RUN) - PrintTestCompilerStatus("CXX" " -- works") + PrintTestCompilerResult(CHECK_PASS "works") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the CXX compiler works passed with " "the following output:\n${__CMAKE_CXX_COMPILER_OUTPUT}\n\n") diff --git a/Modules/CMakeTestCompilerCommon.cmake b/Modules/CMakeTestCompilerCommon.cmake index 6ee5175dd2a..da7c007d0b4 100644 --- a/Modules/CMakeTestCompilerCommon.cmake +++ b/Modules/CMakeTestCompilerCommon.cmake @@ -2,8 +2,15 @@ # file Copyright.txt or https://cmake.org/licensing for details. -function(PrintTestCompilerStatus LANG MSG) - message(STATUS "Check for working ${LANG} compiler: ${CMAKE_${LANG}_COMPILER}${MSG}") +function(PrintTestCompilerStatus LANG) + # ARGN shouldn't be needed now, but it is there to preserve backward + # compatibility in case this function is called from project code or + # custom toolchains (they shouldn't, but we can easily support it) + message(CHECK_START "Check for working ${LANG} compiler: ${CMAKE_${LANG}_COMPILER}${ARGN}") +endfunction() + +function(PrintTestCompilerResult TYPE MSG) + message(${TYPE} "${MSG}") endfunction() # if required set the target type if not already explicitly set diff --git a/Modules/CMakeTestFortranCompiler.cmake b/Modules/CMakeTestFortranCompiler.cmake index e9860e9deb1..7461f9cc9c9 100644 --- a/Modules/CMakeTestFortranCompiler.cmake +++ b/Modules/CMakeTestFortranCompiler.cmake @@ -21,7 +21,7 @@ unset(CMAKE_Fortran_COMPILER_WORKS CACHE) # is set and cmake stops processing commands and will not generate # any makefiles or projects. if(NOT CMAKE_Fortran_COMPILER_WORKS) - PrintTestCompilerStatus("Fortran" "") + PrintTestCompilerStatus("Fortran") file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f " PROGRAM TESTFortran PRINT *, 'Hello' @@ -37,7 +37,7 @@ if(NOT CMAKE_Fortran_COMPILER_WORKS) endif() if(NOT CMAKE_Fortran_COMPILER_WORKS) - PrintTestCompilerStatus("Fortran" " -- broken") + PrintTestCompilerResult(CHECK_FAIL "broken") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the Fortran compiler works failed with " "the following output:\n${OUTPUT}\n\n") @@ -48,7 +48,7 @@ if(NOT CMAKE_Fortran_COMPILER_WORKS) "CMake will not be able to correctly generate this project.") else() if(FORTRAN_TEST_WAS_RUN) - PrintTestCompilerStatus("Fortran" " -- works") + PrintTestCompilerResult(CHECK_PASS "works") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the Fortran compiler works passed with " "the following output:\n${OUTPUT}\n\n") @@ -60,7 +60,7 @@ else() # Test for Fortran 90 support by using an f90-specific construct. if(NOT DEFINED CMAKE_Fortran_COMPILER_SUPPORTS_F90) - message(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90") + message(CHECK_START "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90") file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompilerF90.f90 " PROGRAM TESTFortran90 integer stop ; stop = 1 ; do while ( stop .eq. 0 ) ; end do @@ -70,13 +70,13 @@ else() ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompilerF90.f90 OUTPUT_VARIABLE OUTPUT) if(CMAKE_Fortran_COMPILER_SUPPORTS_F90) - message(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90 -- yes") + message(CHECK_PASS "yes") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the Fortran compiler supports Fortran 90 passed with " "the following output:\n${OUTPUT}\n\n") set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 1) else() - message(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90 -- no") + message(CHECK_FAIL "no") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the Fortran compiler supports Fortran 90 failed with " "the following output:\n${OUTPUT}\n\n") diff --git a/Modules/CMakeTestOBJCCompiler.cmake b/Modules/CMakeTestOBJCCompiler.cmake index 00306832286..bcc6fae3b33 100644 --- a/Modules/CMakeTestOBJCCompiler.cmake +++ b/Modules/CMakeTestOBJCCompiler.cmake @@ -27,7 +27,7 @@ unset(CMAKE_OBJC_COMPILER_WORKS CACHE) # is set and cmake stops processing commands and will not generate # any makefiles or projects. if(NOT CMAKE_OBJC_COMPILER_WORKS) - PrintTestCompilerStatus("OBJC" "") + PrintTestCompilerStatus("OBJC") __TestCompiler_setTryCompileTargetType() file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testOBJCCompiler.m "#ifdef __cplusplus\n" @@ -49,7 +49,7 @@ if(NOT CMAKE_OBJC_COMPILER_WORKS) endif() if(NOT CMAKE_OBJC_COMPILER_WORKS) - PrintTestCompilerStatus("OBJC" " -- broken") + PrintTestCompilerResult(CHECK_FAIL "broken") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the Objective-C compiler works failed with " "the following output:\n${__CMAKE_OBJC_COMPILER_OUTPUT}\n\n") @@ -60,7 +60,7 @@ if(NOT CMAKE_OBJC_COMPILER_WORKS) "CMake will not be able to correctly generate this project.") else() if(OBJC_TEST_WAS_RUN) - PrintTestCompilerStatus("OBJC" " -- works") + PrintTestCompilerResult(CHECK_PASS "works") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the Objective-C compiler works passed with " "the following output:\n${__CMAKE_OBJC_COMPILER_OUTPUT}\n\n") diff --git a/Modules/CMakeTestOBJCXXCompiler.cmake b/Modules/CMakeTestOBJCXXCompiler.cmake index bcce2f1486c..83227d57357 100644 --- a/Modules/CMakeTestOBJCXXCompiler.cmake +++ b/Modules/CMakeTestOBJCXXCompiler.cmake @@ -27,7 +27,7 @@ unset(CMAKE_OBJCXX_COMPILER_WORKS CACHE) # is set and cmake stops processing commands and will not generate # any makefiles or projects. if(NOT CMAKE_OBJCXX_COMPILER_WORKS) - PrintTestCompilerStatus("OBJCXX" "") + PrintTestCompilerStatus("OBJCXX") __TestCompiler_setTryCompileTargetType() file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testOBJCXXCompiler.mm "#ifndef __cplusplus\n" @@ -48,7 +48,7 @@ if(NOT CMAKE_OBJCXX_COMPILER_WORKS) endif() if(NOT CMAKE_OBJCXX_COMPILER_WORKS) - PrintTestCompilerStatus("OBJCXX" " -- broken") + PrintTestCompilerResult(CHECK_FAIL "broken") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the Objective-C++ compiler works failed with " "the following output:\n${__CMAKE_OBJCXX_COMPILER_OUTPUT}\n\n") @@ -59,7 +59,7 @@ if(NOT CMAKE_OBJCXX_COMPILER_WORKS) "CMake will not be able to correctly generate this project.") else() if(OBJCXX_TEST_WAS_RUN) - PrintTestCompilerStatus("OBJCXX" " -- works") + PrintTestCompilerResult(CHECK_PASS "works") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the Objective-C++ compiler works passed with " "the following output:\n${__CMAKE_OBJCXX_COMPILER_OUTPUT}\n\n") diff --git a/Modules/CMakeTestSwiftCompiler.cmake b/Modules/CMakeTestSwiftCompiler.cmake index 841aee643ff..3e4ff95e433 100644 --- a/Modules/CMakeTestSwiftCompiler.cmake +++ b/Modules/CMakeTestSwiftCompiler.cmake @@ -20,7 +20,7 @@ unset(CMAKE_Swift_COMPILER_WORKS CACHE) # is set and cmake stops processing commands and will not generate # any makefiles or projects. if(NOT CMAKE_Swift_COMPILER_WORKS) - PrintTestCompilerStatus("Swift" "") + PrintTestCompilerStatus("Swift") file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/main.swift "print(\"CMake\")\n") try_compile(CMAKE_Swift_COMPILER_WORKS ${CMAKE_BINARY_DIR} @@ -33,7 +33,7 @@ if(NOT CMAKE_Swift_COMPILER_WORKS) endif() if(NOT CMAKE_Swift_COMPILER_WORKS) - PrintTestCompilerStatus("Swift" " -- broken") + PrintTestCompilerResult(CHECK_FAIL "broken") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the Swift compiler works failed with " "the following output:\n${__CMAKE_Swift_COMPILER_OUTPUT}\n\n") @@ -44,7 +44,7 @@ if(NOT CMAKE_Swift_COMPILER_WORKS) "CMake will not be able to correctly generate this project.") else() if(Swift_TEST_WAS_RUN) - PrintTestCompilerStatus("Swift" " -- works") + PrintTestCompilerResult(CHECK_PASS "works") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the Swift compiler works passed with " "the following output:\n${__CMAKE_Swift_COMPILER_OUTPUT}\n\n") diff --git a/Modules/CheckCSourceCompiles.cmake b/Modules/CheckCSourceCompiles.cmake index 77ba0cc462d..67fc993be33 100644 --- a/Modules/CheckCSourceCompiles.cmake +++ b/Modules/CheckCSourceCompiles.cmake @@ -104,7 +104,7 @@ macro(CHECK_C_SOURCE_COMPILES SOURCE VAR) "${SOURCE}\n") if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Performing Test ${VAR}") + message(CHECK_START "Performing Test ${VAR}") endif() try_compile(${VAR} ${CMAKE_BINARY_DIR} @@ -125,7 +125,7 @@ macro(CHECK_C_SOURCE_COMPILES SOURCE VAR) if(${VAR}) set(${VAR} 1 CACHE INTERNAL "Test ${VAR}") if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Performing Test ${VAR} - Success") + message(CHECK_PASS "Success") endif() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Performing C SOURCE FILE Test ${VAR} succeeded with the following output:\n" @@ -133,7 +133,7 @@ macro(CHECK_C_SOURCE_COMPILES SOURCE VAR) "Source file was:\n${SOURCE}\n") else() if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Performing Test ${VAR} - Failed") + message(CHECK_FAIL "Failed") endif() set(${VAR} "" CACHE INTERNAL "Test ${VAR}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log diff --git a/Modules/CheckCSourceRuns.cmake b/Modules/CheckCSourceRuns.cmake index eba70f2ba41..7d116db8de0 100644 --- a/Modules/CheckCSourceRuns.cmake +++ b/Modules/CheckCSourceRuns.cmake @@ -92,7 +92,7 @@ macro(CHECK_C_SOURCE_RUNS SOURCE VAR) "${SOURCE}\n") if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Performing Test ${VAR}") + message(CHECK_START "Performing Test ${VAR}") endif() try_run(${VAR}_EXITCODE ${VAR}_COMPILED ${CMAKE_BINARY_DIR} @@ -113,7 +113,7 @@ macro(CHECK_C_SOURCE_RUNS SOURCE VAR) if("${${VAR}_EXITCODE}" EQUAL 0) set(${VAR} 1 CACHE INTERNAL "Test ${VAR}") if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Performing Test ${VAR} - Success") + message(CHECK_PASS "Success") endif() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Performing C SOURCE FILE Test ${VAR} succeeded with the following compile output:\n" @@ -130,7 +130,7 @@ macro(CHECK_C_SOURCE_RUNS SOURCE VAR) endif() if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Performing Test ${VAR} - Failed") + message(CHECK_FAIL "Failed") endif() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Performing C SOURCE FILE Test ${VAR} failed with the following compile output:\n" diff --git a/Modules/CheckCXXSourceCompiles.cmake b/Modules/CheckCXXSourceCompiles.cmake index cc457a565e1..c693d32b3fd 100644 --- a/Modules/CheckCXXSourceCompiles.cmake +++ b/Modules/CheckCXXSourceCompiles.cmake @@ -105,7 +105,7 @@ macro(CHECK_CXX_SOURCE_COMPILES SOURCE VAR) "${SOURCE}\n") if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Performing Test ${VAR}") + message(CHECK_START "Performing Test ${VAR}") endif() try_compile(${VAR} ${CMAKE_BINARY_DIR} @@ -126,7 +126,7 @@ macro(CHECK_CXX_SOURCE_COMPILES SOURCE VAR) if(${VAR}) set(${VAR} 1 CACHE INTERNAL "Test ${VAR}") if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Performing Test ${VAR} - Success") + message(CHECK_PASS "Success") endif() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Performing C++ SOURCE FILE Test ${VAR} succeeded with the following output:\n" @@ -134,7 +134,7 @@ macro(CHECK_CXX_SOURCE_COMPILES SOURCE VAR) "Source file was:\n${SOURCE}\n") else() if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Performing Test ${VAR} - Failed") + message(CHECK_FAIL "Failed") endif() set(${VAR} "" CACHE INTERNAL "Test ${VAR}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log diff --git a/Modules/CheckCXXSourceRuns.cmake b/Modules/CheckCXXSourceRuns.cmake index 5e3f1958173..408e183a3eb 100644 --- a/Modules/CheckCXXSourceRuns.cmake +++ b/Modules/CheckCXXSourceRuns.cmake @@ -92,7 +92,7 @@ macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR) "${SOURCE}\n") if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Performing Test ${VAR}") + message(CHECK_START "Performing Test ${VAR}") endif() try_run(${VAR}_EXITCODE ${VAR}_COMPILED ${CMAKE_BINARY_DIR} @@ -114,7 +114,7 @@ macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR) if("${${VAR}_EXITCODE}" EQUAL 0) set(${VAR} 1 CACHE INTERNAL "Test ${VAR}") if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Performing Test ${VAR} - Success") + message(CHECK_PASS "Success") endif() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Performing C++ SOURCE FILE Test ${VAR} succeeded with the following output:\n" @@ -131,7 +131,7 @@ macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR) endif() if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Performing Test ${VAR} - Failed") + message(CHECK_FAIL "Failed") endif() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n" diff --git a/Modules/CheckFortranFunctionExists.cmake b/Modules/CheckFortranFunctionExists.cmake index 7ca205a6dc6..d06203fc231 100644 --- a/Modules/CheckFortranFunctionExists.cmake +++ b/Modules/CheckFortranFunctionExists.cmake @@ -38,7 +38,7 @@ include_guard(GLOBAL) macro(CHECK_FORTRAN_FUNCTION_EXISTS FUNCTION VARIABLE) if(NOT DEFINED ${VARIABLE}) - message(STATUS "Looking for Fortran ${FUNCTION}") + message(CHECK_START "Looking for Fortran ${FUNCTION}") if(CMAKE_REQUIRED_LINK_OPTIONS) set(CHECK_FUNCTION_EXISTS_ADD_LINK_OPTIONS LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS}) @@ -61,21 +61,20 @@ macro(CHECK_FORTRAN_FUNCTION_EXISTS FUNCTION VARIABLE) " ) try_compile(${VARIABLE} - ${CMAKE_BINARY_DIR} - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f - ${CHECK_FUNCTION_EXISTS_ADD_LINK_OPTIONS} - ${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES} - OUTPUT_VARIABLE OUTPUT + ${CMAKE_BINARY_DIR} + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f + ${CHECK_FUNCTION_EXISTS_ADD_LINK_OPTIONS} + ${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES} + OUTPUT_VARIABLE OUTPUT ) -# message(STATUS "${OUTPUT}") if(${VARIABLE}) set(${VARIABLE} 1 CACHE INTERNAL "Have Fortran function ${FUNCTION}") - message(STATUS "Looking for Fortran ${FUNCTION} - found") + message(CHECK_PASS "found") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the Fortran ${FUNCTION} exists passed with the following output:\n" "${OUTPUT}\n\n") else() - message(STATUS "Looking for Fortran ${FUNCTION} - not found") + message(CHECK_FAIL "not found") set(${VARIABLE} "" CACHE INTERNAL "Have Fortran function ${FUNCTION}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the Fortran ${FUNCTION} exists failed with the following output:\n" diff --git a/Modules/CheckFortranSourceCompiles.cmake b/Modules/CheckFortranSourceCompiles.cmake index f94b2546894..f0fde8d55a4 100644 --- a/Modules/CheckFortranSourceCompiles.cmake +++ b/Modules/CheckFortranSourceCompiles.cmake @@ -127,7 +127,7 @@ macro(CHECK_Fortran_SOURCE_COMPILES SOURCE VAR) "${SOURCE}\n") if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Performing Test ${VAR}") + message(CHECK_START "Performing Test ${VAR}") endif() try_compile(${VAR} ${CMAKE_BINARY_DIR} @@ -148,7 +148,7 @@ macro(CHECK_Fortran_SOURCE_COMPILES SOURCE VAR) if(${VAR}) set(${VAR} 1 CACHE INTERNAL "Test ${VAR}") if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Performing Test ${VAR} - Success") + message(CHECK_PASS "Success") endif() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Performing Fortran SOURCE FILE Test ${VAR} succeeded with the following output:\n" @@ -156,7 +156,7 @@ macro(CHECK_Fortran_SOURCE_COMPILES SOURCE VAR) "Source file was:\n${SOURCE}\n") else() if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Performing Test ${VAR} - Failed") + message(CHECK_FAIL "Failed") endif() set(${VAR} "" CACHE INTERNAL "Test ${VAR}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log diff --git a/Modules/CheckFortranSourceRuns.cmake b/Modules/CheckFortranSourceRuns.cmake index a80c13d0070..a3e5d5dbf14 100644 --- a/Modules/CheckFortranSourceRuns.cmake +++ b/Modules/CheckFortranSourceRuns.cmake @@ -122,7 +122,7 @@ macro(CHECK_Fortran_SOURCE_RUNS SOURCE VAR) "${SOURCE}\n") if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Performing Test ${VAR}") + message(CHECK_START "Performing Test ${VAR}") endif() try_run(${VAR}_EXITCODE ${VAR}_COMPILED ${CMAKE_BINARY_DIR} @@ -144,7 +144,7 @@ macro(CHECK_Fortran_SOURCE_RUNS SOURCE VAR) if("${${VAR}_EXITCODE}" EQUAL 0) set(${VAR} 1 CACHE INTERNAL "Test ${VAR}") if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Performing Test ${VAR} - Success") + message(CHECK_PASS "Success") endif() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Performing Fortran SOURCE FILE Test ${VAR} succeeded with the following output:\n" @@ -161,7 +161,7 @@ macro(CHECK_Fortran_SOURCE_RUNS SOURCE VAR) endif() if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Performing Test ${VAR} - Failed") + message(CHECK_FAIL "Failed") endif() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Performing Fortran SOURCE FILE Test ${VAR} failed with the following output:\n" diff --git a/Modules/CheckFunctionExists.cmake b/Modules/CheckFunctionExists.cmake index c39144fa813..136da89d9bf 100644 --- a/Modules/CheckFunctionExists.cmake +++ b/Modules/CheckFunctionExists.cmake @@ -57,7 +57,7 @@ macro(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE) set(MACRO_CHECK_FUNCTION_DEFINITIONS "-DCHECK_FUNCTION_EXISTS=${FUNCTION} ${CMAKE_REQUIRED_FLAGS}") if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Looking for ${FUNCTION}") + message(CHECK_START "Looking for ${FUNCTION}") endif() if(CMAKE_REQUIRED_LINK_OPTIONS) set(CHECK_FUNCTION_EXISTS_ADD_LINK_OPTIONS @@ -101,14 +101,14 @@ macro(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE) if(${VARIABLE}) set(${VARIABLE} 1 CACHE INTERNAL "Have function ${FUNCTION}") if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Looking for ${FUNCTION} - found") + message(CHECK_PASS "found") endif() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the function ${FUNCTION} exists passed with the following output:\n" "${OUTPUT}\n\n") else() if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Looking for ${FUNCTION} - not found") + message(CHECK_FAIL "not found") endif() set(${VARIABLE} "" CACHE INTERNAL "Have function ${FUNCTION}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log diff --git a/Modules/CheckIncludeFile.cmake b/Modules/CheckIncludeFile.cmake index d7b9481da35..3a104736c66 100644 --- a/Modules/CheckIncludeFile.cmake +++ b/Modules/CheckIncludeFile.cmake @@ -55,7 +55,7 @@ macro(CHECK_INCLUDE_FILE INCLUDE VARIABLE) configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.c.in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.c) if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Looking for ${INCLUDE}") + message(CHECK_START "Looking for ${INCLUDE}") endif() if(${ARGC} EQUAL 3) set(CMAKE_C_FLAGS_SAVE ${CMAKE_C_FLAGS}) @@ -109,7 +109,7 @@ macro(CHECK_INCLUDE_FILE INCLUDE VARIABLE) if(${VARIABLE}) if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Looking for ${INCLUDE} - found") + message(CHECK_PASS "found") endif() set(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log @@ -118,7 +118,7 @@ macro(CHECK_INCLUDE_FILE INCLUDE VARIABLE) "${OUTPUT}\n\n") else() if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Looking for ${INCLUDE} - not found") + message(CHECK_FAIL "not found") endif() set(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log diff --git a/Modules/CheckIncludeFileCXX.cmake b/Modules/CheckIncludeFileCXX.cmake index de5a83b35cb..496550fa866 100644 --- a/Modules/CheckIncludeFileCXX.cmake +++ b/Modules/CheckIncludeFileCXX.cmake @@ -54,7 +54,7 @@ macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE) configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx) if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Looking for C++ include ${INCLUDE}") + message(CHECK_START "Looking for C++ include ${INCLUDE}") endif() if(${ARGC} EQUAL 3) set(CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS}) @@ -108,7 +108,7 @@ macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE) if(${VARIABLE}) if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Looking for C++ include ${INCLUDE} - found") + message(CHECK_PASS "found") endif() set(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log @@ -117,7 +117,7 @@ macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE) "${OUTPUT}\n\n") else() if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Looking for C++ include ${INCLUDE} - not found") + message(CHECK_FAIL "not found") endif() set(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log diff --git a/Modules/CheckIncludeFiles.cmake b/Modules/CheckIncludeFiles.cmake index f52ab55fbd7..8e10cd6abbc 100644 --- a/Modules/CheckIncludeFiles.cmake +++ b/Modules/CheckIncludeFiles.cmake @@ -131,7 +131,7 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE) endif() if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Looking for ${_description}") + message(CHECK_START "Looking for ${_description}") endif() try_compile(${VARIABLE} ${CMAKE_BINARY_DIR} @@ -147,7 +147,7 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE) unset(_CIF_LINK_LIBRARIES) if(${VARIABLE}) if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Looking for ${_description} - found") + message(CHECK_PASS "found") endif() set(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log @@ -156,7 +156,7 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE) "${OUTPUT}\n\n") else() if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Looking for ${_description} - not found") + message(CHECK_FAIL "not found") endif() set(${VARIABLE} "" CACHE INTERNAL "Have includes ${INCLUDE}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log diff --git a/Modules/CheckLanguage.cmake b/Modules/CheckLanguage.cmake index a1a3a7aaca4..a33792612d9 100644 --- a/Modules/CheckLanguage.cmake +++ b/Modules/CheckLanguage.cmake @@ -39,7 +39,7 @@ include_guard(GLOBAL) macro(check_language lang) if(NOT DEFINED CMAKE_${lang}_COMPILER) set(_desc "Looking for a ${lang} compiler") - message(STATUS ${_desc}) + message(CHECK_START "${_desc}") file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Check${lang}) set(extra_compiler_variables) @@ -78,13 +78,15 @@ file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/result.cmake\" file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "${_desc} passed with the following output:\n" "${output}\n") + set(_CHECK_COMPILER_STATUS CHECK_PASS) else() set(CMAKE_${lang}_COMPILER NOTFOUND) + set(_CHECK_COMPILER_STATUS CHECK_FAIL) file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "${_desc} failed with the following output:\n" "${output}\n") endif() - message(STATUS "${_desc} - ${CMAKE_${lang}_COMPILER}") + message(${_CHECK_COMPILER_STATUS} "${CMAKE_${lang}_COMPILER}") set(CMAKE_${lang}_COMPILER "${CMAKE_${lang}_COMPILER}" CACHE FILEPATH "${lang} compiler") mark_as_advanced(CMAKE_${lang}_COMPILER) diff --git a/Modules/CheckLibraryExists.cmake b/Modules/CheckLibraryExists.cmake index 6504df5d799..6470dfd0493 100644 --- a/Modules/CheckLibraryExists.cmake +++ b/Modules/CheckLibraryExists.cmake @@ -42,7 +42,7 @@ macro(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE) set(MACRO_CHECK_LIBRARY_EXISTS_DEFINITION "-DCHECK_FUNCTION_EXISTS=${FUNCTION} ${CMAKE_REQUIRED_FLAGS}") if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Looking for ${FUNCTION} in ${LIBRARY}") + message(CHECK_START "Looking for ${FUNCTION} in ${LIBRARY}") endif() set(CHECK_LIBRARY_EXISTS_LINK_OPTIONS) if(CMAKE_REQUIRED_LINK_OPTIONS) @@ -78,7 +78,7 @@ macro(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE) if(${VARIABLE}) if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - found") + message(CHECK_PASS "found") endif() set(${VARIABLE} 1 CACHE INTERNAL "Have library ${LIBRARY}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log @@ -87,7 +87,7 @@ macro(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE) "${OUTPUT}\n\n") else() if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - not found") + message(CHECK_FAIL "not found") endif() set(${VARIABLE} "" CACHE INTERNAL "Have library ${LIBRARY}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log diff --git a/Modules/CheckOBJCSourceCompiles.cmake b/Modules/CheckOBJCSourceCompiles.cmake index a4676ad6e8e..601f1fa443b 100644 --- a/Modules/CheckOBJCSourceCompiles.cmake +++ b/Modules/CheckOBJCSourceCompiles.cmake @@ -104,7 +104,7 @@ macro(CHECK_OBJC_SOURCE_COMPILES SOURCE VAR) "${SOURCE}\n") if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Performing Test ${VAR}") + message(CHECK_START "Performing Test ${VAR}") endif() try_compile(${VAR} ${CMAKE_BINARY_DIR} @@ -125,7 +125,7 @@ macro(CHECK_OBJC_SOURCE_COMPILES SOURCE VAR) if(${VAR}) set(${VAR} 1 CACHE INTERNAL "Test ${VAR}") if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Performing Test ${VAR} - Success") + message(CHECK_PASS "Success") endif() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Performing Objective-C SOURCE FILE Test ${VAR} succeeded with the following output:\n" @@ -133,7 +133,7 @@ macro(CHECK_OBJC_SOURCE_COMPILES SOURCE VAR) "Source file was:\n${SOURCE}\n") else() if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Performing Test ${VAR} - Failed") + message(CHECK_FAIL "Failed") endif() set(${VAR} "" CACHE INTERNAL "Test ${VAR}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log diff --git a/Modules/CheckOBJCSourceRuns.cmake b/Modules/CheckOBJCSourceRuns.cmake index 00a1ebd0c78..6684693916c 100644 --- a/Modules/CheckOBJCSourceRuns.cmake +++ b/Modules/CheckOBJCSourceRuns.cmake @@ -92,7 +92,7 @@ macro(CHECK_OBJC_SOURCE_RUNS SOURCE VAR) "${SOURCE}\n") if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Performing Test ${VAR}") + message(CHECK_START "Performing Test ${VAR}") endif() try_run(${VAR}_EXITCODE ${VAR}_COMPILED ${CMAKE_BINARY_DIR} @@ -113,7 +113,7 @@ macro(CHECK_OBJC_SOURCE_RUNS SOURCE VAR) if("${${VAR}_EXITCODE}" EQUAL 0) set(${VAR} 1 CACHE INTERNAL "Test ${VAR}") if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Performing Test ${VAR} - Success") + message(CHECK_PASS "Success") endif() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Performing Objective-C SOURCE FILE Test ${VAR} succeeded with the following compile output:\n" @@ -130,7 +130,7 @@ macro(CHECK_OBJC_SOURCE_RUNS SOURCE VAR) endif() if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Performing Test ${VAR} - Failed") + message(CHECK_FAIL "Failed") endif() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Performing Objective-C SOURCE FILE Test ${VAR} failed with the following compile output:\n" diff --git a/Modules/CheckOBJCXXSourceCompiles.cmake b/Modules/CheckOBJCXXSourceCompiles.cmake index 4c0fdd0d3c4..2ee79f48a71 100644 --- a/Modules/CheckOBJCXXSourceCompiles.cmake +++ b/Modules/CheckOBJCXXSourceCompiles.cmake @@ -105,7 +105,7 @@ macro(CHECK_OBJCXX_SOURCE_COMPILES SOURCE VAR) "${SOURCE}\n") if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Performing Test ${VAR}") + message(CHECK_START "Performing Test ${VAR}") endif() try_compile(${VAR} ${CMAKE_BINARY_DIR} @@ -126,7 +126,7 @@ macro(CHECK_OBJCXX_SOURCE_COMPILES SOURCE VAR) if(${VAR}) set(${VAR} 1 CACHE INTERNAL "Test ${VAR}") if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Performing Test ${VAR} - Success") + message(CHECK_PASS "Success") endif() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Performing Objective-C++ SOURCE FILE Test ${VAR} succeeded with the following output:\n" @@ -134,7 +134,7 @@ macro(CHECK_OBJCXX_SOURCE_COMPILES SOURCE VAR) "Source file was:\n${SOURCE}\n") else() if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Performing Test ${VAR} - Failed") + message(CHECK_FAIL "Failed") endif() set(${VAR} "" CACHE INTERNAL "Test ${VAR}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log diff --git a/Modules/CheckOBJCXXSourceRuns.cmake b/Modules/CheckOBJCXXSourceRuns.cmake index a3d5923e9f7..7f7e04f77ee 100644 --- a/Modules/CheckOBJCXXSourceRuns.cmake +++ b/Modules/CheckOBJCXXSourceRuns.cmake @@ -92,7 +92,7 @@ macro(CHECK_OBJCXX_SOURCE_RUNS SOURCE VAR) "${SOURCE}\n") if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Performing Test ${VAR}") + message(CHECK_START "Performing Test ${VAR}") endif() try_run(${VAR}_EXITCODE ${VAR}_COMPILED ${CMAKE_BINARY_DIR} @@ -114,7 +114,7 @@ macro(CHECK_OBJCXX_SOURCE_RUNS SOURCE VAR) if("${${VAR}_EXITCODE}" EQUAL 0) set(${VAR} 1 CACHE INTERNAL "Test ${VAR}") if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Performing Test ${VAR} - Success") + message(CHECK_PASS "Success") endif() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Performing Objective-C++ SOURCE FILE Test ${VAR} succeeded with the following output:\n" @@ -131,7 +131,7 @@ macro(CHECK_OBJCXX_SOURCE_RUNS SOURCE VAR) endif() if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Performing Test ${VAR} - Failed") + message(CHECK_FAIL "Failed") endif() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Performing Objective-C++ SOURCE FILE Test ${VAR} failed with the following output:\n" diff --git a/Modules/CheckPrototypeDefinition.cmake b/Modules/CheckPrototypeDefinition.cmake index a7b020c06d0..8b06403d7e5 100644 --- a/Modules/CheckPrototypeDefinition.cmake +++ b/Modules/CheckPrototypeDefinition.cmake @@ -54,6 +54,9 @@ include_guard(GLOBAL) function(check_prototype_definition _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIABLE) if (NOT DEFINED ${_VARIABLE}) + if(NOT CMAKE_REQUIRED_QUIET) + message(CHECK_START "Checking prototype ${_FUNCTION} for ${_VARIABLE}") + endif() set(CHECK_PROTOTYPE_DEFINITION_CONTENT "/* */\n") set(CHECK_PROTOTYPE_DEFINITION_FLAGS ${CMAKE_REQUIRED_FLAGS}) @@ -103,14 +106,14 @@ function(check_prototype_definition _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIAB if (${_VARIABLE}) set(${_VARIABLE} 1 CACHE INTERNAL "Have correct prototype for ${_FUNCTION}") if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Checking prototype ${_FUNCTION} for ${_VARIABLE} - True") + message(CHECK_PASS "True") endif() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the prototype ${_FUNCTION} exists for ${_VARIABLE} passed with the following output:\n" "${OUTPUT}\n\n") else () if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Checking prototype ${_FUNCTION} for ${_VARIABLE} - False") + message(CHECK_FAIL "False") endif() set(${_VARIABLE} 0 CACHE INTERNAL "Have correct prototype for ${_FUNCTION}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log diff --git a/Modules/CheckSymbolExists.cmake b/Modules/CheckSymbolExists.cmake index 105338301ac..4f202c41d59 100644 --- a/Modules/CheckSymbolExists.cmake +++ b/Modules/CheckSymbolExists.cmake @@ -126,7 +126,7 @@ int main(int argc, char** argv) "${SOURCEFILE}" @ONLY) if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Looking for ${SYMBOL}") + message(CHECK_START "Looking for ${SYMBOL}") endif() try_compile(${VARIABLE} ${CMAKE_BINARY_DIR} @@ -140,7 +140,7 @@ int main(int argc, char** argv) OUTPUT_VARIABLE OUTPUT) if(${VARIABLE}) if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Looking for ${SYMBOL} - found") + message(CHECK_PASS "found") endif() set(${VARIABLE} 1 CACHE INTERNAL "Have symbol ${SYMBOL}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log @@ -150,7 +150,7 @@ int main(int argc, char** argv) "${CMAKE_CONFIGURABLE_FILE_CONTENT}\n") else() if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Looking for ${SYMBOL} - not found") + message(CHECK_FAIL "not found") endif() set(${VARIABLE} "" CACHE INTERNAL "Have symbol ${SYMBOL}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake index 37273730712..2b07b7cc035 100644 --- a/Modules/CheckTypeSize.cmake +++ b/Modules/CheckTypeSize.cmake @@ -86,7 +86,7 @@ cmake_policy(SET CMP0054 NEW) # Helper function. DO NOT CALL DIRECTLY. function(__check_type_size_impl type var map builtin language) if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Check size of ${type}") + message(CHECK_START "Check size of ${type}") endif() # Include header files. @@ -173,7 +173,7 @@ function(__check_type_size_impl type var map builtin language) endif() if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Check size of ${type} - done") + message(CHECK_PASS "done") endif() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining size of ${type} passed with the following output:\n${output}\n\n") @@ -181,7 +181,7 @@ function(__check_type_size_impl type var map builtin language) else() # The check failed to compile. if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Check size of ${type} - failed") + message(CHECK_FAIL "failed") endif() file(READ ${src} content) file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log diff --git a/Modules/CheckVariableExists.cmake b/Modules/CheckVariableExists.cmake index f4953a349f0..8a935352496 100644 --- a/Modules/CheckVariableExists.cmake +++ b/Modules/CheckVariableExists.cmake @@ -42,7 +42,7 @@ macro(CHECK_VARIABLE_EXISTS VAR VARIABLE) set(MACRO_CHECK_VARIABLE_DEFINITIONS "-DCHECK_VARIABLE_EXISTS=${VAR} ${CMAKE_REQUIRED_FLAGS}") if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Looking for ${VAR}") + message(CHECK_START "Looking for ${VAR}") endif() if(CMAKE_REQUIRED_LINK_OPTIONS) set(CHECK_VARIABLE_EXISTS_ADD_LINK_OPTIONS @@ -67,7 +67,7 @@ macro(CHECK_VARIABLE_EXISTS VAR VARIABLE) if(${VARIABLE}) set(${VARIABLE} 1 CACHE INTERNAL "Have variable ${VAR}") if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Looking for ${VAR} - found") + message(CHECK_PASS "found") endif() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the variable ${VAR} exists passed with the following output:\n" @@ -75,7 +75,7 @@ macro(CHECK_VARIABLE_EXISTS VAR VARIABLE) else() set(${VARIABLE} "" CACHE INTERNAL "Have variable ${VAR}") if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Looking for ${VAR} - not found") + message(CHECK_FAIL "not found") endif() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the variable ${VAR} exists failed with the following output:\n" diff --git a/Modules/Compiler/NAG-Fortran.cmake b/Modules/Compiler/NAG-Fortran.cmake index 9973febc3d9..c54ab9da1cc 100644 --- a/Modules/Compiler/NAG-Fortran.cmake +++ b/Modules/Compiler/NAG-Fortran.cmake @@ -1,6 +1,6 @@ # Help CMAKE_PARSE_IMPLICIT_LINK_INFO detect NAG Fortran object files. if(NOT CMAKE_Fortran_COMPILER_WORKS AND NOT CMAKE_Fortran_COMPILER_FORCED) - message(STATUS "Detecting NAG Fortran directory") + message(CHECK_START "Detecting NAG Fortran directory") # Run with -dryrun to see sample "link" line. execute_process( COMMAND ${CMAKE_Fortran_COMPILER} dummy.o -dryrun @@ -20,11 +20,11 @@ if(NOT CMAKE_Fortran_COMPILER_WORKS AND NOT CMAKE_Fortran_COMPILER_FORCED) " directory: ${_nag_dir}\n" " regex: ${CMAKE_Fortran_IMPLICIT_OBJECT_REGEX}\n" "from output:\n${_dryrun}\n\n") - message(STATUS "Detecting NAG Fortran directory - ${_nag_dir}") + message(CHECK_PASS "${_nag_dir}") else() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Detecting NAG Fortran directory with -dryrun failed:\n${_dryrun}\n\n") - message(STATUS "Detecting NAG Fortran directory - failed") + message(CHECK_FAIL "failed") endif() endif() diff --git a/Modules/FindDCMTK.cmake b/Modules/FindDCMTK.cmake index d48de089669..b2e00dffd25 100644 --- a/Modules/FindDCMTK.cmake +++ b/Modules/FindDCMTK.cmake @@ -102,7 +102,7 @@ set(_SAVED_DCMTK_DIR ${DCMTK_DIR}) # Step1: Attempt to find a version of DCMTK providing a DCMTKConfig.cmake file. # if(NOT DCMTK_FIND_QUIETLY) - message(STATUS "Trying to find DCMTK expecting DCMTKConfig.cmake") + message(CHECK_START "Trying to find DCMTK expecting DCMTKConfig.cmake") endif() find_package(DCMTK QUIET NO_MODULE) if(DCMTK_FOUND @@ -110,12 +110,12 @@ if(DCMTK_FOUND AND NOT "x" STREQUAL "x${DCMTK_INCLUDE_DIRS}") if(NOT DCMTK_FIND_QUIETLY) - message(STATUS "Trying to find DCMTK expecting DCMTKConfig.cmake - ok") + message(CHECK_PASS "ok") endif() return() else() if(NOT DCMTK_FIND_QUIETLY) - message(STATUS "Trying to find DCMTK expecting DCMTKConfig.cmake - failed") + message(CHECK_FAIL "failed") endif() endif() diff --git a/Modules/FindMFC.cmake b/Modules/FindMFC.cmake index e366619ce09..b8ca71bb860 100644 --- a/Modules/FindMFC.cmake +++ b/Modules/FindMFC.cmake @@ -31,7 +31,7 @@ if(MFC_ATTEMPT_TRY_COMPILE) set(CHECK_INCLUDE_FILE_VAR "afxwin.h") configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx) - message(STATUS "Looking for MFC") + message(CHECK_START "Looking for MFC") # Try both shared and static as the root project may have set the /MT flag try_compile(MFC_HAVE_MFC ${CMAKE_BINARY_DIR} @@ -51,13 +51,13 @@ if(MFC_ATTEMPT_TRY_COMPILE) OUTPUT_VARIABLE OUTPUT) endif() if(MFC_HAVE_MFC) - message(STATUS "Looking for MFC - found") + message(CHECK_PASS "found") set(MFC_HAVE_MFC 1 CACHE INTERNAL "Have MFC?") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if MFC exists passed with the following output:\n" "${OUTPUT}\n\n") else() - message(STATUS "Looking for MFC - not found") + message(CHECK_FAIL "not found") set(MFC_HAVE_MFC 0 CACHE INTERNAL "Have MFC?") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if MFC exists failed with the following output:\n" diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake index d39fe33d57a..1780511819c 100644 --- a/Modules/FindThreads.cmake +++ b/Modules/FindThreads.cmake @@ -90,7 +90,7 @@ macro(_check_pthreads_flag) if(NOT Threads_FOUND) # If we did not find a thread library look for -pthread compiler option. if(NOT DEFINED THREADS_HAVE_PTHREAD_ARG) - message(STATUS "Check if compiler accepts -pthread") + message(CHECK_START "Check if compiler accepts -pthread") if(CMAKE_C_COMPILER_LOADED) set(_threads_src ${CMAKE_CURRENT_LIST_DIR}/CheckForPthreads.c) elseif(CMAKE_CXX_COMPILER_LOADED) @@ -106,9 +106,9 @@ macro(_check_pthreads_flag) if(THREADS_HAVE_PTHREAD_ARG) set(Threads_FOUND TRUE) - message(STATUS "Check if compiler accepts -pthread - yes") + message(CHECK_PASS "yes") else() - message(STATUS "Check if compiler accepts -pthread - no") + message(CHECK_FAIL "no") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if compiler accepts -pthread failed with the following output:\n${OUTPUT}\n\n") diff --git a/Modules/FortranCInterface.cmake b/Modules/FortranCInterface.cmake index 893a96fb542..547346ba907 100644 --- a/Modules/FortranCInterface.cmake +++ b/Modules/FortranCInterface.cmake @@ -341,7 +341,7 @@ function(FortranCInterface_VERIFY) # Build the verification project if not yet built. if(NOT DEFINED FortranCInterface_VERIFIED_${lang}) set(_desc "Verifying Fortran/${lang} Compiler Compatibility") - message(STATUS "${_desc}") + message(CHECK_START "${_desc}") # Build a sample project which reports symbols. set(CMAKE_TRY_COMPILE_CONFIGURATION Release) @@ -363,12 +363,12 @@ function(FortranCInterface_VERIFY) # Report results. if(FortranCInterface_VERIFY_${lang}_COMPILED) - message(STATUS "${_desc} - Success") + message(CHECK_PASS "Success") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "${_desc} passed with the following output:\n${_output}\n\n") set(FortranCInterface_VERIFIED_${lang} 1 CACHE INTERNAL "Fortran/${lang} compatibility") else() - message(STATUS "${_desc} - Failed") + message(CHECK_FAIL "Failed") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "${_desc} failed with the following output:\n${_output}\n\n") set(FortranCInterface_VERIFIED_${lang} 0 CACHE INTERNAL "Fortran/${lang} compatibility") diff --git a/Modules/FortranCInterface/Detect.cmake b/Modules/FortranCInterface/Detect.cmake index 7789785334b..33de6c614be 100644 --- a/Modules/FortranCInterface/Detect.cmake +++ b/Modules/FortranCInterface/Detect.cmake @@ -15,7 +15,7 @@ if(${FortranCInterface_BINARY_DIR}/Input.cmake OR ${CMAKE_CURRENT_LIST_FILE} IS_NEWER_THAN ${FortranCInterface_BINARY_DIR}/Output.cmake ) - message(STATUS "Detecting Fortran/C Interface") + message(CHECK_START "Detecting Fortran/C Interface") else() return() endif() @@ -172,7 +172,9 @@ if(FortranCInterface_GLOBAL_FOUND) else() set(_result "Found GLOBAL but not MODULE mangling") endif() + set(_result_type CHECK_PASS) elseif(NOT _result) set(_result "Failed to recognize symbols") + set(_result_type CHECK_FAIL) endif() -message(STATUS "Detecting Fortran/C Interface - ${_result}") +message(${_result_type} "${_result}") diff --git a/Modules/Platform/Apple-GNU.cmake b/Modules/Platform/Apple-GNU.cmake index 0eb81683100..95727369d46 100644 --- a/Modules/Platform/Apple-GNU.cmake +++ b/Modules/Platform/Apple-GNU.cmake @@ -19,17 +19,17 @@ endmacro() macro(cmake_gnu_set_sysroot_flag lang) if(NOT DEFINED CMAKE_${lang}_SYSROOT_FLAG) set(_doc "${lang} compiler has -isysroot") - message(STATUS "Checking whether ${_doc}") + message(CHECK_START "Checking whether ${_doc}") execute_process( COMMAND ${CMAKE_${lang}_COMPILER} "-v" "--help" OUTPUT_VARIABLE _gcc_help ERROR_VARIABLE _gcc_help ) if("${_gcc_help}" MATCHES "isysroot") - message(STATUS "Checking whether ${_doc} - yes") + message(CHECK_PASS "yes") set(CMAKE_${lang}_SYSROOT_FLAG "-isysroot") else() - message(STATUS "Checking whether ${_doc} - no") + message(CHECK_FAIL "no") set(CMAKE_${lang}_SYSROOT_FLAG "") endif() set(CMAKE_${lang}_SYSROOT_FLAG_CODE "set(CMAKE_${lang}_SYSROOT_FLAG \"${CMAKE_${lang}_SYSROOT_FLAG}\")") @@ -39,17 +39,17 @@ endmacro() macro(cmake_gnu_set_osx_deployment_target_flag lang) if(NOT DEFINED CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG) set(_doc "${lang} compiler supports OSX deployment target flag") - message(STATUS "Checking whether ${_doc}") + message(CHECK_START "Checking whether ${_doc}") execute_process( COMMAND ${CMAKE_${lang}_COMPILER} "-v" "--help" OUTPUT_VARIABLE _gcc_help ERROR_VARIABLE _gcc_help ) if("${_gcc_help}" MATCHES "macosx-version-min") - message(STATUS "Checking whether ${_doc} - yes") + message(CHECK_PASS "yes") set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "-mmacosx-version-min=") else() - message(STATUS "Checking whether ${_doc} - no") + message(CHECK_FAIL "no") set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "") endif() set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG_CODE "set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG \"${CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG}\")") diff --git a/Modules/TestBigEndian.cmake b/Modules/TestBigEndian.cmake index 0c6e188c0f7..8a769b7e2c8 100644 --- a/Modules/TestBigEndian.cmake +++ b/Modules/TestBigEndian.cmake @@ -19,8 +19,8 @@ include(CheckTypeSize) macro(TEST_BIG_ENDIAN VARIABLE) if(NOT DEFINED HAVE_${VARIABLE}) - message(STATUS "Check if the system is big endian") - message(STATUS "Searching 16 bit integer") + message(CHECK_START "Check if the system is big endian") + message(CHECK_START "Searching 16 bit integer") if(CMAKE_C_COMPILER_LOADED) set(_test_language "C") @@ -32,19 +32,19 @@ macro(TEST_BIG_ENDIAN VARIABLE) CHECK_TYPE_SIZE("unsigned short" CMAKE_SIZEOF_UNSIGNED_SHORT LANGUAGE ${_test_language}) if(CMAKE_SIZEOF_UNSIGNED_SHORT EQUAL 2) - message(STATUS "Using unsigned short") + message(CHECK_PASS "Using unsigned short") set(CMAKE_16BIT_TYPE "unsigned short") else() CHECK_TYPE_SIZE("unsigned int" CMAKE_SIZEOF_UNSIGNED_INT LANGUAGE ${_test_language}) if(CMAKE_SIZEOF_UNSIGNED_INT) - message(STATUS "Using unsigned int") + message(CHECK_PASS "Using unsigned int") set(CMAKE_16BIT_TYPE "unsigned int") else() CHECK_TYPE_SIZE("unsigned long" CMAKE_SIZEOF_UNSIGNED_LONG LANGUAGE ${_test_language}) if(CMAKE_SIZEOF_UNSIGNED_LONG) - message(STATUS "Using unsigned long") + message(CHECK_PASS "Using unsigned long") set(CMAKE_16BIT_TYPE "unsigned long") else() message(FATAL_ERROR "no suitable type found") @@ -95,15 +95,16 @@ macro(TEST_BIG_ENDIAN VARIABLE) if(CMAKE_TEST_ENDIANESS_STRINGS_LE) set(${VARIABLE} 0 CACHE INTERNAL "Result of TEST_BIG_ENDIAN" FORCE) - message(STATUS "Check if the system is big endian - little endian") + message(CHECK_PASS "little endian") endif() if(CMAKE_TEST_ENDIANESS_STRINGS_BE) set(${VARIABLE} 1 CACHE INTERNAL "Result of TEST_BIG_ENDIAN" FORCE) - message(STATUS "Check if the system is big endian - big endian") + message(CHECK_PASS "big endian") endif() if(NOT CMAKE_TEST_ENDIANESS_STRINGS_BE AND NOT CMAKE_TEST_ENDIANESS_STRINGS_LE) + message(CHECK_FAIL "TEST_BIG_ENDIAN found no result!") message(SEND_ERROR "TEST_BIG_ENDIAN found no result!") endif() @@ -111,7 +112,7 @@ macro(TEST_BIG_ENDIAN VARIABLE) "Determining if the system is big endian passed with the following output:\n${OUTPUT}\nTestEndianess.c:\n${TEST_ENDIANESS_FILE_CONTENT}\n\n") else() - message(STATUS "Check if the system is big endian - failed") + message(CHECK_FAIL "failed") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the system is big endian failed with the following output:\n${OUTPUT}\nTestEndianess.c:\n${TEST_ENDIANESS_FILE_CONTENT}\n\n") set(${VARIABLE}) diff --git a/Modules/TestCXXAcceptsFlag.cmake b/Modules/TestCXXAcceptsFlag.cmake index 92a362e2ffa..ce505f3ce18 100644 --- a/Modules/TestCXXAcceptsFlag.cmake +++ b/Modules/TestCXXAcceptsFlag.cmake @@ -23,19 +23,19 @@ Check if the CXX compiler accepts a flag. macro(CHECK_CXX_ACCEPTS_FLAG FLAGS VARIABLE) if(NOT DEFINED ${VARIABLE}) - message(STATUS "Checking to see if CXX compiler accepts flag ${FLAGS}") + message(CHECK_START "Checking to see if CXX compiler accepts flag ${FLAGS}") try_compile(${VARIABLE} ${CMAKE_BINARY_DIR} ${CMAKE_ROOT}/Modules/DummyCXXFile.cxx CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${FLAGS} OUTPUT_VARIABLE OUTPUT) if(${VARIABLE}) - message(STATUS "Checking to see if CXX compiler accepts flag ${FLAGS} - yes") + message(CHECK_PASS "yes") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the CXX compiler accepts the flag ${FLAGS} passed with " "the following output:\n${OUTPUT}\n\n") else() - message(STATUS "Checking to see if CXX compiler accepts flag ${FLAGS} - no") + message(CHECK_FAIL "no") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the CXX compiler accepts the flag ${FLAGS} failed with " "the following output:\n${OUTPUT}\n\n") diff --git a/Modules/TestForANSIForScope.cmake b/Modules/TestForANSIForScope.cmake index 272e4ec8b0e..0f2dc013db4 100644 --- a/Modules/TestForANSIForScope.cmake +++ b/Modules/TestForANSIForScope.cmake @@ -16,19 +16,19 @@ for-init-statement to the loop body. #]=======================================================================] if(NOT DEFINED CMAKE_ANSI_FOR_SCOPE) - message(STATUS "Check for ANSI scope") + message(CHECK_START "Check for ANSI scope") try_compile(CMAKE_ANSI_FOR_SCOPE ${CMAKE_BINARY_DIR} ${CMAKE_ROOT}/Modules/TestForAnsiForScope.cxx OUTPUT_VARIABLE OUTPUT) if (CMAKE_ANSI_FOR_SCOPE) - message(STATUS "Check for ANSI scope - found") + message(CHECK_PASS "found") set (CMAKE_NO_ANSI_FOR_SCOPE 0 CACHE INTERNAL "Does the compiler support ansi for scope.") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the CXX compiler understands ansi for scopes passed with " "the following output:\n${OUTPUT}\n\n") else () - message(STATUS "Check for ANSI scope - not found") + message(CHECK_FAIL "not found") set (CMAKE_NO_ANSI_FOR_SCOPE 1 CACHE INTERNAL "Does the compiler support ansi for scope.") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log diff --git a/Modules/TestForSSTREAM.cmake b/Modules/TestForSSTREAM.cmake index e70df00ab47..545b7ec29f2 100644 --- a/Modules/TestForSSTREAM.cmake +++ b/Modules/TestForSSTREAM.cmake @@ -15,19 +15,19 @@ check if the compiler supports the standard ANSI sstream header #]=======================================================================] if(NOT DEFINED CMAKE_HAS_ANSI_STRING_STREAM) - message(STATUS "Check for sstream") + message(CHECK_START "Check for sstream") try_compile(CMAKE_HAS_ANSI_STRING_STREAM ${CMAKE_BINARY_DIR} ${CMAKE_ROOT}/Modules/TestForSSTREAM.cxx OUTPUT_VARIABLE OUTPUT) if (CMAKE_HAS_ANSI_STRING_STREAM) - message(STATUS "Check for sstream - found") + message(CHECK_PASS "found") set (CMAKE_NO_ANSI_STRING_STREAM 0 CACHE INTERNAL "Does the compiler support sstream") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the CXX compiler has sstream passed with " "the following output:\n${OUTPUT}\n\n") else () - message(STATUS "Check for sstream - not found") + message(CHECK_FAIL "not found") set (CMAKE_NO_ANSI_STRING_STREAM 1 CACHE INTERNAL "Does the compiler support sstream") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log diff --git a/Modules/TestForSTDNamespace.cmake b/Modules/TestForSTDNamespace.cmake index 703e631ebbb..d101c833ea0 100644 --- a/Modules/TestForSTDNamespace.cmake +++ b/Modules/TestForSTDNamespace.cmake @@ -15,19 +15,19 @@ check if the compiler supports std:: on stl classes #]=======================================================================] if(NOT DEFINED CMAKE_STD_NAMESPACE) - message(STATUS "Check for STD namespace") + message(CHECK_START "Check for STD namespace") try_compile(CMAKE_STD_NAMESPACE ${CMAKE_BINARY_DIR} ${CMAKE_ROOT}/Modules/TestForSTDNamespace.cxx OUTPUT_VARIABLE OUTPUT) if (CMAKE_STD_NAMESPACE) - message(STATUS "Check for STD namespace - found") + message(CHECK_PASS "found") set (CMAKE_NO_STD_NAMESPACE 0 CACHE INTERNAL "Does the compiler support std::.") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the CXX compiler has std namespace passed with " "the following output:\n${OUTPUT}\n\n") else () - message(STATUS "Check for STD namespace - not found") + message(CHECK_FAIL "not found") set (CMAKE_NO_STD_NAMESPACE 1 CACHE INTERNAL "Does the compiler support std::.") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log diff --git a/Source/Checks/Curses.cmake b/Source/Checks/Curses.cmake index 2942b666aeb..d35dd2a6e1e 100644 --- a/Source/Checks/Curses.cmake +++ b/Source/Checks/Curses.cmake @@ -1,4 +1,7 @@ -message(STATUS "Checking for curses support") +include(${CMAKE_CURRENT_LIST_DIR}/cm_message_checks_compat.cmake) +cm_message_checks_compat( + "Checking for curses support" __checkStart __checkPass __checkFail) +message(${__checkStart}) # Try compiling a simple project using curses. # Pass in any cache entries that the user may have set. @@ -31,11 +34,11 @@ set(CMakeCheckCurses_COMPILED "${CMakeCheckCurses_COMPILED}") unset(CMakeCheckCurses_COMPILED CACHE) if(CMakeCheckCurses_COMPILED) - message(STATUS "Checking for curses support - Success") + message(${__checkPass} "Success") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Checking for curses support passed with the following output:\n${CMakeCheckCurses_OUTPUT}\n\n") else() - message(STATUS "Checking for curses support - Failed") + message(${__checkFail} "Failed") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Checking for curses support failed with the following output:\n${CMakeCheckCurses_OUTPUT}\n\n") endif() diff --git a/Source/Checks/cm_c11_thread_local.cmake b/Source/Checks/cm_c11_thread_local.cmake index 6b8d10b2bdd..2263be3badd 100644 --- a/Source/Checks/cm_c11_thread_local.cmake +++ b/Source/Checks/cm_c11_thread_local.cmake @@ -1,7 +1,11 @@ set(CMake_C11_THREAD_LOCAL_BROKEN 0) if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_C11_STANDARD_COMPILE_OPTION) if(NOT DEFINED CMake_C11_THREAD_LOCAL_WORKS) - message(STATUS "Checking if compiler supports C11 _Thread_local") + include(${CMAKE_CURRENT_LIST_DIR}/cm_message_checks_compat.cmake) + cm_message_checks_compat( + "Checking if compiler supports C11 _Thread_local" + __checkStart __checkPass __checkFail) + message(${__checkStart}) try_compile(CMake_C11_THREAD_LOCAL_WORKS ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_LIST_DIR}/cm_c11_thread_local.c @@ -12,14 +16,14 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_C11_STANDARD_COMPILE_OPTION) set_property(CACHE CMake_C11_THREAD_LOCAL_WORKS PROPERTY VALUE 0) endif() if(CMake_C11_THREAD_LOCAL_WORKS) - message(STATUS "Checking if compiler supports C11 _Thread_local - yes") + message(${__checkPass} "yes") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if compiler supports C11 _Thread_local passed with the following output:\n" "${OUTPUT}\n" "\n" ) else() - message(STATUS "Checking if compiler supports C11 _Thread_local - no") + message(${__checkFail} "no") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if compiler supports C11 _Thread_local failed with the following output:\n" "${OUTPUT}\n" diff --git a/Source/Checks/cm_cxx14_check.cmake b/Source/Checks/cm_cxx14_check.cmake index 38606b9c90f..8e9c2c70a64 100644 --- a/Source/Checks/cm_cxx14_check.cmake +++ b/Source/Checks/cm_cxx14_check.cmake @@ -4,7 +4,11 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|PGI") set(CMake_CXX14_WORKS 0) endif() if(NOT DEFINED CMake_CXX14_WORKS) - message(STATUS "Checking if compiler supports needed C++14 constructs") + include(${CMAKE_CURRENT_LIST_DIR}/cm_message_checks_compat.cmake) + cm_message_checks_compat( + "Checking if compiler supports needed C++14 constructs" + __checkStart __checkPass __checkFail) + message(${__checkStart}) try_compile(CMake_CXX14_WORKS ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_LIST_DIR}/cm_cxx14_check.cpp @@ -15,14 +19,14 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|PGI") set_property(CACHE CMake_CXX14_WORKS PROPERTY VALUE 0) endif() if(CMake_CXX14_WORKS) - message(STATUS "Checking if compiler supports needed C++14 constructs - yes") + message(${__checkPass} "yes") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if compiler supports needed C++14 constructs passed with the following output:\n" "${OUTPUT}\n" "\n" ) else() - message(STATUS "Checking if compiler supports needed C++14 constructs - no") + message(${__checkFail} "no") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if compiler supports needed C++14 constructs failed with the following output:\n" "${OUTPUT}\n" diff --git a/Source/Checks/cm_cxx17_check.cmake b/Source/Checks/cm_cxx17_check.cmake index 4da2fd7cacd..9e1d9c3eaef 100644 --- a/Source/Checks/cm_cxx17_check.cmake +++ b/Source/Checks/cm_cxx17_check.cmake @@ -4,7 +4,11 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|PGI") set(CMake_CXX17_WORKS 0) endif() if(NOT DEFINED CMake_CXX17_WORKS) - message(STATUS "Checking if compiler supports needed C++17 constructs") + include(${CMAKE_CURRENT_LIST_DIR}/cm_message_checks_compat.cmake) + cm_message_checks_compat( + "Checking if compiler supports needed C++17 constructs" + __checkStart __checkPass __checkFail) + message(${__checkStart}) try_compile(CMake_CXX17_WORKS ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_LIST_DIR}/cm_cxx17_check.cpp @@ -15,14 +19,14 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|PGI") set_property(CACHE CMake_CXX17_WORKS PROPERTY VALUE 0) endif() if(CMake_CXX17_WORKS) - message(STATUS "Checking if compiler supports needed C++17 constructs - yes") + message(${__checkPass} "yes") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if compiler supports needed C++17 constructs passed with the following output:\n" "${OUTPUT}\n" "\n" ) else() - message(STATUS "Checking if compiler supports needed C++17 constructs - no") + message(${__checkFail} "no") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if compiler supports needed C++17 constructs failed with the following output:\n" "${OUTPUT}\n" diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake index fb68ed78c9a..de8a77af555 100644 --- a/Source/Checks/cm_cxx_features.cmake +++ b/Source/Checks/cm_cxx_features.cmake @@ -1,8 +1,12 @@ +include(${CMAKE_CURRENT_LIST_DIR}/cm_message_checks_compat.cmake) function(cm_check_cxx_feature name) string(TOUPPER ${name} FEATURE) if(NOT DEFINED CMake_HAVE_CXX_${FEATURE}) - message(STATUS "Checking if compiler supports C++ ${name}") + cm_message_checks_compat( + "Checking if compiler supports C++ ${name}" + __checkStart __checkPass __checkFail) + message(${__checkStart}) if(CMAKE_CXX_STANDARD) set(maybe_cxx_standard -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}) else() @@ -31,14 +35,14 @@ function(cm_check_cxx_feature name) set(CMake_HAVE_CXX_${FEATURE} OFF CACHE INTERNAL "TRY_COMPILE" FORCE) endif() if(CMake_HAVE_CXX_${FEATURE}) - message(STATUS "Checking if compiler supports C++ ${name} - yes") + message(${__checkPass} "yes") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if compiler supports C++ ${name} passed with the following output:\n" "${OUTPUT}\n" "\n" ) else() - message(STATUS "Checking if compiler supports C++ ${name} - no") + message(${__checkFail} "no") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if compiler supports C++ ${name} failed with the following output:\n" "${OUTPUT}\n" diff --git a/Source/Checks/cm_message_checks_compat.cmake b/Source/Checks/cm_message_checks_compat.cmake new file mode 100644 index 00000000000..024c397a8b3 --- /dev/null +++ b/Source/Checks/cm_message_checks_compat.cmake @@ -0,0 +1,13 @@ +# Supporting using the CHECK_... message modes if available +# and fall back to the older behavior if not +macro(cm_message_checks_compat description startVar passVar failVar) + if(CMAKE_VERSION VERSION_GREATER 3.16.2019) + set(${startVar} CHECK_START "${description}") + set(${passVar} CHECK_PASS) + set(${failVar} CHECK_FAIL) + else() + set(${startVar} STATUS "${description}") + set(${passVar} STATUS "${description} - ") + set(${failVar} STATUS "${description} - ") + endif() +endmacro() From 0fb4e0ad15540e782b4baa7117e8db30c8afe640 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Sun, 3 Nov 2019 00:01:06 -0400 Subject: [PATCH 077/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 17a23950bba..3c4a4642de2 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191102) +set(CMake_VERSION_PATCH 20191103) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From e3afdef8c567880d7c83ca5980e4c5f5d289880c Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Mon, 4 Nov 2019 00:01:09 -0500 Subject: [PATCH 078/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 3c4a4642de2..ad42756770f 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191103) +set(CMake_VERSION_PATCH 20191104) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From 30e79bb4a388b59c5851b949a0dd559bc57e8ad3 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 4 Nov 2019 11:21:38 -0500 Subject: [PATCH 079/662] Tests: Extend RunCMake.CTestCommandLine internal timeout for valgrind A case added by commit 39ac8b4eb5 (ctest: Add --repeat-after-timeout option, 2019-10-29) includes a success-case timeout of 2 seconds. That is too short when running under valgrind, so extend it to 5 seconds. --- .../RunCMake/CTestCommandLine/repeat-after-timeout-cmake.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-cmake.cmake b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-cmake.cmake index 4dc9c3648f0..873c0bd6fbb 100644 --- a/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-cmake.cmake +++ b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-cmake.cmake @@ -9,7 +9,7 @@ add_test(NAME test1 COMMAND ${CMAKE_COMMAND} "-DTEST_OUTPUT_FILE=${TEST_OUTPUT_FILE}" -P "${CMAKE_CURRENT_SOURCE_DIR}/test1-timeout.cmake") -set_tests_properties(test1 PROPERTIES DEPENDS "initialization" TIMEOUT 2) +set_tests_properties(test1 PROPERTIES DEPENDS "initialization" TIMEOUT 5) add_test(hello ${CMAKE_COMMAND} -E echo hello) add_test(goodbye ${CMAKE_COMMAND} -E echo goodbye) From 3c85f11fedf55c5072cd00deb129a0782130d78c Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Fri, 1 Nov 2019 17:37:59 -0400 Subject: [PATCH 080/662] INSTALL_NAME_DIR: Add support for generator expressions --- Source/cmExportInstallFileGenerator.cxx | 5 +++-- Source/cmGeneratorTarget.cxx | 15 ++++++++++++--- Source/cmGeneratorTarget.h | 3 ++- Source/cmInstallTargetGenerator.cxx | 6 ++++-- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index 090e30f5e6a..987ec9ea7b8 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -517,13 +517,14 @@ void cmExportInstallFileGenerator::ComplainAboutMissingTarget( } std::string cmExportInstallFileGenerator::InstallNameDir( - cmGeneratorTarget* target, const std::string& /*config*/) + cmGeneratorTarget* target, const std::string& config) { std::string install_name_dir; cmMakefile* mf = target->Target->GetMakefile(); if (mf->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME")) { - install_name_dir = target->GetInstallNameDirForInstallTree(); + install_name_dir = + target->GetInstallNameDirForInstallTree(config, "${_IMPORT_PREFIX}"); } return install_name_dir; diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index d5e58b0062d..d750d964319 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -2125,7 +2125,9 @@ std::string cmGeneratorTarget::GetInstallNameDirForBuildTree( // If building directly for installation then the build tree install_name // is the same as the install tree. if (this->MacOSXUseInstallNameDir()) { - return this->GetInstallNameDirForInstallTree(); + std::string installPrefix = + this->Makefile->GetSafeDefinition("CMAKE_INSTALL_PREFIX"); + return this->GetInstallNameDirForInstallTree(config, installPrefix); } // Use the build tree directory for the target. @@ -2143,7 +2145,8 @@ std::string cmGeneratorTarget::GetInstallNameDirForBuildTree( return ""; } -std::string cmGeneratorTarget::GetInstallNameDirForInstallTree() const +std::string cmGeneratorTarget::GetInstallNameDirForInstallTree( + const std::string& config, const std::string& installPrefix) const { if (this->Makefile->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME")) { std::string dir; @@ -2151,7 +2154,13 @@ std::string cmGeneratorTarget::GetInstallNameDirForInstallTree() const if (this->CanGenerateInstallNameDir(INSTALL_NAME_FOR_INSTALL)) { if (install_name_dir && *install_name_dir) { - dir = cmStrCat(install_name_dir, '/'); + dir = install_name_dir; + cmGeneratorExpression::ReplaceInstallPrefix(dir, installPrefix); + dir = + cmGeneratorExpression::Evaluate(dir, this->LocalGenerator, config); + if (!dir.empty()) { + dir = cmStrCat(dir, '/'); + } } } if (!install_name_dir) { diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 46235131404..62b88c5259a 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -276,7 +276,8 @@ class cmGeneratorTarget /** Return the install name directory for the target in the * install tree. For example: "\@rpath/" or "\@loader_path/". */ - std::string GetInstallNameDirForInstallTree() const; + std::string GetInstallNameDirForInstallTree( + const std::string& config, const std::string& installPrefix) const; cmListFileBacktrace GetBacktrace() const; diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index 0cd04cc1d98..90cccaba413 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -554,7 +554,8 @@ void cmInstallTargetGenerator::AddInstallNamePatchRule( // components of the install_name field then we need to create a // mapping to be applied after installation. std::string for_build = tgt->GetInstallNameDirForBuildTree(config); - std::string for_install = tgt->GetInstallNameDirForInstallTree(); + std::string for_install = tgt->GetInstallNameDirForInstallTree( + config, "${CMAKE_INSTALL_PREFIX}"); if (for_build != for_install) { // The directory portions differ. Append the filename to // create the mapping. @@ -577,7 +578,8 @@ void cmInstallTargetGenerator::AddInstallNamePatchRule( if (this->Target->GetType() == cmStateEnums::SHARED_LIBRARY) { std::string for_build = this->Target->GetInstallNameDirForBuildTree(config); - std::string for_install = this->Target->GetInstallNameDirForInstallTree(); + std::string for_install = this->Target->GetInstallNameDirForInstallTree( + config, "${CMAKE_INSTALL_PREFIX}"); if (this->Target->IsFrameworkOnApple() && for_install.empty()) { // Frameworks seem to have an id corresponding to their own full From 82ddcf0db1d220564145122c3cce25d25ee0e254 Mon Sep 17 00:00:00 2001 From: Johnny Jazeix Date: Sat, 2 Nov 2019 11:25:01 +0100 Subject: [PATCH 081/662] MinGW Makefiles: do not fail if sh.exe is present in the path The check was added only to fail early in an environment known not to work at the time: * https://web.archive.org/web/20120912010035/http://lists.trolltech.com/qt-interest/2006-01/thread00091-0.html Fixes: #19327 --- Help/release/dev/mingw_no_sh.rst | 5 +++++ Modules/CMakeMinGWFindMake.cmake | 7 +------ 2 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 Help/release/dev/mingw_no_sh.rst diff --git a/Help/release/dev/mingw_no_sh.rst b/Help/release/dev/mingw_no_sh.rst new file mode 100644 index 00000000000..700886585b2 --- /dev/null +++ b/Help/release/dev/mingw_no_sh.rst @@ -0,0 +1,5 @@ +mingw-no-sh +----------- + +* The :generator:`MinGW Makefiles` generator no longer issues an error if + ``sh.exe`` is present in the environment's ``PATH``. diff --git a/Modules/CMakeMinGWFindMake.cmake b/Modules/CMakeMinGWFindMake.cmake index 523f00c3a32..f026e9aa7c8 100644 --- a/Modules/CMakeMinGWFindMake.cmake +++ b/Modules/CMakeMinGWFindMake.cmake @@ -7,10 +7,5 @@ find_program(CMAKE_MAKE_PROGRAM mingw32-make.exe PATHS c:/MinGW/bin /MinGW/bin "[HKEY_CURRENT_USER\\Software\\CodeBlocks;Path]/MinGW/bin" ) -find_program(CMAKE_SH sh.exe ) -if(CMAKE_SH) - message(FATAL_ERROR "sh.exe was found in your PATH, here:\n${CMAKE_SH}\nFor MinGW make to work correctly sh.exe must NOT be in your path.\nRun cmake from a shell that does not have sh.exe in your PATH.\nIf you want to use a UNIX shell, then use MSYS Makefiles.\n") - set(CMAKE_MAKE_PROGRAM NOTFOUND) -endif() -mark_as_advanced(CMAKE_MAKE_PROGRAM CMAKE_SH) +mark_as_advanced(CMAKE_MAKE_PROGRAM) From 93b66735ac2092675eec7a636625df84ff306fdc Mon Sep 17 00:00:00 2001 From: Sylvain Joubert Date: Sun, 27 Oct 2019 18:25:41 +0100 Subject: [PATCH 082/662] ccmake: Use type-based colors to display cache values The colors are based on the entry type (or value for booleans), paths and filepaths sharing the same color. --- Help/release/dev/ccmake-colored-values.rst | 5 ++++ Source/CursesDialog/CMakeLists.txt | 21 ++++++++++++++ Source/CursesDialog/ccmake.cxx | 2 ++ Source/CursesDialog/cmCursesBoolWidget.cxx | 15 ++++++++-- Source/CursesDialog/cmCursesColor.cxx | 29 +++++++++++++++++++ Source/CursesDialog/cmCursesColor.h | 24 +++++++++++++++ Source/CursesDialog/cmCursesOptionsWidget.cxx | 10 +++++-- Source/CursesDialog/cmCursesPathWidget.cxx | 8 +++++ Source/CursesDialog/cmCursesStringWidget.cxx | 10 +++++-- 9 files changed, 118 insertions(+), 6 deletions(-) create mode 100644 Help/release/dev/ccmake-colored-values.rst create mode 100644 Source/CursesDialog/cmCursesColor.cxx create mode 100644 Source/CursesDialog/cmCursesColor.h diff --git a/Help/release/dev/ccmake-colored-values.rst b/Help/release/dev/ccmake-colored-values.rst new file mode 100644 index 00000000000..b00885dfc0b --- /dev/null +++ b/Help/release/dev/ccmake-colored-values.rst @@ -0,0 +1,5 @@ +ccmake-colored-values +--------------------- + +* :manual:`ccmake(1)` now displays cache values using colors + based on the entry type if the terminal supports color. diff --git a/Source/CursesDialog/CMakeLists.txt b/Source/CursesDialog/CMakeLists.txt index a9e46fd58f4..c24ee762162 100644 --- a/Source/CursesDialog/CMakeLists.txt +++ b/Source/CursesDialog/CMakeLists.txt @@ -5,6 +5,7 @@ add_executable(ccmake ccmake.cxx cmCursesBoolWidget.cxx cmCursesCacheEntryComposite.cxx + cmCursesColor.cxx cmCursesDummyWidget.cxx cmCursesFilePathWidget.cxx cmCursesForm.cxx @@ -17,21 +18,41 @@ add_executable(ccmake cmCursesWidget.cxx ) target_include_directories(ccmake PRIVATE ${CURSES_INCLUDE_PATH}) +set(CMAKE_REQUIRED_INCLUDES ${CURSES_INCLUDE_PATH}) target_link_libraries(ccmake CMakeLib) if(CMAKE_USE_SYSTEM_FORM) find_path(CURSES_FORM_INCLUDE_DIR NAMES form.h HINTS ${CURSES_INCLUDE_PATH} ${CURSES_INCLUDE_PATH}/ncurses) if(CURSES_FORM_INCLUDE_DIR) target_include_directories(ccmake PRIVATE ${CURSES_FORM_INCLUDE_DIR}) + list(APPEND CMAKE_REQUIRED_INCLUDES ${CURSES_FORM_INCLUDE_DIR}) endif() target_link_libraries(ccmake ${CURSES_FORM_LIBRARY} ${CURSES_LIBRARY} ) + set(CMAKE_REQUIRED_LIBRARIES + ${CURSES_FORM_LIBRARY} + ${CURSES_LIBRARY} + ) if(CURSES_EXTRA_LIBRARY) target_link_libraries(ccmake ${CURSES_EXTRA_LIBRARY}) + list(APPEND CMAKE_REQUIRED_LIBRARIES ${CURSES_EXTRA_LIBRARY}) endif() else() target_link_libraries(ccmake cmForm) + get_target_property(cmFormIncludeDirs cmForm INTERFACE_INCLUDE_DIRECTORIES) + list(APPEND CMAKE_REQUIRED_INCLUDES ${cmFormIncludeDirs}) + get_target_property(cmFormLibraries cmForm INTERFACE_LINK_LIBRARIES) + set(CMAKE_REQUIRED_LIBRARIES ${cmFormLibraries}) +endif() + +include(CheckSymbolExists) +check_symbol_exists(use_default_colors + "form.h" + HAVE_CURSES_USE_DEFAULT_COLORS) +if(HAVE_CURSES_USE_DEFAULT_COLORS) + set_source_files_properties(cmCursesColor.cxx + PROPERTIES COMPILE_DEFINITIONS HAVE_CURSES_USE_DEFAULT_COLORS) endif() if(CMake_JOB_POOL_LINK_BIN) diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx index 9e9dfbd1955..77321050852 100644 --- a/Source/CursesDialog/ccmake.cxx +++ b/Source/CursesDialog/ccmake.cxx @@ -9,6 +9,7 @@ #include "cmsys/Encoding.hxx" +#include "cmCursesColor.h" #include "cmCursesForm.h" #include "cmCursesMainForm.h" #include "cmCursesStandardIncludes.h" @@ -126,6 +127,7 @@ int main(int argc, char const* const* argv) noecho(); /* Echo off */ cbreak(); /* nl- or cr not needed */ keypad(stdscr, true); /* Use key symbols as KEY_DOWN */ + cmCursesColor::InitColors(); signal(SIGWINCH, onsig); diff --git a/Source/CursesDialog/cmCursesBoolWidget.cxx b/Source/CursesDialog/cmCursesBoolWidget.cxx index 97b0811288f..c4dbed8350c 100644 --- a/Source/CursesDialog/cmCursesBoolWidget.cxx +++ b/Source/CursesDialog/cmCursesBoolWidget.cxx @@ -4,6 +4,7 @@ #include +#include "cmCursesColor.h" #include "cmCursesWidget.h" #include "cmStateTypes.h" @@ -12,8 +13,10 @@ cmCursesBoolWidget::cmCursesBoolWidget(int width, int height, int left, : cmCursesWidget(width, height, left, top) { this->Type = cmStateEnums::BOOL; - set_field_fore(this->Field, A_NORMAL); - set_field_back(this->Field, A_STANDOUT); + if (!cmCursesColor::HasColors()) { + set_field_fore(this->Field, A_NORMAL); + set_field_back(this->Field, A_STANDOUT); + } field_opts_off(this->Field, O_STATIC); this->SetValueAsBool(false); } @@ -42,8 +45,16 @@ void cmCursesBoolWidget::SetValueAsBool(bool value) { if (value) { this->SetValue("ON"); + if (cmCursesColor::HasColors()) { + set_field_fore(this->Field, COLOR_PAIR(cmCursesColor::BoolOn)); + set_field_back(this->Field, COLOR_PAIR(cmCursesColor::BoolOn)); + } } else { this->SetValue("OFF"); + if (cmCursesColor::HasColors()) { + set_field_fore(this->Field, COLOR_PAIR(cmCursesColor::BoolOff)); + set_field_back(this->Field, COLOR_PAIR(cmCursesColor::BoolOff)); + } } } diff --git a/Source/CursesDialog/cmCursesColor.cxx b/Source/CursesDialog/cmCursesColor.cxx new file mode 100644 index 00000000000..641d48ccece --- /dev/null +++ b/Source/CursesDialog/cmCursesColor.cxx @@ -0,0 +1,29 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#include "cmCursesColor.h" + +#include "cmCursesStandardIncludes.h" + +bool cmCursesColor::HasColors() +{ +#ifdef HAVE_CURSES_USE_DEFAULT_COLORS + return has_colors(); +#else + return false; +#endif +} + +void cmCursesColor::InitColors() +{ +#ifdef HAVE_CURSES_USE_DEFAULT_COLORS + if (HasColors()) { + start_color(); + use_default_colors(); + init_pair(cmCursesColor::BoolOff, COLOR_RED, -1); + init_pair(cmCursesColor::BoolOn, COLOR_GREEN, -1); + init_pair(cmCursesColor::String, COLOR_BLUE, -1); + init_pair(cmCursesColor::Path, COLOR_YELLOW, -1); + init_pair(cmCursesColor::Options, COLOR_MAGENTA, -1); + } +#endif +} diff --git a/Source/CursesDialog/cmCursesColor.h b/Source/CursesDialog/cmCursesColor.h new file mode 100644 index 00000000000..78ca52cbb15 --- /dev/null +++ b/Source/CursesDialog/cmCursesColor.h @@ -0,0 +1,24 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#ifndef cmCursesColor_h +#define cmCursesColor_h + +class cmCursesColor +{ +public: + enum Color + { + // Default color is pair 0 + BoolOff = 1, + BoolOn, + String, + Path, + Options + }; + + static bool HasColors(); + + static void InitColors(); +}; + +#endif // cmCursesColor_h diff --git a/Source/CursesDialog/cmCursesOptionsWidget.cxx b/Source/CursesDialog/cmCursesOptionsWidget.cxx index eb773ad0fb2..a15241faed3 100644 --- a/Source/CursesDialog/cmCursesOptionsWidget.cxx +++ b/Source/CursesDialog/cmCursesOptionsWidget.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCursesOptionsWidget.h" +#include "cmCursesColor.h" #include "cmCursesWidget.h" #include "cmStateTypes.h" @@ -15,8 +16,13 @@ cmCursesOptionsWidget::cmCursesOptionsWidget(int width, int height, int left, // there is no option type, and string type causes ccmake to cast // the widget into a string widget at some point. BOOL is safe for // now. - set_field_fore(this->Field, A_NORMAL); - set_field_back(this->Field, A_STANDOUT); + if (cmCursesColor::HasColors()) { + set_field_fore(this->Field, COLOR_PAIR(cmCursesColor::Options)); + set_field_back(this->Field, COLOR_PAIR(cmCursesColor::Options)); + } else { + set_field_fore(this->Field, A_NORMAL); + set_field_back(this->Field, A_STANDOUT); + } field_opts_off(this->Field, O_STATIC); } diff --git a/Source/CursesDialog/cmCursesPathWidget.cxx b/Source/CursesDialog/cmCursesPathWidget.cxx index bb3808e89c7..8ed42dee75b 100644 --- a/Source/CursesDialog/cmCursesPathWidget.cxx +++ b/Source/CursesDialog/cmCursesPathWidget.cxx @@ -4,6 +4,7 @@ #include +#include "cmCursesColor.h" #include "cmCursesMainForm.h" #include "cmCursesStringWidget.h" #include "cmStateTypes.h" @@ -16,6 +17,13 @@ cmCursesPathWidget::cmCursesPathWidget(int width, int height, int left, this->Type = cmStateEnums::PATH; this->Cycle = false; this->CurrentIndex = 0; + if (cmCursesColor::HasColors()) { + set_field_fore(this->Field, COLOR_PAIR(cmCursesColor::Path)); + set_field_back(this->Field, COLOR_PAIR(cmCursesColor::Path)); + } else { + set_field_fore(this->Field, A_NORMAL); + set_field_back(this->Field, A_STANDOUT); + } } void cmCursesPathWidget::OnType(int& key, cmCursesMainForm* fm, WINDOW* w) diff --git a/Source/CursesDialog/cmCursesStringWidget.cxx b/Source/CursesDialog/cmCursesStringWidget.cxx index 6296af20baa..c62947836ce 100644 --- a/Source/CursesDialog/cmCursesStringWidget.cxx +++ b/Source/CursesDialog/cmCursesStringWidget.cxx @@ -4,6 +4,7 @@ #include +#include "cmCursesColor.h" #include "cmCursesForm.h" #include "cmCursesMainForm.h" #include "cmCursesStandardIncludes.h" @@ -21,8 +22,13 @@ cmCursesStringWidget::cmCursesStringWidget(int width, int height, int left, { this->InEdit = false; this->Type = cmStateEnums::STRING; - set_field_fore(this->Field, A_NORMAL); - set_field_back(this->Field, A_STANDOUT); + if (cmCursesColor::HasColors()) { + set_field_fore(this->Field, COLOR_PAIR(cmCursesColor::String)); + set_field_back(this->Field, COLOR_PAIR(cmCursesColor::String)); + } else { + set_field_fore(this->Field, A_NORMAL); + set_field_back(this->Field, A_STANDOUT); + } field_opts_off(this->Field, O_STATIC); } From 005aba29a1b5774b778bb65f4751a572d628589f Mon Sep 17 00:00:00 2001 From: Sylvain Joubert Date: Wed, 30 Oct 2019 14:08:42 +0100 Subject: [PATCH 083/662] ccmake: Improve display of the key controls Reduce space usage and add the key to display the output --- Source/CursesDialog/cmCursesLongMessageForm.cxx | 2 +- Source/CursesDialog/cmCursesMainForm.cxx | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Source/CursesDialog/cmCursesLongMessageForm.cxx b/Source/CursesDialog/cmCursesLongMessageForm.cxx index 41fceee3c65..a69fdee8944 100644 --- a/Source/CursesDialog/cmCursesLongMessageForm.cxx +++ b/Source/CursesDialog/cmCursesLongMessageForm.cxx @@ -86,7 +86,7 @@ void cmCursesLongMessageForm::PrintKeys() return; } char firstLine[512]; - sprintf(firstLine, "Press [e] to exit help"); + sprintf(firstLine, "Press [e] to exit screen"); char fmt_s[] = "%s"; curses_move(y - 2, 0); diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 972509f65f4..4385ddc3954 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -322,25 +322,25 @@ void cmCursesMainForm::PrintKeys(int process /* = 0 */) } else { if (this->OkToGenerate) { sprintf(firstLine, - "Press [c] to configure Press [g] to generate and exit"); + " [l] Show log output [c] Configure" + " [g] Generate "); } else { sprintf(firstLine, - "Press [c] to configure "); + " [l] Show log output [c] Configure" + " "); } { const char* toggleKeyInstruction = - "Press [t] to toggle advanced mode (Currently %s)"; + " [t] Toggle advanced mode (currently %s)"; sprintf(thirdLine, toggleKeyInstruction, - this->AdvancedMode ? "On" : "Off"); + this->AdvancedMode ? "on" : "off"); } sprintf(secondLine, - "Press [h] for help " - "Press [q] to quit without generating"); + " [h] Help [q] Quit without generating"); } curses_move(y - 4, 0); - char fmt[512] = - "Press [enter] to edit option Press [d] to delete an entry"; + char fmt[512] = "Keys: [enter] Edit an entry [d] Delete an entry"; if (process) { memset(fmt, ' ', 57); } From d5d5ba3f7fe7dd5a52e6671387128cb9a901ec1e Mon Sep 17 00:00:00 2001 From: Sylvain Joubert Date: Wed, 30 Oct 2019 14:10:33 +0100 Subject: [PATCH 084/662] ccmake: Identify the current cache entry --- Source/CursesDialog/cmCursesMainForm.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 4385ddc3954..ffc95289666 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -447,6 +447,15 @@ void cmCursesMainForm::UpdateStatusBar(const char* message) bar[width] = '\0'; + // Highlight the current label + // Fields are grouped by 3, the first one being the label + // so start at 0 and move up by 3 avoiding the last null entry + using size_type = decltype(this->Fields)::size_type; + for (size_type index = 0; index < this->Fields.size() - 1; index += 3) { + bool currentLabel = index == static_cast(findex - 2); + set_field_fore(this->Fields[index], currentLabel ? A_STANDOUT : A_NORMAL); + } + // Display CMake version info on the next line // We want to display this on the right char version[cmCursesMainForm::MAX_WIDTH]; From f4eebeb447e628aac3d1f79b780bc309e2ad5904 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 4 Nov 2019 14:49:53 -0500 Subject: [PATCH 085/662] FindCUDA: Revert "Use find_program instead of find_path to find nvcc" Revert commit 067ee518f7 (FindCUDA: Use find_program instead of find_path to find nvcc, 2019-10-31). It causes `CUDA_TOOLKIT_ROOT_DIR` to contain the path to nvcc rather than the toolkit directory. --- Modules/FindCUDA.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 79d7fda6533..b6859aaf41b 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -676,7 +676,7 @@ endif() # Search for the cuda distribution. if(NOT CUDA_TOOLKIT_ROOT_DIR AND NOT CMAKE_CROSSCOMPILING) # Search in the CUDA_BIN_PATH first. - find_program(CUDA_TOOLKIT_ROOT_DIR + find_path(CUDA_TOOLKIT_ROOT_DIR NAMES nvcc nvcc.exe PATHS ENV CUDA_TOOLKIT_ROOT @@ -688,7 +688,7 @@ if(NOT CUDA_TOOLKIT_ROOT_DIR AND NOT CMAKE_CROSSCOMPILING) ) # Now search default paths - find_program(CUDA_TOOLKIT_ROOT_DIR + find_path(CUDA_TOOLKIT_ROOT_DIR NAMES nvcc nvcc.exe PATHS /opt/cuda/bin PATH_SUFFIXES cuda/bin From 2e9feddf68a15e9f8909aedbd8b0f3e916273b94 Mon Sep 17 00:00:00 2001 From: Hong Xu Date: Mon, 4 Nov 2019 11:18:05 -0800 Subject: [PATCH 086/662] FindCUDA: Use find_program instead of find_path when searching for nvcc. Before this commit, nvcc would not be found if it is in env PATH but a non-standard location. This commit fixes this issue. --- Modules/FindCUDA.cmake | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index b6859aaf41b..85d705c8d66 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -676,7 +676,7 @@ endif() # Search for the cuda distribution. if(NOT CUDA_TOOLKIT_ROOT_DIR AND NOT CMAKE_CROSSCOMPILING) # Search in the CUDA_BIN_PATH first. - find_path(CUDA_TOOLKIT_ROOT_DIR + find_program(CUDA_TOOLKIT_ROOT_DIR_NVCC NAMES nvcc nvcc.exe PATHS ENV CUDA_TOOLKIT_ROOT @@ -688,19 +688,22 @@ if(NOT CUDA_TOOLKIT_ROOT_DIR AND NOT CMAKE_CROSSCOMPILING) ) # Now search default paths - find_path(CUDA_TOOLKIT_ROOT_DIR + find_program(CUDA_TOOLKIT_ROOT_DIR_NVCC NAMES nvcc nvcc.exe PATHS /opt/cuda/bin PATH_SUFFIXES cuda/bin DOC "Toolkit location." ) - if (CUDA_TOOLKIT_ROOT_DIR) + if (CUDA_TOOLKIT_ROOT_DIR_NVCC) + get_filename_component(CUDA_TOOLKIT_ROOT_DIR_NVCC_PAR "${CUDA_TOOLKIT_ROOT_DIR_NVCC}" DIRECTORY) + get_filename_component(CUDA_TOOLKIT_ROOT_DIR "${CUDA_TOOLKIT_ROOT_DIR_NVCC_PAR}" DIRECTORY CACHE) string(REGEX REPLACE "[/\\\\]?bin[64]*[/\\\\]?$" "" CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT_DIR}) # We need to force this back into the cache. set(CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT_DIR} CACHE PATH "Toolkit location." FORCE) set(CUDA_TOOLKIT_TARGET_DIR ${CUDA_TOOLKIT_ROOT_DIR}) endif() + unset(CUDA_TOOLKIT_ROOT_DIR_NVCC CACHE) if (NOT EXISTS ${CUDA_TOOLKIT_ROOT_DIR}) if(CUDA_FIND_REQUIRED) From deeab72aae14de3bfce4189ea5e9ee42e7ad94dc Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Mon, 4 Nov 2019 12:01:44 -0500 Subject: [PATCH 087/662] Tests: Add tests for INSTALL_NAME_DIR --- Tests/RunCMake/CMakeLists.txt | 3 + .../RunCMake/INSTALL_NAME_DIR/CMakeLists.txt | 4 ++ .../INSTALL_NAME_DIR/INSTALL_NAME_DIR.cmake | 15 ++++ .../INSTALL_NAME_DIR/RunCMakeTest.cmake | 69 +++++++++++++++++++ .../empty-install-check.cmake | 1 + Tests/RunCMake/INSTALL_NAME_DIR/empty.cmake | 3 + .../empty_genex-install-check.cmake | 1 + .../INSTALL_NAME_DIR/empty_genex.cmake | 3 + .../INSTALL_NAME_DIR/none-install-check.cmake | 1 + Tests/RunCMake/INSTALL_NAME_DIR/none.cmake | 3 + .../prefix_genex-install-check.cmake | 6 ++ .../INSTALL_NAME_DIR/prefix_genex.cmake | 3 + .../simple-install-check.cmake | 1 + Tests/RunCMake/INSTALL_NAME_DIR/simple.cmake | 3 + .../simple_genex-install-check.cmake | 1 + .../INSTALL_NAME_DIR/simple_genex.cmake | 3 + Tests/RunCMake/INSTALL_NAME_DIR/test.c | 3 + 17 files changed, 123 insertions(+) create mode 100644 Tests/RunCMake/INSTALL_NAME_DIR/CMakeLists.txt create mode 100644 Tests/RunCMake/INSTALL_NAME_DIR/INSTALL_NAME_DIR.cmake create mode 100644 Tests/RunCMake/INSTALL_NAME_DIR/RunCMakeTest.cmake create mode 100644 Tests/RunCMake/INSTALL_NAME_DIR/empty-install-check.cmake create mode 100644 Tests/RunCMake/INSTALL_NAME_DIR/empty.cmake create mode 100644 Tests/RunCMake/INSTALL_NAME_DIR/empty_genex-install-check.cmake create mode 100644 Tests/RunCMake/INSTALL_NAME_DIR/empty_genex.cmake create mode 100644 Tests/RunCMake/INSTALL_NAME_DIR/none-install-check.cmake create mode 100644 Tests/RunCMake/INSTALL_NAME_DIR/none.cmake create mode 100644 Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex-install-check.cmake create mode 100644 Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex.cmake create mode 100644 Tests/RunCMake/INSTALL_NAME_DIR/simple-install-check.cmake create mode 100644 Tests/RunCMake/INSTALL_NAME_DIR/simple.cmake create mode 100644 Tests/RunCMake/INSTALL_NAME_DIR/simple_genex-install-check.cmake create mode 100644 Tests/RunCMake/INSTALL_NAME_DIR/simple_genex.cmake create mode 100644 Tests/RunCMake/INSTALL_NAME_DIR/test.c diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 31b280b7798..449075122a7 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -290,6 +290,9 @@ add_RunCMake_test(set_property) add_RunCMake_test(string) add_RunCMake_test(test_include_dirs) add_RunCMake_test(BundleUtilities) +if(APPLE) + add_RunCMake_test(INSTALL_NAME_DIR) +endif() function(add_RunCMake_test_try_compile) if(CMAKE_VERSION VERSION_LESS 3.9.20170907 AND "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC") diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/CMakeLists.txt b/Tests/RunCMake/INSTALL_NAME_DIR/CMakeLists.txt new file mode 100644 index 00000000000..5253d3479e3 --- /dev/null +++ b/Tests/RunCMake/INSTALL_NAME_DIR/CMakeLists.txt @@ -0,0 +1,4 @@ +cmake_minimum_required(VERSION 3.16) +project(${RunCMake_TEST} NONE) +include(${CMAKE_CURRENT_LIST_DIR}/INSTALL_NAME_DIR.cmake) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/INSTALL_NAME_DIR.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/INSTALL_NAME_DIR.cmake new file mode 100644 index 00000000000..eaa0b456a6e --- /dev/null +++ b/Tests/RunCMake/INSTALL_NAME_DIR/INSTALL_NAME_DIR.cmake @@ -0,0 +1,15 @@ +function(add_install_name_dir_libraries install_name_dir) + add_library(build_dir SHARED test.c) + add_library(install_dir SHARED test.c) + if(NOT install_name_dir STREQUAL "NONE") + set_target_properties(build_dir install_dir PROPERTIES + INSTALL_NAME_DIR "${install_name_dir}" + ) + endif() + set_target_properties(install_dir PROPERTIES + BUILD_WITH_INSTALL_NAME_DIR TRUE + ) + install(TARGETS build_dir install_dir EXPORT InstallNameDirTest DESTINATION lib) + install(EXPORT InstallNameDirTest DESTINATION lib/cmake/InstallNameDirTest FILE InstallNameDirTest-targets.cmake) + file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/targets.txt" CONTENT "$\n$\n" CONDITION $) +endfunction() diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/RunCMakeTest.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/RunCMakeTest.cmake new file mode 100644 index 00000000000..2aa03ddab31 --- /dev/null +++ b/Tests/RunCMake/INSTALL_NAME_DIR/RunCMakeTest.cmake @@ -0,0 +1,69 @@ +cmake_minimum_required(VERSION 3.16) + +include(RunCMake) + +function(run_install_test case) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${case}-build) + set(RunCMake_TEST_NO_CLEAN 1) + set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE:STRING=Debug "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/fake_install") + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + run_cmake(${case}) + run_cmake_command(${case}-build ${CMAKE_COMMAND} --build . --config Debug) + run_cmake_command(${case}-install ${CMAKE_COMMAND} --install . --config Debug --prefix "${RunCMake_TEST_BINARY_DIR}/real_install") +endfunction() + +find_program(OTOOL_COMMAND otool) + +function(check_install_name_dir file expected) + execute_process(COMMAND ${OTOOL_COMMAND} -l ${file} RESULT_VARIABLE _result OUTPUT_VARIABLE _output) + if(_result) + string(APPEND RunCMake_TEST_FAILED "Could not run otool on ${file}\n") + elseif(_output MATCHES "cmd LC_ID_DYLIB\n[^\n]*\n *name ([^\n]*) \\(offset [0-9]+\\)\n") + set(_install_name "${CMAKE_MATCH_1}") + if(NOT _install_name MATCHES "${expected}") + string(APPEND RunCMake_TEST_FAILED "Install name of ${file} did not match ${expected} (actual: ${_install_name})\n") + endif() + else() + string(APPEND RunCMake_TEST_FAILED "otool did not print install name for ${file}\n") + endif() + + set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) +endfunction() + +function(check_imported_soname contents target expected) + if(contents MATCHES "set_target_properties\\(${target} PROPERTIES\n[^\n]*\n *IMPORTED_SONAME_DEBUG \"([^\n]*)\"\n") + set(_soname "${CMAKE_MATCH_1}") + set(_regex "^${expected}lib${target}\\.dylib$") + if(NOT _soname MATCHES "${_regex}") + string(APPEND RunCMake_TEST_FAILED "Target ${target}'s IMPORTED_SONAME_DEBUG did not match ${_regex} (actual: ${_soname})\n") + endif() + else() + string(APPEND RunCMake_TEST_FAILED "Could not find IMPORTED_SONAME_DEBUG for target ${target} in package config file\n") + endif() + + set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) +endfunction() + +function(check_libraries fake_install real_install soname_prefix) + file(STRINGS "${RunCMake_TEST_BINARY_DIR}/targets.txt" _targets) + list(GET _targets 0 _build_dir) + list(GET _targets 1 _install_dir) + check_install_name_dir("${_build_dir}" "^@rpath/libbuild_dir\\.dylib$") + check_install_name_dir("${_install_dir}" "^${fake_install}libinstall_dir\\.dylib$") + check_install_name_dir("${RunCMake_TEST_BINARY_DIR}/real_install/lib/libbuild_dir.dylib" "^${real_install}libbuild_dir\\.dylib$") + check_install_name_dir("${RunCMake_TEST_BINARY_DIR}/real_install/lib/libinstall_dir.dylib" "^${real_install}libinstall_dir\\.dylib$") + + file(READ "${RunCMake_TEST_BINARY_DIR}/real_install/lib/cmake/InstallNameDirTest/InstallNameDirTest-targets-debug.cmake" _targets) + check_imported_soname("${_targets}" build_dir "${soname_prefix}") + check_imported_soname("${_targets}" install_dir "${soname_prefix}") + + set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) +endfunction() + +run_install_test(none) +run_install_test(empty) +run_install_test(simple) +run_install_test(simple_genex) +run_install_test(prefix_genex) +run_install_test(empty_genex) diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/empty-install-check.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/empty-install-check.cmake new file mode 100644 index 00000000000..db87d2cb9d2 --- /dev/null +++ b/Tests/RunCMake/INSTALL_NAME_DIR/empty-install-check.cmake @@ -0,0 +1 @@ +check_libraries("" "" "") diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/empty.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/empty.cmake new file mode 100644 index 00000000000..0cde4d1184a --- /dev/null +++ b/Tests/RunCMake/INSTALL_NAME_DIR/empty.cmake @@ -0,0 +1,3 @@ +enable_language(C) + +add_install_name_dir_libraries("") diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/empty_genex-install-check.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/empty_genex-install-check.cmake new file mode 100644 index 00000000000..db87d2cb9d2 --- /dev/null +++ b/Tests/RunCMake/INSTALL_NAME_DIR/empty_genex-install-check.cmake @@ -0,0 +1 @@ +check_libraries("" "" "") diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/empty_genex.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/empty_genex.cmake new file mode 100644 index 00000000000..321c8d1ab94 --- /dev/null +++ b/Tests/RunCMake/INSTALL_NAME_DIR/empty_genex.cmake @@ -0,0 +1,3 @@ +enable_language(C) + +add_install_name_dir_libraries($<0:/usr/local/lib>) diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/none-install-check.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/none-install-check.cmake new file mode 100644 index 00000000000..c3e7ac4f72d --- /dev/null +++ b/Tests/RunCMake/INSTALL_NAME_DIR/none-install-check.cmake @@ -0,0 +1 @@ +check_libraries(@rpath/ @rpath/ @rpath/) diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/none.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/none.cmake new file mode 100644 index 00000000000..79c5e7d7544 --- /dev/null +++ b/Tests/RunCMake/INSTALL_NAME_DIR/none.cmake @@ -0,0 +1,3 @@ +enable_language(C) + +add_install_name_dir_libraries(NONE) diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex-install-check.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex-install-check.cmake new file mode 100644 index 00000000000..8cf7db82d88 --- /dev/null +++ b/Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex-install-check.cmake @@ -0,0 +1,6 @@ +check_libraries( + ".*/Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex-build/fake_install/lib/" + ".*/Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex-build/real_install/lib/" + # "$" has to be escaped twice because of its significance in regexes. + "\\\${_IMPORT_PREFIX}/lib/" + ) diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex.cmake new file mode 100644 index 00000000000..7e26208f535 --- /dev/null +++ b/Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex.cmake @@ -0,0 +1,3 @@ +enable_language(C) + +add_install_name_dir_libraries($<1:$/lib>) diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/simple-install-check.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/simple-install-check.cmake new file mode 100644 index 00000000000..5f737cbfb82 --- /dev/null +++ b/Tests/RunCMake/INSTALL_NAME_DIR/simple-install-check.cmake @@ -0,0 +1 @@ +check_libraries(/usr/local/lib/ /usr/local/lib/ /usr/local/lib/) diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/simple.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/simple.cmake new file mode 100644 index 00000000000..d0198750dc9 --- /dev/null +++ b/Tests/RunCMake/INSTALL_NAME_DIR/simple.cmake @@ -0,0 +1,3 @@ +enable_language(C) + +add_install_name_dir_libraries(/usr/local/lib) diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/simple_genex-install-check.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/simple_genex-install-check.cmake new file mode 100644 index 00000000000..5f737cbfb82 --- /dev/null +++ b/Tests/RunCMake/INSTALL_NAME_DIR/simple_genex-install-check.cmake @@ -0,0 +1 @@ +check_libraries(/usr/local/lib/ /usr/local/lib/ /usr/local/lib/) diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/simple_genex.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/simple_genex.cmake new file mode 100644 index 00000000000..1e729e86f8d --- /dev/null +++ b/Tests/RunCMake/INSTALL_NAME_DIR/simple_genex.cmake @@ -0,0 +1,3 @@ +enable_language(C) + +add_install_name_dir_libraries($<1:/usr/local/lib>) diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/test.c b/Tests/RunCMake/INSTALL_NAME_DIR/test.c new file mode 100644 index 00000000000..c2db61cc822 --- /dev/null +++ b/Tests/RunCMake/INSTALL_NAME_DIR/test.c @@ -0,0 +1,3 @@ +void test(void) +{ +} From a0e2e0ca9725996c5ff4662f84d9bca8ea4edd35 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Mon, 4 Nov 2019 12:08:53 -0500 Subject: [PATCH 088/662] Help: Add documentation and release notes for INSTALL_NAME_DIR genex --- Help/manual/cmake-generator-expressions.7.rst | 3 ++- Help/prop_tgt/INSTALL_NAME_DIR.rst | 4 ++++ Help/release/dev/install-name-dir-genex.rst | 7 +++++++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 Help/release/dev/install-name-dir-genex.rst diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst index 75f4bd48a2a..691481b9920 100644 --- a/Help/manual/cmake-generator-expressions.7.rst +++ b/Help/manual/cmake-generator-expressions.7.rst @@ -596,7 +596,8 @@ Target-Dependent Queries requirement. ``$`` Content of the install prefix when the target is exported via - :command:`install(EXPORT)` and empty otherwise. + :command:`install(EXPORT)`, or when evaluated in + :prop_tgt:`INSTALL_NAME_DIR`, and empty otherwise. Output-Related Expressions -------------------------- diff --git a/Help/prop_tgt/INSTALL_NAME_DIR.rst b/Help/prop_tgt/INSTALL_NAME_DIR.rst index 2216072acb1..747615ac8e5 100644 --- a/Help/prop_tgt/INSTALL_NAME_DIR.rst +++ b/Help/prop_tgt/INSTALL_NAME_DIR.rst @@ -10,3 +10,7 @@ installed targets. This property is initialized by the value of the variable :variable:`CMAKE_INSTALL_NAME_DIR` if it is set when a target is created. + +This property supports :manual:`generator expressions `. +In particular, the ``$`` generator expression can be used to set the +directory relative to the install-time prefix. diff --git a/Help/release/dev/install-name-dir-genex.rst b/Help/release/dev/install-name-dir-genex.rst new file mode 100644 index 00000000000..0cb41f08d93 --- /dev/null +++ b/Help/release/dev/install-name-dir-genex.rst @@ -0,0 +1,7 @@ +install-name-dir-genex +---------------------- + +* The :prop_tgt:`INSTALL_NAME_DIR` target property now supports + :manual:`generator expressions `. + In particular, the ``$`` generator expression can + be used to set the directory relative to the install-time prefix. From 003e1f992e6e0dc32a0778f2bec604843cf180b4 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Tue, 5 Nov 2019 00:01:08 -0500 Subject: [PATCH 089/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index ad42756770f..7425c0fcdc0 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191104) +set(CMake_VERSION_PATCH 20191105) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From 68b5af65fa09c90278826898f199d289c049a01d Mon Sep 17 00:00:00 2001 From: Johnny Jazeix Date: Tue, 5 Nov 2019 20:09:53 +0100 Subject: [PATCH 090/662] CPack/NSIS: Add options for custom welcome/finish titles + display on 3 lines Fixes: #11275 --- Help/cpack_gen/nsis.rst | 16 ++++++++ .../cpack-nsis-welcome-finish-page-title.rst | 10 +++++ Modules/Internal/CPack/NSIS.template.in | 4 ++ Source/CPack/cmCPackNSISGenerator.cxx | 37 ++++++++++++++++--- 4 files changed, 61 insertions(+), 6 deletions(-) create mode 100644 Help/release/dev/cpack-nsis-welcome-finish-page-title.rst diff --git a/Help/cpack_gen/nsis.rst b/Help/cpack_gen/nsis.rst index 38676c46597..dc6524938ca 100644 --- a/Help/cpack_gen/nsis.rst +++ b/Help/cpack_gen/nsis.rst @@ -133,3 +133,19 @@ on Windows Nullsoft Scriptable Install System. Specify the name of the program to uninstall the version. Default is ``Uninstall``. + +.. variable:: CPACK_NSIS_WELCOME_TITLE + + The title to display on the top of the page for the welcome page. + +.. variable:: CPACK_NSIS_WELCOME_TITLE_3LINES + + Display the title in the welcome page on 3 lines instead of 2. + +.. variable:: CPACK_NSIS_FINISH_TITLE + + The title to display on the top of the page for the finish page. + +.. variable:: CPACK_NSIS_FINISH_TITLE_3LINES + + Display the title in the finish page on 3 lines instead of 2. diff --git a/Help/release/dev/cpack-nsis-welcome-finish-page-title.rst b/Help/release/dev/cpack-nsis-welcome-finish-page-title.rst new file mode 100644 index 00000000000..8091d31e6e3 --- /dev/null +++ b/Help/release/dev/cpack-nsis-welcome-finish-page-title.rst @@ -0,0 +1,10 @@ +cpack-nsis-welcome-finish-page-title +------------------------------------ + +* The :cpack_gen:`CPack NSIS Generator` now supports + :variable:`CPACK_NSIS_WELCOME_TITLE` and :variable:`CPACK_NSIS_WELCOME_TITLE_3LINES`. + These can be used to specify the welcome page title and display it in 3 lines. + +* The :cpack_gen:`CPack NSIS Generator` now supports + :variable:`CPACK_NSIS_FINISH_TITLE` and :variable:`CPACK_NSIS_FINISH_TITLE_3LINES`. + These can be used to specify the finish page title and display it in 3 lines. diff --git a/Modules/Internal/CPack/NSIS.template.in b/Modules/Internal/CPack/NSIS.template.in index c1db769aca2..23bb0018386 100644 --- a/Modules/Internal/CPack/NSIS.template.in +++ b/Modules/Internal/CPack/NSIS.template.in @@ -542,6 +542,8 @@ FunctionEnd ;-------------------------------- ;Pages + @CPACK_NSIS_INSTALLER_WELCOME_TITLE_CODE@ + @CPACK_NSIS_INSTALLER_WELCOME_TITLE_3LINES_CODE@ !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE "@CPACK_RESOURCE_FILE_LICENSE@" @@ -557,6 +559,8 @@ FunctionEnd @CPACK_NSIS_PAGE_COMPONENTS@ !insertmacro MUI_PAGE_INSTFILES + @CPACK_NSIS_INSTALLER_FINISH_TITLE_CODE@ + @CPACK_NSIS_INSTALLER_FINISH_TITLE_3LINES_CODE@ !insertmacro MUI_PAGE_FINISH !insertmacro MUI_UNPAGE_CONFIRM diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index adea8ecd15f..f90a740ef7f 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -129,14 +129,13 @@ int cmCPackNSISGenerator::PackageFiles() this->IsSet("CPACK_NSIS_MUI_UNIICON")) { std::string installerIconCode; if (this->IsSet("CPACK_NSIS_MUI_ICON")) { - installerIconCode += "!define MUI_ICON \""; - installerIconCode += this->GetOption("CPACK_NSIS_MUI_ICON"); - installerIconCode += "\"\n"; + installerIconCode += cmStrCat( + "!define MUI_ICON \"", this->GetOption("CPACK_NSIS_MUI_ICON"), "\"\n"); } if (this->IsSet("CPACK_NSIS_MUI_UNIICON")) { - installerIconCode += "!define MUI_UNICON \""; - installerIconCode += this->GetOption("CPACK_NSIS_MUI_UNIICON"); - installerIconCode += "\"\n"; + installerIconCode += + cmStrCat("!define MUI_UNICON \"", + this->GetOption("CPACK_NSIS_MUI_UNIICON"), "\"\n"); } this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_ICON_CODE", installerIconCode.c_str()); @@ -174,6 +173,32 @@ int cmCPackNSISGenerator::PackageFiles() installerRunCode.c_str()); } + if (this->IsSet("CPACK_NSIS_WELCOME_TITLE")) { + std::string welcomeTitleCode = + cmStrCat("!define MUI_WELCOMEPAGE_TITLE \"", + this->GetOption("CPACK_NSIS_WELCOME_TITLE"), "\""); + this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_WELCOME_TITLE_CODE", + welcomeTitleCode.c_str()); + } + + if (this->IsSet("CPACK_NSIS_WELCOME_TITLE_3LINES")) { + this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_WELCOME_TITLE_3LINES_CODE", + "!define MUI_WELCOMEPAGE_TITLE_3LINES"); + } + + if (this->IsSet("CPACK_NSIS_FINISH_TITLE")) { + std::string finishTitleCode = + cmStrCat("!define MUI_FINISHPAGE_TITLE \"", + this->GetOption("CPACK_NSIS_FINISH_TITLE"), "\""); + this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_FINISH_TITLE_CODE", + finishTitleCode.c_str()); + } + + if (this->IsSet("CPACK_NSIS_FINISH_TITLE_3LINES")) { + this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_FINISH_TITLE_3LINES_CODE", + "!define MUI_FINISHPAGE_TITLE_3LINES"); + } + // Setup all of the component sections if (this->Components.empty()) { this->SetOptionIfNotSet("CPACK_NSIS_INSTALLATION_TYPES", ""); From 2a67ebf71b1b6086fcfdde04d77925038f81850c Mon Sep 17 00:00:00 2001 From: Marc Chevrier Date: Tue, 5 Nov 2019 18:57:46 +0100 Subject: [PATCH 091/662] cmGeneratorTarget: modernize memory management --- Source/cmGeneratorTarget.cxx | 98 +++++++++++++++++------------------- Source/cmGeneratorTarget.h | 24 +++++---- 2 files changed, 59 insertions(+), 63 deletions(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 41f1df9a1c7..5090d87ada0 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -10,11 +10,11 @@ #include #include #include -#include #include #include #include +#include #include #include @@ -162,7 +162,8 @@ class TargetPropertyEntryString : public cmGeneratorTarget::TargetPropertyEntry cmListFileBacktrace Backtrace; }; -cmGeneratorTarget::TargetPropertyEntry* CreateTargetPropertyEntry( +std::unique_ptr +CreateTargetPropertyEntry( const std::string& propertyValue, cmListFileBacktrace backtrace = cmListFileBacktrace(), bool evaluateForBuildsystem = false) @@ -172,15 +173,18 @@ cmGeneratorTarget::TargetPropertyEntry* CreateTargetPropertyEntry( std::unique_ptr cge = ge.Parse(propertyValue); cge->SetEvaluateForBuildsystem(evaluateForBuildsystem); - return new TargetPropertyEntryGenex(std::move(cge)); + return std::unique_ptr( + cm::make_unique(std::move(cge))); } - return new TargetPropertyEntryString(propertyValue, std::move(backtrace)); + return std::unique_ptr( + cm::make_unique(propertyValue, + std::move(backtrace))); } void CreatePropertyGeneratorExpressions( cmStringRange entries, cmBacktraceRange backtraces, - std::vector& items, + std::vector>& items, bool evaluateForBuildsystem = false) { auto btIt = backtraces.begin(); @@ -219,13 +223,13 @@ struct EvaluatedTargetPropertyEntry EvaluatedTargetPropertyEntry EvaluateTargetPropertyEntry( cmGeneratorTarget const* thisTarget, std::string const& config, std::string const& lang, cmGeneratorExpressionDAGChecker* dagChecker, - cmGeneratorTarget::TargetPropertyEntry* entry) + cmGeneratorTarget::TargetPropertyEntry& entry) { - EvaluatedTargetPropertyEntry ee(entry->LinkImplItem, entry->GetBacktrace()); - cmExpandList(entry->Evaluate(thisTarget->GetLocalGenerator(), config, - thisTarget, dagChecker, lang), + EvaluatedTargetPropertyEntry ee(entry.LinkImplItem, entry.GetBacktrace()); + cmExpandList(entry.Evaluate(thisTarget->GetLocalGenerator(), config, + thisTarget, dagChecker, lang), ee.Values); - if (entry->GetHadContextSensitiveCondition()) { + if (entry.GetHadContextSensitiveCondition()) { ee.ContextDependent = true; } return ee; @@ -234,13 +238,14 @@ EvaluatedTargetPropertyEntry EvaluateTargetPropertyEntry( std::vector EvaluateTargetPropertyEntries( cmGeneratorTarget const* thisTarget, std::string const& config, std::string const& lang, cmGeneratorExpressionDAGChecker* dagChecker, - std::vector const& in) + std::vector> const& + in) { std::vector out; out.reserve(in.size()); - for (cmGeneratorTarget::TargetPropertyEntry* entry : in) { + for (auto& entry : in) { out.emplace_back(EvaluateTargetPropertyEntry(thisTarget, config, lang, - dagChecker, entry)); + dagChecker, *entry)); } return out; } @@ -304,23 +309,12 @@ cmGeneratorTarget::cmGeneratorTarget(cmTarget* t, cmLocalGenerator* lg) this->PolicyMap = t->GetPolicyMap(); } -cmGeneratorTarget::~cmGeneratorTarget() -{ - cmDeleteAll(this->IncludeDirectoriesEntries); - cmDeleteAll(this->CompileOptionsEntries); - cmDeleteAll(this->CompileFeaturesEntries); - cmDeleteAll(this->CompileDefinitionsEntries); - cmDeleteAll(this->LinkOptionsEntries); - cmDeleteAll(this->LinkDirectoriesEntries); - cmDeleteAll(this->PrecompileHeadersEntries); - cmDeleteAll(this->SourceEntries); - cmDeleteAll(this->LinkInformation); -} +cmGeneratorTarget::~cmGeneratorTarget() = default; const char* cmGeneratorTarget::GetSourcesProperty() const { std::vector values; - for (TargetPropertyEntry* se : this->SourceEntries) { + for (auto& se : this->SourceEntries) { values.push_back(se->GetInput()); } static std::string value; @@ -3288,10 +3282,10 @@ std::vector> cmGeneratorTarget::GetCompileDefinitions( CM_FALLTHROUGH; } case cmPolicies::OLD: { - std::unique_ptr entry( - CreateTargetPropertyEntry(configProp)); + std::unique_ptr entry = + CreateTargetPropertyEntry(configProp); entries.emplace_back(EvaluateTargetPropertyEntry( - this, config, language, &dagChecker, entry.get())); + this, config, language, &dagChecker, *entry)); } break; case cmPolicies::NEW: case cmPolicies::REQUIRED_ALWAYS: @@ -3778,10 +3772,10 @@ std::vector> cmGeneratorTarget::GetStaticLibraryLinkOptions( if (const char* linkOptions = this->GetProperty("STATIC_LIBRARY_OPTIONS")) { std::vector options = cmExpandedList(linkOptions); for (const auto& option : options) { - std::unique_ptr entry( - CreateTargetPropertyEntry(option)); - entries.emplace_back(EvaluateTargetPropertyEntry( - this, config, language, &dagChecker, entry.get())); + std::unique_ptr entry = + CreateTargetPropertyEntry(option); + entries.emplace_back(EvaluateTargetPropertyEntry(this, config, language, + &dagChecker, *entry)); } } processOptions(this, entries, result, uniqueOptions, false, @@ -3932,10 +3926,10 @@ std::vector> cmGeneratorTarget::GetLinkDepends( if (const char* linkDepends = this->GetProperty("LINK_DEPENDS")) { std::vector depends = cmExpandedList(linkDepends); for (const auto& depend : depends) { - std::unique_ptr entry( - CreateTargetPropertyEntry(depend)); - entries.emplace_back(EvaluateTargetPropertyEntry( - this, config, language, &dagChecker, entry.get())); + std::unique_ptr entry = + CreateTargetPropertyEntry(depend); + entries.emplace_back(EvaluateTargetPropertyEntry(this, config, language, + &dagChecker, *entry)); } } AddInterfaceEntries(this, config, "INTERFACE_LINK_DEPENDS", language, @@ -4719,9 +4713,9 @@ std::string intersect(const std::set& s1, } void cmGeneratorTarget::CheckPropertyCompatibility( - cmComputeLinkInformation* info, const std::string& config) const + cmComputeLinkInformation& info, const std::string& config) const { - const cmComputeLinkInformation::ItemVector& deps = info->GetItems(); + const cmComputeLinkInformation::ItemVector& deps = info.GetItems(); std::set emittedBools; static const std::string strBool = "COMPATIBLE_INTERFACE_BOOL"; @@ -5066,10 +5060,11 @@ PropertyType checkInterfacePropertyCompatibility(cmGeneratorTarget const* tgt, } std::string interfaceProperty = "INTERFACE_" + p; - std::unique_ptr genexInterpreter( - p == "POSITION_INDEPENDENT_CODE" ? new cmGeneratorExpressionInterpreter( - tgt->GetLocalGenerator(), config, tgt) - : nullptr); + std::unique_ptr genexInterpreter; + if (p == "POSITION_INDEPENDENT_CODE") { + genexInterpreter = cm::make_unique( + tgt->GetLocalGenerator(), config, tgt); + } for (cmGeneratorTarget const* theTarget : deps) { // An error should be reported if one dependency @@ -5216,22 +5211,19 @@ cmComputeLinkInformation* cmGeneratorTarget::GetLinkInformation( auto i = this->LinkInformation.find(key); if (i == this->LinkInformation.end()) { // Compute information for this configuration. - cmComputeLinkInformation* info = - new cmComputeLinkInformation(this, config); - if (!info || !info->Compute()) { - delete info; - info = nullptr; + auto info = cm::make_unique(this, config); + if (info && !info->Compute()) { + info.reset(); } // Store the information for this configuration. - cmTargetLinkInformationMap::value_type entry(key, info); - i = this->LinkInformation.insert(entry).first; + i = this->LinkInformation.emplace(key, std::move(info)).first; - if (info) { - this->CheckPropertyCompatibility(info, config); + if (i->second) { + this->CheckPropertyCompatibility(*i->second, config); } } - return i->second; + return i->second.get(); } void cmGeneratorTarget::GetTargetVersion(int& major, int& minor) const diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 46235131404..eab2b7a0958 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -815,10 +816,10 @@ class cmGeneratorTarget mutable std::map CompatibleInterfacesMap; using cmTargetLinkInformationMap = - std::map; + std::map>; mutable cmTargetLinkInformationMap LinkInformation; - void CheckPropertyCompatibility(cmComputeLinkInformation* info, + void CheckPropertyCompatibility(cmComputeLinkInformation& info, const std::string& config) const; struct LinkImplClosure : public std::vector @@ -881,14 +882,17 @@ class cmGeneratorTarget bool MaybeHaveInterfaceProperty(std::string const& prop, cmGeneratorExpressionContext* context) const; - std::vector IncludeDirectoriesEntries; - std::vector CompileOptionsEntries; - std::vector CompileFeaturesEntries; - std::vector CompileDefinitionsEntries; - std::vector LinkOptionsEntries; - std::vector LinkDirectoriesEntries; - std::vector PrecompileHeadersEntries; - std::vector SourceEntries; + using TargetPropertyEntryVector = + std::vector>; + + TargetPropertyEntryVector IncludeDirectoriesEntries; + TargetPropertyEntryVector CompileOptionsEntries; + TargetPropertyEntryVector CompileFeaturesEntries; + TargetPropertyEntryVector CompileDefinitionsEntries; + TargetPropertyEntryVector LinkOptionsEntries; + TargetPropertyEntryVector LinkDirectoriesEntries; + TargetPropertyEntryVector PrecompileHeadersEntries; + TargetPropertyEntryVector SourceEntries; mutable std::set LinkImplicitNullProperties; mutable std::map PchHeaders; mutable std::map PchSources; From 099f6c300aabb050902fe248dbbf1487cf494d61 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Wed, 6 Nov 2019 00:01:08 -0500 Subject: [PATCH 092/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 7425c0fcdc0..c8e91089da7 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191105) +set(CMake_VERSION_PATCH 20191106) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From 53227a4ff27c6eda7cb5b3b283f96d1f2d2d56ca Mon Sep 17 00:00:00 2001 From: Alex Turbov Date: Mon, 4 Nov 2019 17:11:07 +0200 Subject: [PATCH 093/662] Refactor: Modernize `foreach` code and fix some bugs - fix the typo in `foreach` documentation - fix broken `foreach(... IN ITEMS ... LISTS ...)` - add tests of `foreach` for existed functionality and fixes --- Help/command/foreach.rst | 2 +- Source/cmForEachCommand.cxx | 145 +++++++++--------- Tests/RunCMake/foreach/RunCMakeTest.cmake | 1 + .../foreach/foreach-all-test-stdout.txt | 44 ++++++ Tests/RunCMake/foreach/foreach-all-test.cmake | 67 ++++++++ Utilities/IWYU/mapping.imp | 1 + 6 files changed, 189 insertions(+), 71 deletions(-) create mode 100644 Tests/RunCMake/foreach/foreach-all-test-stdout.txt create mode 100644 Tests/RunCMake/foreach/foreach-all-test.cmake diff --git a/Help/command/foreach.rst b/Help/command/foreach.rst index ae2afb2905d..ecbfed3d9d3 100644 --- a/Help/command/foreach.rst +++ b/Help/command/foreach.rst @@ -47,7 +47,7 @@ of undocumented behavior that may change in future releases. .. code-block:: cmake - foreach(loop_var IN [LISTS []] [ITEMS []]) + foreach( IN [LISTS []] [ITEMS []]) In this variant, ```` is a whitespace or semicolon separated list of list-valued variables. The ``foreach`` diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx index 44392baa757..91cd4efd47c 100644 --- a/Source/cmForEachCommand.cxx +++ b/Source/cmForEachCommand.cxx @@ -2,7 +2,12 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmForEachCommand.h" -#include +#include +#include +// NOTE The declaration of `std::abs` has moved to `cmath` since C++17 +// See https://en.cppreference.com/w/cpp/numeric/math/abs +// ALERT But IWYU used to lint `#include`s do not "understand" +// conditional compilation (i.e. `#if __cplusplus >= 201703L`) #include #include @@ -21,8 +26,6 @@ #include "cmSystemTools.h" namespace { -bool HandleInMode(std::vector const& args, cmMakefile& makefile); - class cmForEachFunctionBlocker : public cmFunctionBlocker { public: @@ -60,7 +63,8 @@ bool cmForEachFunctionBlocker::ArgumentsMatch(cmListFileFunction const& lff, { std::vector expandedArguments; mf.ExpandArguments(lff.Arguments, expandedArguments); - return expandedArguments.empty() || expandedArguments[0] == this->Args[0]; + return expandedArguments.empty() || + expandedArguments.front() == this->Args.front(); } bool cmForEachFunctionBlocker::Replay( @@ -70,13 +74,13 @@ bool cmForEachFunctionBlocker::Replay( // at end of for each execute recorded commands // store the old value std::string oldDef; - if (mf.GetDefinition(this->Args[0])) { - oldDef = mf.GetDefinition(this->Args[0]); + if (mf.GetDefinition(this->Args.front())) { + oldDef = mf.GetDefinition(this->Args.front()); } for (std::string const& arg : cmMakeRange(this->Args).advance(1)) { // set the variable to the loop value - mf.AddDefinition(this->Args[0], arg); + mf.AddDefinition(this->Args.front(), arg); // Invoke all the functions that were collected in the block. for (cmListFileFunction const& func : functions) { cmExecutionStatus status(mf); @@ -84,12 +88,12 @@ bool cmForEachFunctionBlocker::Replay( if (status.GetReturnInvoked()) { inStatus.SetReturnInvoked(); // restore the variable to its prior value - mf.AddDefinition(this->Args[0], oldDef); + mf.AddDefinition(this->Args.front(), oldDef); return true; } if (status.GetBreakInvoked()) { // restore the variable to its prior value - mf.AddDefinition(this->Args[0], oldDef); + mf.AddDefinition(this->Args.front(), oldDef); return true; } if (status.GetContinueInvoked()) { @@ -102,11 +106,48 @@ bool cmForEachFunctionBlocker::Replay( } // restore the variable to its prior value - mf.AddDefinition(this->Args[0], oldDef); + mf.AddDefinition(this->Args.front(), oldDef); return true; } + +bool HandleInMode(std::vector const& args, cmMakefile& makefile) +{ + auto fb = cm::make_unique(&makefile); + fb->Args.push_back(args.front()); + + enum Doing + { + DoingNone, + DoingLists, + DoingItems + }; + Doing doing = DoingNone; + for (std::string const& arg : cmMakeRange(args).advance(2)) { + if (arg == "LISTS") { + doing = DoingLists; + } else if (arg == "ITEMS") { + doing = DoingItems; + } else if (doing == DoingLists) { + auto const& value = makefile.GetSafeDefinition(arg); + if (!value.empty()) { + cmExpandList(value, fb->Args, true); + } + } else if (doing == DoingItems) { + fb->Args.push_back(arg); + } else { + makefile.IssueMessage(MessageType::FATAL_ERROR, + cmStrCat("Unknown argument:\n", " ", arg, "\n")); + return true; + } + } + + makefile.AddFunctionBlocker(std::move(fb)); + + return true; } +} // anonymous namespace + bool cmForEachCommand(std::vector const& args, cmExecutionStatus& status) { @@ -126,16 +167,16 @@ bool cmForEachCommand(std::vector const& args, int stop = 0; int step = 0; if (args.size() == 3) { - stop = atoi(args[2].c_str()); + stop = std::stoi(args[2]); } if (args.size() == 4) { - start = atoi(args[2].c_str()); - stop = atoi(args[3].c_str()); + start = std::stoi(args[2]); + stop = std::stoi(args[3]); } if (args.size() == 5) { - start = atoi(args[2].c_str()); - stop = atoi(args[3].c_str()); - step = atoi(args[4].c_str()); + start = std::stoi(args[2]); + stop = std::stoi(args[3]); + step = std::stoi(args[4]); } if (step == 0) { if (start > stop) { @@ -151,21 +192,24 @@ bool cmForEachCommand(std::vector const& args, ", stop ", stop, ", step ", step)); return false; } - std::vector range; - char buffer[100]; - range.push_back(args[0]); - int cc; - for (cc = start;; cc += step) { - if ((step > 0 && cc > stop) || (step < 0 && cc < stop)) { - break; - } - sprintf(buffer, "%d", cc); - range.emplace_back(buffer); - if (cc == stop) { - break; - } - } - fb->Args = range; + + // Calculate expected iterations count and reserve enough space + // in the `fb->Args` vector. The first item is the iteration variable + // name... + const std::size_t iter_cnt = 2u + + int(start < stop) * (stop - start) / std::abs(step) + + int(start > stop) * (start - stop) / std::abs(step); + fb->Args.resize(iter_cnt); + fb->Args.front() = args.front(); + auto cc = start; + auto generator = [&cc, step]() -> std::string { + auto result = std::to_string(cc); + cc += step; + return result; + }; + // Fill the `range` vector w/ generated string values + // (starting from 2nd position) + std::generate(++fb->Args.begin(), fb->Args.end(), generator); } else { fb->Args = args; } @@ -176,42 +220,3 @@ bool cmForEachCommand(std::vector const& args, return true; } - -namespace { -bool HandleInMode(std::vector const& args, cmMakefile& makefile) -{ - auto fb = cm::make_unique(&makefile); - fb->Args.push_back(args[0]); - - enum Doing - { - DoingNone, - DoingLists, - DoingItems - }; - Doing doing = DoingNone; - for (unsigned int i = 2; i < args.size(); ++i) { - if (doing == DoingItems) { - fb->Args.push_back(args[i]); - } else if (args[i] == "LISTS") { - doing = DoingLists; - } else if (args[i] == "ITEMS") { - doing = DoingItems; - } else if (doing == DoingLists) { - const char* value = makefile.GetDefinition(args[i]); - if (value && *value) { - cmExpandList(value, fb->Args, true); - } - } else { - makefile.IssueMessage( - MessageType::FATAL_ERROR, - cmStrCat("Unknown argument:\n", " ", args[i], "\n")); - return true; - } - } - - makefile.AddFunctionBlocker(std::move(fb)); - - return true; -} -} diff --git a/Tests/RunCMake/foreach/RunCMakeTest.cmake b/Tests/RunCMake/foreach/RunCMakeTest.cmake index 4b74cfe4937..0f1fdd47d88 100644 --- a/Tests/RunCMake/foreach/RunCMakeTest.cmake +++ b/Tests/RunCMake/foreach/RunCMakeTest.cmake @@ -1,3 +1,4 @@ include(RunCMake) run_cmake(BadRangeInFunction) +run_cmake(foreach-all-test) diff --git a/Tests/RunCMake/foreach/foreach-all-test-stdout.txt b/Tests/RunCMake/foreach/foreach-all-test-stdout.txt new file mode 100644 index 00000000000..e8f622d6eef --- /dev/null +++ b/Tests/RunCMake/foreach/foreach-all-test-stdout.txt @@ -0,0 +1,44 @@ +-- foreach\(RANGE\): +-- \[0\.\.1\]/1 +-- < 0 +-- < 1 +-- \[1\.\.1\]/1 +-- < 1 +-- \[0\.\.10\]/2 +-- < 0 +-- < 2 +-- < 4 +-- < 6 +-- < 8 +-- < 10 +-- \[-10\.\.0\]/3 +-- < -10 +-- < -7 +-- < -4 +-- < -1 +-- \[0\.\.-10\]/-5 +-- < 0 +-- < -5 +-- < -10 +-- foreach\(IN ITEMS\): +-- < one +-- < two +-- < three +-- foreach\(IN LISTS\): +-- < satu +-- < dua +-- < tiga +-- foreach\(IN LISTS and ITEMS\): +-- < satu +-- < dua +-- < tiga +-- < one +-- < two +-- < three +-- foreach\(IN ITEMS and LISTS\): +-- < one +-- < two +-- < three +-- < satu +-- < dua +-- < tiga diff --git a/Tests/RunCMake/foreach/foreach-all-test.cmake b/Tests/RunCMake/foreach/foreach-all-test.cmake new file mode 100644 index 00000000000..2e377c80286 --- /dev/null +++ b/Tests/RunCMake/foreach/foreach-all-test.cmake @@ -0,0 +1,67 @@ +message(STATUS "foreach(RANGE):") +list(APPEND CMAKE_MESSAGE_INDENT " ") + +message(STATUS "[0..1]/1") +list(APPEND CMAKE_MESSAGE_INDENT " < ") +foreach(i RANGE 1) + message(STATUS ${i}) +endforeach() +list(POP_BACK CMAKE_MESSAGE_INDENT) + +message(STATUS "[1..1]/1") +list(APPEND CMAKE_MESSAGE_INDENT " < ") +foreach(i RANGE 1 1) + message(STATUS ${i}) +endforeach() +list(POP_BACK CMAKE_MESSAGE_INDENT) + +message(STATUS "[0..10]/2") +list(APPEND CMAKE_MESSAGE_INDENT " < ") +foreach(i RANGE 0 10 2) + message(STATUS ${i}) +endforeach() +list(POP_BACK CMAKE_MESSAGE_INDENT) + +message(STATUS "[-10..0]/3") +list(APPEND CMAKE_MESSAGE_INDENT " < ") +foreach(i RANGE -10 0 3) + message(STATUS ${i}) +endforeach() +list(POP_BACK CMAKE_MESSAGE_INDENT) + +message(STATUS "[0..-10]/-5") +list(APPEND CMAKE_MESSAGE_INDENT " < ") +foreach(i RANGE 0 -10 -5) + message(STATUS ${i}) +endforeach() +list(POP_BACK CMAKE_MESSAGE_INDENT) +list(POP_BACK CMAKE_MESSAGE_INDENT) + +message(STATUS "foreach(IN ITEMS):") +list(APPEND CMAKE_MESSAGE_INDENT " < ") +foreach(i IN ITEMS one two three) + message(STATUS ${i}) +endforeach() +list(POP_BACK CMAKE_MESSAGE_INDENT) + +message(STATUS "foreach(IN LISTS):") +list(APPEND CMAKE_MESSAGE_INDENT " < ") +list(APPEND count satu dua tiga) +foreach(i IN LISTS count) + message(STATUS ${i}) +endforeach() +list(POP_BACK CMAKE_MESSAGE_INDENT) + +message(STATUS "foreach(IN LISTS and ITEMS):") +list(APPEND CMAKE_MESSAGE_INDENT " < ") +foreach(i IN LISTS count ITEMS one two three) + message(STATUS ${i}) +endforeach() +list(POP_BACK CMAKE_MESSAGE_INDENT) + +message(STATUS "foreach(IN ITEMS and LISTS):") +list(APPEND CMAKE_MESSAGE_INDENT " < ") +foreach(i IN ITEMS one two three LISTS count) + message(STATUS ${i}) +endforeach() +list(POP_BACK CMAKE_MESSAGE_INDENT) diff --git a/Utilities/IWYU/mapping.imp b/Utilities/IWYU/mapping.imp index ef31e8befef..5e4c7ba5866 100644 --- a/Utilities/IWYU/mapping.imp +++ b/Utilities/IWYU/mapping.imp @@ -24,6 +24,7 @@ { include: [ "", private, "", public ] }, { include: [ "", private, "", public ] }, { include: [ "", private, "", public ] }, + { include: [ "", private, "", public ] }, { include: [ "", private, "", public ] }, { include: [ "", private, "", public ] }, { include: [ "", private, "", public ] }, From 12fd957ce3dc1d66a9161594679558fd8a73c284 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 6 Nov 2019 12:00:53 -0500 Subject: [PATCH 094/662] Help/dev: Add 'external-discussion' to the main workflow status list This was accidentally left out of commit 49f5b6f7bf (Help: Document the expire and external discussion resolve states, 2019-05-26, v3.15.0-rc1~35^2). --- Help/dev/review.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Help/dev/review.rst b/Help/dev/review.rst index cbde6feead5..36b9789ea05 100644 --- a/Help/dev/review.rst +++ b/Help/dev/review.rst @@ -53,6 +53,10 @@ in GitLab to track the state of a MR: to a period of inactivity. See the `Expire`_ step. Use this label after closing a MR for this reason. +* ``workflow:external-discussion`` indicates that the MR has been closed + pending discussion elsewhere. See the `External Discussion`_ step. + Use this label after closing a MR for this reason. + The workflow status labels are intended to be mutually exclusive, so please remove any existing workflow label when adding one. From 8f3cbe3c65e1c723319d8c63ef7f3e3c8ef5b59d Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Thu, 7 Nov 2019 00:01:07 -0500 Subject: [PATCH 095/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index c8e91089da7..bb56009e817 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191106) +set(CMake_VERSION_PATCH 20191107) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From aeae4182cb90cbf65b1c27cc877f62d2c7690aaf Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 4 Nov 2019 16:37:06 -0500 Subject: [PATCH 096/662] FindPostgreSQL: support version encoding used in pre-10 releases With the 10.x release, PostgreSQL upstream started encoding the version as `MMmmmm` where `M` is major and `m` is minor. Prior to that, `MMmmPP` was used where `P` was the patch number. Detect this difference and decode it based on the used encoding. Fixes: #19912 --- Modules/FindPostgreSQL.cmake | 21 ++++++++++++++++----- Tests/FindPostgreSQL/Test/main.c | 15 ++++++++++++--- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/Modules/FindPostgreSQL.cmake b/Modules/FindPostgreSQL.cmake index 4b5e60e21a9..1631c9c332b 100644 --- a/Modules/FindPostgreSQL.cmake +++ b/Modules/FindPostgreSQL.cmake @@ -184,11 +184,22 @@ if (PostgreSQL_INCLUDE_DIR) endif() endforeach() if (_PostgreSQL_VERSION_NUM) - math(EXPR _PostgreSQL_major_version "${_PostgreSQL_VERSION_NUM} / 10000") - math(EXPR _PostgreSQL_minor_version "${_PostgreSQL_VERSION_NUM} % 10000") - set(PostgreSQL_VERSION_STRING "${_PostgreSQL_major_version}.${_PostgreSQL_minor_version}") - unset(_PostgreSQL_major_version) - unset(_PostgreSQL_minor_version) + # 9.x and older encoding + if (_PostgreSQL_VERSION_NUM LESS 100000) + math(EXPR _PostgreSQL_major_version "${_PostgreSQL_VERSION_NUM} / 10000") + math(EXPR _PostgreSQL_minor_version "${_PostgreSQL_VERSION_NUM} % 10000 / 100") + math(EXPR _PostgreSQL_patch_version "${_PostgreSQL_VERSION_NUM} % 100") + set(PostgreSQL_VERSION_STRING "${_PostgreSQL_major_version}.${_PostgreSQL_minor_version}.${_PostgreSQL_patch_version}") + unset(_PostgreSQL_major_version) + unset(_PostgreSQL_minor_version) + unset(_PostgreSQL_patch_version) + else () + math(EXPR _PostgreSQL_major_version "${_PostgreSQL_VERSION_NUM} / 10000") + math(EXPR _PostgreSQL_minor_version "${_PostgreSQL_VERSION_NUM} % 10000") + set(PostgreSQL_VERSION_STRING "${_PostgreSQL_major_version}.${_PostgreSQL_minor_version}") + unset(_PostgreSQL_major_version) + unset(_PostgreSQL_minor_version) + endif () else () foreach(_PG_CONFIG_HEADER ${_PG_CONFIG_HEADERS}) if(EXISTS "${_PG_CONFIG_HEADER}") diff --git a/Tests/FindPostgreSQL/Test/main.c b/Tests/FindPostgreSQL/Test/main.c index 2cfeed0da2b..a63377a2562 100644 --- a/Tests/FindPostgreSQL/Test/main.c +++ b/Tests/FindPostgreSQL/Test/main.c @@ -5,10 +5,19 @@ int main() { int version = PQlibVersion(); - int major = version / 10000; - int minor = version % 10000; char version_string[100]; - snprintf(version_string, sizeof(version_string), "%d.%d", major, minor); + // 9.x and older encoding. + if (version < 100000) { + int major = version / 10000; + int minor = version % 10000 / 100; + int patch = version % 100; + snprintf(version_string, sizeof(version_string), "%d.%d.%d", major, minor, + patch); + } else { + int major = version / 10000; + int minor = version % 10000; + snprintf(version_string, sizeof(version_string), "%d.%d", major, minor); + } printf("Found PostgreSQL version %s, expected version %s\n", version_string, CMAKE_EXPECTED_POSTGRESQL_VERSION); return strcmp(version_string, CMAKE_EXPECTED_POSTGRESQL_VERSION); From 0faeb6a4282f476eb5873b7a1e6d60760a06c3bd Mon Sep 17 00:00:00 2001 From: Deniz Bahadir Date: Tue, 5 Nov 2019 17:27:24 +0100 Subject: [PATCH 097/662] FindBoost: Prevent warning due to new meta-component "ALL" of Boost 1.73 --- Modules/FindBoost.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index 078000f2288..af4947caee1 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -449,6 +449,9 @@ if (NOT Boost_NO_BOOST_CMAKE) # Convert component found variables to standard variables if required # Necessary for legacy boost-cmake and 1.70 builtin BoostConfig if(Boost_FIND_COMPONENTS) + # Ignore the meta-component "ALL", introduced by Boost 1.73 + list(REMOVE_ITEM Boost_FIND_COMPONENTS "ALL") + foreach(_comp IN LISTS Boost_FIND_COMPONENTS) if(DEFINED Boost_${_comp}_FOUND) continue() From 24d52daf49e8da92bf21eeb9f3687c84993ba2b6 Mon Sep 17 00:00:00 2001 From: Denis Thulin Date: Thu, 7 Nov 2019 15:39:52 +0100 Subject: [PATCH 098/662] FindOpenSSL: Lookup all pkg-config directories When using a custom sysroot to build things using pkg-config, some of the output variables feature the sysroot while others do not: ```console $ export PKG_CONFIG_SYSROOT_DIR=/path/to/sysroot $ export PKG_CONFIG_LIBDIR=/path/to/sysroot/usr/lib/pkgconfig $ pkg-config --cflags-only-I openssl -I/path/to/sysroot/usr/include/ $ pkg-config --variable=includedir openssl /usr/include $ pkg-config --libs-only-L openssl -L/path/to/sysroot/usr/lib $ pkg-config --variable=libdir openssl /usr/lib ``` When using `pkg_check_modules`, it's pretty much the same: ```cmake pkg_check_modules(_OPENSSL QUIET openssl) _OPENSSL_INCLUDE_DIRS == /path/to/sysroot/usr/include/ _OPENSSL_INCLUDEDIR == /usr/include _OPENSSL_LIBRARY_DIRS == -L/path/to/sysroot/usr/lib _OPENSSL_LIBDIR == /usr/lib ``` However, FindOpenSSL only searches for headers in `INCLUDEDIR` and libraries in `LIBDIR` instead of searching `INCLUDE_DIRS` and `LIBRARY_DIRS` as well. This fixes that behaviour. Fixes: #16885 Signed-off-by: Denis Thulin --- Modules/FindOpenSSL.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake index 33ceab75411..3688ae9dba3 100644 --- a/Modules/FindOpenSSL.cmake +++ b/Modules/FindOpenSSL.cmake @@ -131,6 +131,7 @@ find_path(OPENSSL_INCLUDE_DIR ${_OPENSSL_ROOT_HINTS_AND_PATHS} HINTS ${_OPENSSL_INCLUDEDIR} + ${_OPENSSL_INCLUDE_DIRS} PATH_SUFFIXES include ) @@ -319,6 +320,7 @@ else() ${_OPENSSL_ROOT_HINTS_AND_PATHS} HINTS ${_OPENSSL_LIBDIR} + ${_OPENSSL_LIBRARY_DIRS} PATH_SUFFIXES lib ) @@ -330,6 +332,7 @@ else() ${_OPENSSL_ROOT_HINTS_AND_PATHS} HINTS ${_OPENSSL_LIBDIR} + ${_OPENSSL_LIBRARY_DIRS} PATH_SUFFIXES lib ) From ed65b3e984ccce9b915a5a71e5a8d13b892b63d8 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 7 Nov 2019 11:21:03 -0500 Subject: [PATCH 099/662] CTest: Rename internal APIs for --repeat options Replace use of the term "rerun" with "repeat" to match the public names. --- Source/CTest/cmCTestMultiProcessHandler.cxx | 6 ++--- Source/CTest/cmCTestRunTest.cxx | 14 +++++----- Source/CTest/cmCTestRunTest.h | 6 ++--- Source/cmCTest.cxx | 30 ++++++++++----------- Source/cmCTest.h | 6 ++--- 5 files changed, 31 insertions(+), 31 deletions(-) diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 9ab3c2eff1e..992a2ef96dd 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -171,9 +171,9 @@ bool cmCTestMultiProcessHandler::StartTestProcess(int test) this->RunningCount += GetProcessorsUsed(test); cmCTestRunTest* testRun = new cmCTestRunTest(*this); - if (this->CTest->GetRerunMode() != cmCTest::Rerun::Never) { - testRun->SetRerunMode(this->CTest->GetRerunMode()); - testRun->SetNumberOfRuns(this->CTest->GetTestRepeat()); + if (this->CTest->GetRepeatMode() != cmCTest::Repeat::Never) { + testRun->SetRepeatMode(this->CTest->GetRepeatMode()); + testRun->SetNumberOfRuns(this->CTest->GetRepeatCount()); } testRun->SetIndex(test); testRun->SetTestProperties(this->Properties[test]); diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 317f0b4086d..cc5de43a9de 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -307,7 +307,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started) } // If the test does not need to rerun push the current TestResult onto the // TestHandler vector - if (!this->NeedsToRerun()) { + if (!this->NeedsToRepeat()) { this->TestHandler->TestResults.push_back(this->TestResult); } this->TestProcess.reset(); @@ -333,7 +333,7 @@ bool cmCTestRunTest::StartAgain(size_t completed) return true; } -bool cmCTestRunTest::NeedsToRerun() +bool cmCTestRunTest::NeedsToRepeat() { this->NumberOfRunsLeft--; if (this->NumberOfRunsLeft == 0) { @@ -342,11 +342,11 @@ bool cmCTestRunTest::NeedsToRerun() // if number of runs left is not 0, and we are running until // we find a failed (or passed) test, then return true so the test can be // restarted - if ((this->RerunMode == cmCTest::Rerun::UntilFail && + if ((this->RepeatMode == cmCTest::Repeat::UntilFail && this->TestResult.Status == cmCTestTestHandler::COMPLETED) || - (this->RerunMode == cmCTest::Rerun::UntilPass && + (this->RepeatMode == cmCTest::Repeat::UntilPass && this->TestResult.Status != cmCTestTestHandler::COMPLETED) || - (this->RerunMode == cmCTest::Rerun::AfterTimeout && + (this->RepeatMode == cmCTest::Repeat::AfterTimeout && this->TestResult.Status == cmCTestTestHandler::TIMEOUT)) { this->RunAgain = true; return true; @@ -748,8 +748,8 @@ void cmCTestRunTest::WriteLogOutputTop(size_t completed, size_t total) // got for run until pass. Trick is when this is called we don't // yet know if we are passing or failing. bool const progressOnLast = - (this->RerunMode != cmCTest::Rerun::UntilPass && - this->RerunMode != cmCTest::Rerun::AfterTimeout); + (this->RepeatMode != cmCTest::Repeat::UntilPass && + this->RepeatMode != cmCTest::Repeat::AfterTimeout); if ((progressOnLast && this->NumberOfRunsLeft == 1) || (!progressOnLast && this->NumberOfRunsLeft == this->NumberOfRunsTotal) || this->CTest->GetTestProgressOutput()) { diff --git a/Source/CTest/cmCTestRunTest.h b/Source/CTest/cmCTestRunTest.h index d5e83d9e4df..7eeaebd8dc5 100644 --- a/Source/CTest/cmCTestRunTest.h +++ b/Source/CTest/cmCTestRunTest.h @@ -35,7 +35,7 @@ class cmCTestRunTest this->NumberOfRunsTotal = n; } - void SetRerunMode(cmCTest::Rerun r) { this->RerunMode = r; } + void SetRepeatMode(cmCTest::Repeat r) { this->RepeatMode = r; } void SetTestProperties(cmCTestTestHandler::cmCTestTestProperties* prop) { this->TestProperties = prop; @@ -102,7 +102,7 @@ class cmCTestRunTest } private: - bool NeedsToRerun(); + bool NeedsToRepeat(); void DartProcessing(); void ExeNotFound(std::string exe); bool ForkProcess(cmDuration testTimeOut, bool explicitTimeout, @@ -136,7 +136,7 @@ class cmCTestRunTest std::vector>> AllocatedResources; - cmCTest::Rerun RerunMode = cmCTest::Rerun::Never; + cmCTest::Repeat RepeatMode = cmCTest::Repeat::Never; int NumberOfRunsLeft = 1; // default to 1 run of the test int NumberOfRunsTotal = 1; // default to 1 run of the test bool RunAgain = false; // default to not having to run again diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 34e9479ce8e..a49866ce984 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -83,8 +83,8 @@ struct cmCTest::Private std::string Name; }; - int RepeatTests = 1; // default to run each test once - cmCTest::Rerun RerunMode = cmCTest::Rerun::Never; + int RepeatCount = 1; // default to run each test once + cmCTest::Repeat RepeatMode = cmCTest::Repeat::Never; std::string ConfigType; std::string ScheduleType; std::chrono::system_clock::time_point StopTime; @@ -1845,7 +1845,7 @@ bool cmCTest::HandleCommandLineArguments(size_t& i, errormsg = "'--repeat-until-fail' requires an argument"; return false; } - if (this->Impl->RerunMode != cmCTest::Rerun::Never) { + if (this->Impl->RepeatMode != cmCTest::Repeat::Never) { errormsg = "At most one '--repeat-*' option may be used."; return false; } @@ -1856,9 +1856,9 @@ bool cmCTest::HandleCommandLineArguments(size_t& i, "'--repeat-until-fail' given non-integer value '" + args[i] + "'"; return false; } - this->Impl->RepeatTests = static_cast(repeat); + this->Impl->RepeatCount = static_cast(repeat); if (repeat > 1) { - this->Impl->RerunMode = cmCTest::Rerun::UntilFail; + this->Impl->RepeatMode = cmCTest::Repeat::UntilFail; } } @@ -1867,7 +1867,7 @@ bool cmCTest::HandleCommandLineArguments(size_t& i, errormsg = "'--repeat-until-pass' requires an argument"; return false; } - if (this->Impl->RerunMode != cmCTest::Rerun::Never) { + if (this->Impl->RepeatMode != cmCTest::Repeat::Never) { errormsg = "At most one '--repeat-*' option may be used."; return false; } @@ -1878,9 +1878,9 @@ bool cmCTest::HandleCommandLineArguments(size_t& i, "'--repeat-until-pass' given non-integer value '" + args[i] + "'"; return false; } - this->Impl->RepeatTests = static_cast(repeat); + this->Impl->RepeatCount = static_cast(repeat); if (repeat > 1) { - this->Impl->RerunMode = cmCTest::Rerun::UntilPass; + this->Impl->RepeatMode = cmCTest::Repeat::UntilPass; } } @@ -1889,7 +1889,7 @@ bool cmCTest::HandleCommandLineArguments(size_t& i, errormsg = "'--repeat-after-timeout' requires an argument"; return false; } - if (this->Impl->RerunMode != cmCTest::Rerun::Never) { + if (this->Impl->RepeatMode != cmCTest::Repeat::Never) { errormsg = "At most one '--repeat-*' option may be used."; return false; } @@ -1900,9 +1900,9 @@ bool cmCTest::HandleCommandLineArguments(size_t& i, "'--repeat-after-timeout' given non-integer value '" + args[i] + "'"; return false; } - this->Impl->RepeatTests = static_cast(repeat); + this->Impl->RepeatCount = static_cast(repeat); if (repeat > 1) { - this->Impl->RerunMode = cmCTest::Rerun::AfterTimeout; + this->Impl->RepeatMode = cmCTest::Repeat::AfterTimeout; } } @@ -2896,14 +2896,14 @@ const std::map& cmCTest::GetDefinitions() const return this->Impl->Definitions; } -int cmCTest::GetTestRepeat() const +int cmCTest::GetRepeatCount() const { - return this->Impl->RepeatTests; + return this->Impl->RepeatCount; } -cmCTest::Rerun cmCTest::GetRerunMode() const +cmCTest::Repeat cmCTest::GetRepeatMode() const { - return this->Impl->RerunMode; + return this->Impl->RepeatMode; } void cmCTest::SetBuildID(const std::string& id) diff --git a/Source/cmCTest.h b/Source/cmCTest.h index bef0f8d368b..e0ae1000b05 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -431,16 +431,16 @@ class cmCTest const std::map& GetDefinitions() const; /** Return the number of times a test should be run */ - int GetTestRepeat() const; + int GetRepeatCount() const; - enum class Rerun + enum class Repeat { Never, UntilFail, UntilPass, AfterTimeout, }; - Rerun GetRerunMode() const; + Repeat GetRepeatMode() const; void GenerateSubprojectsOutput(cmXMLWriter& xml); std::vector GetLabelsForSubprojects(); From 42d5d8f425e655a07d3dcb0802d90cb5c167b164 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 7 Nov 2019 11:10:06 -0500 Subject: [PATCH 100/662] cmCTestMultiProcessHandler: Hold repeat mode as a member --- Source/CTest/cmCTestMultiProcessHandler.cxx | 6 +++--- Source/CTest/cmCTestMultiProcessHandler.h | 10 +++++++++- Source/CTest/cmCTestTestHandler.cxx | 2 ++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 992a2ef96dd..04abf98195d 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -171,9 +171,9 @@ bool cmCTestMultiProcessHandler::StartTestProcess(int test) this->RunningCount += GetProcessorsUsed(test); cmCTestRunTest* testRun = new cmCTestRunTest(*this); - if (this->CTest->GetRepeatMode() != cmCTest::Repeat::Never) { - testRun->SetRepeatMode(this->CTest->GetRepeatMode()); - testRun->SetNumberOfRuns(this->CTest->GetRepeatCount()); + if (this->RepeatMode != cmCTest::Repeat::Never) { + testRun->SetRepeatMode(this->RepeatMode); + testRun->SetNumberOfRuns(this->RepeatCount); } testRun->SetIndex(test); testRun->SetTestProperties(this->Properties[test]); diff --git a/Source/CTest/cmCTestMultiProcessHandler.h b/Source/CTest/cmCTestMultiProcessHandler.h index 1db4bfdd1b2..483740138e5 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.h +++ b/Source/CTest/cmCTestMultiProcessHandler.h @@ -14,11 +14,11 @@ #include "cm_uv.h" +#include "cmCTest.h" #include "cmCTestResourceAllocator.h" #include "cmCTestTestHandler.h" #include "cmUVHandlePtr.h" -class cmCTest; struct cmCTestBinPackerAllocation; class cmCTestResourceSpec; class cmCTestRunTest; @@ -85,6 +85,12 @@ class cmCTestMultiProcessHandler cmCTestTestHandler* GetTestHandler() { return this->TestHandler; } + void SetRepeatMode(cmCTest::Repeat mode, int count) + { + this->RepeatMode = mode; + this->RepeatCount = count; + } + void SetQuiet(bool b) { this->Quiet = b; } void InitResourceAllocator(const cmCTestResourceSpec& spec) @@ -179,6 +185,8 @@ class cmCTestMultiProcessHandler cmCTestTestHandler* TestHandler; cmCTest* CTest; bool HasCycles; + cmCTest::Repeat RepeatMode = cmCTest::Repeat::Never; + int RepeatCount = 1; bool Quiet; bool SerialTestRunning; }; diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 8e3ac226392..9a060831b35 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -1231,6 +1231,8 @@ void cmCTestTestHandler::ProcessDirectory(std::vector& passed, parallel->SetCTest(this->CTest); parallel->SetParallelLevel(this->CTest->GetParallelLevel()); parallel->SetTestHandler(this); + parallel->SetRepeatMode(this->CTest->GetRepeatMode(), + this->CTest->GetRepeatCount()); parallel->SetQuiet(this->Quiet); if (this->TestLoad > 0) { parallel->SetTestLoad(this->TestLoad); From 28994115e83b568ccba546db26a55381cbad244d Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 7 Nov 2019 11:27:48 -0500 Subject: [PATCH 101/662] ctest_test: Add option to REPEAT tests --- Help/command/ctest_test.rst | 20 ++++++++++++ Help/release/dev/ctest-repeat-until-pass.rst | 3 ++ Source/CTest/cmCTestTestCommand.cxx | 4 +++ Source/CTest/cmCTestTestCommand.h | 1 + Source/CTest/cmCTestTestHandler.cxx | 32 +++++++++++++++++-- Source/CTest/cmCTestTestHandler.h | 4 ++- Tests/RunCMake/ctest_test/RunCMakeTest.cmake | 22 ++++++++++++- .../TestRepeatAfterTimeout-stdout.txt | 10 ++++++ .../ctest_test/TestRepeatAfterTimeout.cmake | 10 ++++++ .../ctest_test/TestRepeatBad1-result.txt | 1 + .../ctest_test/TestRepeatBad1-stderr.txt | 1 + .../ctest_test/TestRepeatBad2-result.txt | 1 + .../ctest_test/TestRepeatBad2-stderr.txt | 1 + .../ctest_test/TestRepeatUntilFail-stdout.txt | 13 ++++++++ .../ctest_test/TestRepeatUntilFail.cmake | 9 ++++++ .../ctest_test/TestRepeatUntilPass-stdout.txt | 10 ++++++ .../ctest_test/TestRepeatUntilPass.cmake | 9 ++++++ 17 files changed, 147 insertions(+), 4 deletions(-) create mode 100644 Tests/RunCMake/ctest_test/TestRepeatAfterTimeout-stdout.txt create mode 100644 Tests/RunCMake/ctest_test/TestRepeatAfterTimeout.cmake create mode 100644 Tests/RunCMake/ctest_test/TestRepeatBad1-result.txt create mode 100644 Tests/RunCMake/ctest_test/TestRepeatBad1-stderr.txt create mode 100644 Tests/RunCMake/ctest_test/TestRepeatBad2-result.txt create mode 100644 Tests/RunCMake/ctest_test/TestRepeatBad2-stderr.txt create mode 100644 Tests/RunCMake/ctest_test/TestRepeatUntilFail-stdout.txt create mode 100644 Tests/RunCMake/ctest_test/TestRepeatUntilFail.cmake create mode 100644 Tests/RunCMake/ctest_test/TestRepeatUntilPass-stdout.txt create mode 100644 Tests/RunCMake/ctest_test/TestRepeatUntilPass.cmake diff --git a/Help/command/ctest_test.rst b/Help/command/ctest_test.rst index 7a3393b4d4f..5c67b2c7068 100644 --- a/Help/command/ctest_test.rst +++ b/Help/command/ctest_test.rst @@ -23,6 +23,7 @@ Perform the :ref:`CTest Test Step` as a :ref:`Dashboard Client`. [STOP_TIME ] [RETURN_VALUE ] [CAPTURE_CMAKE_ERROR ] + [REPEAT :] [QUIET] ) @@ -95,6 +96,25 @@ The options are: and then the ``--test-load`` command-line argument to :manual:`ctest(1)`. See also the ``TestLoad`` setting in the :ref:`CTest Test Step`. +``REPEAT :`` + Run tests repeatedly based on the given ```` up to ```` times. + The modes are: + + ``UNTIL_FAIL`` + Require each test to run ```` times without failing in order to pass. + This is useful in finding sporadic failures in test cases. + + ``UNTIL_PASS`` + Allow each test to run up to ```` times in order to pass. + Repeats tests if they fail for any reason. + This is useful in tolerating sporadic failures in test cases. + + ``AFTER_TIMEOUT`` + Allow each test to run up to ```` times in order to pass. + Repeats tests only if they timeout. + This is useful in tolerating sporadic timeouts in test cases + on busy machines. + ``SCHEDULE_RANDOM `` Launch tests in a random order. This may be useful for detecting implicit test dependencies. diff --git a/Help/release/dev/ctest-repeat-until-pass.rst b/Help/release/dev/ctest-repeat-until-pass.rst index d1772471819..b5f6c26281b 100644 --- a/Help/release/dev/ctest-repeat-until-pass.rst +++ b/Help/release/dev/ctest-repeat-until-pass.rst @@ -4,3 +4,6 @@ ctest-repeat-until-pass * The :manual:`ctest(1)` tool learned new ``--repeat-until-pass `` and ``--repeat-after-timeout `` options to help tolerate sporadic test failures. + +* The :command:`ctest_test` command gained a ``REPEAT :`` option + to specify conditions in which to repeat tests. diff --git a/Source/CTest/cmCTestTestCommand.cxx b/Source/CTest/cmCTestTestCommand.cxx index 9784214053f..0f9b6958dfa 100644 --- a/Source/CTest/cmCTestTestCommand.cxx +++ b/Source/CTest/cmCTestTestCommand.cxx @@ -29,6 +29,7 @@ void cmCTestTestCommand::BindArguments() this->Bind("EXCLUDE_FIXTURE_SETUP"_s, this->ExcludeFixtureSetup); this->Bind("EXCLUDE_FIXTURE_CLEANUP"_s, this->ExcludeFixtureCleanup); this->Bind("PARALLEL_LEVEL"_s, this->ParallelLevel); + this->Bind("REPEAT"_s, this->Repeat); this->Bind("SCHEDULE_RANDOM"_s, this->ScheduleRandom); this->Bind("STOP_TIME"_s, this->StopTime); this->Bind("TEST_LOAD"_s, this->TestLoad); @@ -85,6 +86,9 @@ cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler() if (!this->ParallelLevel.empty()) { handler->SetOption("ParallelLevel", this->ParallelLevel.c_str()); } + if (!this->Repeat.empty()) { + handler->SetOption("Repeat", this->Repeat.c_str()); + } if (!this->ScheduleRandom.empty()) { handler->SetOption("ScheduleRandom", this->ScheduleRandom.c_str()); } diff --git a/Source/CTest/cmCTestTestCommand.h b/Source/CTest/cmCTestTestCommand.h index 4019694b2ed..2345afbcfeb 100644 --- a/Source/CTest/cmCTestTestCommand.h +++ b/Source/CTest/cmCTestTestCommand.h @@ -55,6 +55,7 @@ class cmCTestTestCommand : public cmCTestHandlerCommand std::string ExcludeFixtureSetup; std::string ExcludeFixtureCleanup; std::string ParallelLevel; + std::string Repeat; std::string ScheduleRandom; std::string StopTime; std::string TestLoad; diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 9a060831b35..37c71547cc4 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -471,6 +471,30 @@ bool cmCTestTestHandler::ProcessOptions() if (cmIsOn(this->GetOption("ScheduleRandom"))) { this->CTest->SetScheduleType("Random"); } + if (const char* repeat = this->GetOption("Repeat")) { + cmsys::RegularExpression repeatRegex( + "^(UNTIL_FAIL|UNTIL_PASS|AFTER_TIMEOUT):([0-9]+)$"); + if (repeatRegex.find(repeat)) { + std::string const& count = repeatRegex.match(2); + unsigned long n = 1; + cmStrToULong(count, &n); // regex guarantees success + this->RepeatCount = static_cast(n); + if (this->RepeatCount > 1) { + std::string const& mode = repeatRegex.match(1); + if (mode == "UNTIL_FAIL") { + this->RepeatMode = cmCTest::Repeat::UntilFail; + } else if (mode == "UNTIL_PASS") { + this->RepeatMode = cmCTest::Repeat::UntilPass; + } else if (mode == "AFTER_TIMEOUT") { + this->RepeatMode = cmCTest::Repeat::AfterTimeout; + } + } + } else { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Repeat option invalid value: " << repeat << std::endl); + return false; + } + } if (this->GetOption("ParallelLevel")) { this->CTest->SetParallelLevel(atoi(this->GetOption("ParallelLevel"))); } @@ -1231,8 +1255,12 @@ void cmCTestTestHandler::ProcessDirectory(std::vector& passed, parallel->SetCTest(this->CTest); parallel->SetParallelLevel(this->CTest->GetParallelLevel()); parallel->SetTestHandler(this); - parallel->SetRepeatMode(this->CTest->GetRepeatMode(), - this->CTest->GetRepeatCount()); + if (this->RepeatMode != cmCTest::Repeat::Never) { + parallel->SetRepeatMode(this->RepeatMode, this->RepeatCount); + } else { + parallel->SetRepeatMode(this->CTest->GetRepeatMode(), + this->CTest->GetRepeatCount()); + } parallel->SetQuiet(this->Quiet); if (this->TestLoad > 0) { parallel->SetTestLoad(this->TestLoad); diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h index eab75d0eb84..55237f9b3a2 100644 --- a/Source/CTest/cmCTestTestHandler.h +++ b/Source/CTest/cmCTestTestHandler.h @@ -18,12 +18,12 @@ #include "cmsys/RegularExpression.hxx" +#include "cmCTest.h" #include "cmCTestGenericHandler.h" #include "cmCTestResourceSpec.h" #include "cmDuration.h" #include "cmListFileCache.h" -class cmCTest; class cmMakefile; class cmXMLWriter; @@ -353,6 +353,8 @@ class cmCTestTestHandler : public cmCTestGenericHandler std::ostream* LogFile; + cmCTest::Repeat RepeatMode = cmCTest::Repeat::Never; + int RepeatCount = 1; bool RerunFailed; }; diff --git a/Tests/RunCMake/ctest_test/RunCMakeTest.cmake b/Tests/RunCMake/ctest_test/RunCMakeTest.cmake index 6877e6a87c0..84d1d666cbf 100644 --- a/Tests/RunCMake/ctest_test/RunCMakeTest.cmake +++ b/Tests/RunCMake/ctest_test/RunCMakeTest.cmake @@ -1,6 +1,9 @@ include(RunCTest) set(RunCMake_TEST_TIMEOUT 60) +unset(ENV{CTEST_PARALLEL_LEVEL}) +unset(ENV{CTEST_OUTPUT_ON_FAILURE}) + set(CASE_CTEST_TEST_ARGS "") set(CASE_CTEST_TEST_LOAD "") @@ -71,7 +74,24 @@ add_test(NAME PassingTest COMMAND ${CMAKE_COMMAND} -E echo PassingTestOutput) add_test(NAME FailingTest COMMAND ${CMAKE_COMMAND} -E no_such_command) ]]) - unset(ENV{CTEST_PARALLEL_LEVEL}) run_ctest(TestOutputSize) endfunction() run_TestOutputSize() + +run_ctest_test(TestRepeatBad1 REPEAT UNKNOWN:3) +run_ctest_test(TestRepeatBad2 REPEAT UNTIL_FAIL:-1) + +function(run_TestRepeat case) + set(CASE_CTEST_TEST_ARGS EXCLUDE RunCMakeVersion ${ARGN}) + string(CONCAT CASE_CMAKELISTS_SUFFIX_CODE [[ +add_test(NAME testRepeat + COMMAND ${CMAKE_COMMAND} -D COUNT_FILE=${CMAKE_CURRENT_BINARY_DIR}/count.cmake + -P "]] "${RunCMake_SOURCE_DIR}/TestRepeat${case}" [[.cmake") +set_property(TEST testRepeat PROPERTY TIMEOUT 5) + ]]) + + run_ctest(TestRepeat${case}) +endfunction() +run_TestRepeat(UntilFail REPEAT UNTIL_FAIL:3) +run_TestRepeat(UntilPass REPEAT UNTIL_PASS:3) +run_TestRepeat(AfterTimeout REPEAT AFTER_TIMEOUT:3) diff --git a/Tests/RunCMake/ctest_test/TestRepeatAfterTimeout-stdout.txt b/Tests/RunCMake/ctest_test/TestRepeatAfterTimeout-stdout.txt new file mode 100644 index 00000000000..17657c55090 --- /dev/null +++ b/Tests/RunCMake/ctest_test/TestRepeatAfterTimeout-stdout.txt @@ -0,0 +1,10 @@ +Test project [^ +]*/Tests/RunCMake/ctest_test/TestRepeatAfterTimeout-build + Start 1: testRepeat +1/1 Test #1: testRepeat .......................\*\*\*Timeout +[0-9.]+ sec + Start 1: testRepeat + Test #1: testRepeat ....................... Passed +[0-9.]+ sec ++ +100% tests passed, 0 tests failed out of 1 ++ +Total Test time \(real\) = +[0-9.]+ sec$ diff --git a/Tests/RunCMake/ctest_test/TestRepeatAfterTimeout.cmake b/Tests/RunCMake/ctest_test/TestRepeatAfterTimeout.cmake new file mode 100644 index 00000000000..abde4f01170 --- /dev/null +++ b/Tests/RunCMake/ctest_test/TestRepeatAfterTimeout.cmake @@ -0,0 +1,10 @@ +include("${COUNT_FILE}" OPTIONAL) +if(NOT COUNT) + set(COUNT 0) +endif() +math(EXPR COUNT "${COUNT} + 1") +file(WRITE "${COUNT_FILE}" "set(COUNT ${COUNT})\n") +if(NOT COUNT EQUAL 2) + message("this test times out except on the 2nd run") + execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 10) +endif() diff --git a/Tests/RunCMake/ctest_test/TestRepeatBad1-result.txt b/Tests/RunCMake/ctest_test/TestRepeatBad1-result.txt new file mode 100644 index 00000000000..b57e2deb77b --- /dev/null +++ b/Tests/RunCMake/ctest_test/TestRepeatBad1-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/ctest_test/TestRepeatBad1-stderr.txt b/Tests/RunCMake/ctest_test/TestRepeatBad1-stderr.txt new file mode 100644 index 00000000000..37cffbfe6ea --- /dev/null +++ b/Tests/RunCMake/ctest_test/TestRepeatBad1-stderr.txt @@ -0,0 +1 @@ +Repeat option invalid value: UNKNOWN:3 diff --git a/Tests/RunCMake/ctest_test/TestRepeatBad2-result.txt b/Tests/RunCMake/ctest_test/TestRepeatBad2-result.txt new file mode 100644 index 00000000000..b57e2deb77b --- /dev/null +++ b/Tests/RunCMake/ctest_test/TestRepeatBad2-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/ctest_test/TestRepeatBad2-stderr.txt b/Tests/RunCMake/ctest_test/TestRepeatBad2-stderr.txt new file mode 100644 index 00000000000..ca5cef754f1 --- /dev/null +++ b/Tests/RunCMake/ctest_test/TestRepeatBad2-stderr.txt @@ -0,0 +1 @@ +Repeat option invalid value: UNTIL_FAIL:-1 diff --git a/Tests/RunCMake/ctest_test/TestRepeatUntilFail-stdout.txt b/Tests/RunCMake/ctest_test/TestRepeatUntilFail-stdout.txt new file mode 100644 index 00000000000..5f91a67e4f0 --- /dev/null +++ b/Tests/RunCMake/ctest_test/TestRepeatUntilFail-stdout.txt @@ -0,0 +1,13 @@ +Test project [^ +]*/Tests/RunCMake/ctest_test/TestRepeatUntilFail-build + Start 1: testRepeat + Test #1: testRepeat ....................... Passed +[0-9.]+ sec + Start 1: testRepeat + Test #1: testRepeat .......................\*\*\*Failed +[0-9.]+ sec ++ +0% tests passed, 1 tests failed out of 1 ++ +Total Test time \(real\) = +[0-9.]+ sec ++ +The following tests FAILED: +[ ]+1 - testRepeat \(Failed\)$ diff --git a/Tests/RunCMake/ctest_test/TestRepeatUntilFail.cmake b/Tests/RunCMake/ctest_test/TestRepeatUntilFail.cmake new file mode 100644 index 00000000000..5eb0d8a9f0a --- /dev/null +++ b/Tests/RunCMake/ctest_test/TestRepeatUntilFail.cmake @@ -0,0 +1,9 @@ +include("${COUNT_FILE}" OPTIONAL) +if(NOT COUNT) + set(COUNT 0) +endif() +math(EXPR COUNT "${COUNT} + 1") +file(WRITE "${COUNT_FILE}" "set(COUNT ${COUNT})\n") +if(COUNT EQUAL 2) + message(FATAL_ERROR "this test fails on the 2nd run") +endif() diff --git a/Tests/RunCMake/ctest_test/TestRepeatUntilPass-stdout.txt b/Tests/RunCMake/ctest_test/TestRepeatUntilPass-stdout.txt new file mode 100644 index 00000000000..bc6939aa810 --- /dev/null +++ b/Tests/RunCMake/ctest_test/TestRepeatUntilPass-stdout.txt @@ -0,0 +1,10 @@ +Test project [^ +]*/Tests/RunCMake/ctest_test/TestRepeatUntilPass-build + Start 1: testRepeat +1/1 Test #1: testRepeat .......................\*\*\*Failed +[0-9.]+ sec + Start 1: testRepeat + Test #1: testRepeat ....................... Passed +[0-9.]+ sec ++ +100% tests passed, 0 tests failed out of 1 ++ +Total Test time \(real\) = +[0-9.]+ sec$ diff --git a/Tests/RunCMake/ctest_test/TestRepeatUntilPass.cmake b/Tests/RunCMake/ctest_test/TestRepeatUntilPass.cmake new file mode 100644 index 00000000000..06625221753 --- /dev/null +++ b/Tests/RunCMake/ctest_test/TestRepeatUntilPass.cmake @@ -0,0 +1,9 @@ +include("${COUNT_FILE}" OPTIONAL) +if(NOT COUNT) + set(COUNT 0) +endif() +math(EXPR COUNT "${COUNT} + 1") +file(WRITE "${COUNT_FILE}" "set(COUNT ${COUNT})\n") +if(NOT COUNT EQUAL 2) + message(FATAL_ERROR "this test passes only on the 2nd run") +endif() From db669b4d1a5fc7e3cfa3d76a9d35e11753e806e2 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Fri, 8 Nov 2019 00:01:09 -0500 Subject: [PATCH 102/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index bb56009e817..53a560b84a5 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191107) +set(CMake_VERSION_PATCH 20191108) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From e6069613a111ff30e9bb9a0e7294b2ea9da574c1 Mon Sep 17 00:00:00 2001 From: Sergey Larin Date: Tue, 5 Nov 2019 15:23:47 +0300 Subject: [PATCH 103/662] CPack: Set background image in macOS installer Now you can set a background image and it's parameters in productbuild and PackageMaker based installers. --- Help/cpack_gen/packagemaker.rst | 53 ++++++++++++++- Help/cpack_gen/productbuild.rst | 52 ++++++++++++++- Help/release/dev/cpack-pkg-background.rst | 8 +++ Source/CPack/cmCPackPKGGenerator.cxx | 66 ++++++++++++++++++- Source/CPack/cmCPackPKGGenerator.h | 8 ++- Source/CPack/cmCPackPackageMakerGenerator.cxx | 2 +- Source/CPack/cmCPackProductBuildGenerator.cxx | 2 +- 7 files changed, 185 insertions(+), 6 deletions(-) create mode 100644 Help/release/dev/cpack-pkg-background.rst diff --git a/Help/cpack_gen/packagemaker.rst b/Help/cpack_gen/packagemaker.rst index e9464b749a9..81acb9d57e0 100644 --- a/Help/cpack_gen/packagemaker.rst +++ b/Help/cpack_gen/packagemaker.rst @@ -15,9 +15,60 @@ macOS using PackageMaker: compatible with. Different versions of macOS support different features. For example, CPack can only build component-based installers for macOS 10.4 or newer, and can only build installers that download - component son-the-fly for macOS 10.5 or newer. If left blank, this value + components on-the-fly for macOS 10.5 or newer. If left blank, this value will be set to the minimum version of macOS that supports the requested features. Set this variable to some value (e.g., 10.4) only if you want to guarantee that your installer will work on that version of macOS, and don't mind missing extra features available in the installer shipping with later versions of macOS. + +.. variable:: CPACK_PACKAGEMAKER_BACKGROUND + + Adds a background to Distribtion XML if specified. The value contains the + path to image in ``Resources`` directory. + +.. variable:: CPACK_PACKAGEMAKER_BACKGROUND_ALIGNMENT + + Adds an ``alignment`` attribute to the background in Distribution XML. + Refer to Apple documentation for valid values. + +.. variable:: CPACK_PACKAGEMAKER_BACKGROUND_SCALING + + Adds a ``scaling`` attribute to the background in Distribution XML. + Refer to Apple documentation for valid values. + +.. variable:: CPACK_PACKAGEMAKER_BACKGROUND_MIME_TYPE + + Adds a ``mime-type`` attribute to the background in Distribution XML. + The option contains MIME type of an image. + +.. variable:: CPACK_PACKAGEMAKER_BACKGROUND_UTI + + Adds an ``uti`` attribute to the background in Distribution XML. + The option contains UTI type of an image. + +.. variable:: CPACK_PACKAGEMAKER_BACKGROUND_DARKAQUA + + Adds a background for the Dark Aqua theme to Distribution XML if + specified. The value contains the path to image in ``Resources`` + directory. + +.. variable:: CPACK_PACKAGEMAKER_BACKGROUND_DARKAQUA_ALIGNMENT + + Does the same as :variable:`CPACK_PACKAGEMAKER_BACKGROUND_ALIGNMENT` option, + but for the dark theme. + +.. variable:: CPACK_PACKAGEMAKER_BACKGROUND_DARKAQUA_SCALING + + Does the same as :variable:`CPACK_PACKAGEMAKER_BACKGROUND_SCALING` option, + but for the dark theme. + +.. variable:: CPACK_PACKAGEMAKER_BACKGROUND_DARKAQUA_MIME_TYPE + + Does the same as :variable:`CPACK_PACKAGEMAKER_BACKGROUND_MIME_TYPE` option, + but for the dark theme. + +.. variable:: CPACK_PACKAGEMAKER_BACKGROUND_DARKAQUA_UTI + + Does the same as :variable:`CPACK_PACKAGEMAKER_BACKGROUND_UTI` option, + but for the dark theme. diff --git a/Help/cpack_gen/productbuild.rst b/Help/cpack_gen/productbuild.rst index d22fcd48a52..82b79aeacfc 100644 --- a/Help/cpack_gen/productbuild.rst +++ b/Help/cpack_gen/productbuild.rst @@ -58,7 +58,6 @@ macOS using ProductBuild: component name. No ``postinstall`` script is added if this variable is not defined for a given component. - .. variable:: CPACK_PRODUCTBUILD_RESOURCES_DIR If specified the productbuild generator copies files from this directory @@ -66,3 +65,54 @@ macOS using ProductBuild: before the :variable:`CPACK_RESOURCE_FILE_WELCOME`, :variable:`CPACK_RESOURCE_FILE_README`, and :variable:`CPACK_RESOURCE_FILE_LICENSE` files are copied. + +.. variable:: CPACK_PRODUCTBUILD_BACKGROUND + + Adds a background to Distribtion XML if specified. The value contains the + path to image in ``Resources`` directory. + +.. variable:: CPACK_PRODUCTBUILD_BACKGROUND_ALIGNMENT + + Adds an ``alignment`` attribute to the background in Distribution XML. + Refer to Apple documentation for valid values. + +.. variable:: CPACK_PRODUCTBUILD_BACKGROUND_SCALING + + Adds a ``scaling`` attribute to the background in Distribution XML. + Refer to Apple documentation for valid values. + +.. variable:: CPACK_PRODUCTBUILD_BACKGROUND_MIME_TYPE + + Adds a ``mime-type`` attribute to the background in Distribution XML. + The option contains MIME type of an image. + +.. variable:: CPACK_PRODUCTBUILD_BACKGROUND_UTI + + Adds an ``uti`` attribute to the background in Distribution XML. + The option contains UTI type of an image. + +.. variable:: CPACK_PRODUCTBUILD_BACKGROUND_DARKAQUA + + Adds a background for the Dark Aqua theme to Distribution XML if + specified. The value contains the path to image in ``Resources`` + directory. + +.. variable:: CPACK_PRODUCTBUILD_BACKGROUND_DARKAQUA_ALIGNMENT + + Does the same as :variable:`CPACK_PRODUCTBUILD_BACKGROUND_ALIGNMENT` option, + but for the dark theme. + +.. variable:: CPACK_PRODUCTBUILD_BACKGROUND_DARKAQUA_SCALING + + Does the same as :variable:`CPACK_PRODUCTBUILD_BACKGROUND_SCALING` option, + but for the dark theme. + +.. variable:: CPACK_PRODUCTBUILD_BACKGROUND_DARKAQUA_MIME_TYPE + + Does the same as :variable:`CPACK_PRODUCTBUILD_BACKGROUND_MIME_TYPE` option, + but for the dark theme. + +.. variable:: CPACK_PRODUCTBUILD_BACKGROUND_DARKAQUA_UTI + + Does the same as :variable:`CPACK_PRODUCTBUILD_BACKGROUND_UTI` option, + but for the dark theme. diff --git a/Help/release/dev/cpack-pkg-background.rst b/Help/release/dev/cpack-pkg-background.rst new file mode 100644 index 00000000000..796f5d62ba6 --- /dev/null +++ b/Help/release/dev/cpack-pkg-background.rst @@ -0,0 +1,8 @@ +cpack-pkg-background +-------------------- + +* The :cpack_gen:`CPack productbuild Generator` and + :cpack_gen:`CPack PackageMaker Generator` gained options + :variable:`CPACK_PRODUCTBUILD_BACKGROUND` and + :variable:`CPACK_PACKAGEMAKER_BACKGROUND`, respectively, + to specify a background image for the macOS installer. diff --git a/Source/CPack/cmCPackPKGGenerator.cxx b/Source/CPack/cmCPackPKGGenerator.cxx index 3e1a51b83da..328aac38269 100644 --- a/Source/CPack/cmCPackPKGGenerator.cxx +++ b/Source/CPack/cmCPackPKGGenerator.cxx @@ -46,7 +46,66 @@ std::string cmCPackPKGGenerator::GetPackageName( return component.ArchiveFile + ".pkg"; } -void cmCPackPKGGenerator::WriteDistributionFile(const char* metapackageFile) +void cmCPackPKGGenerator::CreateBackground(const char* themeName, + const char* metapackageFile, + cm::string_view genName, + cmXMLWriter& xout) +{ + std::string paramSuffix = + (themeName == nullptr) ? "" : cmSystemTools::UpperCase(themeName); + std::string opt = (themeName == nullptr) + ? cmStrCat("CPACK_", genName, "_BACKGROUND") + : cmStrCat("CPACK_", genName, "_BACKGROUND_", paramSuffix); + const char* bgFileName = this->GetOption(opt); + if (bgFileName == nullptr) { + return; + } + + std::string bgFilePath = cmStrCat(metapackageFile, "/Contents/", bgFileName); + + if (!cmSystemTools::FileExists(bgFilePath)) { + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Background image doesn't exist in the resource directory: " + << bgFileName << std::endl); + return; + } + + if (themeName == nullptr) { + xout.StartElement("background"); + } else { + xout.StartElement(cmStrCat("background-", themeName)); + } + + xout.Attribute("file", bgFileName); + + const char* param = this->GetOption(cmStrCat(opt, "_ALIGNMENT")); + if (param != nullptr) { + xout.Attribute("alignment", param); + } + + param = this->GetOption(cmStrCat(opt, "_SCALING")); + if (param != nullptr) { + xout.Attribute("scaling", param); + } + + // Apple docs say that you must provide either mime-type or uti + // attribute for the background, but I've seen examples that + // doesn't have them, so don't make them mandatory. + param = this->GetOption(cmStrCat(opt, "_MIME_TYPE")); + if (param != nullptr) { + xout.Attribute("mime-type", param); + } + + param = this->GetOption(cmStrCat(opt, "_UTI")); + if (param != nullptr) { + xout.Attribute("uti", param); + } + + xout.EndElement(); +} + +void cmCPackPKGGenerator::WriteDistributionFile(const char* metapackageFile, + const char* genName) { std::string distributionTemplate = this->FindTemplate("Internal/CPack/CPack.distribution.dist.in"); @@ -102,6 +161,11 @@ void cmCPackPKGGenerator::WriteDistributionFile(const char* metapackageFile) CreateChoice(PostFlightComponent, xout); } + // default background + this->CreateBackground(nullptr, metapackageFile, genName, xout); + // Dark Aqua + this->CreateBackground("darkAqua", metapackageFile, genName, xout); + this->SetOption("CPACK_PACKAGEMAKER_CHOICES", choiceOut.str().c_str()); // Create the distribution.dist file in the metapackage to turn it diff --git a/Source/CPack/cmCPackPKGGenerator.h b/Source/CPack/cmCPackPKGGenerator.h index 69286ffde67..be730abddfd 100644 --- a/Source/CPack/cmCPackPKGGenerator.h +++ b/Source/CPack/cmCPackPKGGenerator.h @@ -9,6 +9,8 @@ #include #include +#include + #include "cmCPackComponentGroup.h" #include "cmCPackGenerator.h" @@ -57,7 +59,7 @@ class cmCPackPKGGenerator : public cmCPackGenerator // inter-component dependencies. metapackageFile is the name of the // metapackage for the distribution. Only valid for a // component-based install. - void WriteDistributionFile(const char* metapackageFile); + void WriteDistributionFile(const char* metapackageFile, const char* genName); // Subroutine of WriteDistributionFile that writes out the // dependency attributes for inter-component dependencies. @@ -85,6 +87,10 @@ class cmCPackPKGGenerator : public cmCPackGenerator /// installer GUI. void CreateChoice(const cmCPackComponent& component, cmXMLWriter& xout); + /// Creates a background in the distribution XML. + void CreateBackground(const char* themeName, const char* metapackageFile, + cm::string_view genName, cmXMLWriter& xout); + // The PostFlight component when creating a metapackage cmCPackComponent PostFlightComponent; }; diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx index c5ba726d507..12ea97b47fd 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.cxx +++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx @@ -279,7 +279,7 @@ int cmCPackPackageMakerGenerator::PackageFiles() } else { // We have built the package in place. Generate the // distribution.dist file to describe it for the installer. - WriteDistributionFile(packageDirFileName.c_str()); + WriteDistributionFile(packageDirFileName.c_str(), "PACKAGEMAKER"); } std::string tmpFile = cmStrCat(this->GetOption("CPACK_TOPLEVEL_DIRECTORY"), diff --git a/Source/CPack/cmCPackProductBuildGenerator.cxx b/Source/CPack/cmCPackProductBuildGenerator.cxx index dae268c5cea..a3e55de5c28 100644 --- a/Source/CPack/cmCPackProductBuildGenerator.cxx +++ b/Source/CPack/cmCPackProductBuildGenerator.cxx @@ -81,7 +81,7 @@ int cmCPackProductBuildGenerator::PackageFiles() } // combine package(s) into a distribution - WriteDistributionFile(packageDirFileName.c_str()); + WriteDistributionFile(packageDirFileName.c_str(), "PRODUCTBUILD"); std::ostringstream pkgCmd; std::string version = this->GetOption("CPACK_PACKAGE_VERSION"); From 4523e4b3262e81ed179321c154770b20899041c6 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Sat, 9 Nov 2019 00:01:07 -0500 Subject: [PATCH 104/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 53a560b84a5..13742747794 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191108) +set(CMake_VERSION_PATCH 20191109) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From a9c09599002baa27bdf4f98664829a92ba529240 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Sun, 10 Nov 2019 00:01:05 -0500 Subject: [PATCH 105/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 13742747794..1fc03671a47 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191109) +set(CMake_VERSION_PATCH 20191110) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From 64843b17375c6ffd8b46ddaa9272e3ad27b6adec Mon Sep 17 00:00:00 2001 From: Vitaly Stakhovsky Date: Sun, 10 Nov 2019 09:29:27 -0500 Subject: [PATCH 106/662] cmVisualStudio10TargetGenerator: use std::string for tag --- Source/cmLocalVisualStudio7Generator.cxx | 2 +- Source/cmLocalVisualStudio7Generator.h | 2 +- Source/cmVisualStudio10TargetGenerator.cxx | 34 +++++++++++----------- Source/cmVisualStudio10TargetGenerator.h | 2 +- Source/cmVisualStudioGeneratorOptions.cxx | 6 ++-- Source/cmVisualStudioGeneratorOptions.h | 3 +- 6 files changed, 25 insertions(+), 24 deletions(-) diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index fd346df6854..73fbf8f75e3 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -2053,7 +2053,7 @@ std::string cmLocalVisualStudio7Generator::ConvertToXMLOutputPathSingle( } void cmVS7GeneratorOptions::OutputFlag(std::ostream& fout, int indent, - const char* flag, + const std::string& flag, const std::string& content) { fout.fill('\t'); diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h index 671783fa532..22a5f9ab4bc 100644 --- a/Source/cmLocalVisualStudio7Generator.h +++ b/Source/cmLocalVisualStudio7Generator.h @@ -30,7 +30,7 @@ class cmVS7GeneratorOptions : public cmVisualStudioGeneratorOptions : cmVisualStudioGeneratorOptions(lg, tool, table, extraTable) { } - void OutputFlag(std::ostream& fout, int indent, const char* tag, + void OutputFlag(std::ostream& fout, int indent, const std::string& tag, const std::string& content) override; }; diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index dac86a182b9..a36afae8ba1 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -52,7 +52,7 @@ struct cmVisualStudio10TargetGenerator::Elem bool HasContent = false; std::string Tag; - Elem(std::ostream& s, const char* tag) + Elem(std::ostream& s, const std::string& tag) : S(s) , Indent(0) , Tag(tag) @@ -60,7 +60,7 @@ struct cmVisualStudio10TargetGenerator::Elem this->StartElement(); } Elem(const Elem&) = delete; - Elem(Elem& par, const char* tag) + Elem(Elem& par, const std::string& tag) : S(par.S) , Indent(par.Indent + 1) , Tag(tag) @@ -77,7 +77,7 @@ struct cmVisualStudio10TargetGenerator::Elem } std::ostream& WriteString(const char* line); void StartElement() { this->WriteString("<") << this->Tag; } - void Element(const char* tag, const std::string& val) + void Element(const std::string& tag, const std::string& val) { Elem(*this, tag).Content(val); } @@ -115,7 +115,7 @@ struct cmVisualStudio10TargetGenerator::Elem } } - void WritePlatformConfigTag(const char* tag, const std::string& cond, + void WritePlatformConfigTag(const std::string& tag, const std::string& cond, const std::string& content); }; @@ -131,8 +131,8 @@ class cmVS10GeneratorOptions : public cmVisualStudioGeneratorOptions { } - void OutputFlag(std::ostream& /*fout*/, int /*indent*/, const char* tag, - const std::string& content) override + void OutputFlag(std::ostream& /*fout*/, int /*indent*/, + const std::string& tag, const std::string& content) override { if (!this->GetConfiguration().empty()) { // if there are configuration specific flags, then @@ -274,7 +274,7 @@ std::string cmVisualStudio10TargetGenerator::CalcCondition( } void cmVisualStudio10TargetGenerator::Elem::WritePlatformConfigTag( - const char* tag, const std::string& cond, const std::string& content) + const std::string& tag, const std::string& cond, const std::string& content) { Elem(*this, tag).Attribute("Condition", cond).Content(content); } @@ -562,7 +562,7 @@ void cmVisualStudio10TargetGenerator::Generate() const char* value = this->GeneratorTarget->GetProperty(keyIt); if (!value) continue; - e1.Element(globalKey.c_str(), value); + e1.Element(globalKey, value); } if (this->Managed) { @@ -913,7 +913,7 @@ void cmVisualStudio10TargetGenerator::WriteDotNetReferenceCustomTags( } } for (auto const& tag : tags) { - e2.Element(tag.first.c_str(), tag.second); + e2.Element(tag.first, tag.second); } } @@ -1019,7 +1019,7 @@ void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup(Elem& e0) if (!tagName.empty()) { std::string value = props.GetPropertyValue(p); if (!value.empty()) { - e2.Element(tagName.c_str(), value); + e2.Element(tagName, value); } } } @@ -1751,7 +1751,7 @@ void cmVisualStudio10TargetGenerator::WriteGroupSources( std::string const& filter = sourceGroup->GetFullName(); std::string path = this->ConvertPath(source, s.RelativePath); ConvertToWindowsSlash(path); - Elem e2(e1, name.c_str()); + Elem e2(e1, name); e2.Attribute("Include", path); if (!filter.empty()) { e2.Element("Filter", filter); @@ -2637,9 +2637,9 @@ void cmVisualStudio10TargetGenerator::OutputLinkIncremental( // Some link options belong here. Use them now and remove them so that // WriteLinkOptions does not use them. - const char* flags[] = { "LinkDelaySign", "LinkKeyFile", 0 }; - for (const char** f = flags; *f; ++f) { - const char* flag = *f; + static const std::vector flags{ "LinkDelaySign", + "LinkKeyFile" }; + for (const std::string& flag : flags) { if (const char* value = linkOptions.GetFlag(flag)) { e1.WritePlatformConfigTag(flag, cond, value); linkOptions.RemoveFlag(flag); @@ -4040,8 +4040,8 @@ void cmVisualStudio10TargetGenerator::WriteEvents( } void cmVisualStudio10TargetGenerator::WriteEvent( - Elem& e1, const char* name, std::vector const& commands, - std::string const& configName) + Elem& e1, const std::string& name, + std::vector const& commands, std::string const& configName) { if (commands.empty()) { return; @@ -4860,7 +4860,7 @@ void cmVisualStudio10TargetGenerator::WriteCSharpSourceProperties( Elem& e2, const std::map& tags) { for (const auto& i : tags) { - e2.Element(i.first.c_str(), i.second); + e2.Element(i.first, i.second); } } diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h index 0835cde9f76..30027c9e721 100644 --- a/Source/cmVisualStudio10TargetGenerator.h +++ b/Source/cmVisualStudio10TargetGenerator.h @@ -165,7 +165,7 @@ class cmVisualStudio10TargetGenerator void WriteLibOptions(Elem& e1, std::string const& config); void WriteManifestOptions(Elem& e1, std::string const& config); void WriteEvents(Elem& e1, std::string const& configName); - void WriteEvent(Elem& e1, const char* name, + void WriteEvent(Elem& e1, std::string const& name, std::vector const& commands, std::string const& configName); void WriteGroupSources(Elem& e0, std::string const& name, diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx index 1139aa9745c..18c19b7d693 100644 --- a/Source/cmVisualStudioGeneratorOptions.cxx +++ b/Source/cmVisualStudioGeneratorOptions.cxx @@ -431,7 +431,7 @@ void cmVisualStudioGeneratorOptions::OutputPreprocessorDefinitions( if (this->Defines.empty()) { return; } - const char* tag = "PreprocessorDefinitions"; + std::string tag = "PreprocessorDefinitions"; if (lang == "CUDA") { tag = "Defines"; } @@ -473,7 +473,7 @@ void cmVisualStudioGeneratorOptions::OutputAdditionalIncludeDirectories( return; } - const char* tag = "AdditionalIncludeDirectories"; + std::string tag = "AdditionalIncludeDirectories"; if (lang == "CUDA") { tag = "Include"; } else if (lang == "ASM_MASM" || lang == "ASM_NASM") { @@ -528,6 +528,6 @@ void cmVisualStudioGeneratorOptions::OutputFlagMap(std::ostream& fout, sep = ";"; } - this->OutputFlag(fout, indent, m.first.c_str(), oss.str()); + this->OutputFlag(fout, indent, m.first, oss.str()); } } diff --git a/Source/cmVisualStudioGeneratorOptions.h b/Source/cmVisualStudioGeneratorOptions.h index 560593e0112..d8dcfe2d22c 100644 --- a/Source/cmVisualStudioGeneratorOptions.h +++ b/Source/cmVisualStudioGeneratorOptions.h @@ -86,7 +86,8 @@ class cmVisualStudioGeneratorOptions : public cmIDEOptions const std::string& GetConfiguration() const; protected: - virtual void OutputFlag(std::ostream& fout, int indent, const char* tag, + virtual void OutputFlag(std::ostream& fout, int indent, + const std::string& tag, const std::string& content) = 0; private: From eb306700d536849c4125d4a9b84e0bd40b4f2844 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Mon, 11 Nov 2019 00:01:08 -0500 Subject: [PATCH 107/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 1fc03671a47..8796e7900a3 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191110) +set(CMake_VERSION_PATCH 20191111) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From 101b5288ffa988b86fc1fe83f3ff65c9694b1484 Mon Sep 17 00:00:00 2001 From: Marc Chevrier Date: Thu, 7 Nov 2019 18:19:49 +0100 Subject: [PATCH 108/662] cmAlgorithm: Extend cmAppend capabilities --- Source/cmAlgorithms.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h index e0d27eedf98..e83f16078e2 100644 --- a/Source/cmAlgorithms.h +++ b/Source/cmAlgorithms.h @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -144,6 +145,13 @@ void cmDeleteAll(Range const& r) ContainerAlgorithms::DefaultDeleter()); } +template +void cmAppend(std::vector& v, std::vector> const& r) +{ + std::transform(r.begin(), r.end(), std::back_inserter(v), + [](const std::unique_ptr& item) { return item.get(); }); +} + template void cmAppend(std::vector& v, Range const& r) { From 75a5d1d4b17634e8ff3df6cdd3fce083aa23495c Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 6 Nov 2019 12:02:05 -0500 Subject: [PATCH 109/662] Help/dev: Document "Backport:" footer for MR descriptions --- Help/dev/maint.rst | 18 +++++++++++++++--- Help/dev/review.rst | 17 +++++++++++++++++ 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/Help/dev/maint.rst b/Help/dev/maint.rst index 44e22734774..a1c1a6fada0 100644 --- a/Help/dev/maint.rst +++ b/Help/dev/maint.rst @@ -14,6 +14,11 @@ Review a Merge Request The `CMake Review Process`_ requires a maintainer to issue the ``Do: merge`` command to integrate a merge request. Please check at least the following: +* If the MR source branch (or part of it) should be backported + to the ``release`` branch (and is already based on a commit + contained in the ``release`` branch), add a ``Backport: release`` or + ``Backport: release:`` trailing line to the MR description. + * If the MR source branch is not named well for the change it makes (e.g. it is just ``master`` or the patch changed during review), add a ``Topic-rename: `` trailing line to the MR description @@ -38,9 +43,10 @@ command to integrate a merge request. Please check at least the following: of various nightly builders.) * Ensure that the MR targets the ``master`` branch. A MR intended for - the ``release`` branch should be based on ``release`` but still merged - to ``master`` first (via ``Do: merge``). A maintainer may then merge - the MR topic to ``release`` manually. + the ``release`` branch should be based on ``release`` but still target + ``master``. Use the above-mentioned ``Backport: release`` line to tell + ``Do: merge`` to merge to both. If a MR is merged without the backport + line, a maintainer may still merge the MR topic to ``release`` manually. Maintain Current Release ======================== @@ -51,6 +57,12 @@ using a local branch named ``release-$ver``, where ``$ver`` is the version number of the current release in the form ``$major.$minor``. It is always merged into ``master`` before publishing. +To merge an open MR to the ``release`` branch, edit its description to +use the ``Backport: release`` line mentioned above and then ``Do: merge`` +normally. To update the ``release`` branch manually (e.g. to merge a +``$topic`` branch that was merged without the backport line), use the +following procedure. + Before merging a ``$topic`` branch into ``release``, verify that the ``$topic`` branch has already been merged to ``master`` via the usual ``Do: merge`` process. Then, to merge the ``$topic`` branch into diff --git a/Help/dev/review.rst b/Help/dev/review.rst index 36b9789ea05..8ec41d29c6e 100644 --- a/Help/dev/review.rst +++ b/Help/dev/review.rst @@ -433,6 +433,21 @@ Additionally, ``Do: merge`` extracts configuration from trailing lines in the MR description (the following have no effect if used in a MR comment instead): +* ``Backport: release[:]``: merge the topic branch into + the ``release`` branch to backport the change. This is allowed + only if the topic branch is based on a commit in ``release`` already. + If only part of the topic branch should be backported, specify it as + ``:``. The ```` may use `git rev-parse`_ + syntax to reference commits relative to the topic ``HEAD``. + See additional `backport instructions`_ for details. + For example: + + ``Backport: release`` + Merge the topic branch head into both ``release`` and ``master``. + ``Backport: release:HEAD~1^2`` + Merge the topic branch head's parent's second parent commit into + the ``release`` branch. Merge the topic branch head to ``master``. + * ``Topic-rename: ``: substitute ```` for the name of the MR topic branch in the constructed merge commit message. It is also used in merge commits constructed by ``Do: stage``. @@ -440,6 +455,8 @@ comment instead): rename set in the MR description. .. _`CMake GitLab Project Masters`: https://gitlab.kitware.com/cmake/cmake/settings/members +.. _`backport instructions`: https://gitlab.kitware.com/utils/git-workflow/wikis/Backport-topics +.. _`git rev-parse`: https://git-scm.com/docs/git-rev-parse Close ----- From f93385283fc86639c0a13b920c66c3a8f42276bb Mon Sep 17 00:00:00 2001 From: Marc Chevrier Date: Thu, 7 Nov 2019 18:52:06 +0100 Subject: [PATCH 110/662] cmLocalGenerator: modernize memory management --- Source/cmComputeTargetDepends.cxx | 9 ++-- Source/cmExtraCodeBlocksGenerator.cxx | 20 +++---- Source/cmExtraCodeLiteGenerator.cxx | 11 ++-- Source/cmExtraEclipseCDT4Generator.cxx | 25 ++++----- Source/cmExtraKateGenerator.cxx | 6 +-- Source/cmExtraSublimeTextGenerator.cxx | 9 ++-- Source/cmGlobalCommonGenerator.cxx | 5 +- Source/cmGlobalGenerator.cxx | 36 +++++++------ Source/cmGlobalUnixMakefileGenerator3.cxx | 44 +++++++-------- Source/cmGlobalVisualStudio8Generator.cxx | 12 +++-- Source/cmGlobalVisualStudioGenerator.cxx | 13 ++--- Source/cmGlobalXCodeGenerator.cxx | 38 ++++++------- Source/cmGraphVizWriter.cxx | 4 +- Source/cmLocalGenerator.cxx | 66 +++++++++++------------ Source/cmLocalGenerator.h | 13 +++-- Source/cmLocalGhsMultiGenerator.cxx | 6 ++- Source/cmLocalNinjaGenerator.cxx | 4 +- Source/cmLocalUnixMakefileGenerator3.cxx | 35 ++++++------ Source/cmLocalVisualStudio10Generator.cxx | 6 ++- Source/cmLocalVisualStudio7Generator.cxx | 14 ++--- Source/cmLocalXCodeGenerator.cxx | 4 +- Source/cmQtAutoGenGlobalInitializer.cxx | 11 ++-- Source/cmQtAutoGenInitializer.cxx | 4 +- 23 files changed, 205 insertions(+), 190 deletions(-) diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx index 162bab29871..c22cf4ac7b7 100644 --- a/Source/cmComputeTargetDepends.cxx +++ b/Source/cmComputeTargetDepends.cxx @@ -4,6 +4,7 @@ #include #include +#include #include #include @@ -160,12 +161,10 @@ void cmComputeTargetDepends::CollectTargets() std::vector const& lgens = this->GlobalGenerator->GetLocalGenerators(); for (cmLocalGenerator* lgen : lgens) { - const std::vector& targets = - lgen->GetGeneratorTargets(); - for (cmGeneratorTarget const* ti : targets) { + for (const auto& ti : lgen->GetGeneratorTargets()) { int index = static_cast(this->Targets.size()); - this->TargetIndex[ti] = index; - this->Targets.push_back(ti); + this->TargetIndex[ti.get()] = index; + this->Targets.push_back(ti.get()); } } } diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index 5a5d959104f..d1da2d783d3 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -3,6 +3,7 @@ #include "cmExtraCodeBlocksGenerator.h" #include +#include #include #include #include @@ -283,8 +284,8 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile( // add all executable and library targets and some of the GLOBAL // and UTILITY targets for (cmLocalGenerator* lg : lgs) { - const std::vector& targets = lg->GetGeneratorTargets(); - for (cmGeneratorTarget* target : targets) { + const auto& targets = lg->GetGeneratorTargets(); + for (const auto& target : targets) { std::string targetName = target->GetName(); switch (target->GetType()) { case cmStateEnums::GLOBAL_TARGET: { @@ -315,7 +316,7 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile( case cmStateEnums::SHARED_LIBRARY: case cmStateEnums::MODULE_LIBRARY: case cmStateEnums::OBJECT_LIBRARY: { - cmGeneratorTarget* gt = target; + cmGeneratorTarget* gt = target.get(); this->AppendTarget(xml, targetName, gt, make, lg, compiler, makeArgs); std::string fastTarget = cmStrCat(targetName, "/fast"); @@ -341,8 +342,8 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile( for (cmLocalGenerator* lg : lgs) { cmMakefile* makefile = lg->GetMakefile(); - const std::vector& targets = lg->GetGeneratorTargets(); - for (cmGeneratorTarget* target : targets) { + const auto& targets = lg->GetGeneratorTargets(); + for (const auto& target : targets) { switch (target->GetType()) { case cmStateEnums::EXECUTABLE: case cmStateEnums::STATIC_LIBRARY: @@ -352,13 +353,12 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile( case cmStateEnums::UTILITY: // can have sources since 2.6.3 { std::vector sources; - cmGeneratorTarget* gt = target; - gt->GetSourceFiles(sources, - makefile->GetSafeDefinition("CMAKE_BUILD_TYPE")); + target->GetSourceFiles( + sources, makefile->GetSafeDefinition("CMAKE_BUILD_TYPE")); for (cmSourceFile* s : sources) { // don't add source files from UTILITY target which have the // GENERATED property set: - if (gt->GetType() == cmStateEnums::UTILITY && + if (target->GetType() == cmStateEnums::UTILITY && s->GetIsGenerated()) { continue; } @@ -391,7 +391,7 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile( } CbpUnit& cbpUnit = allFiles[fullPath]; - cbpUnit.Targets.push_back(target); + cbpUnit.Targets.push_back(target.get()); } } default: // intended fallthrough diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx index c7b74570f72..269e8dde29e 100644 --- a/Source/cmExtraCodeLiteGenerator.cxx +++ b/Source/cmExtraCodeLiteGenerator.cxx @@ -4,6 +4,7 @@ #include #include +#include #include #include #include @@ -119,7 +120,7 @@ std::vector cmExtraCodeLiteGenerator::CreateProjectsByTarget( const std::vector& lgs = this->GlobalGenerator->GetLocalGenerators(); for (cmLocalGenerator* lg : lgs) { - for (cmGeneratorTarget* lt : lg->GetGeneratorTargets()) { + for (const auto& lt : lg->GetGeneratorTargets()) { cmStateEnums::TargetType type = lt->GetType(); std::string const& outputDir = lg->GetCurrentBinaryDirectory(); std::string targetName = lt->GetName(); @@ -142,7 +143,7 @@ std::vector cmExtraCodeLiteGenerator::CreateProjectsByTarget( xml->Attribute("Active", "No"); xml->EndElement(); - CreateNewProjectFile(lt, filename); + CreateNewProjectFile(lt.get(), filename); break; default: break; @@ -269,9 +270,9 @@ void cmExtraCodeLiteGenerator::CreateNewProjectFile( for (cmLocalGenerator* lg : lgs) { cmMakefile* makefile = lg->GetMakefile(); - const std::vector& targets = lg->GetGeneratorTargets(); - for (cmGeneratorTarget* target : targets) { - projectType = CollectSourceFiles(makefile, target, cFiles, otherFiles); + for (const auto& target : lg->GetGeneratorTargets()) { + projectType = + CollectSourceFiles(makefile, target.get(), cFiles, otherFiles); } } diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index b286acf0c8d..cf7937572ef 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -6,6 +6,7 @@ #include #include #include +#include #include #include @@ -496,9 +497,9 @@ void cmExtraEclipseCDT4Generator::CreateLinksForTargets(cmXMLWriter& xml) for (cmLocalGenerator* lg : this->GlobalGenerator->GetLocalGenerators()) { cmMakefile* makefile = lg->GetMakefile(); - const std::vector& targets = lg->GetGeneratorTargets(); + const auto& targets = lg->GetGeneratorTargets(); - for (cmGeneratorTarget* target : targets) { + for (const auto& target : targets) { std::string linkName2 = cmStrCat(linkName, '/'); switch (target->GetType()) { case cmStateEnums::EXECUTABLE: @@ -519,10 +520,9 @@ void cmExtraEclipseCDT4Generator::CreateLinksForTargets(cmXMLWriter& xml) std::vector sourceGroups = makefile->GetSourceGroups(); // get the files from the source lists then add them to the groups - cmGeneratorTarget* gt = const_cast(target); std::vector files; - gt->GetSourceFiles(files, - makefile->GetSafeDefinition("CMAKE_BUILD_TYPE")); + target->GetSourceFiles( + files, makefile->GetSafeDefinition("CMAKE_BUILD_TYPE")); for (cmSourceFile* sf : files) { // Add the file to the list of sources. std::string const& source = sf->ResolveFullPath(); @@ -860,15 +860,14 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const // include dirs emmited.clear(); for (cmLocalGenerator* lgen : this->GlobalGenerator->GetLocalGenerators()) { - const std::vector& targets = - lgen->GetGeneratorTargets(); - for (cmGeneratorTarget* target : targets) { + const auto& targets = lgen->GetGeneratorTargets(); + for (const auto& target : targets) { if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } std::vector includeDirs; std::string config = mf->GetSafeDefinition("CMAKE_BUILD_TYPE"); - lgen->GetIncludeDirectories(includeDirs, target, "C", config); + lgen->GetIncludeDirectories(includeDirs, target.get(), "C", config); this->AppendIncludeDirectories(xml, includeDirs, emmited); } } @@ -916,15 +915,14 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const // add all executable and library targets and some of the GLOBAL // and UTILITY targets for (cmLocalGenerator* lgen : this->GlobalGenerator->GetLocalGenerators()) { - const std::vector& targets = - lgen->GetGeneratorTargets(); + const auto& targets = lgen->GetGeneratorTargets(); std::string subdir = lgen->MaybeConvertToRelativePath( this->HomeOutputDirectory, lgen->GetCurrentBinaryDirectory()); if (subdir == ".") { subdir.clear(); } - for (cmGeneratorTarget* target : targets) { + for (const auto& target : targets) { std::string targetName = target->GetName(); switch (target->GetType()) { case cmStateEnums::GLOBAL_TARGET: { @@ -975,8 +973,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const std::string cleanArgs = cmStrCat("-E chdir \"", lgen->GetCurrentBinaryDirectory(), "\" \"", cmSystemTools::GetCMakeCommand(), "\" -P \""); - cmGeneratorTarget* gt = target; - cleanArgs += lgen->GetTargetDirectory(gt); + cleanArgs += lgen->GetTargetDirectory(target.get()); cleanArgs += "/cmake_clean.cmake\""; cmExtraEclipseCDT4Generator::AppendTarget( xml, "Clean", cmSystemTools::GetCMakeCommand(), cleanArgs, diff --git a/Source/cmExtraKateGenerator.cxx b/Source/cmExtraKateGenerator.cxx index e8c9dd00202..bbbc281bbe9 100644 --- a/Source/cmExtraKateGenerator.cxx +++ b/Source/cmExtraKateGenerator.cxx @@ -3,6 +3,7 @@ #include "cmExtraKateGenerator.h" #include +#include #include #include #include @@ -111,12 +112,11 @@ void cmExtraKateGenerator::WriteTargets(const cmLocalGenerator* lg, // and UTILITY targets for (cmLocalGenerator* localGen : this->GlobalGenerator->GetLocalGenerators()) { - const std::vector& targets = - localGen->GetGeneratorTargets(); + const auto& targets = localGen->GetGeneratorTargets(); std::string currentDir = localGen->GetCurrentBinaryDirectory(); bool topLevel = (currentDir == localGen->GetBinaryDirectory()); - for (cmGeneratorTarget* target : targets) { + for (const auto& target : targets) { std::string const& targetName = target->GetName(); switch (target->GetType()) { case cmStateEnums::GLOBAL_TARGET: { diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx index 495324cbf39..603fea38da2 100644 --- a/Source/cmExtraSublimeTextGenerator.cxx +++ b/Source/cmExtraSublimeTextGenerator.cxx @@ -3,6 +3,7 @@ #include "cmExtraSublimeTextGenerator.h" #include +#include #include #include #include @@ -182,8 +183,8 @@ void cmExtraSublimeTextGenerator::AppendAllTargets( // and UTILITY targets for (cmLocalGenerator* lg : lgs) { cmMakefile* makefile = lg->GetMakefile(); - const std::vector& targets = lg->GetGeneratorTargets(); - for (cmGeneratorTarget* target : targets) { + const auto& targets = lg->GetGeneratorTargets(); + for (const auto& target : targets) { std::string targetName = target->GetName(); switch (target->GetType()) { case cmStateEnums::GLOBAL_TARGET: { @@ -216,11 +217,11 @@ void cmExtraSublimeTextGenerator::AppendAllTargets( case cmStateEnums::SHARED_LIBRARY: case cmStateEnums::MODULE_LIBRARY: case cmStateEnums::OBJECT_LIBRARY: { - this->AppendTarget(fout, targetName, lg, target, make.c_str(), + this->AppendTarget(fout, targetName, lg, target.get(), make.c_str(), makefile, compiler.c_str(), sourceFileFlags, false); std::string fastTarget = cmStrCat(targetName, "/fast"); - this->AppendTarget(fout, fastTarget, lg, target, make.c_str(), + this->AppendTarget(fout, fastTarget, lg, target.get(), make.c_str(), makefile, compiler.c_str(), sourceFileFlags, false); } break; diff --git a/Source/cmGlobalCommonGenerator.cxx b/Source/cmGlobalCommonGenerator.cxx index 9fa4467b2a8..d6c0a87298d 100644 --- a/Source/cmGlobalCommonGenerator.cxx +++ b/Source/cmGlobalCommonGenerator.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGlobalCommonGenerator.h" +#include #include #include "cmGeneratorTarget.h" @@ -32,7 +33,7 @@ cmGlobalCommonGenerator::ComputeDirectoryTargets() const // The directory-level rule should depend on the target-level rules // for all targets in the directory. - for (auto gt : lg->GetGeneratorTargets()) { + for (const auto& gt : lg->GetGeneratorTargets()) { cmStateEnums::TargetType const type = gt->GetType(); if (type != cmStateEnums::EXECUTABLE && type != cmStateEnums::STATIC_LIBRARY && @@ -43,7 +44,7 @@ cmGlobalCommonGenerator::ComputeDirectoryTargets() const continue; } DirectoryTarget::Target t; - t.GT = gt; + t.GT = gt.get(); if (const char* exclude = gt->GetProperty("EXCLUDE_FROM_ALL")) { if (cmIsOn(exclude)) { // This target has been explicitly excluded. diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 2efafc64bad..d903289e4b4 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -10,6 +10,9 @@ #include #include #include +#include + +#include #include "cmsys/Directory.hxx" #include "cmsys/FStream.hxx" @@ -296,7 +299,7 @@ bool cmGlobalGenerator::CheckTargetsForMissingSources() const { bool failed = false; for (cmLocalGenerator* localGen : this->LocalGenerators) { - for (cmGeneratorTarget* target : localGen->GetGeneratorTargets()) { + for (const auto& target : localGen->GetGeneratorTargets()) { if (target->GetType() == cmStateEnums::TargetType::GLOBAL_TARGET || target->GetType() == cmStateEnums::TargetType::INTERFACE_LIBRARY || target->GetType() == cmStateEnums::TargetType::UTILITY || @@ -336,7 +339,7 @@ bool cmGlobalGenerator::CheckTargetsForType() const } bool failed = false; for (cmLocalGenerator* generator : this->LocalGenerators) { - for (cmGeneratorTarget* target : generator->GetGeneratorTargets()) { + for (const auto& target : generator->GetGeneratorTargets()) { if (target->GetType() == cmStateEnums::EXECUTABLE && target->GetPropertyAsBool("WIN32_EXECUTABLE")) { std::vector const& configs = @@ -364,7 +367,7 @@ bool cmGlobalGenerator::CheckTargetsForPchCompilePdb() const } bool failed = false; for (cmLocalGenerator* generator : this->LocalGenerators) { - for (cmGeneratorTarget* target : generator->GetGeneratorTargets()) { + for (const auto& target : generator->GetGeneratorTargets()) { if (target->GetType() == cmStateEnums::TargetType::GLOBAL_TARGET || target->GetType() == cmStateEnums::TargetType::INTERFACE_LIBRARY || target->GetType() == cmStateEnums::TargetType::UTILITY || @@ -1557,12 +1560,12 @@ bool cmGlobalGenerator::AddAutomaticSources() { for (cmLocalGenerator* lg : this->LocalGenerators) { lg->CreateEvaluationFileOutputs(); - for (cmGeneratorTarget* gt : lg->GetGeneratorTargets()) { + for (const auto& gt : lg->GetGeneratorTargets()) { if (gt->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } - lg->AddUnityBuild(gt); - lg->AddPchDependencies(gt); + lg->AddUnityBuild(gt.get()); + lg->AddPchDependencies(gt.get()); } } return true; @@ -1650,8 +1653,7 @@ void cmGlobalGenerator::CreateGeneratorTargets( if (targetTypes == AllTargets) { for (auto& target : mf->GetTargets()) { cmTarget* t = &target.second; - cmGeneratorTarget* gt = new cmGeneratorTarget(t, lg); - lg->AddGeneratorTarget(gt); + lg->AddGeneratorTarget(cm::make_unique(t, lg)); } } @@ -1667,9 +1669,9 @@ void cmGlobalGenerator::CreateGeneratorTargets(TargetTypes targetTypes) cmMakefile* mf = this->Makefiles[i]; for (cmTarget* ownedImpTgt : mf->GetOwnedImportedTargets()) { cmLocalGenerator* lg = this->LocalGenerators[i]; - cmGeneratorTarget* gt = new cmGeneratorTarget(ownedImpTgt, lg); - lg->AddOwnedImportedGeneratorTarget(gt); - importedMap[ownedImpTgt] = gt; + auto gt = cm::make_unique(ownedImpTgt, lg); + importedMap[ownedImpTgt] = gt.get(); + lg->AddOwnedImportedGeneratorTarget(std::move(gt)); } } @@ -2766,15 +2768,15 @@ void cmGlobalGenerator::GetTargetSets(TargetDependSet& projectTargets, continue; } // loop over all the generator targets in the makefile - for (cmGeneratorTarget* target : generator->GetGeneratorTargets()) { - if (this->IsRootOnlyTarget(target) && + for (const auto& target : generator->GetGeneratorTargets()) { + if (this->IsRootOnlyTarget(target.get()) && target->GetLocalGenerator() != root) { continue; } // put the target in the set of original targets - originalTargets.insert(target); + originalTargets.insert(target.get()); // Get the set of targets that depend on target - this->AddTargetDepends(target, projectTargets); + this->AddTargetDepends(target.get(), projectTargets); } } } @@ -2951,11 +2953,11 @@ void cmGlobalGenerator::WriteSummary() cmGeneratedFileStream fout(fname); for (cmLocalGenerator* lg : this->LocalGenerators) { - for (cmGeneratorTarget* tgt : lg->GetGeneratorTargets()) { + for (const auto& tgt : lg->GetGeneratorTargets()) { if (tgt->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } - this->WriteSummary(tgt); + this->WriteSummary(tgt.get()); fout << tgt->GetSupportDirectory() << "\n"; } } diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 4c2d69f0910..dfc495edf90 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -374,16 +374,15 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefileLanguageRules( for (cmLocalGenerator* lGenerator : lGenerators) { lg = static_cast(lGenerator); // for all of out targets - for (cmGeneratorTarget* tgt : lg->GetGeneratorTargets()) { + for (const auto& tgt : lg->GetGeneratorTargets()) { if ((tgt->GetType() == cmStateEnums::EXECUTABLE) || (tgt->GetType() == cmStateEnums::STATIC_LIBRARY) || (tgt->GetType() == cmStateEnums::SHARED_LIBRARY) || (tgt->GetType() == cmStateEnums::MODULE_LIBRARY) || (tgt->GetType() == cmStateEnums::OBJECT_LIBRARY) || (tgt->GetType() == cmStateEnums::UTILITY)) { - cmGeneratorTarget* gt = tgt; - std::string tname = - cmStrCat(lg->GetRelativeTargetDirectory(gt), "/DependInfo.cmake"); + std::string tname = cmStrCat(lg->GetRelativeTargetDirectory(tgt.get()), + "/DependInfo.cmake"); cmSystemTools::ConvertToUnixSlashes(tname); cmakefileStream << " \"" << tname << "\"\n"; } @@ -549,7 +548,7 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules( cmLocalUnixMakefileGenerator3* lg = static_cast(localGen); // for each target Generate the rule files for each target. - for (cmGeneratorTarget* gtarget : lg->GetGeneratorTargets()) { + for (const auto& gtarget : lg->GetGeneratorTargets()) { // Don't emit the same rule twice (e.g. two targets with the same // simple name) int type = gtarget->GetType(); @@ -580,7 +579,7 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules( depends, commands, true); // Add a fast rule to build the target - std::string localName = lg->GetRelativeTargetDirectory(gtarget); + std::string localName = lg->GetRelativeTargetDirectory(gtarget.get()); std::string makefileName; makefileName = cmStrCat(localName, "/build.make"); depends.clear(); @@ -595,8 +594,8 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules( // Add a local name for the rule to relink the target before // installation. if (gtarget->NeedRelinkBeforeInstall(lg->GetConfigName())) { - makeTargetName = - cmStrCat(lg->GetRelativeTargetDirectory(gtarget), "/preinstall"); + makeTargetName = cmStrCat( + lg->GetRelativeTargetDirectory(gtarget.get()), "/preinstall"); localName = cmStrCat(name, "/preinstall"); depends.clear(); commands.clear(); @@ -625,7 +624,7 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2( } // for each target Generate the rule files for each target. - for (cmGeneratorTarget* gtarget : lg->GetGeneratorTargets()) { + for (const auto& gtarget : lg->GetGeneratorTargets()) { int type = gtarget->GetType(); std::string name = gtarget->GetName(); if (!name.empty() && @@ -637,7 +636,7 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2( (type == cmStateEnums::UTILITY))) { std::string makefileName; // Add a rule to build the target by name. - localName = lg->GetRelativeTargetDirectory(gtarget); + localName = lg->GetRelativeTargetDirectory(gtarget.get()); makefileName = cmStrCat(localName, "/build.make"); lg->WriteDivider(ruleFileStream); @@ -661,7 +660,7 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2( { std::ostringstream progressArg; const char* sep = ""; - for (unsigned long progFile : this->ProgressMap[gtarget].Marks) { + for (unsigned long progFile : this->ProgressMap[gtarget.get()].Marks) { progressArg << sep << progFile; sep = ","; } @@ -680,7 +679,7 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2( cmLocalUnixMakefileGenerator3::EchoNormal, &progress); } - this->AppendGlobalTargetDepends(depends, gtarget); + this->AppendGlobalTargetDepends(depends, gtarget.get()); lg->WriteMakeRule(ruleFileStream, "All Build rule for target.", localName, depends, commands, true); @@ -697,7 +696,8 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2( cmOutputConverter::SHELL); // std::set emitted; - progCmd << " " << this->CountProgressMarksInTarget(gtarget, emitted); + progCmd << " " + << this->CountProgressMarksInTarget(gtarget.get(), emitted); commands.push_back(progCmd.str()); } std::string tmp = "CMakeFiles/Makefile2"; @@ -715,7 +715,8 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2( if (regenerate) { depends.emplace_back("cmake_check_build_system"); } - localName = cmStrCat(lg->GetRelativeTargetDirectory(gtarget), "/rule"); + localName = + cmStrCat(lg->GetRelativeTargetDirectory(gtarget.get()), "/rule"); lg->WriteMakeRule(ruleFileStream, "Build rule for subdir invocation for target.", localName, depends, commands, true); @@ -729,8 +730,8 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2( // Add rules to prepare the target for installation. if (gtarget->NeedRelinkBeforeInstall(lg->GetConfigName())) { - localName = - cmStrCat(lg->GetRelativeTargetDirectory(gtarget), "/preinstall"); + localName = cmStrCat(lg->GetRelativeTargetDirectory(gtarget.get()), + "/preinstall"); depends.clear(); commands.clear(); commands.push_back(lg->GetRecursiveMakeCall(makefileName, localName)); @@ -740,7 +741,7 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2( } // add the clean rule - localName = lg->GetRelativeTargetDirectory(gtarget); + localName = lg->GetRelativeTargetDirectory(gtarget.get()); makeTargetName = cmStrCat(localName, "/clean"); depends.clear(); commands.clear(); @@ -760,7 +761,7 @@ void cmGlobalUnixMakefileGenerator3::InitializeProgressMarks() this->DirectoryTargetsMap.clear(); // Loop over all targets in all local generators. for (cmLocalGenerator* lg : this->LocalGenerators) { - for (cmGeneratorTarget* gt : lg->GetGeneratorTargets()) { + for (const auto& gt : lg->GetGeneratorTargets()) { cmLocalGenerator* tlg = gt->GetLocalGenerator(); if (gt->GetType() == cmStateEnums::INTERFACE_LIBRARY || @@ -778,12 +779,13 @@ void cmGlobalUnixMakefileGenerator3::InitializeProgressMarks() // This local generator includes the target. std::set& targetSet = this->DirectoryTargetsMap[csnp]; - targetSet.insert(gt); + targetSet.insert(gt.get()); // Add dependencies of the included target. An excluded // target may still be included if it is a dependency of a // non-excluded target. - for (cmTargetDepend const& tgtdep : this->GetTargetDirectDepends(gt)) { + for (cmTargetDepend const& tgtdep : + this->GetTargetDirectDepends(gt.get())) { targetSet.insert(tgtdep); } } @@ -894,7 +896,7 @@ void cmGlobalUnixMakefileGenerator3::WriteHelpRule( // the targets if (lg2 == lg || lg->IsRootMakefile()) { // for each target Generate the rule files for each target. - for (cmGeneratorTarget* target : lg2->GetGeneratorTargets()) { + for (const auto& target : lg2->GetGeneratorTargets()) { cmStateEnums::TargetType type = target->GetType(); if ((type == cmStateEnums::EXECUTABLE) || (type == cmStateEnums::STATIC_LIBRARY) || diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 8e6125b8a2d..d39d42a0db9 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -2,6 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGlobalVisualStudio8Generator.h" +#include + #include "cmCustomCommand.h" #include "cmCustomCommandLines.h" #include "cmDocumentationEntry.h" @@ -109,8 +111,9 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget() CMAKE_CHECK_BUILD_SYSTEM_TARGET, cmCommandOrigin::Generator, false, no_working_directory, no_byproducts, no_depends, no_commands); - cmGeneratorTarget* gt = new cmGeneratorTarget(tgt, lg); - lg->AddGeneratorTarget(gt); + auto ptr = cm::make_unique(tgt, lg); + auto gt = ptr.get(); + lg->AddGeneratorTarget(std::move(ptr)); // Organize in the "predefined targets" folder: // @@ -203,10 +206,9 @@ void cmGlobalVisualStudio8Generator::AddExtraIDETargets() cmGlobalVisualStudio7Generator::AddExtraIDETargets(); if (this->AddCheckTarget()) { for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i) { - const std::vector& tgts = - this->LocalGenerators[i]->GetGeneratorTargets(); + const auto& tgts = this->LocalGenerators[i]->GetGeneratorTargets(); // All targets depend on the build-system check target. - for (cmGeneratorTarget const* ti : tgts) { + for (const auto& ti : tgts) { if (ti->GetName() != CMAKE_CHECK_BUILD_SYSTEM_TARGET) { ti->Target->AddUtility(CMAKE_CHECK_BUILD_SYSTEM_TARGET); } diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index 54124070d79..218199420e4 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -7,6 +7,7 @@ #include #include +#include #include @@ -200,8 +201,8 @@ void cmGlobalVisualStudioGenerator::AddExtraIDETargets() "ALL_BUILD", cmCommandOrigin::Generator, true, no_working_dir, no_byproducts, no_depends, no_commands, false, "Build all projects"); - cmGeneratorTarget* gt = new cmGeneratorTarget(allBuild, gen[0]); - gen[0]->AddGeneratorTarget(gt); + gen[0]->AddGeneratorTarget( + cm::make_unique(allBuild, gen[0])); // // Organize in the "predefined targets" folder: @@ -212,12 +213,12 @@ void cmGlobalVisualStudioGenerator::AddExtraIDETargets() // Now make all targets depend on the ALL_BUILD target for (cmLocalGenerator const* i : gen) { - for (cmGeneratorTarget* tgt : i->GetGeneratorTargets()) { + for (const auto& tgt : i->GetGeneratorTargets()) { if (tgt->GetType() == cmStateEnums::GLOBAL_TARGET || tgt->IsImported()) { continue; } - if (!this->IsExcluded(gen[0], tgt)) { + if (!this->IsExcluded(gen[0], tgt.get())) { allBuild->AddUtility(tgt->GetName()); } } @@ -389,8 +390,8 @@ bool cmGlobalVisualStudioGenerator::ComputeTargetDepends() } for (auto const& it : this->ProjectMap) { for (const cmLocalGenerator* i : it.second) { - for (cmGeneratorTarget* ti : i->GetGeneratorTargets()) { - this->ComputeVSTargetDepends(ti); + for (const auto& ti : i->GetGeneratorTargets()) { + this->ComputeVSTargetDepends(ti.get()); } } } diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 998ffa6918a..7a0ab380b87 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGlobalXCodeGenerator.h" +#include #include #include #include @@ -412,10 +413,10 @@ void cmGlobalXCodeGenerator::ComputeTargetOrder() { size_t index = 0; auto const& lgens = this->GetLocalGenerators(); - for (cmLocalGenerator* lgen : lgens) { - auto const& targets = lgen->GetGeneratorTargets(); - for (cmGeneratorTarget const* gt : targets) { - this->ComputeTargetOrder(gt, index); + for (auto const& lgen : lgens) { + const auto& targets = lgen->GetGeneratorTargets(); + for (const auto& gt : targets) { + this->ComputeTargetOrder(gt.get(), index); } } assert(index == this->TargetOrderIndex.size()); @@ -511,8 +512,7 @@ void cmGlobalXCodeGenerator::AddExtraTargets( no_byproducts, no_depends, cmMakeSingleCommandLine({ "echo", "Build all projects" })); - cmGeneratorTarget* allBuildGt = new cmGeneratorTarget(allbuild, root); - root->AddGeneratorTarget(allBuildGt); + root->AddGeneratorTarget(cm::make_unique(allbuild, root)); // Add XCODE depend helper std::string dir = root->GetCurrentBinaryDirectory(); @@ -536,14 +536,13 @@ void cmGlobalXCodeGenerator::AddExtraTargets( no_working_directory, no_byproducts, no_depends, cmMakeSingleCommandLine({ "make", "-f", file })); - cmGeneratorTarget* checkGt = new cmGeneratorTarget(check, root); - root->AddGeneratorTarget(checkGt); + root->AddGeneratorTarget(cm::make_unique(check, root)); } // now make the allbuild depend on all the non-utility targets // in the project for (auto& gen : gens) { - for (auto target : gen->GetGeneratorTargets()) { + for (const auto& target : gen->GetGeneratorTargets()) { if (target->GetType() == cmStateEnums::GLOBAL_TARGET) { continue; } @@ -567,7 +566,7 @@ void cmGlobalXCodeGenerator::AddExtraTargets( cmObjectLibraryCommands::Accept); } - if (!this->IsExcluded(gens[0], target)) { + if (!this->IsExcluded(gens[0], target.get())) { allbuild->AddUtility(target->GetName()); } } @@ -1092,8 +1091,8 @@ bool cmGlobalXCodeGenerator::CreateXCodeTargets( cmLocalGenerator* gen, std::vector& targets) { this->SetCurrentLocalGenerator(gen); - std::vector gts = - this->CurrentLocalGenerator->GetGeneratorTargets(); + std::vector gts; + cmAppend(gts, this->CurrentLocalGenerator->GetGeneratorTargets()); std::sort(gts.begin(), gts.end(), [this](cmGeneratorTarget const* l, cmGeneratorTarget const* r) { return this->TargetOrderIndex[l] < this->TargetOrderIndex[r]; @@ -1363,9 +1362,9 @@ void cmGlobalXCodeGenerator::ForceLinkerLanguages() { for (auto localGenerator : this->LocalGenerators) { // All targets depend on the build-system check target. - for (auto tgt : localGenerator->GetGeneratorTargets()) { + for (const auto& tgt : localGenerator->GetGeneratorTargets()) { // This makes sure all targets link using the proper language. - this->ForceLinkerLanguage(tgt); + this->ForceLinkerLanguage(tgt.get()); } } } @@ -2822,7 +2821,7 @@ bool cmGlobalXCodeGenerator::CreateGroups( for (auto& generator : generators) { cmMakefile* mf = generator->GetMakefile(); std::vector sourceGroups = mf->GetSourceGroups(); - for (auto gtgt : generator->GetGeneratorTargets()) { + for (const auto& gtgt : generator->GetGeneratorTargets()) { // Same skipping logic here as in CreateXCodeTargets so that we do not // end up with (empty anyhow) ZERO_CHECK, install, or test source // groups: @@ -2837,11 +2836,12 @@ bool cmGlobalXCodeGenerator::CreateGroups( continue; } - auto addSourceToGroup = [this, mf, gtgt, + auto addSourceToGroup = [this, mf, >gt, &sourceGroups](std::string const& source) { cmSourceGroup* sourceGroup = mf->FindSourceGroup(source, sourceGroups); - cmXCodeObject* pbxgroup = this->CreateOrGetPBXGroup(gtgt, sourceGroup); - std::string key = GetGroupMapKeyFromPath(gtgt, source); + cmXCodeObject* pbxgroup = + this->CreateOrGetPBXGroup(gtgt.get(), sourceGroup); + std::string key = GetGroupMapKeyFromPath(gtgt.get(), source); this->GroupMap[key] = pbxgroup; }; @@ -2867,7 +2867,7 @@ bool cmGlobalXCodeGenerator::CreateGroups( // Add the Info.plist we are about to generate for an App Bundle. if (gtgt->GetPropertyAsBool("MACOSX_BUNDLE")) { - std::string plist = this->ComputeInfoPListLocation(gtgt); + std::string plist = this->ComputeInfoPListLocation(gtgt.get()); cmSourceFile* sf = gtgt->Makefile->GetOrCreateSource( plist, true, cmSourceFileLocationKind::Known); addSourceToGroup(sf->ResolveFullPath()); diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx index 7759c5f9d33..9c1a924b25e 100644 --- a/Source/cmGraphVizWriter.cxx +++ b/Source/cmGraphVizWriter.cxx @@ -278,12 +278,12 @@ void cmGraphVizWriter::Write() sortedGeneratorTargets; for (cmLocalGenerator const* lg : gg->GetLocalGenerators()) { - for (cmGeneratorTarget const* gt : lg->GetGeneratorTargets()) { + for (const auto& gt : lg->GetGeneratorTargets()) { // Reserved targets have inconsistent names across platforms (e.g. 'all' // vs. 'ALL_BUILD'), which can disrupt the traversal ordering. // We don't need or want them anyway. if (!cmGlobalGenerator::IsReservedTarget(gt->GetName())) { - sortedGeneratorTargets.insert(gt); + sortedGeneratorTargets.insert(gt.get()); } } } diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 4b9b0159f20..50c42af9cfe 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2,6 +2,20 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmLocalGenerator.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + #include "cmsys/RegularExpression.hxx" #include "cmAlgorithms.h" @@ -40,20 +54,6 @@ # include "cmCryptoHash.h" #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - #if defined(__HAIKU__) # include # include @@ -181,11 +181,7 @@ cmRulePlaceholderExpander* cmLocalGenerator::CreateRulePlaceholderExpander() this->LinkerSysroot); } -cmLocalGenerator::~cmLocalGenerator() -{ - cmDeleteAll(this->GeneratorTargets); - cmDeleteAll(this->OwnedImportedGeneratorTargets); -} +cmLocalGenerator::~cmLocalGenerator() = default; void cmLocalGenerator::IssueMessage(MessageType t, std::string const& text) const @@ -263,8 +259,8 @@ static void MoveSystemIncludesToEnd(std::vector>& includeDirs, void cmLocalGenerator::TraceDependencies() { // Generate the rule files for each target. - const std::vector& targets = this->GetGeneratorTargets(); - for (cmGeneratorTarget* target : targets) { + const auto& targets = this->GetGeneratorTargets(); + for (const auto& target : targets) { if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } @@ -635,11 +631,14 @@ void cmLocalGenerator::GenerateInstallRules() } } -void cmLocalGenerator::AddGeneratorTarget(cmGeneratorTarget* gt) +void cmLocalGenerator::AddGeneratorTarget( + std::unique_ptr gt) { - this->GeneratorTargets.push_back(gt); - this->GeneratorTargetSearchIndex.emplace(gt->GetName(), gt); - this->GlobalGenerator->IndexGeneratorTarget(gt); + cmGeneratorTarget* gt_ptr = gt.get(); + + this->GeneratorTargets.push_back(std::move(gt)); + this->GeneratorTargetSearchIndex.emplace(gt_ptr->GetName(), gt_ptr); + this->GlobalGenerator->IndexGeneratorTarget(gt_ptr); } void cmLocalGenerator::AddImportedGeneratorTarget(cmGeneratorTarget* gt) @@ -648,9 +647,10 @@ void cmLocalGenerator::AddImportedGeneratorTarget(cmGeneratorTarget* gt) this->GlobalGenerator->IndexGeneratorTarget(gt); } -void cmLocalGenerator::AddOwnedImportedGeneratorTarget(cmGeneratorTarget* gt) +void cmLocalGenerator::AddOwnedImportedGeneratorTarget( + std::unique_ptr gt) { - this->OwnedImportedGeneratorTargets.push_back(gt); + this->OwnedImportedGeneratorTargets.push_back(std::move(gt)); } cmGeneratorTarget* cmLocalGenerator::FindLocalNonAliasGeneratorTarget( @@ -673,8 +673,8 @@ void cmLocalGenerator::ComputeTargetManifest() } // Add our targets to the manifest for each configuration. - const std::vector& targets = this->GetGeneratorTargets(); - for (cmGeneratorTarget* target : targets) { + const auto& targets = this->GetGeneratorTargets(); + for (const auto& target : targets) { if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } @@ -694,8 +694,8 @@ bool cmLocalGenerator::ComputeTargetCompileFeatures() } // Process compile features of all targets. - const std::vector& targets = this->GetGeneratorTargets(); - for (cmGeneratorTarget* target : targets) { + const auto& targets = this->GetGeneratorTargets(); + for (const auto& target : targets) { for (std::string const& c : configNames) { if (!target->ComputeCompileFeatures(c)) { return false; @@ -2842,8 +2842,8 @@ void cmLocalGenerator::GenerateTargetInstallRules( { // Convert the old-style install specification from each target to // an install generator and run it. - const std::vector& tgts = this->GetGeneratorTargets(); - for (cmGeneratorTarget* l : tgts) { + const auto& tgts = this->GetGeneratorTargets(); + for (const auto& l : tgts) { if (l->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 12359dbddda..e5c89f9b867 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -143,14 +144,16 @@ class cmLocalGenerator : public cmOutputConverter bool forResponseFile = false, const std::string& config = ""); - const std::vector& GetGeneratorTargets() const + using GeneratorTargetVector = + std::vector>; + const GeneratorTargetVector& GetGeneratorTargets() const { return this->GeneratorTargets; } - void AddGeneratorTarget(cmGeneratorTarget* gt); + void AddGeneratorTarget(std::unique_ptr gt); void AddImportedGeneratorTarget(cmGeneratorTarget* gt); - void AddOwnedImportedGeneratorTarget(cmGeneratorTarget* gt); + void AddOwnedImportedGeneratorTarget(std::unique_ptr gt); cmGeneratorTarget* FindLocalNonAliasGeneratorTarget( const std::string& name) const; @@ -461,11 +464,11 @@ class cmLocalGenerator : public cmOutputConverter using GeneratorTargetMap = std::unordered_map; GeneratorTargetMap GeneratorTargetSearchIndex; - std::vector GeneratorTargets; + GeneratorTargetVector GeneratorTargets; std::set WarnCMP0063; GeneratorTargetMap ImportedGeneratorTargets; - std::vector OwnedImportedGeneratorTargets; + GeneratorTargetVector OwnedImportedGeneratorTargets; std::map AliasTargets; std::map Compilers; diff --git a/Source/cmLocalGhsMultiGenerator.cxx b/Source/cmLocalGhsMultiGenerator.cxx index 4b10798e1f6..29c169f132a 100644 --- a/Source/cmLocalGhsMultiGenerator.cxx +++ b/Source/cmLocalGhsMultiGenerator.cxx @@ -5,6 +5,7 @@ #include #include +#include "cmAlgorithms.h" #include "cmGeneratorTarget.h" #include "cmGhsMultiTargetGenerator.h" #include "cmGlobalGenerator.h" @@ -50,10 +51,11 @@ void cmLocalGhsMultiGenerator::GenerateTargetsDepthFirst( void cmLocalGhsMultiGenerator::Generate() { - std::vector remaining = this->GetGeneratorTargets(); + std::vector remaining; + cmAppend(remaining, this->GetGeneratorTargets()); for (auto& t : remaining) { if (t) { - GenerateTargetsDepthFirst(t, remaining); + this->GenerateTargetsDepthFirst(t, remaining); } } } diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index 134bbe18afe..ea500acfc96 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -82,11 +82,11 @@ void cmLocalNinjaGenerator::Generate() } } - for (cmGeneratorTarget* target : this->GetGeneratorTargets()) { + for (const auto& target : this->GetGeneratorTargets()) { if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } - auto tg = cmNinjaTargetGenerator::New(target); + auto tg = cmNinjaTargetGenerator::New(target.get()); if (tg) { tg->Generate(); } diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 4a70248d6ff..ce3be63c330 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -121,12 +121,12 @@ void cmLocalUnixMakefileGenerator3::Generate() // Generate the rule files for each target. cmGlobalUnixMakefileGenerator3* gg = static_cast(this->GlobalGenerator); - for (cmGeneratorTarget* target : this->GetGeneratorTargets()) { + for (const auto& target : this->GetGeneratorTargets()) { if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } std::unique_ptr tg( - cmMakefileTargetGenerator::New(target)); + cmMakefileTargetGenerator::New(target.get())); if (tg) { tg->WriteRuleFiles(); gg->RecordTargetProgress(tg.get()); @@ -157,7 +157,7 @@ void cmLocalUnixMakefileGenerator3::ComputeHomeRelativeOutputPath() void cmLocalUnixMakefileGenerator3::GetLocalObjectFiles( std::map& localObjectFiles) { - for (cmGeneratorTarget* gt : this->GetGeneratorTargets()) { + for (const auto& gt : this->GetGeneratorTargets()) { if (gt->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } @@ -165,7 +165,7 @@ void cmLocalUnixMakefileGenerator3::GetLocalObjectFiles( gt->GetObjectSources(objectSources, this->ConfigName); // Compute full path to object file directory for this target. std::string dir = cmStrCat(gt->LocalGenerator->GetCurrentBinaryDirectory(), - '/', this->GetTargetDirectory(gt), '/'); + '/', this->GetTargetDirectory(gt.get()), '/'); // Compute the name of each object file. for (cmSourceFile const* sf : objectSources) { bool hasSourceExtension = true; @@ -176,7 +176,7 @@ void cmLocalUnixMakefileGenerator3::GetLocalObjectFiles( } LocalObjectInfo& info = localObjectFiles[objectName]; info.HasSourceExtension = hasSourceExtension; - info.emplace_back(gt, sf->GetLanguage()); + info.emplace_back(gt.get(), sf->GetLanguage()); } } } @@ -352,7 +352,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefileTargets( // for each target we just provide a rule to cd up to the top and do a make // on the target std::string localName; - for (cmGeneratorTarget* target : this->GetGeneratorTargets()) { + for (const auto& target : this->GetGeneratorTargets()) { if ((target->GetType() == cmStateEnums::EXECUTABLE) || (target->GetType() == cmStateEnums::STATIC_LIBRARY) || (target->GetType() == cmStateEnums::SHARED_LIBRARY) || @@ -362,7 +362,8 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefileTargets( emitted.insert(target->GetName()); // for subdirs add a rule to build this specific target by name. - localName = cmStrCat(this->GetRelativeTargetDirectory(target), "/rule"); + localName = + cmStrCat(this->GetRelativeTargetDirectory(target.get()), "/rule"); commands.clear(); depends.clear(); @@ -383,11 +384,11 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefileTargets( } // Add a fast rule to build the target - std::string makefileName = - cmStrCat(this->GetRelativeTargetDirectory(target), "/build.make"); + std::string makefileName = cmStrCat( + this->GetRelativeTargetDirectory(target.get()), "/build.make"); // make sure the makefile name is suitable for a makefile std::string makeTargetName = - cmStrCat(this->GetRelativeTargetDirectory(target), "/build"); + cmStrCat(this->GetRelativeTargetDirectory(target.get()), "/build"); localName = cmStrCat(target->GetName(), "/fast"); depends.clear(); commands.clear(); @@ -401,8 +402,8 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefileTargets( // Add a local name for the rule to relink the target before // installation. if (target->NeedRelinkBeforeInstall(this->ConfigName)) { - makeTargetName = - cmStrCat(this->GetRelativeTargetDirectory(target), "/preinstall"); + makeTargetName = cmStrCat( + this->GetRelativeTargetDirectory(target.get()), "/preinstall"); localName = cmStrCat(target->GetName(), "/preinstall"); depends.clear(); commands.clear(); @@ -1551,8 +1552,8 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules( this->WriteDivider(ruleFileStream); ruleFileStream << "# Targets provided globally by CMake.\n" << "\n"; - const std::vector& targets = this->GetGeneratorTargets(); - for (cmGeneratorTarget* gt : targets) { + const auto& targets = this->GetGeneratorTargets(); + for (const auto& gt : targets) { if (gt->GetType() == cmStateEnums::GLOBAL_TARGET) { std::string targetString = "Special rule for the target " + gt->GetName(); @@ -1573,10 +1574,10 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules( // Global targets store their rules in pre- and post-build commands. this->AppendCustomDepends(depends, gt->GetPreBuildCommands()); this->AppendCustomDepends(depends, gt->GetPostBuildCommands()); - this->AppendCustomCommands(commands, gt->GetPreBuildCommands(), gt, - this->GetCurrentBinaryDirectory()); - this->AppendCustomCommands(commands, gt->GetPostBuildCommands(), gt, + this->AppendCustomCommands(commands, gt->GetPreBuildCommands(), gt.get(), this->GetCurrentBinaryDirectory()); + this->AppendCustomCommands(commands, gt->GetPostBuildCommands(), + gt.get(), this->GetCurrentBinaryDirectory()); std::string targetName = gt->GetName(); this->WriteMakeRule(ruleFileStream, targetString.c_str(), targetName, depends, commands, true); diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx index f3d828b28e9..d9c4ce0f703 100644 --- a/Source/cmLocalVisualStudio10Generator.cxx +++ b/Source/cmLocalVisualStudio10Generator.cxx @@ -4,6 +4,7 @@ #include "cm_expat.h" +#include "cmAlgorithms.h" #include "cmGeneratorTarget.h" #include "cmGlobalVisualStudio10Generator.h" #include "cmMakefile.h" @@ -101,10 +102,11 @@ void cmLocalVisualStudio10Generator::GenerateTargetsDepthFirst( void cmLocalVisualStudio10Generator::Generate() { - std::vector remaining = this->GetGeneratorTargets(); + std::vector remaining; + cmAppend(remaining, this->GetGeneratorTargets()); for (auto& t : remaining) { if (t) { - GenerateTargetsDepthFirst(t, remaining); + this->GenerateTargetsDepthFirst(t, remaining); } } this->WriteStampFiles(); diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index fd346df6854..672b19049be 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -64,8 +64,8 @@ cmLocalVisualStudio7Generator::~cmLocalVisualStudio7Generator() void cmLocalVisualStudio7Generator::AddHelperCommands() { // Now create GUIDs for targets - const std::vector& tgts = this->GetGeneratorTargets(); - for (cmGeneratorTarget const* l : tgts) { + const auto& tgts = this->GetGeneratorTargets(); + for (const auto& l : tgts) { if (l->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } @@ -89,8 +89,8 @@ void cmLocalVisualStudio7Generator::FixGlobalTargets() // Visual Studio .NET 2003 Service Pack 1 will not run post-build // commands for targets in which no sources are built. Add dummy // rules to force these targets to build. - const std::vector& tgts = this->GetGeneratorTargets(); - for (cmGeneratorTarget* l : tgts) { + const auto& tgts = this->GetGeneratorTargets(); + for (auto& l : tgts) { if (l->GetType() == cmStateEnums::GLOBAL_TARGET) { std::vector no_depends; cmCustomCommandLines force_commands = @@ -125,17 +125,17 @@ void cmLocalVisualStudio7Generator::WriteProjectFiles() } // Get the set of targets in this directory. - const std::vector& tgts = this->GetGeneratorTargets(); + const auto& tgts = this->GetGeneratorTargets(); // Create the project file for each target. - for (cmGeneratorTarget* l : tgts) { + for (const auto& l : tgts) { if (l->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } // INCLUDE_EXTERNAL_MSPROJECT command only affects the workspace // so don't build a projectfile for it if (!l->GetProperty("EXTERNAL_MSPROJECT")) { - this->CreateSingleVCProj(l->GetName(), l); + this->CreateSingleVCProj(l->GetName(), l.get()); } } } diff --git a/Source/cmLocalXCodeGenerator.cxx b/Source/cmLocalXCodeGenerator.cxx index 5a06d4a53b4..ac0d35ea889 100644 --- a/Source/cmLocalXCodeGenerator.cxx +++ b/Source/cmLocalXCodeGenerator.cxx @@ -40,7 +40,7 @@ void cmLocalXCodeGenerator::Generate() { cmLocalGenerator::Generate(); - for (auto target : this->GetGeneratorTargets()) { + for (const auto& target : this->GetGeneratorTargets()) { target->HasMacOSXRpathInstallNameDir(""); } } @@ -49,7 +49,7 @@ void cmLocalXCodeGenerator::GenerateInstallRules() { cmLocalGenerator::GenerateInstallRules(); - for (auto target : this->GetGeneratorTargets()) { + for (const auto& target : this->GetGeneratorTargets()) { target->HasMacOSXRpathInstallNameDir(""); } } diff --git a/Source/cmQtAutoGenGlobalInitializer.cxx b/Source/cmQtAutoGenGlobalInitializer.cxx index ef6b8863646..4792860a593 100644 --- a/Source/cmQtAutoGenGlobalInitializer.cxx +++ b/Source/cmQtAutoGenGlobalInitializer.cxx @@ -73,7 +73,7 @@ cmQtAutoGenGlobalInitializer::cmQtAutoGenGlobalInitializer( } // Find targets that require AUTOMOC/UIC/RCC processing - for (cmGeneratorTarget* target : localGen->GetGeneratorTargets()) { + for (const auto& target : localGen->GetGeneratorTargets()) { // Process only certain target types switch (target->GetType()) { case cmStateEnums::EXECUTABLE: @@ -104,7 +104,7 @@ cmQtAutoGenGlobalInitializer::cmQtAutoGenGlobalInitializer( target->GetSafeProperty(kw().AUTORCC_EXECUTABLE); // We support Qt4, Qt5 and Qt6 - auto qtVersion = cmQtAutoGenInitializer::GetQtVersion(target); + auto qtVersion = cmQtAutoGenInitializer::GetQtVersion(target.get()); bool const validQt = (qtVersion.first.Major == 4) || (qtVersion.first.Major == 5) || (qtVersion.first.Major == 6); @@ -135,8 +135,8 @@ cmQtAutoGenGlobalInitializer::cmQtAutoGenGlobalInitializer( if (mocIsValid || uicIsValid || rccIsValid) { // Create autogen target initializer Initializers_.emplace_back(cm::make_unique( - this, target, qtVersion.first, mocIsValid, uicIsValid, rccIsValid, - globalAutoGenTarget, globalAutoRccTarget)); + this, target.get(), qtVersion.first, mocIsValid, uicIsValid, + rccIsValid, globalAutoGenTarget, globalAutoRccTarget)); } } } @@ -160,7 +160,8 @@ void cmQtAutoGenGlobalInitializer::GetOrCreateGlobalTarget( std::vector() /*output*/, std::vector() /*depends*/, cmCustomCommandLines(), false, comment.c_str()); - localGen->AddGeneratorTarget(new cmGeneratorTarget(target, localGen)); + localGen->AddGeneratorTarget( + cm::make_unique(target, localGen)); // Set FOLDER property in the target { diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index a20f1060f88..68b71224f11 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -1126,7 +1126,7 @@ bool cmQtAutoGenInitializer::InitAutogenTarget() commandLines, false, autogenComment.c_str()); // Create autogen generator target this->LocalGen->AddGeneratorTarget( - new cmGeneratorTarget(autogenTarget, this->LocalGen)); + cm::make_unique(autogenTarget, this->LocalGen)); // Forward origin utilities to autogen target if (this->AutogenTarget.DependOrigin) { @@ -1206,7 +1206,7 @@ bool cmQtAutoGenInitializer::InitRccTargets() // Create autogen generator target this->LocalGen->AddGeneratorTarget( - new cmGeneratorTarget(autoRccTarget, this->LocalGen)); + cm::make_unique(autoRccTarget, this->LocalGen)); // Set FOLDER property in autogen target if (!this->TargetsFolder.empty()) { From 46371132b3d79d2a4c86ee2a99b7a0fed4367750 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Mon, 11 Nov 2019 11:49:52 -0500 Subject: [PATCH 111/662] FindCUDA: CUDA_LIBRARIES doesn't contain raw `-pthread` If a person tried to pass `CUDA_LIBRARIES` to nvcc compiler it could fail as it might have `-pthread` which nvcc doesn't support. Instead we now use the `Threads::Threads` so that nvcc gets the correct `-Xcompiler -pthread` flag. --- Modules/FindCUDA.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 85d705c8d66..2a3e1317a8d 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -924,7 +924,7 @@ set(CUDA_LIBRARIES) if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY) list(APPEND CUDA_LIBRARIES ${CUDA_CUDARTEMU_LIBRARY}) elseif(CUDA_USE_STATIC_CUDA_RUNTIME AND CUDA_cudart_static_LIBRARY) - list(APPEND CUDA_LIBRARIES ${CUDA_cudart_static_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}) + list(APPEND CUDA_LIBRARIES ${CUDA_cudart_static_LIBRARY} Threads::Threads ${CMAKE_DL_LIBS}) if (CUDA_rt_LIBRARY) list(APPEND CUDA_LIBRARIES ${CUDA_rt_LIBRARY}) endif() From 2dcd7ce4ba803fa4c4d27526e45e2c9cbb88e49e Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Tue, 12 Nov 2019 00:01:07 -0500 Subject: [PATCH 112/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 8796e7900a3..41bde355a6c 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191111) +set(CMake_VERSION_PATCH 20191112) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From e49d85ae4b5397ec33bcfc6bc7984fedd7dcff11 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Wed, 13 Nov 2019 00:01:10 -0500 Subject: [PATCH 113/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 41bde355a6c..d5688932a54 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191112) +set(CMake_VERSION_PATCH 20191113) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From 78ce959a40c788356e304829d5f93742c5c83fa6 Mon Sep 17 00:00:00 2001 From: KWSys Upstream Date: Wed, 13 Nov 2019 09:47:45 -0500 Subject: [PATCH 114/662] KWSys 2019-11-13 (e67ed8ef) Code extracted from: https://gitlab.kitware.com/utils/kwsys.git at commit e67ed8efaf193036a92b648eec2ea71fabc0c05a (master). Upstream Shortlog ----------------- Brad King (2): b019deea RegularExpression: Suppress VS 2013 warning C4351 a5248df0 CTestCustom: Suppress PGI Community Edition compiler license warnings Paul Smith (1): dfd0521e Terminal: Support GNU make's TTY notification environment variable Todd Martin (2): 0492cad3 SystemTools: Remove redundant ToWindowsExtendedPath calls 680ab6d2 FStream: Expose is_open publicly --- CTestCustom.cmake.in | 4 ++++ FStream.hxx.in | 14 +++++++++----- RegularExpression.hxx.in | 11 +++++++++++ SystemTools.cxx | 14 +------------- Terminal.c | 8 ++++++++ 5 files changed, 33 insertions(+), 18 deletions(-) diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in index 760221b1244..c07f0f30f8f 100644 --- a/CTestCustom.cmake.in +++ b/CTestCustom.cmake.in @@ -12,3 +12,7 @@ list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE kwsys.testProcess-10 ) + +list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION + "LICENSE WARNING" + ) diff --git a/FStream.hxx.in b/FStream.hxx.in index d79bbdf16b9..b4244889202 100644 --- a/FStream.hxx.in +++ b/FStream.hxx.in @@ -87,7 +87,7 @@ public: bool _open(char const* file_name, std::ios_base::openmode mode) { - if (is_open() || file_) { + if (_is_open() || file_) { return false; } # if defined(_MSC_VER) @@ -108,7 +108,7 @@ public: return success; } - bool is_open() + bool _is_open() { if (!buf_) { return false; @@ -116,7 +116,7 @@ public: return buf_->is_open(); } - bool is_open() const + bool _is_open() const { if (!buf_) { return false; @@ -198,9 +198,11 @@ public: this->_set_state(this->_open(file_name, mode), this, this); } + bool is_open() { return this->_is_open(); } + void close() { this->_set_state(this->_close(), this, this); } - using basic_efilebuf::is_open; + using basic_efilebuf::_is_open; internal_buffer_type* rdbuf() const { return this->buf_; } @@ -212,7 +214,7 @@ class basic_ofstream : public std::basic_ostream , public basic_efilebuf { - using basic_efilebuf::is_open; + using basic_efilebuf::_is_open; public: typedef typename basic_efilebuf::internal_buffer_type @@ -242,6 +244,8 @@ public: void close() { this->_set_state(this->_close(), this, this); } + bool is_open() { return this->_is_open(); } + internal_buffer_type* rdbuf() const { return this->buf_; } ~basic_ofstream() @KWSYS_NAMESPACE@_FStream_NOEXCEPT { close(); } diff --git a/RegularExpression.hxx.in b/RegularExpression.hxx.in index 0c2366b8421..d11db88280b 100644 --- a/RegularExpression.hxx.in +++ b/RegularExpression.hxx.in @@ -66,6 +66,13 @@ private: const char* searchstring; }; +#ifdef _MSC_VER +# pragma warning(push) +# if _MSC_VER < 1900 +# pragma warning(disable : 4351) /* new behavior */ +# endif +#endif + /** * \brief Creates an invalid match object */ @@ -76,6 +83,10 @@ inline RegularExpressionMatch::RegularExpressionMatch() { } +#ifdef _MSC_VER +# pragma warning(pop) +#endif + /** * \brief Returns true if the match pointers are valid */ diff --git a/SystemTools.cxx b/SystemTools.cxx index ce4d6ef9505..dcf05daa85e 100644 --- a/SystemTools.cxx +++ b/SystemTools.cxx @@ -2326,14 +2326,8 @@ bool SystemTools::TextFilesDiffer(const std::string& path1, static bool CopyFileContentBlockwise(const std::string& source, const std::string& destination) { -// Open files -#if defined(_WIN32) - kwsys::ifstream fin( - Encoding::ToNarrow(Encoding::ToWindowsExtendedPath(source)).c_str(), - std::ios::in | std::ios::binary); -#else + // Open files kwsys::ifstream fin(source.c_str(), std::ios::in | std::ios::binary); -#endif if (!fin) { return false; } @@ -2344,14 +2338,8 @@ static bool CopyFileContentBlockwise(const std::string& source, // that do not allow file removal can be modified. SystemTools::RemoveFile(destination); -#if defined(_WIN32) - kwsys::ofstream fout( - Encoding::ToNarrow(Encoding::ToWindowsExtendedPath(destination)).c_str(), - std::ios::out | std::ios::trunc | std::ios::binary); -#else kwsys::ofstream fout(destination.c_str(), std::ios::out | std::ios::trunc | std::ios::binary); -#endif if (!fout) { return false; } diff --git a/Terminal.c b/Terminal.c index 4dd246148c5..c9515ee7d0e 100644 --- a/Terminal.c +++ b/Terminal.c @@ -172,6 +172,14 @@ static int kwsysTerminalStreamIsVT100(FILE* stream, int default_vt100, } } + /* GNU make 4.1+ may tell us that its output is destined for a TTY. */ + { + const char* termout = getenv("MAKE_TERMOUT"); + if (termout && *termout != '\0') { + return 1; + } + } + /* If running inside emacs the terminal is not VT100. Some emacs seem to claim the TERM is xterm even though they do not support VT100 escapes. */ From 34b7dbbfc37180989b57a0fb25ca4e0010cf992b Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Wed, 13 Nov 2019 11:29:26 -0500 Subject: [PATCH 115/662] LexerParser: Regenerate parsers with bison 3.4.2 --- .../LexerParser/cmCommandArgumentParser.cxx | 121 +- .../cmCommandArgumentParserTokens.h | 2 +- Source/LexerParser/cmDependsJavaParser.cxx | 1381 +++++++++-------- .../LexerParser/cmDependsJavaParserTokens.h | 2 +- Source/LexerParser/cmExprParser.cxx | 121 +- Source/LexerParser/cmExprParserTokens.h | 2 +- Source/LexerParser/cmFortranParser.cxx | 128 +- Source/LexerParser/cmFortranParserTokens.h | 9 +- 8 files changed, 892 insertions(+), 874 deletions(-) diff --git a/Source/LexerParser/cmCommandArgumentParser.cxx b/Source/LexerParser/cmCommandArgumentParser.cxx index ae7fb42ea8d..34dc8ecfead 100644 --- a/Source/LexerParser/cmCommandArgumentParser.cxx +++ b/Source/LexerParser/cmCommandArgumentParser.cxx @@ -1,4 +1,4 @@ -/* A Bison parser, made by GNU Bison 3.3.2. */ +/* A Bison parser, made by GNU Bison 3.4.2. */ /* Bison implementation for Yacc-like parsers in C @@ -48,7 +48,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "3.3.2" +#define YYBISON_VERSION "3.4.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -72,7 +72,7 @@ /* First part of user prologue. */ -#line 1 "cmCommandArgumentParser.y" /* yacc.c:337 */ +#line 1 "cmCommandArgumentParser.y" /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ @@ -134,7 +134,8 @@ static void cmCommandArgument_yyerror(yyscan_t yyscanner, const char* message); # pragma GCC diagnostic ignored "-Wconversion" #endif -#line 138 "cmCommandArgumentParser.cxx" /* yacc.c:337 */ +#line 138 "cmCommandArgumentParser.cxx" + # ifndef YY_NULLPTR # if defined __cplusplus # if 201103L <= __cplusplus @@ -155,8 +156,8 @@ static void cmCommandArgument_yyerror(yyscan_t yyscanner, const char* message); # define YYERROR_VERBOSE 1 #endif -/* In a future release of Bison, this section will be replaced - by #include "cmCommandArgumentParserTokens.h". */ +/* Use api.header.include to #include this header + instead of duplicating it here. */ #ifndef YY_CMCOMMANDARGUMENT_YY_CMCOMMANDARGUMENTPARSERTOKENS_H_INCLUDED # define YY_CMCOMMANDARGUMENT_YY_CMCOMMANDARGUMENTPARSERTOKENS_H_INCLUDED /* Debug traces. */ @@ -310,6 +311,8 @@ typedef short yytype_int16; #endif +#define YY_ASSERT(E) ((void) (0 && (E))) + #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -700,7 +703,9 @@ yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, yy if (yytype < YYNTOKENS) YYPRINT (yyo, yytoknum[yytype], *yyvaluep); # endif + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -1138,6 +1143,8 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); | yynewstate -- set current state (the top of the stack) to yystate. | `--------------------------------------------------------------------*/ yysetstate: + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + YY_ASSERT (0 <= yystate && yystate < YYNSTATES); *yyssp = (yytype_int16) yystate; if (yyss + yystacksize - 1 <= yyssp) @@ -1200,8 +1207,6 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); } #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - if (yystate == YYFINAL) YYACCEPT; @@ -1269,7 +1274,6 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END - goto yynewstate; @@ -1304,193 +1308,194 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); YY_REDUCE_PRINT (yyn); switch (yyn) { - case 2: -#line 99 "cmCommandArgumentParser.y" /* yacc.c:1652 */ + case 2: +#line 99 "cmCommandArgumentParser.y" { (yyval.str) = 0; yyGetParser->SetResult((yyvsp[0].str)); } -#line 1314 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */ +#line 1318 "cmCommandArgumentParser.cxx" break; case 3: -#line 105 "cmCommandArgumentParser.y" /* yacc.c:1652 */ +#line 105 "cmCommandArgumentParser.y" { (yyval.str) = (yyvsp[0].str); } -#line 1322 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */ +#line 1326 "cmCommandArgumentParser.cxx" break; case 4: -#line 108 "cmCommandArgumentParser.y" /* yacc.c:1652 */ +#line 108 "cmCommandArgumentParser.y" { (yyval.str) = yyGetParser->CombineUnions((yyvsp[-1].str), (yyvsp[0].str)); } -#line 1330 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */ +#line 1334 "cmCommandArgumentParser.cxx" break; case 5: -#line 113 "cmCommandArgumentParser.y" /* yacc.c:1652 */ +#line 113 "cmCommandArgumentParser.y" { (yyval.str) = 0; } -#line 1338 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */ +#line 1342 "cmCommandArgumentParser.cxx" break; case 6: -#line 116 "cmCommandArgumentParser.y" /* yacc.c:1652 */ +#line 116 "cmCommandArgumentParser.y" { (yyval.str) = yyGetParser->CombineUnions((yyvsp[-1].str), (yyvsp[0].str)); } -#line 1346 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */ +#line 1350 "cmCommandArgumentParser.cxx" break; case 7: -#line 121 "cmCommandArgumentParser.y" /* yacc.c:1652 */ +#line 121 "cmCommandArgumentParser.y" { (yyval.str) = (yyvsp[0].str); } -#line 1354 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */ +#line 1358 "cmCommandArgumentParser.cxx" break; case 8: -#line 124 "cmCommandArgumentParser.y" /* yacc.c:1652 */ +#line 124 "cmCommandArgumentParser.y" { (yyval.str) = (yyvsp[0].str); } -#line 1362 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */ +#line 1366 "cmCommandArgumentParser.cxx" break; case 9: -#line 129 "cmCommandArgumentParser.y" /* yacc.c:1652 */ +#line 129 "cmCommandArgumentParser.y" { (yyval.str) = (yyvsp[0].str); } -#line 1370 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */ +#line 1374 "cmCommandArgumentParser.cxx" break; case 10: -#line 132 "cmCommandArgumentParser.y" /* yacc.c:1652 */ +#line 132 "cmCommandArgumentParser.y" { (yyval.str) = (yyvsp[0].str); } -#line 1378 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */ +#line 1382 "cmCommandArgumentParser.cxx" break; case 11: -#line 135 "cmCommandArgumentParser.y" /* yacc.c:1652 */ +#line 135 "cmCommandArgumentParser.y" { (yyval.str) = (yyvsp[0].str); } -#line 1386 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */ +#line 1390 "cmCommandArgumentParser.cxx" break; case 12: -#line 138 "cmCommandArgumentParser.y" /* yacc.c:1652 */ +#line 138 "cmCommandArgumentParser.y" { (yyval.str) = (yyvsp[0].str); } -#line 1394 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */ +#line 1398 "cmCommandArgumentParser.cxx" break; case 13: -#line 141 "cmCommandArgumentParser.y" /* yacc.c:1652 */ +#line 141 "cmCommandArgumentParser.y" { (yyval.str) = (yyvsp[0].str); } -#line 1402 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */ +#line 1406 "cmCommandArgumentParser.cxx" break; case 14: -#line 144 "cmCommandArgumentParser.y" /* yacc.c:1652 */ +#line 144 "cmCommandArgumentParser.y" { (yyval.str) = (yyvsp[0].str); } -#line 1410 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */ +#line 1414 "cmCommandArgumentParser.cxx" break; case 15: -#line 149 "cmCommandArgumentParser.y" /* yacc.c:1652 */ +#line 149 "cmCommandArgumentParser.y" { (yyval.str) = yyGetParser->ExpandSpecialVariable((yyvsp[-2].str), (yyvsp[-1].str)); } -#line 1418 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */ +#line 1422 "cmCommandArgumentParser.cxx" break; case 16: -#line 152 "cmCommandArgumentParser.y" /* yacc.c:1652 */ +#line 152 "cmCommandArgumentParser.y" { (yyval.str) = yyGetParser->ExpandSpecialVariable((yyvsp[-2].str), (yyvsp[-1].str)); } -#line 1426 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */ +#line 1430 "cmCommandArgumentParser.cxx" break; case 17: -#line 155 "cmCommandArgumentParser.y" /* yacc.c:1652 */ +#line 155 "cmCommandArgumentParser.y" { (yyval.str) = yyGetParser->ExpandVariable((yyvsp[-1].str)); } -#line 1434 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */ +#line 1438 "cmCommandArgumentParser.cxx" break; case 18: -#line 158 "cmCommandArgumentParser.y" /* yacc.c:1652 */ +#line 158 "cmCommandArgumentParser.y" { (yyval.str) = yyGetParser->ExpandVariableForAt((yyvsp[0].str)); } -#line 1442 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */ +#line 1446 "cmCommandArgumentParser.cxx" break; case 19: -#line 163 "cmCommandArgumentParser.y" /* yacc.c:1652 */ +#line 163 "cmCommandArgumentParser.y" { (yyval.str) = (yyvsp[0].str); } -#line 1450 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */ +#line 1454 "cmCommandArgumentParser.cxx" break; case 20: -#line 166 "cmCommandArgumentParser.y" /* yacc.c:1652 */ +#line 166 "cmCommandArgumentParser.y" { (yyval.str) = (yyvsp[-1].str); } -#line 1458 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */ +#line 1462 "cmCommandArgumentParser.cxx" break; case 21: -#line 171 "cmCommandArgumentParser.y" /* yacc.c:1652 */ +#line 171 "cmCommandArgumentParser.y" { (yyval.str) = 0; } -#line 1466 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */ +#line 1470 "cmCommandArgumentParser.cxx" break; case 22: -#line 174 "cmCommandArgumentParser.y" /* yacc.c:1652 */ +#line 174 "cmCommandArgumentParser.y" { (yyval.str) = yyGetParser->CombineUnions((yyvsp[-1].str), (yyvsp[0].str)); } -#line 1474 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */ +#line 1478 "cmCommandArgumentParser.cxx" break; case 23: -#line 179 "cmCommandArgumentParser.y" /* yacc.c:1652 */ +#line 179 "cmCommandArgumentParser.y" { (yyval.str) = (yyvsp[0].str); } -#line 1482 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */ +#line 1486 "cmCommandArgumentParser.cxx" break; case 24: -#line 182 "cmCommandArgumentParser.y" /* yacc.c:1652 */ +#line 182 "cmCommandArgumentParser.y" { (yyval.str) = (yyvsp[0].str); } -#line 1490 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */ +#line 1494 "cmCommandArgumentParser.cxx" break; -#line 1494 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */ +#line 1498 "cmCommandArgumentParser.cxx" + default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -1723,7 +1728,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); #endif return yyresult; } -#line 187 "cmCommandArgumentParser.y" /* yacc.c:1918 */ +#line 187 "cmCommandArgumentParser.y" /* End of grammar */ diff --git a/Source/LexerParser/cmCommandArgumentParserTokens.h b/Source/LexerParser/cmCommandArgumentParserTokens.h index 56c9794f9fc..033b8994d14 100644 --- a/Source/LexerParser/cmCommandArgumentParserTokens.h +++ b/Source/LexerParser/cmCommandArgumentParserTokens.h @@ -1,4 +1,4 @@ -/* A Bison parser, made by GNU Bison 3.3.2. */ +/* A Bison parser, made by GNU Bison 3.4.2. */ /* Bison interface for Yacc-like parsers in C diff --git a/Source/LexerParser/cmDependsJavaParser.cxx b/Source/LexerParser/cmDependsJavaParser.cxx index 6c1fb2cb376..b15082ddb2c 100644 --- a/Source/LexerParser/cmDependsJavaParser.cxx +++ b/Source/LexerParser/cmDependsJavaParser.cxx @@ -1,4 +1,4 @@ -/* A Bison parser, made by GNU Bison 3.3.2. */ +/* A Bison parser, made by GNU Bison 3.4.2. */ /* Bison implementation for Yacc-like parsers in C @@ -48,7 +48,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "3.3.2" +#define YYBISON_VERSION "3.4.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -72,7 +72,7 @@ /* First part of user prologue. */ -#line 1 "cmDependsJavaParser.y" /* yacc.c:337 */ +#line 1 "cmDependsJavaParser.y" /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ @@ -123,7 +123,8 @@ static void cmDependsJava_yyerror(yyscan_t yyscanner, const char* message); # pragma GCC diagnostic ignored "-Wconversion" #endif -#line 127 "cmDependsJavaParser.cxx" /* yacc.c:337 */ +#line 127 "cmDependsJavaParser.cxx" + # ifndef YY_NULLPTR # if defined __cplusplus # if 201103L <= __cplusplus @@ -144,8 +145,8 @@ static void cmDependsJava_yyerror(yyscan_t yyscanner, const char* message); # define YYERROR_VERBOSE 1 #endif -/* In a future release of Bison, this section will be replaced - by #include "cmDependsJavaParserTokens.h". */ +/* Use api.header.include to #include this header + instead of duplicating it here. */ #ifndef YY_CMDEPENDSJAVA_YY_CMDEPENDSJAVAPARSERTOKENS_H_INCLUDED # define YY_CMDEPENDSJAVA_YY_CMDEPENDSJAVAPARSERTOKENS_H_INCLUDED /* Debug traces. */ @@ -481,6 +482,8 @@ typedef short yytype_int16; #endif +#define YY_ASSERT(E) ((void) (0 && (E))) + #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -1685,7 +1688,9 @@ yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, yy if (yytype < YYNTOKENS) YYPRINT (yyo, yytoknum[yytype], *yyvaluep); # endif + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -2123,6 +2128,8 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); | yynewstate -- set current state (the top of the stack) to yystate. | `--------------------------------------------------------------------*/ yysetstate: + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + YY_ASSERT (0 <= yystate && yystate < YYNSTATES); *yyssp = (yytype_int16) yystate; if (yyss + yystacksize - 1 <= yyssp) @@ -2185,8 +2192,6 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); } #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - if (yystate == YYFINAL) YYACCEPT; @@ -2254,7 +2259,6 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END - goto yynewstate; @@ -2289,215 +2293,215 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); YY_REDUCE_PRINT (yyn); switch (yyn) { - case 2: -#line 183 "cmDependsJavaParser.y" /* yacc.c:1652 */ + case 2: +#line 183 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2301 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2305 "cmDependsJavaParser.cxx" break; case 3: -#line 192 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 192 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2312 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2316 "cmDependsJavaParser.cxx" break; case 4: -#line 200 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 200 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2323 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2327 "cmDependsJavaParser.cxx" break; case 5: -#line 208 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 208 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2334 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2338 "cmDependsJavaParser.cxx" break; case 6: -#line 216 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 216 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2345 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2349 "cmDependsJavaParser.cxx" break; case 7: -#line 224 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 224 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2356 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2360 "cmDependsJavaParser.cxx" break; case 8: -#line 232 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 232 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2367 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2371 "cmDependsJavaParser.cxx" break; case 9: -#line 241 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 241 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2378 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2382 "cmDependsJavaParser.cxx" break; case 10: -#line 249 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 249 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2389 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2393 "cmDependsJavaParser.cxx" break; case 11: -#line 258 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 258 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2400 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2404 "cmDependsJavaParser.cxx" break; case 12: -#line 266 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 266 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2411 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2415 "cmDependsJavaParser.cxx" break; case 13: -#line 275 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 275 "cmDependsJavaParser.y" { jpElementStart(0); } -#line 2419 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2423 "cmDependsJavaParser.cxx" break; case 14: -#line 280 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 280 "cmDependsJavaParser.y" { jpElementStart(0); } -#line 2427 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2431 "cmDependsJavaParser.cxx" break; case 15: -#line 285 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 285 "cmDependsJavaParser.y" { jpElementStart(0); } -#line 2435 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2439 "cmDependsJavaParser.cxx" break; case 16: -#line 290 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 290 "cmDependsJavaParser.y" { jpElementStart(0); } -#line 2443 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2447 "cmDependsJavaParser.cxx" break; case 17: -#line 295 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 295 "cmDependsJavaParser.y" { jpElementStart(0); } -#line 2451 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2455 "cmDependsJavaParser.cxx" break; case 18: -#line 300 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 300 "cmDependsJavaParser.y" { jpElementStart(0); } -#line 2459 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2463 "cmDependsJavaParser.cxx" break; case 19: -#line 305 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 305 "cmDependsJavaParser.y" { jpElementStart(0); } -#line 2467 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2471 "cmDependsJavaParser.cxx" break; case 20: -#line 310 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 310 "cmDependsJavaParser.y" { jpElementStart(0); } -#line 2475 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2479 "cmDependsJavaParser.cxx" break; case 21: -#line 316 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 316 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2486 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2490 "cmDependsJavaParser.cxx" break; case 22: -#line 324 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 324 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2497 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2501 "cmDependsJavaParser.cxx" break; case 23: -#line 333 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 333 "cmDependsJavaParser.y" { jpElementStart(1); jpStoreClass((yyvsp[0].str)); @@ -2505,44 +2509,44 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2509 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2513 "cmDependsJavaParser.cxx" break; case 24: -#line 343 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 343 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2520 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2524 "cmDependsJavaParser.cxx" break; case 25: -#line 352 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 352 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2531 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2535 "cmDependsJavaParser.cxx" break; case 26: -#line 361 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 361 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2542 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2546 "cmDependsJavaParser.cxx" break; case 27: -#line 369 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 369 "cmDependsJavaParser.y" { jpElementStart(2); jpStoreClass((yyvsp[-1].str)); @@ -2550,56 +2554,56 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2554 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2558 "cmDependsJavaParser.cxx" break; case 28: -#line 379 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 379 "cmDependsJavaParser.y" { jpElementStart(1); (yyval.str) = (yyvsp[0].str); } -#line 2563 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2567 "cmDependsJavaParser.cxx" break; case 29: -#line 385 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 385 "cmDependsJavaParser.y" { jpElementStart(1); (yyval.str) = (yyvsp[0].str); } -#line 2572 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2576 "cmDependsJavaParser.cxx" break; case 30: -#line 392 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 392 "cmDependsJavaParser.y" { jpElementStart(1); (yyval.str) = (yyvsp[0].str); } -#line 2581 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2585 "cmDependsJavaParser.cxx" break; case 31: -#line 399 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 399 "cmDependsJavaParser.y" { jpElementStart(1); (yyval.str) = (yyvsp[0].str); } -#line 2590 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2594 "cmDependsJavaParser.cxx" break; case 32: -#line 405 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 405 "cmDependsJavaParser.y" { jpElementStart(2); (yyval.str) = (yyvsp[0].str); } -#line 2599 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2603 "cmDependsJavaParser.cxx" break; case 33: -#line 412 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 412 "cmDependsJavaParser.y" { jpElementStart(3); yyGetParser->AddClassFound((yyvsp[-2].str)); @@ -2607,11 +2611,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->DeallocateParserType(&((yyvsp[-2].str))); (yyval.str) = const_cast(yyGetParser->GetCurrentCombine()); } -#line 2611 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2615 "cmDependsJavaParser.cxx" break; case 34: -#line 421 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 421 "cmDependsJavaParser.y" { jpElementStart(3); jpStoreClass((yyvsp[-2].str)); @@ -2620,11 +2624,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2624 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2628 "cmDependsJavaParser.cxx" break; case 35: -#line 431 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 431 "cmDependsJavaParser.y" { jpElementStart(3); jpStoreClass((yyvsp[-2].str)); @@ -2633,118 +2637,118 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2637 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2641 "cmDependsJavaParser.cxx" break; case 36: -#line 441 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 441 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2648 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2652 "cmDependsJavaParser.cxx" break; case 37: -#line 450 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 450 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2659 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2663 "cmDependsJavaParser.cxx" break; case 38: -#line 458 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 458 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2670 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2674 "cmDependsJavaParser.cxx" break; case 39: -#line 467 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 467 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2681 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2685 "cmDependsJavaParser.cxx" break; case 40: -#line 475 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 475 "cmDependsJavaParser.y" { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2691 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2695 "cmDependsJavaParser.cxx" break; case 41: -#line 482 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 482 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2702 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2706 "cmDependsJavaParser.cxx" break; case 42: -#line 490 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 490 "cmDependsJavaParser.y" { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2712 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2716 "cmDependsJavaParser.cxx" break; case 43: -#line 497 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 497 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2723 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2727 "cmDependsJavaParser.cxx" break; case 44: -#line 505 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 505 "cmDependsJavaParser.y" { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2733 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2737 "cmDependsJavaParser.cxx" break; case 45: -#line 512 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 512 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2744 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2748 "cmDependsJavaParser.cxx" break; case 46: -#line 521 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 521 "cmDependsJavaParser.y" { jpElementStart(3); yyGetParser->SetCurrentPackage((yyvsp[-1].str)); @@ -2754,33 +2758,33 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2758 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2762 "cmDependsJavaParser.cxx" break; case 47: -#line 533 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 533 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2769 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2773 "cmDependsJavaParser.cxx" break; case 48: -#line 541 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 541 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2780 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2784 "cmDependsJavaParser.cxx" break; case 49: -#line 550 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 550 "cmDependsJavaParser.y" { jpElementStart(3); yyGetParser->AddPackagesImport((yyvsp[-1].str)); @@ -2790,11 +2794,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2794 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2798 "cmDependsJavaParser.cxx" break; case 50: -#line 562 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 562 "cmDependsJavaParser.y" { jpElementStart(5); std::string str = (yyvsp[-3].str); @@ -2805,77 +2809,77 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2809 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2813 "cmDependsJavaParser.cxx" break; case 51: -#line 575 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 575 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2820 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2824 "cmDependsJavaParser.cxx" break; case 52: -#line 583 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 583 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2831 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2835 "cmDependsJavaParser.cxx" break; case 53: -#line 591 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 591 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2842 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2846 "cmDependsJavaParser.cxx" break; case 54: -#line 600 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 600 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2853 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2857 "cmDependsJavaParser.cxx" break; case 55: -#line 608 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 608 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2864 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2868 "cmDependsJavaParser.cxx" break; case 67: -#line 623 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 623 "cmDependsJavaParser.y" { yyGetParser->StartClass((yyvsp[0].str)); jpElementStart(3); yyGetParser->DeallocateParserType(&((yyvsp[0].str))); jpCheckEmpty(3); } -#line 2875 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2879 "cmDependsJavaParser.cxx" break; case 68: -#line 633 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 633 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -2883,11 +2887,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); yyGetParser->EndClass(); } -#line 2887 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2891 "cmDependsJavaParser.cxx" break; case 69: -#line 642 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 642 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(2); @@ -2895,11 +2899,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); yyGetParser->EndClass(); } -#line 2899 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2903 "cmDependsJavaParser.cxx" break; case 70: -#line 651 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 651 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -2907,11 +2911,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); yyGetParser->EndClass(); } -#line 2911 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2915 "cmDependsJavaParser.cxx" break; case 71: -#line 660 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 660 "cmDependsJavaParser.y" { jpElementStart(4); jpCheckEmpty(4); @@ -2919,226 +2923,226 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); yyGetParser->EndClass(); } -#line 2923 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2927 "cmDependsJavaParser.cxx" break; case 72: -#line 669 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 669 "cmDependsJavaParser.y" { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2933 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2937 "cmDependsJavaParser.cxx" break; case 73: -#line 676 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 676 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2944 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2948 "cmDependsJavaParser.cxx" break; case 74: -#line 685 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 685 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2955 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2959 "cmDependsJavaParser.cxx" break; case 75: -#line 694 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 694 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2966 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2970 "cmDependsJavaParser.cxx" break; case 76: -#line 703 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 703 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2977 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2981 "cmDependsJavaParser.cxx" break; case 77: -#line 711 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 711 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2988 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 2992 "cmDependsJavaParser.cxx" break; case 78: -#line 720 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 720 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2999 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3003 "cmDependsJavaParser.cxx" break; case 79: -#line 728 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 728 "cmDependsJavaParser.y" { jpElementStart(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3009 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3013 "cmDependsJavaParser.cxx" break; case 80: -#line 735 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 735 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3020 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3024 "cmDependsJavaParser.cxx" break; case 81: -#line 744 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 744 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3031 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3035 "cmDependsJavaParser.cxx" break; case 82: -#line 752 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 752 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3042 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3046 "cmDependsJavaParser.cxx" break; case 83: -#line 760 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 760 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3053 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3057 "cmDependsJavaParser.cxx" break; case 84: -#line 768 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 768 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3064 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3068 "cmDependsJavaParser.cxx" break; case 85: -#line 777 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 777 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3075 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3079 "cmDependsJavaParser.cxx" break; case 86: -#line 785 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 785 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3086 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3090 "cmDependsJavaParser.cxx" break; case 87: -#line 794 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 794 "cmDependsJavaParser.y" { jpElementStart(4); } -#line 3094 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3098 "cmDependsJavaParser.cxx" break; case 88: -#line 800 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 800 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3105 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3109 "cmDependsJavaParser.cxx" break; case 89: -#line 808 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 808 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3116 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3120 "cmDependsJavaParser.cxx" break; case 90: -#line 817 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 817 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3127 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3131 "cmDependsJavaParser.cxx" break; case 91: -#line 825 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 825 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3138 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3142 "cmDependsJavaParser.cxx" break; case 92: -#line 834 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 834 "cmDependsJavaParser.y" { jpElementStart(1); yyGetParser->DeallocateParserType(&((yyvsp[0].str))); @@ -3146,77 +3150,77 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3150 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3154 "cmDependsJavaParser.cxx" break; case 93: -#line 843 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 843 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3161 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3165 "cmDependsJavaParser.cxx" break; case 94: -#line 852 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 852 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3172 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3176 "cmDependsJavaParser.cxx" break; case 95: -#line 860 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 860 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3183 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3187 "cmDependsJavaParser.cxx" break; case 96: -#line 869 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 869 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3194 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3198 "cmDependsJavaParser.cxx" break; case 97: -#line 877 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 877 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3205 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3209 "cmDependsJavaParser.cxx" break; case 98: -#line 885 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 885 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3216 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3220 "cmDependsJavaParser.cxx" break; case 99: -#line 894 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 894 "cmDependsJavaParser.y" { jpElementStart(4); jpCheckEmpty(4); @@ -3224,11 +3228,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3228 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3232 "cmDependsJavaParser.cxx" break; case 100: -#line 903 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 903 "cmDependsJavaParser.y" { jpElementStart(4); jpCheckEmpty(4); @@ -3236,22 +3240,22 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3240 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3244 "cmDependsJavaParser.cxx" break; case 101: -#line 912 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 912 "cmDependsJavaParser.y" { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3251 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3255 "cmDependsJavaParser.cxx" break; case 102: -#line 920 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 920 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3259,11 +3263,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3263 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3267 "cmDependsJavaParser.cxx" break; case 103: -#line 930 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 930 "cmDependsJavaParser.y" { jpElementStart(4); yyGetParser->DeallocateParserType(&((yyvsp[-3].str))); @@ -3272,40 +3276,40 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3276 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3280 "cmDependsJavaParser.cxx" break; case 104: -#line 940 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 940 "cmDependsJavaParser.y" { jpElementStart(3); } -#line 3285 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3289 "cmDependsJavaParser.cxx" break; case 105: -#line 946 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 946 "cmDependsJavaParser.y" { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3296 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3300 "cmDependsJavaParser.cxx" break; case 107: -#line 957 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 957 "cmDependsJavaParser.y" { jpElementStart(1); } -#line 3305 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3309 "cmDependsJavaParser.cxx" break; case 108: -#line 963 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 963 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -3313,11 +3317,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3317 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3321 "cmDependsJavaParser.cxx" break; case 109: -#line 973 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 973 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -3325,11 +3329,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3329 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3333 "cmDependsJavaParser.cxx" break; case 110: -#line 983 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 983 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -3337,20 +3341,20 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3341 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3345 "cmDependsJavaParser.cxx" break; case 111: -#line 993 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 993 "cmDependsJavaParser.y" { jpElementStart(1); } -#line 3350 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3354 "cmDependsJavaParser.cxx" break; case 112: -#line 999 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 999 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -3358,11 +3362,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3362 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3366 "cmDependsJavaParser.cxx" break; case 113: -#line 1009 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1009 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3370,11 +3374,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3374 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3378 "cmDependsJavaParser.cxx" break; case 114: -#line 1019 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1019 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -3382,11 +3386,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3386 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3390 "cmDependsJavaParser.cxx" break; case 115: -#line 1029 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1029 "cmDependsJavaParser.y" { jpElementStart(4); jpCheckEmpty(4); @@ -3394,11 +3398,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3398 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3402 "cmDependsJavaParser.cxx" break; case 116: -#line 1038 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1038 "cmDependsJavaParser.y" { jpElementStart(5); jpCheckEmpty(5); @@ -3406,11 +3410,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3410 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3414 "cmDependsJavaParser.cxx" break; case 117: -#line 1048 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1048 "cmDependsJavaParser.y" { jpElementStart(4); yyGetParser->DeallocateParserType(&((yyvsp[-3].str))); @@ -3419,11 +3423,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3423 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3427 "cmDependsJavaParser.cxx" break; case 118: -#line 1059 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1059 "cmDependsJavaParser.y" { jpElementStart(4); jpCheckEmpty(4); @@ -3431,22 +3435,22 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3435 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3439 "cmDependsJavaParser.cxx" break; case 119: -#line 1068 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1068 "cmDependsJavaParser.y" { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3446 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3450 "cmDependsJavaParser.cxx" break; case 120: -#line 1076 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1076 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -3454,11 +3458,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3458 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3462 "cmDependsJavaParser.cxx" break; case 121: -#line 1086 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1086 "cmDependsJavaParser.y" { jpElementStart(5); jpCheckEmpty(5); @@ -3466,11 +3470,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3470 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3474 "cmDependsJavaParser.cxx" break; case 122: -#line 1095 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1095 "cmDependsJavaParser.y" { jpElementStart(5); jpCheckEmpty(5); @@ -3478,22 +3482,22 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3482 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3486 "cmDependsJavaParser.cxx" break; case 123: -#line 1105 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1105 "cmDependsJavaParser.y" { yyGetParser->StartClass((yyvsp[0].str)); jpElementStart(3); yyGetParser->DeallocateParserType(&((yyvsp[0].str))); jpCheckEmpty(3); } -#line 3493 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3497 "cmDependsJavaParser.cxx" break; case 124: -#line 1114 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1114 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -3501,21 +3505,21 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); yyGetParser->EndClass(); } -#line 3505 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3509 "cmDependsJavaParser.cxx" break; case 125: -#line 1123 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1123 "cmDependsJavaParser.y" { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3515 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3519 "cmDependsJavaParser.cxx" break; case 126: -#line 1130 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1130 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3523,11 +3527,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3527 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3531 "cmDependsJavaParser.cxx" break; case 127: -#line 1140 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1140 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -3535,11 +3539,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3539 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3543 "cmDependsJavaParser.cxx" break; case 128: -#line 1149 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1149 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -3547,11 +3551,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3551 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3555 "cmDependsJavaParser.cxx" break; case 129: -#line 1159 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1159 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -3559,33 +3563,33 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3563 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3567 "cmDependsJavaParser.cxx" break; case 130: -#line 1168 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1168 "cmDependsJavaParser.y" { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3574 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3578 "cmDependsJavaParser.cxx" break; case 131: -#line 1176 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1176 "cmDependsJavaParser.y" { jpElementStart(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3585 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3589 "cmDependsJavaParser.cxx" break; case 132: -#line 1185 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1185 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3593,11 +3597,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3597 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3601 "cmDependsJavaParser.cxx" break; case 133: -#line 1194 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1194 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3605,11 +3609,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3609 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3613 "cmDependsJavaParser.cxx" break; case 134: -#line 1203 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1203 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3617,22 +3621,22 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3621 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3625 "cmDependsJavaParser.cxx" break; case 135: -#line 1212 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1212 "cmDependsJavaParser.y" { jpElementStart(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3632 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3636 "cmDependsJavaParser.cxx" break; case 136: -#line 1220 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1220 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3640,22 +3644,22 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3644 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3648 "cmDependsJavaParser.cxx" break; case 137: -#line 1229 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1229 "cmDependsJavaParser.y" { jpElementStart(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3655 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3659 "cmDependsJavaParser.cxx" break; case 138: -#line 1238 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1238 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3663,11 +3667,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3667 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3671 "cmDependsJavaParser.cxx" break; case 139: -#line 1248 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1248 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -3675,11 +3679,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3679 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3683 "cmDependsJavaParser.cxx" break; case 140: -#line 1258 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1258 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3687,11 +3691,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3691 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3695 "cmDependsJavaParser.cxx" break; case 141: -#line 1267 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1267 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -3699,11 +3703,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3703 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3707 "cmDependsJavaParser.cxx" break; case 142: -#line 1277 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1277 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -3711,22 +3715,22 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3715 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3719 "cmDependsJavaParser.cxx" break; case 143: -#line 1286 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1286 "cmDependsJavaParser.y" { jpElementStart(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3726 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3730 "cmDependsJavaParser.cxx" break; case 144: -#line 1294 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1294 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3734,11 +3738,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3738 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3742 "cmDependsJavaParser.cxx" break; case 145: -#line 1303 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1303 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -3746,11 +3750,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3750 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3754 "cmDependsJavaParser.cxx" break; case 146: -#line 1313 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1313 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3758,11 +3762,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3762 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3766 "cmDependsJavaParser.cxx" break; case 147: -#line 1322 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1322 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -3770,33 +3774,33 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3774 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3778 "cmDependsJavaParser.cxx" break; case 148: -#line 1332 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1332 "cmDependsJavaParser.y" { jpElementStart(4); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3785 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3789 "cmDependsJavaParser.cxx" break; case 149: -#line 1340 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1340 "cmDependsJavaParser.y" { jpElementStart(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3796 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3800 "cmDependsJavaParser.cxx" break; case 150: -#line 1348 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1348 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3804,11 +3808,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3808 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3812 "cmDependsJavaParser.cxx" break; case 151: -#line 1358 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1358 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3816,11 +3820,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3820 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3824 "cmDependsJavaParser.cxx" break; case 152: -#line 1367 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1367 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(2); @@ -3828,11 +3832,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3832 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3836 "cmDependsJavaParser.cxx" break; case 153: -#line 1377 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1377 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3840,11 +3844,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3844 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3848 "cmDependsJavaParser.cxx" break; case 154: -#line 1386 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1386 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3852,11 +3856,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3856 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3860 "cmDependsJavaParser.cxx" break; case 155: -#line 1395 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1395 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3864,11 +3868,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3868 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3872 "cmDependsJavaParser.cxx" break; case 156: -#line 1405 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1405 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(2); @@ -3876,11 +3880,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3880 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3884 "cmDependsJavaParser.cxx" break; case 157: -#line 1415 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1415 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(3); @@ -3888,11 +3892,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3892 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3896 "cmDependsJavaParser.cxx" break; case 158: -#line 1424 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1424 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(2); @@ -3900,11 +3904,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3904 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3908 "cmDependsJavaParser.cxx" break; case 159: -#line 1434 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1434 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3912,11 +3916,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3916 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3920 "cmDependsJavaParser.cxx" break; case 160: -#line 1443 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1443 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3924,11 +3928,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3928 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3932 "cmDependsJavaParser.cxx" break; case 161: -#line 1452 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1452 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3936,11 +3940,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3940 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3944 "cmDependsJavaParser.cxx" break; case 162: -#line 1461 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1461 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3948,11 +3952,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3952 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3956 "cmDependsJavaParser.cxx" break; case 163: -#line 1470 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1470 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3960,11 +3964,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3964 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3968 "cmDependsJavaParser.cxx" break; case 164: -#line 1479 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1479 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3972,11 +3976,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3976 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3980 "cmDependsJavaParser.cxx" break; case 165: -#line 1489 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1489 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3984,11 +3988,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 3988 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 3992 "cmDependsJavaParser.cxx" break; case 166: -#line 1498 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1498 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3996,11 +4000,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4000 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4004 "cmDependsJavaParser.cxx" break; case 167: -#line 1507 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1507 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4008,11 +4012,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4012 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4016 "cmDependsJavaParser.cxx" break; case 168: -#line 1516 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1516 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4020,11 +4024,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4024 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4028 "cmDependsJavaParser.cxx" break; case 169: -#line 1525 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1525 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4032,11 +4036,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4036 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4040 "cmDependsJavaParser.cxx" break; case 170: -#line 1535 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1535 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4044,11 +4048,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4048 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4052 "cmDependsJavaParser.cxx" break; case 171: -#line 1544 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1544 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4056,11 +4060,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4060 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4064 "cmDependsJavaParser.cxx" break; case 172: -#line 1553 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1553 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4068,11 +4072,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4072 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4076 "cmDependsJavaParser.cxx" break; case 173: -#line 1562 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1562 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4080,11 +4084,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4084 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4088 "cmDependsJavaParser.cxx" break; case 174: -#line 1571 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1571 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4092,11 +4096,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4096 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4100 "cmDependsJavaParser.cxx" break; case 175: -#line 1580 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1580 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4104,11 +4108,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4108 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4112 "cmDependsJavaParser.cxx" break; case 176: -#line 1589 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1589 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4116,11 +4120,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4120 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4124 "cmDependsJavaParser.cxx" break; case 177: -#line 1598 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1598 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4128,11 +4132,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4132 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4136 "cmDependsJavaParser.cxx" break; case 178: -#line 1607 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1607 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4140,11 +4144,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4144 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4148 "cmDependsJavaParser.cxx" break; case 179: -#line 1616 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1616 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4152,11 +4156,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4156 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4160 "cmDependsJavaParser.cxx" break; case 180: -#line 1625 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1625 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4164,11 +4168,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4168 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4172 "cmDependsJavaParser.cxx" break; case 181: -#line 1634 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1634 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4176,11 +4180,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4180 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4184 "cmDependsJavaParser.cxx" break; case 182: -#line 1644 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1644 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4188,11 +4192,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4192 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4196 "cmDependsJavaParser.cxx" break; case 183: -#line 1654 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1654 "cmDependsJavaParser.y" { jpElementStart(3); yyGetParser->DeallocateParserType(&((yyvsp[-2].str))); @@ -4201,11 +4205,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4205 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4209 "cmDependsJavaParser.cxx" break; case 184: -#line 1665 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1665 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -4213,11 +4217,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4217 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4221 "cmDependsJavaParser.cxx" break; case 185: -#line 1675 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1675 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -4225,11 +4229,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4229 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4233 "cmDependsJavaParser.cxx" break; case 186: -#line 1685 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1685 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4237,11 +4241,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4241 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4245 "cmDependsJavaParser.cxx" break; case 187: -#line 1694 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1694 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4249,11 +4253,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4253 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4257 "cmDependsJavaParser.cxx" break; case 188: -#line 1703 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1703 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4261,11 +4265,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4265 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4269 "cmDependsJavaParser.cxx" break; case 189: -#line 1712 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1712 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4273,11 +4277,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4277 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4281 "cmDependsJavaParser.cxx" break; case 190: -#line 1721 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1721 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4285,11 +4289,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4289 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4293 "cmDependsJavaParser.cxx" break; case 191: -#line 1730 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1730 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4297,11 +4301,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4301 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4305 "cmDependsJavaParser.cxx" break; case 192: -#line 1739 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1739 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4309,11 +4313,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4313 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4317 "cmDependsJavaParser.cxx" break; case 193: -#line 1749 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1749 "cmDependsJavaParser.y" { jpElementStart(5); jpCheckEmpty(5); @@ -4321,11 +4325,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4325 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4329 "cmDependsJavaParser.cxx" break; case 194: -#line 1759 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1759 "cmDependsJavaParser.y" { jpElementStart(7); jpCheckEmpty(7); @@ -4333,11 +4337,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4337 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4341 "cmDependsJavaParser.cxx" break; case 195: -#line 1769 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1769 "cmDependsJavaParser.y" { jpElementStart(7); jpCheckEmpty(7); @@ -4345,40 +4349,40 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4349 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4353 "cmDependsJavaParser.cxx" break; case 196: -#line 1779 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1779 "cmDependsJavaParser.y" { jpElementStart(5); } -#line 4358 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4362 "cmDependsJavaParser.cxx" break; case 197: -#line 1786 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1786 "cmDependsJavaParser.y" { jpElementStart(4); } -#line 4367 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4371 "cmDependsJavaParser.cxx" break; case 198: -#line 1792 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1792 "cmDependsJavaParser.y" { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 4378 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4382 "cmDependsJavaParser.cxx" break; case 199: -#line 1800 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1800 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4386,22 +4390,22 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4390 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4394 "cmDependsJavaParser.cxx" break; case 200: -#line 1809 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1809 "cmDependsJavaParser.y" { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 4401 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4405 "cmDependsJavaParser.cxx" break; case 201: -#line 1817 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1817 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -4409,11 +4413,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4413 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4417 "cmDependsJavaParser.cxx" break; case 202: -#line 1827 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1827 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -4421,11 +4425,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4425 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4429 "cmDependsJavaParser.cxx" break; case 203: -#line 1837 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1837 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4433,11 +4437,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4437 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4441 "cmDependsJavaParser.cxx" break; case 204: -#line 1846 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1846 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -4445,11 +4449,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4449 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4453 "cmDependsJavaParser.cxx" break; case 205: -#line 1856 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1856 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -4457,11 +4461,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4461 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4465 "cmDependsJavaParser.cxx" break; case 206: -#line 1865 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1865 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -4469,58 +4473,58 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4473 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4477 "cmDependsJavaParser.cxx" break; case 207: -#line 1875 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1875 "cmDependsJavaParser.y" { jpElementStart(5); } -#line 4482 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4486 "cmDependsJavaParser.cxx" break; case 208: -#line 1882 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1882 "cmDependsJavaParser.y" { jpElementStart(5); } -#line 4491 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4495 "cmDependsJavaParser.cxx" break; case 209: -#line 1889 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1889 "cmDependsJavaParser.y" { jpElementStart(7); } -#line 4500 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4504 "cmDependsJavaParser.cxx" break; case 210: -#line 1897 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1897 "cmDependsJavaParser.y" { jpElementStart(9); } -#line 4509 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4513 "cmDependsJavaParser.cxx" break; case 211: -#line 1903 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1903 "cmDependsJavaParser.y" { jpElementStart(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 4520 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4524 "cmDependsJavaParser.cxx" break; case 212: -#line 1911 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1911 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4528,22 +4532,22 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4532 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4536 "cmDependsJavaParser.cxx" break; case 213: -#line 1920 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1920 "cmDependsJavaParser.y" { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 4543 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4547 "cmDependsJavaParser.cxx" break; case 214: -#line 1928 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1928 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4551,33 +4555,33 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4555 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4559 "cmDependsJavaParser.cxx" break; case 215: -#line 1939 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1939 "cmDependsJavaParser.y" { jpElementStart(9); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 4566 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4570 "cmDependsJavaParser.cxx" break; case 216: -#line 1947 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1947 "cmDependsJavaParser.y" { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 4577 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4581 "cmDependsJavaParser.cxx" break; case 217: -#line 1955 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1955 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4585,11 +4589,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4589 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4593 "cmDependsJavaParser.cxx" break; case 218: -#line 1965 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1965 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4597,11 +4601,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4601 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4605 "cmDependsJavaParser.cxx" break; case 219: -#line 1974 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1974 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4609,11 +4613,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4613 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4617 "cmDependsJavaParser.cxx" break; case 220: -#line 1984 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1984 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4621,11 +4625,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4625 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4629 "cmDependsJavaParser.cxx" break; case 221: -#line 1994 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 1994 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4633,11 +4637,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4637 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4641 "cmDependsJavaParser.cxx" break; case 222: -#line 2003 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2003 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -4645,11 +4649,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4649 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4653 "cmDependsJavaParser.cxx" break; case 223: -#line 2013 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2013 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -4657,11 +4661,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4661 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4665 "cmDependsJavaParser.cxx" break; case 224: -#line 2022 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2022 "cmDependsJavaParser.y" { jpElementStart(5); jpCheckEmpty(5); @@ -4669,11 +4673,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4673 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4677 "cmDependsJavaParser.cxx" break; case 225: -#line 2032 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2032 "cmDependsJavaParser.y" { jpElementStart(3); yyGetParser->DeallocateParserType(&((yyvsp[-1].str))); @@ -4682,31 +4686,31 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4686 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4690 "cmDependsJavaParser.cxx" break; case 226: -#line 2042 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2042 "cmDependsJavaParser.y" { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 4697 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4701 "cmDependsJavaParser.cxx" break; case 227: -#line 2050 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2050 "cmDependsJavaParser.y" { jpElementStart(1); } -#line 4706 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4710 "cmDependsJavaParser.cxx" break; case 228: -#line 2057 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2057 "cmDependsJavaParser.y" { jpElementStart(3); yyGetParser->DeallocateParserType(&((yyvsp[-1].str))); @@ -4715,11 +4719,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4719 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4723 "cmDependsJavaParser.cxx" break; case 229: -#line 2068 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2068 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -4727,11 +4731,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4731 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4735 "cmDependsJavaParser.cxx" break; case 230: -#line 2078 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2078 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -4739,11 +4743,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4743 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4747 "cmDependsJavaParser.cxx" break; case 231: -#line 2088 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2088 "cmDependsJavaParser.y" { jpElementStart(5); jpCheckEmpty(5); @@ -4751,11 +4755,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4755 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4759 "cmDependsJavaParser.cxx" break; case 232: -#line 2098 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2098 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -4763,11 +4767,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4767 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4771 "cmDependsJavaParser.cxx" break; case 233: -#line 2107 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2107 "cmDependsJavaParser.y" { jpElementStart(4); jpCheckEmpty(4); @@ -4775,22 +4779,22 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4779 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4783 "cmDependsJavaParser.cxx" break; case 234: -#line 2116 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2116 "cmDependsJavaParser.y" { jpElementStart(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 4790 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4794 "cmDependsJavaParser.cxx" break; case 235: -#line 2124 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2124 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4798,11 +4802,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4802 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4806 "cmDependsJavaParser.cxx" break; case 236: -#line 2134 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2134 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4810,11 +4814,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4814 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4818 "cmDependsJavaParser.cxx" break; case 237: -#line 2143 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2143 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -4822,20 +4826,20 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4826 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4830 "cmDependsJavaParser.cxx" break; case 238: -#line 2153 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2153 "cmDependsJavaParser.y" { jpElementStart(5); } -#line 4835 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4839 "cmDependsJavaParser.cxx" break; case 239: -#line 2160 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2160 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -4843,11 +4847,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4847 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4851 "cmDependsJavaParser.cxx" break; case 240: -#line 2170 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2170 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4855,11 +4859,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4859 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4863 "cmDependsJavaParser.cxx" break; case 241: -#line 2179 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2179 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4867,11 +4871,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4871 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4875 "cmDependsJavaParser.cxx" break; case 242: -#line 2189 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2189 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4879,20 +4883,20 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4883 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4887 "cmDependsJavaParser.cxx" break; case 243: -#line 2198 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2198 "cmDependsJavaParser.y" { jpElementStart(1); } -#line 4892 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4896 "cmDependsJavaParser.cxx" break; case 244: -#line 2204 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2204 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -4900,11 +4904,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4904 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4908 "cmDependsJavaParser.cxx" break; case 245: -#line 2213 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2213 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4912,11 +4916,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4916 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4920 "cmDependsJavaParser.cxx" break; case 246: -#line 2222 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2222 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4924,11 +4928,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4928 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4932 "cmDependsJavaParser.cxx" break; case 247: -#line 2231 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2231 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4936,11 +4940,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4940 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4944 "cmDependsJavaParser.cxx" break; case 248: -#line 2240 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2240 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4948,11 +4952,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4952 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4956 "cmDependsJavaParser.cxx" break; case 249: -#line 2250 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2250 "cmDependsJavaParser.y" { jpElementStart(6); jpCheckEmpty(6); @@ -4960,22 +4964,22 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4964 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4968 "cmDependsJavaParser.cxx" break; case 250: -#line 2259 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2259 "cmDependsJavaParser.y" { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 4975 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4979 "cmDependsJavaParser.cxx" break; case 251: -#line 2267 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2267 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4983,22 +4987,22 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 4987 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 4991 "cmDependsJavaParser.cxx" break; case 252: -#line 2276 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2276 "cmDependsJavaParser.y" { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 4998 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5002 "cmDependsJavaParser.cxx" break; case 253: -#line 2284 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2284 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5006,11 +5010,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5010 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5014 "cmDependsJavaParser.cxx" break; case 254: -#line 2294 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2294 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5018,11 +5022,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5022 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5026 "cmDependsJavaParser.cxx" break; case 255: -#line 2303 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2303 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5030,11 +5034,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5034 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5038 "cmDependsJavaParser.cxx" break; case 256: -#line 2313 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2313 "cmDependsJavaParser.y" { jpElementStart(4); jpCheckEmpty(4); @@ -5042,11 +5046,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5046 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5050 "cmDependsJavaParser.cxx" break; case 257: -#line 2322 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2322 "cmDependsJavaParser.y" { jpElementStart(4); jpCheckEmpty(4); @@ -5054,11 +5058,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5058 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5062 "cmDependsJavaParser.cxx" break; case 258: -#line 2331 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2331 "cmDependsJavaParser.y" { jpElementStart(4); jpCheckEmpty(4); @@ -5066,11 +5070,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5070 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5074 "cmDependsJavaParser.cxx" break; case 259: -#line 2340 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2340 "cmDependsJavaParser.y" { jpElementStart(4); jpCheckEmpty(4); @@ -5078,22 +5082,22 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5082 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5086 "cmDependsJavaParser.cxx" break; case 260: -#line 2349 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2349 "cmDependsJavaParser.y" { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 5093 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5097 "cmDependsJavaParser.cxx" break; case 261: -#line 2357 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2357 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5101,11 +5105,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5105 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5109 "cmDependsJavaParser.cxx" break; case 262: -#line 2367 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2367 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5113,11 +5117,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5117 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5121 "cmDependsJavaParser.cxx" break; case 263: -#line 2376 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2376 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -5125,11 +5129,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5129 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5133 "cmDependsJavaParser.cxx" break; case 264: -#line 2386 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2386 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5137,29 +5141,29 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5141 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5145 "cmDependsJavaParser.cxx" break; case 265: -#line 2396 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2396 "cmDependsJavaParser.y" { jpElementStart(2); } -#line 5150 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5154 "cmDependsJavaParser.cxx" break; case 266: -#line 2402 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2402 "cmDependsJavaParser.y" { jpElementStart(3); } -#line 5159 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5163 "cmDependsJavaParser.cxx" break; case 267: -#line 2409 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2409 "cmDependsJavaParser.y" { jpElementStart(3); yyGetParser->DeallocateParserType(&((yyvsp[0].str))); @@ -5168,11 +5172,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5172 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5176 "cmDependsJavaParser.cxx" break; case 268: -#line 2419 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2419 "cmDependsJavaParser.y" { jpElementStart(3); yyGetParser->DeallocateParserType(&((yyvsp[0].str))); @@ -5181,11 +5185,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5185 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5189 "cmDependsJavaParser.cxx" break; case 269: -#line 2429 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2429 "cmDependsJavaParser.y" { jpElementStart(3); yyGetParser->DeallocateParserType(&((yyvsp[0].str))); @@ -5194,11 +5198,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5198 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5202 "cmDependsJavaParser.cxx" break; case 270: -#line 2439 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2439 "cmDependsJavaParser.y" { jpElementStart(3); yyGetParser->DeallocateParserType(&((yyvsp[0].str))); @@ -5207,11 +5211,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5211 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5215 "cmDependsJavaParser.cxx" break; case 271: -#line 2450 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2450 "cmDependsJavaParser.y" { jpElementStart(4); yyGetParser->DeallocateParserType(&((yyvsp[-3].str))); @@ -5220,11 +5224,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5224 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5228 "cmDependsJavaParser.cxx" break; case 272: -#line 2460 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2460 "cmDependsJavaParser.y" { jpElementStart(6); yyGetParser->DeallocateParserType(&((yyvsp[-5].str))); @@ -5234,11 +5238,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5238 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5242 "cmDependsJavaParser.cxx" break; case 273: -#line 2471 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2471 "cmDependsJavaParser.y" { jpElementStart(6); yyGetParser->DeallocateParserType(&((yyvsp[-3].str))); @@ -5247,11 +5251,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5251 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5255 "cmDependsJavaParser.cxx" break; case 274: -#line 2481 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2481 "cmDependsJavaParser.y" { jpElementStart(6); yyGetParser->DeallocateParserType(&((yyvsp[-3].str))); @@ -5260,11 +5264,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5264 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5268 "cmDependsJavaParser.cxx" break; case 275: -#line 2492 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2492 "cmDependsJavaParser.y" { jpElementStart(4); yyGetParser->DeallocateParserType(&((yyvsp[-3].str))); @@ -5273,11 +5277,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5277 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5281 "cmDependsJavaParser.cxx" break; case 276: -#line 2502 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2502 "cmDependsJavaParser.y" { jpElementStart(4); jpCheckEmpty(4); @@ -5285,11 +5289,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5289 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5293 "cmDependsJavaParser.cxx" break; case 277: -#line 2512 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2512 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5297,11 +5301,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5301 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5305 "cmDependsJavaParser.cxx" break; case 278: -#line 2521 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2521 "cmDependsJavaParser.y" { jpElementStart(1); yyGetParser->DeallocateParserType(&((yyvsp[0].str))); @@ -5309,11 +5313,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5313 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5317 "cmDependsJavaParser.cxx" break; case 279: -#line 2530 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2530 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5321,11 +5325,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5325 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5329 "cmDependsJavaParser.cxx" break; case 280: -#line 2539 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2539 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5333,11 +5337,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5337 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5341 "cmDependsJavaParser.cxx" break; case 281: -#line 2548 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2548 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5345,11 +5349,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5349 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5353 "cmDependsJavaParser.cxx" break; case 282: -#line 2558 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2558 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -5357,11 +5361,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5361 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5365 "cmDependsJavaParser.cxx" break; case 283: -#line 2568 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2568 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -5369,11 +5373,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5373 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5377 "cmDependsJavaParser.cxx" break; case 284: -#line 2578 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2578 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5381,11 +5385,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5385 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5389 "cmDependsJavaParser.cxx" break; case 285: -#line 2587 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2587 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5393,11 +5397,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5397 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5401 "cmDependsJavaParser.cxx" break; case 286: -#line 2596 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2596 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -5405,11 +5409,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5409 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5413 "cmDependsJavaParser.cxx" break; case 287: -#line 2605 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2605 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -5417,11 +5421,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5421 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5425 "cmDependsJavaParser.cxx" break; case 288: -#line 2614 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2614 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5429,11 +5433,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5433 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5437 "cmDependsJavaParser.cxx" break; case 289: -#line 2624 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2624 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -5441,11 +5445,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5445 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5449 "cmDependsJavaParser.cxx" break; case 290: -#line 2634 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2634 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -5453,11 +5457,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5457 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5461 "cmDependsJavaParser.cxx" break; case 291: -#line 2644 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2644 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5465,11 +5469,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5469 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5473 "cmDependsJavaParser.cxx" break; case 292: -#line 2653 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2653 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -5477,11 +5481,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5481 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5485 "cmDependsJavaParser.cxx" break; case 293: -#line 2662 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2662 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -5489,11 +5493,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5493 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5497 "cmDependsJavaParser.cxx" break; case 294: -#line 2671 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2671 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5501,11 +5505,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5505 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5509 "cmDependsJavaParser.cxx" break; case 295: -#line 2681 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2681 "cmDependsJavaParser.y" { jpElementStart(5); jpCheckEmpty(5); @@ -5513,11 +5517,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5517 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5521 "cmDependsJavaParser.cxx" break; case 296: -#line 2690 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2690 "cmDependsJavaParser.y" { jpElementStart(4); jpCheckEmpty(4); @@ -5525,20 +5529,20 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5529 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5533 "cmDependsJavaParser.cxx" break; case 297: -#line 2699 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2699 "cmDependsJavaParser.y" { jpElementStart(5); } -#line 5538 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5542 "cmDependsJavaParser.cxx" break; case 298: -#line 2706 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2706 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5546,11 +5550,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5550 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5554 "cmDependsJavaParser.cxx" break; case 299: -#line 2715 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2715 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5558,11 +5562,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5562 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5566 "cmDependsJavaParser.cxx" break; case 300: -#line 2724 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2724 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5570,11 +5574,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5574 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5578 "cmDependsJavaParser.cxx" break; case 301: -#line 2733 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2733 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5582,11 +5586,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5586 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5590 "cmDependsJavaParser.cxx" break; case 302: -#line 2743 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2743 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5594,11 +5598,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5598 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5602 "cmDependsJavaParser.cxx" break; case 303: -#line 2752 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2752 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5606,11 +5610,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5610 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5614 "cmDependsJavaParser.cxx" break; case 304: -#line 2761 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2761 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5618,11 +5622,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5622 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5626 "cmDependsJavaParser.cxx" break; case 305: -#line 2771 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2771 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5630,11 +5634,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5634 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5638 "cmDependsJavaParser.cxx" break; case 306: -#line 2780 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2780 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5642,11 +5646,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5646 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5650 "cmDependsJavaParser.cxx" break; case 307: -#line 2789 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2789 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5654,11 +5658,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5658 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5662 "cmDependsJavaParser.cxx" break; case 308: -#line 2798 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2798 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5666,11 +5670,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5670 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5674 "cmDependsJavaParser.cxx" break; case 309: -#line 2808 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2808 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5678,11 +5682,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5682 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5686 "cmDependsJavaParser.cxx" break; case 310: -#line 2817 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2817 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5690,11 +5694,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5694 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5698 "cmDependsJavaParser.cxx" break; case 311: -#line 2826 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2826 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5702,11 +5706,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5706 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5710 "cmDependsJavaParser.cxx" break; case 312: -#line 2835 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2835 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5714,11 +5718,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5718 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5722 "cmDependsJavaParser.cxx" break; case 313: -#line 2844 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2844 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5726,11 +5730,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5730 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5734 "cmDependsJavaParser.cxx" break; case 314: -#line 2853 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2853 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5738,11 +5742,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5742 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5746 "cmDependsJavaParser.cxx" break; case 315: -#line 2863 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2863 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5750,11 +5754,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5754 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5758 "cmDependsJavaParser.cxx" break; case 316: -#line 2872 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2872 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5762,11 +5766,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5766 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5770 "cmDependsJavaParser.cxx" break; case 317: -#line 2881 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2881 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5774,11 +5778,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5778 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5782 "cmDependsJavaParser.cxx" break; case 318: -#line 2891 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2891 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5786,11 +5790,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5790 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5794 "cmDependsJavaParser.cxx" break; case 319: -#line 2900 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2900 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5798,11 +5802,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5802 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5806 "cmDependsJavaParser.cxx" break; case 320: -#line 2910 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2910 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5810,11 +5814,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5814 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5818 "cmDependsJavaParser.cxx" break; case 321: -#line 2919 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2919 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5822,11 +5826,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5826 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5830 "cmDependsJavaParser.cxx" break; case 322: -#line 2929 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2929 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5834,11 +5838,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5838 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5842 "cmDependsJavaParser.cxx" break; case 323: -#line 2938 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2938 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5846,11 +5850,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5850 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5854 "cmDependsJavaParser.cxx" break; case 324: -#line 2948 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2948 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5858,11 +5862,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5862 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5866 "cmDependsJavaParser.cxx" break; case 325: -#line 2957 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2957 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5870,11 +5874,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5874 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5878 "cmDependsJavaParser.cxx" break; case 326: -#line 2967 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2967 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5882,11 +5886,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5886 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5890 "cmDependsJavaParser.cxx" break; case 327: -#line 2976 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2976 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5894,11 +5898,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5898 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5902 "cmDependsJavaParser.cxx" break; case 328: -#line 2986 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2986 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5906,11 +5910,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5910 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5914 "cmDependsJavaParser.cxx" break; case 329: -#line 2995 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 2995 "cmDependsJavaParser.y" { jpElementStart(5); jpCheckEmpty(5); @@ -5918,11 +5922,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5922 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5926 "cmDependsJavaParser.cxx" break; case 330: -#line 3005 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 3005 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5930,11 +5934,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5934 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5938 "cmDependsJavaParser.cxx" break; case 331: -#line 3014 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 3014 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5942,11 +5946,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5946 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5950 "cmDependsJavaParser.cxx" break; case 332: -#line 3024 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 3024 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5954,11 +5958,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5958 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5962 "cmDependsJavaParser.cxx" break; case 333: -#line 3034 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 3034 "cmDependsJavaParser.y" { jpElementStart(1); yyGetParser->DeallocateParserType(&((yyvsp[0].str))); @@ -5967,11 +5971,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5971 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5975 "cmDependsJavaParser.cxx" break; case 334: -#line 3044 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 3044 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5979,11 +5983,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5983 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5987 "cmDependsJavaParser.cxx" break; case 335: -#line 3053 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 3053 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5991,11 +5995,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 5995 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 5999 "cmDependsJavaParser.cxx" break; case 336: -#line 3063 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 3063 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6003,11 +6007,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 6007 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 6011 "cmDependsJavaParser.cxx" break; case 337: -#line 3072 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 3072 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6015,11 +6019,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 6019 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 6023 "cmDependsJavaParser.cxx" break; case 338: -#line 3081 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 3081 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6027,11 +6031,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 6031 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 6035 "cmDependsJavaParser.cxx" break; case 339: -#line 3090 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 3090 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6039,11 +6043,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 6043 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 6047 "cmDependsJavaParser.cxx" break; case 340: -#line 3099 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 3099 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6051,11 +6055,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 6055 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 6059 "cmDependsJavaParser.cxx" break; case 341: -#line 3108 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 3108 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6063,11 +6067,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 6067 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 6071 "cmDependsJavaParser.cxx" break; case 342: -#line 3117 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 3117 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6075,11 +6079,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 6079 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 6083 "cmDependsJavaParser.cxx" break; case 343: -#line 3126 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 3126 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6087,11 +6091,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 6091 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 6095 "cmDependsJavaParser.cxx" break; case 344: -#line 3135 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 3135 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6099,11 +6103,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 6103 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 6107 "cmDependsJavaParser.cxx" break; case 345: -#line 3144 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 3144 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6111,11 +6115,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 6115 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 6119 "cmDependsJavaParser.cxx" break; case 346: -#line 3153 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 3153 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6123,11 +6127,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 6127 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 6131 "cmDependsJavaParser.cxx" break; case 347: -#line 3162 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 3162 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6135,11 +6139,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 6139 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 6143 "cmDependsJavaParser.cxx" break; case 348: -#line 3172 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 3172 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6147,11 +6151,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 6151 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 6155 "cmDependsJavaParser.cxx" break; case 349: -#line 3182 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 3182 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6159,11 +6163,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 6163 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 6167 "cmDependsJavaParser.cxx" break; case 350: -#line 3192 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 3192 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6171,11 +6175,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 6175 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 6179 "cmDependsJavaParser.cxx" break; case 351: -#line 3201 "cmDependsJavaParser.y" /* yacc.c:1652 */ +#line 3201 "cmDependsJavaParser.y" { jpElementStart(3); jpStoreClass((yyvsp[-2].str)); @@ -6184,11 +6188,12 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyGetParser->SetCurrentCombine(""); } -#line 6188 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 6192 "cmDependsJavaParser.cxx" break; -#line 6192 "cmDependsJavaParser.cxx" /* yacc.c:1652 */ +#line 6196 "cmDependsJavaParser.cxx" + default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -6421,7 +6426,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); #endif return yyresult; } -#line 3210 "cmDependsJavaParser.y" /* yacc.c:1918 */ +#line 3210 "cmDependsJavaParser.y" /* End of grammar */ diff --git a/Source/LexerParser/cmDependsJavaParserTokens.h b/Source/LexerParser/cmDependsJavaParserTokens.h index 6bbc0848d45..e0dfa01cc56 100644 --- a/Source/LexerParser/cmDependsJavaParserTokens.h +++ b/Source/LexerParser/cmDependsJavaParserTokens.h @@ -1,4 +1,4 @@ -/* A Bison parser, made by GNU Bison 3.3.2. */ +/* A Bison parser, made by GNU Bison 3.4.2. */ /* Bison interface for Yacc-like parsers in C diff --git a/Source/LexerParser/cmExprParser.cxx b/Source/LexerParser/cmExprParser.cxx index 8416e7249cc..562b35bf713 100644 --- a/Source/LexerParser/cmExprParser.cxx +++ b/Source/LexerParser/cmExprParser.cxx @@ -1,4 +1,4 @@ -/* A Bison parser, made by GNU Bison 3.3.2. */ +/* A Bison parser, made by GNU Bison 3.4.2. */ /* Bison implementation for Yacc-like parsers in C @@ -48,7 +48,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "3.3.2" +#define YYBISON_VERSION "3.4.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -72,7 +72,7 @@ /* First part of user prologue. */ -#line 1 "cmExprParser.y" /* yacc.c:337 */ +#line 1 "cmExprParser.y" /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ @@ -116,7 +116,8 @@ static void cmExpr_yyerror(yyscan_t yyscanner, const char* message); # pragma GCC diagnostic ignored "-Wconversion" #endif -#line 120 "cmExprParser.cxx" /* yacc.c:337 */ +#line 120 "cmExprParser.cxx" + # ifndef YY_NULLPTR # if defined __cplusplus # if 201103L <= __cplusplus @@ -137,8 +138,8 @@ static void cmExpr_yyerror(yyscan_t yyscanner, const char* message); # define YYERROR_VERBOSE 1 #endif -/* In a future release of Bison, this section will be replaced - by #include "cmExprParserTokens.h". */ +/* Use api.header.include to #include this header + instead of duplicating it here. */ #ifndef YY_CMEXPR_YY_CMEXPRPARSERTOKENS_H_INCLUDED # define YY_CMEXPR_YY_CMEXPRPARSERTOKENS_H_INCLUDED /* Debug traces. */ @@ -296,6 +297,8 @@ typedef short yytype_int16; #endif +#define YY_ASSERT(E) ((void) (0 && (E))) + #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -688,7 +691,9 @@ yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, yy if (yytype < YYNTOKENS) YYPRINT (yyo, yytoknum[yytype], *yyvaluep); # endif + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -1126,6 +1131,8 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); | yynewstate -- set current state (the top of the stack) to yystate. | `--------------------------------------------------------------------*/ yysetstate: + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + YY_ASSERT (0 <= yystate && yystate < YYNSTATES); *yyssp = (yytype_int16) yystate; if (yyss + yystacksize - 1 <= yyssp) @@ -1188,8 +1195,6 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); } #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - if (yystate == YYFINAL) YYACCEPT; @@ -1257,7 +1262,6 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END - goto yynewstate; @@ -1292,195 +1296,196 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); YY_REDUCE_PRINT (yyn); switch (yyn) { - case 2: -#line 77 "cmExprParser.y" /* yacc.c:1652 */ + case 2: +#line 77 "cmExprParser.y" { cmExpr_yyget_extra(yyscanner)->SetResult((yyvsp[0].Number)); } -#line 1301 "cmExprParser.cxx" /* yacc.c:1652 */ +#line 1305 "cmExprParser.cxx" break; case 3: -#line 82 "cmExprParser.y" /* yacc.c:1652 */ +#line 82 "cmExprParser.y" { (yyval.Number) = (yyvsp[0].Number); } -#line 1309 "cmExprParser.cxx" /* yacc.c:1652 */ +#line 1313 "cmExprParser.cxx" break; case 4: -#line 85 "cmExprParser.y" /* yacc.c:1652 */ +#line 85 "cmExprParser.y" { (yyval.Number) = (yyvsp[-2].Number) | (yyvsp[0].Number); } -#line 1317 "cmExprParser.cxx" /* yacc.c:1652 */ +#line 1321 "cmExprParser.cxx" break; case 5: -#line 90 "cmExprParser.y" /* yacc.c:1652 */ +#line 90 "cmExprParser.y" { (yyval.Number) = (yyvsp[0].Number); } -#line 1325 "cmExprParser.cxx" /* yacc.c:1652 */ +#line 1329 "cmExprParser.cxx" break; case 6: -#line 93 "cmExprParser.y" /* yacc.c:1652 */ +#line 93 "cmExprParser.y" { (yyval.Number) = (yyvsp[-2].Number) ^ (yyvsp[0].Number); } -#line 1333 "cmExprParser.cxx" /* yacc.c:1652 */ +#line 1337 "cmExprParser.cxx" break; case 7: -#line 98 "cmExprParser.y" /* yacc.c:1652 */ +#line 98 "cmExprParser.y" { (yyval.Number) = (yyvsp[0].Number); } -#line 1341 "cmExprParser.cxx" /* yacc.c:1652 */ +#line 1345 "cmExprParser.cxx" break; case 8: -#line 101 "cmExprParser.y" /* yacc.c:1652 */ +#line 101 "cmExprParser.y" { (yyval.Number) = (yyvsp[-2].Number) & (yyvsp[0].Number); } -#line 1349 "cmExprParser.cxx" /* yacc.c:1652 */ +#line 1353 "cmExprParser.cxx" break; case 9: -#line 106 "cmExprParser.y" /* yacc.c:1652 */ +#line 106 "cmExprParser.y" { (yyval.Number) = (yyvsp[0].Number); } -#line 1357 "cmExprParser.cxx" /* yacc.c:1652 */ +#line 1361 "cmExprParser.cxx" break; case 10: -#line 109 "cmExprParser.y" /* yacc.c:1652 */ +#line 109 "cmExprParser.y" { (yyval.Number) = (yyvsp[-2].Number) << (yyvsp[0].Number); } -#line 1365 "cmExprParser.cxx" /* yacc.c:1652 */ +#line 1369 "cmExprParser.cxx" break; case 11: -#line 112 "cmExprParser.y" /* yacc.c:1652 */ +#line 112 "cmExprParser.y" { (yyval.Number) = (yyvsp[-2].Number) >> (yyvsp[0].Number); } -#line 1373 "cmExprParser.cxx" /* yacc.c:1652 */ +#line 1377 "cmExprParser.cxx" break; case 12: -#line 117 "cmExprParser.y" /* yacc.c:1652 */ +#line 117 "cmExprParser.y" { (yyval.Number) = (yyvsp[0].Number); } -#line 1381 "cmExprParser.cxx" /* yacc.c:1652 */ +#line 1385 "cmExprParser.cxx" break; case 13: -#line 120 "cmExprParser.y" /* yacc.c:1652 */ +#line 120 "cmExprParser.y" { (yyval.Number) = (yyvsp[-2].Number) + (yyvsp[0].Number); } -#line 1389 "cmExprParser.cxx" /* yacc.c:1652 */ +#line 1393 "cmExprParser.cxx" break; case 14: -#line 123 "cmExprParser.y" /* yacc.c:1652 */ +#line 123 "cmExprParser.y" { (yyval.Number) = (yyvsp[-2].Number) - (yyvsp[0].Number); } -#line 1397 "cmExprParser.cxx" /* yacc.c:1652 */ +#line 1401 "cmExprParser.cxx" break; case 15: -#line 128 "cmExprParser.y" /* yacc.c:1652 */ +#line 128 "cmExprParser.y" { (yyval.Number) = (yyvsp[0].Number); } -#line 1405 "cmExprParser.cxx" /* yacc.c:1652 */ +#line 1409 "cmExprParser.cxx" break; case 16: -#line 131 "cmExprParser.y" /* yacc.c:1652 */ +#line 131 "cmExprParser.y" { (yyval.Number) = (yyvsp[-2].Number) * (yyvsp[0].Number); } -#line 1413 "cmExprParser.cxx" /* yacc.c:1652 */ +#line 1417 "cmExprParser.cxx" break; case 17: -#line 134 "cmExprParser.y" /* yacc.c:1652 */ +#line 134 "cmExprParser.y" { if (yyvsp[0].Number == 0) { throw std::overflow_error("divide by zero"); } (yyval.Number) = (yyvsp[-2].Number) / (yyvsp[0].Number); } -#line 1424 "cmExprParser.cxx" /* yacc.c:1652 */ +#line 1428 "cmExprParser.cxx" break; case 18: -#line 140 "cmExprParser.y" /* yacc.c:1652 */ +#line 140 "cmExprParser.y" { (yyval.Number) = (yyvsp[-2].Number) % (yyvsp[0].Number); } -#line 1432 "cmExprParser.cxx" /* yacc.c:1652 */ +#line 1436 "cmExprParser.cxx" break; case 19: -#line 145 "cmExprParser.y" /* yacc.c:1652 */ +#line 145 "cmExprParser.y" { (yyval.Number) = (yyvsp[0].Number); } -#line 1440 "cmExprParser.cxx" /* yacc.c:1652 */ +#line 1444 "cmExprParser.cxx" break; case 20: -#line 148 "cmExprParser.y" /* yacc.c:1652 */ +#line 148 "cmExprParser.y" { (yyval.Number) = + (yyvsp[0].Number); } -#line 1448 "cmExprParser.cxx" /* yacc.c:1652 */ +#line 1452 "cmExprParser.cxx" break; case 21: -#line 151 "cmExprParser.y" /* yacc.c:1652 */ +#line 151 "cmExprParser.y" { (yyval.Number) = - (yyvsp[0].Number); } -#line 1456 "cmExprParser.cxx" /* yacc.c:1652 */ +#line 1460 "cmExprParser.cxx" break; case 22: -#line 154 "cmExprParser.y" /* yacc.c:1652 */ +#line 154 "cmExprParser.y" { (yyval.Number) = ~ (yyvsp[0].Number); } -#line 1464 "cmExprParser.cxx" /* yacc.c:1652 */ +#line 1468 "cmExprParser.cxx" break; case 23: -#line 159 "cmExprParser.y" /* yacc.c:1652 */ +#line 159 "cmExprParser.y" { (yyval.Number) = (yyvsp[0].Number); } -#line 1472 "cmExprParser.cxx" /* yacc.c:1652 */ +#line 1476 "cmExprParser.cxx" break; case 24: -#line 162 "cmExprParser.y" /* yacc.c:1652 */ +#line 162 "cmExprParser.y" { (yyval.Number) = (yyvsp[-1].Number); } -#line 1480 "cmExprParser.cxx" /* yacc.c:1652 */ +#line 1484 "cmExprParser.cxx" break; -#line 1484 "cmExprParser.cxx" /* yacc.c:1652 */ +#line 1488 "cmExprParser.cxx" + default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -1713,7 +1718,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); #endif return yyresult; } -#line 167 "cmExprParser.y" /* yacc.c:1918 */ +#line 167 "cmExprParser.y" /* End of grammar */ diff --git a/Source/LexerParser/cmExprParserTokens.h b/Source/LexerParser/cmExprParserTokens.h index 5ffd7c5100d..e30a8325726 100644 --- a/Source/LexerParser/cmExprParserTokens.h +++ b/Source/LexerParser/cmExprParserTokens.h @@ -1,4 +1,4 @@ -/* A Bison parser, made by GNU Bison 3.3.2. */ +/* A Bison parser, made by GNU Bison 3.4.2. */ /* Bison interface for Yacc-like parsers in C diff --git a/Source/LexerParser/cmFortranParser.cxx b/Source/LexerParser/cmFortranParser.cxx index 2ca79276d8f..f016fd8b6f0 100644 --- a/Source/LexerParser/cmFortranParser.cxx +++ b/Source/LexerParser/cmFortranParser.cxx @@ -1,4 +1,4 @@ -/* A Bison parser, made by GNU Bison 3.3.2. */ +/* A Bison parser, made by GNU Bison 3.4.2. */ /* Bison implementation for Yacc-like parsers in C @@ -48,7 +48,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "3.3.2" +#define YYBISON_VERSION "3.4.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -72,7 +72,7 @@ /* First part of user prologue. */ -#line 1 "cmFortranParser.y" /* yacc.c:337 */ +#line 1 "cmFortranParser.y" /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ @@ -135,7 +135,8 @@ static void cmFortran_yyerror(yyscan_t yyscanner, const char* message) # pragma GCC diagnostic ignored "-Wconversion" #endif -#line 139 "cmFortranParser.cxx" /* yacc.c:337 */ +#line 139 "cmFortranParser.cxx" + # ifndef YY_NULLPTR # if defined __cplusplus # if 201103L <= __cplusplus @@ -156,8 +157,8 @@ static void cmFortran_yyerror(yyscan_t yyscanner, const char* message) # define YYERROR_VERBOSE 1 #endif -/* In a future release of Bison, this section will be replaced - by #include "cmFortranParserTokens.h". */ +/* Use api.header.include to #include this header + instead of duplicating it here. */ #ifndef YY_CMFORTRAN_YY_CMFORTRANPARSERTOKENS_H_INCLUDED # define YY_CMFORTRAN_YY_CMFORTRANPARSERTOKENS_H_INCLUDED /* Debug traces. */ @@ -255,16 +256,15 @@ extern int cmFortran_yydebug; /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED - union YYSTYPE { -#line 73 "cmFortranParser.y" /* yacc.c:352 */ +#line 73 "cmFortranParser.y" char* string; -#line 266 "cmFortranParser.cxx" /* yacc.c:352 */ -}; +#line 266 "cmFortranParser.cxx" +}; typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 @@ -378,6 +378,8 @@ typedef short yytype_int16; #endif +#define YY_ASSERT(E) ((void) (0 && (E))) + #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -930,7 +932,9 @@ yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, yy if (yytype < YYNTOKENS) YYPRINT (yyo, yytoknum[yytype], *yyvaluep); # endif + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -1368,6 +1372,8 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); | yynewstate -- set current state (the top of the stack) to yystate. | `--------------------------------------------------------------------*/ yysetstate: + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + YY_ASSERT (0 <= yystate && yystate < YYNSTATES); *yyssp = (yytype_int16) yystate; if (yyss + yystacksize - 1 <= yyssp) @@ -1430,8 +1436,6 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); } #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - if (yystate == YYFINAL) YYACCEPT; @@ -1499,7 +1503,6 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END - goto yynewstate; @@ -1534,27 +1537,27 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); YY_REDUCE_PRINT (yyn); switch (yyn) { - case 4: -#line 104 "cmFortranParser.y" /* yacc.c:1652 */ + case 4: +#line 104 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_SetInInterface(parser, true); } -#line 1544 "cmFortranParser.cxx" /* yacc.c:1652 */ +#line 1547 "cmFortranParser.cxx" break; case 5: -#line 108 "cmFortranParser.y" /* yacc.c:1652 */ +#line 108 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleUse(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1554 "cmFortranParser.cxx" /* yacc.c:1652 */ +#line 1557 "cmFortranParser.cxx" break; case 6: -#line 113 "cmFortranParser.y" /* yacc.c:1652 */ +#line 113 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); if (cmsysString_strcasecmp((yyvsp[-2].string), "function") != 0 && @@ -1564,22 +1567,22 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); } free((yyvsp[-2].string)); } -#line 1568 "cmFortranParser.cxx" /* yacc.c:1652 */ +#line 1571 "cmFortranParser.cxx" break; case 7: -#line 122 "cmFortranParser.y" /* yacc.c:1652 */ +#line 122 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleSubmodule(parser, (yyvsp[-4].string), (yyvsp[-2].string)); free((yyvsp[-4].string)); free((yyvsp[-2].string)); } -#line 1579 "cmFortranParser.cxx" /* yacc.c:1652 */ +#line 1582 "cmFortranParser.cxx" break; case 8: -#line 128 "cmFortranParser.y" /* yacc.c:1652 */ +#line 128 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleSubmoduleNested(parser, (yyvsp[-6].string), (yyvsp[-4].string), (yyvsp[-2].string)); @@ -1587,40 +1590,40 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); free((yyvsp[-4].string)); free((yyvsp[-2].string)); } -#line 1591 "cmFortranParser.cxx" /* yacc.c:1652 */ +#line 1594 "cmFortranParser.cxx" break; case 9: -#line 135 "cmFortranParser.y" /* yacc.c:1652 */ +#line 135 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_SetInInterface(parser, true); free((yyvsp[-2].string)); } -#line 1601 "cmFortranParser.cxx" /* yacc.c:1652 */ +#line 1604 "cmFortranParser.cxx" break; case 10: -#line 140 "cmFortranParser.y" /* yacc.c:1652 */ +#line 140 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_SetInInterface(parser, false); } -#line 1610 "cmFortranParser.cxx" /* yacc.c:1652 */ +#line 1613 "cmFortranParser.cxx" break; case 11: -#line 144 "cmFortranParser.y" /* yacc.c:1652 */ +#line 144 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleUse(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1620 "cmFortranParser.cxx" /* yacc.c:1652 */ +#line 1623 "cmFortranParser.cxx" break; case 12: -#line 149 "cmFortranParser.y" /* yacc.c:1652 */ +#line 149 "cmFortranParser.y" { if (cmsysString_strcasecmp((yyvsp[-4].string), "non_intrinsic") == 0) { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); @@ -1629,139 +1632,140 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); free((yyvsp[-4].string)); free((yyvsp[-2].string)); } -#line 1633 "cmFortranParser.cxx" /* yacc.c:1652 */ +#line 1636 "cmFortranParser.cxx" break; case 13: -#line 157 "cmFortranParser.y" /* yacc.c:1652 */ +#line 157 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleInclude(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1643 "cmFortranParser.cxx" /* yacc.c:1652 */ +#line 1646 "cmFortranParser.cxx" break; case 14: -#line 162 "cmFortranParser.y" /* yacc.c:1652 */ +#line 162 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleLineDirective(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1653 "cmFortranParser.cxx" /* yacc.c:1652 */ +#line 1656 "cmFortranParser.cxx" break; case 15: -#line 167 "cmFortranParser.y" /* yacc.c:1652 */ +#line 167 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleInclude(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1663 "cmFortranParser.cxx" /* yacc.c:1652 */ +#line 1666 "cmFortranParser.cxx" break; case 16: -#line 172 "cmFortranParser.y" /* yacc.c:1652 */ +#line 172 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleInclude(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1673 "cmFortranParser.cxx" /* yacc.c:1652 */ +#line 1676 "cmFortranParser.cxx" break; case 17: -#line 177 "cmFortranParser.y" /* yacc.c:1652 */ +#line 177 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleDefine(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1683 "cmFortranParser.cxx" /* yacc.c:1652 */ +#line 1686 "cmFortranParser.cxx" break; case 18: -#line 182 "cmFortranParser.y" /* yacc.c:1652 */ +#line 182 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleUndef(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1693 "cmFortranParser.cxx" /* yacc.c:1652 */ +#line 1696 "cmFortranParser.cxx" break; case 19: -#line 187 "cmFortranParser.y" /* yacc.c:1652 */ +#line 187 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleIfdef(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1703 "cmFortranParser.cxx" /* yacc.c:1652 */ +#line 1706 "cmFortranParser.cxx" break; case 20: -#line 192 "cmFortranParser.y" /* yacc.c:1652 */ +#line 192 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleIfndef(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1713 "cmFortranParser.cxx" /* yacc.c:1652 */ +#line 1716 "cmFortranParser.cxx" break; case 21: -#line 197 "cmFortranParser.y" /* yacc.c:1652 */ +#line 197 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleIf(parser); } -#line 1722 "cmFortranParser.cxx" /* yacc.c:1652 */ +#line 1725 "cmFortranParser.cxx" break; case 22: -#line 201 "cmFortranParser.y" /* yacc.c:1652 */ +#line 201 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleElif(parser); } -#line 1731 "cmFortranParser.cxx" /* yacc.c:1652 */ +#line 1734 "cmFortranParser.cxx" break; case 23: -#line 205 "cmFortranParser.y" /* yacc.c:1652 */ +#line 205 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleElse(parser); } -#line 1740 "cmFortranParser.cxx" /* yacc.c:1652 */ +#line 1743 "cmFortranParser.cxx" break; case 24: -#line 209 "cmFortranParser.y" /* yacc.c:1652 */ +#line 209 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleEndif(parser); } -#line 1749 "cmFortranParser.cxx" /* yacc.c:1652 */ +#line 1752 "cmFortranParser.cxx" break; case 48: -#line 231 "cmFortranParser.y" /* yacc.c:1652 */ +#line 231 "cmFortranParser.y" { free ((yyvsp[0].string)); } -#line 1755 "cmFortranParser.cxx" /* yacc.c:1652 */ +#line 1758 "cmFortranParser.cxx" break; case 55: -#line 238 "cmFortranParser.y" /* yacc.c:1652 */ +#line 238 "cmFortranParser.y" { free ((yyvsp[0].string)); } -#line 1761 "cmFortranParser.cxx" /* yacc.c:1652 */ +#line 1764 "cmFortranParser.cxx" break; -#line 1765 "cmFortranParser.cxx" /* yacc.c:1652 */ +#line 1768 "cmFortranParser.cxx" + default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -1994,6 +1998,6 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); #endif return yyresult; } -#line 249 "cmFortranParser.y" /* yacc.c:1918 */ +#line 249 "cmFortranParser.y" /* End of grammar */ diff --git a/Source/LexerParser/cmFortranParserTokens.h b/Source/LexerParser/cmFortranParserTokens.h index 0da4c1c43ed..f66a15cf872 100644 --- a/Source/LexerParser/cmFortranParserTokens.h +++ b/Source/LexerParser/cmFortranParserTokens.h @@ -1,4 +1,4 @@ -/* A Bison parser, made by GNU Bison 3.3.2. */ +/* A Bison parser, made by GNU Bison 3.4.2. */ /* Bison interface for Yacc-like parsers in C @@ -131,16 +131,15 @@ extern int cmFortran_yydebug; /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED - union YYSTYPE { -#line 73 "cmFortranParser.y" /* yacc.c:1921 */ +#line 73 "cmFortranParser.y" char* string; -#line 142 "cmFortranParserTokens.h" /* yacc.c:1921 */ -}; +#line 141 "cmFortranParserTokens.h" +}; typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 From 154b8d1a279e42183a876bdd816c347ae9fe3829 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tiziano=20M=C3=BCller?= Date: Wed, 13 Nov 2019 16:01:06 +0100 Subject: [PATCH 116/662] Fortran: ignore CPP line directives in line-continued USE stmts Issue: #18188 --- Source/LexerParser/cmFortranParser.cxx | 246 ++++++++++++------------- Source/LexerParser/cmFortranParser.y | 1 + 2 files changed, 124 insertions(+), 123 deletions(-) diff --git a/Source/LexerParser/cmFortranParser.cxx b/Source/LexerParser/cmFortranParser.cxx index f016fd8b6f0..2494aadcc76 100644 --- a/Source/LexerParser/cmFortranParser.cxx +++ b/Source/LexerParser/cmFortranParser.cxx @@ -511,16 +511,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 593 +#define YYLAST 594 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 41 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 14 /* YYNRULES -- Number of rules. */ -#define YYNRULES 63 +#define YYNRULES 64 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 126 +#define YYNSTATES 127 #define YYUNDEFTOK 2 #define YYMAXUTOK 295 @@ -576,7 +576,7 @@ static const yytype_uint8 yyrline[] = 220, 220, 221, 221, 222, 222, 223, 223, 224, 224, 225, 225, 226, 226, 227, 227, 228, 228, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246 + 243, 244, 245, 246, 247 }; #endif @@ -628,16 +628,16 @@ static const yytype_int16 yypact[] = -39, 21, -39, 1, -39, -20, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -24, -18, 20, -8, - -3, 39, -39, 15, 16, 18, 19, 33, -39, -39, + -3, 40, -39, 15, 16, 17, 19, 34, -39, -39, -39, -39, -39, -39, 59, -39, -39, -39, -39, -39, - 35, 36, 37, -39, -39, -39, -39, -39, -39, 76, - 114, 129, 167, 182, -39, -39, -39, -39, -39, -39, + 36, 37, 38, -39, -39, -39, -39, -39, -39, 77, + 115, 130, 168, 183, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, 220, 235, 273, 288, -21, 26, -39, 326, - 341, 379, 394, 432, 447, -39, -39, -39, -39, -39, - -39, -39, -39, -39, 38, 40, 41, 485, -39, -39, - -39, -39, -39, -39, 45, -39, -39, -39, 43, 500, - 538, -39, -39, -39, 553, -39 + -39, -39, -39, 221, 236, 274, 289, -21, 26, -39, + 327, 342, 380, 395, 433, 448, -39, -39, -39, -39, + -39, -39, -39, -39, -39, 39, 41, 42, 486, -39, + -39, -39, -39, -39, -39, 18, -39, -39, -39, 43, + 501, 539, -39, -39, -39, 554, -39 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -651,13 +651,13 @@ static const yytype_uint8 yydefact[] = 0, 0, 3, 0, 0, 0, 0, 0, 46, 46, 46, 46, 26, 46, 0, 46, 46, 4, 46, 46, 0, 0, 0, 46, 46, 46, 46, 46, 46, 0, - 0, 0, 0, 0, 15, 57, 56, 62, 58, 59, - 60, 61, 63, 55, 48, 49, 50, 51, 52, 53, - 54, 47, 0, 0, 0, 0, 0, 0, 46, 0, - 0, 0, 0, 0, 0, 21, 22, 23, 24, 14, - 10, 13, 9, 6, 0, 0, 0, 0, 5, 16, - 17, 18, 19, 20, 0, 46, 46, 11, 0, 0, - 0, 46, 7, 12, 0, 8 + 0, 0, 0, 0, 15, 57, 56, 64, 62, 58, + 59, 60, 61, 63, 55, 48, 49, 50, 51, 52, + 53, 54, 47, 0, 0, 0, 0, 0, 0, 46, + 0, 0, 0, 0, 0, 0, 21, 22, 23, 24, + 14, 10, 13, 9, 6, 0, 0, 0, 0, 5, + 16, 17, 18, 19, 20, 0, 46, 46, 11, 0, + 0, 0, 46, 7, 12, 0, 8 }; /* YYPGOTO[NTERM-NUM]. */ @@ -671,7 +671,7 @@ static const yytype_int8 yypgoto[] = static const yytype_int8 yydefgoto[] = { -1, 1, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 44, 81 + 40, 41, 44, 82 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -679,66 +679,66 @@ static const yytype_int8 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_uint8 yytable[] = { - 59, 60, 61, 62, 42, 63, 104, 82, 83, 105, - 84, 85, 43, 45, 46, 89, 90, 91, 92, 93, - 94, 2, 3, 47, 4, 49, 50, 5, 6, 7, + 59, 60, 61, 62, 42, 63, 105, 83, 84, 106, + 85, 86, 43, 45, 46, 90, 91, 92, 93, 94, + 95, 2, 3, 47, 4, 49, 50, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 54, 0, 55, - 107, 56, 57, 48, 106, 25, 26, 27, 28, 29, - 30, 31, 64, 65, 66, 51, 58, 52, 86, 87, - 88, 114, 53, 115, 116, 118, 121, 119, 120, 95, - 65, 66, 0, 124, 0, 67, 68, 69, 70, 71, - 72, 73, 74, 0, 75, 76, 77, 78, 79, 80, - 0, 0, 67, 68, 69, 70, 71, 72, 73, 74, - 0, 75, 76, 77, 78, 79, 80, 96, 65, 66, + 18, 19, 20, 21, 22, 23, 24, 54, 119, 55, + 56, 108, 57, 48, 107, 25, 26, 27, 28, 29, + 30, 31, 64, 65, 66, 67, 51, 58, 52, 87, + 88, 89, 115, 53, 116, 117, 122, 0, 120, 121, + 96, 65, 66, 67, 125, 68, 69, 70, 71, 72, + 73, 74, 75, 0, 76, 77, 78, 79, 80, 81, + 0, 0, 0, 68, 69, 70, 71, 72, 73, 74, + 75, 0, 76, 77, 78, 79, 80, 81, 97, 65, + 66, 67, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 98, 65, 66, 67, 0, 0, 0, + 0, 68, 69, 70, 71, 72, 73, 74, 75, 0, + 76, 77, 78, 79, 80, 81, 68, 69, 70, 71, + 72, 73, 74, 75, 0, 76, 77, 78, 79, 80, + 81, 99, 65, 66, 67, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 100, 65, 66, 67, + 0, 0, 0, 0, 68, 69, 70, 71, 72, 73, + 74, 75, 0, 76, 77, 78, 79, 80, 81, 68, + 69, 70, 71, 72, 73, 74, 75, 0, 76, 77, + 78, 79, 80, 81, 101, 65, 66, 67, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 102, + 65, 66, 67, 0, 0, 0, 0, 68, 69, 70, + 71, 72, 73, 74, 75, 0, 76, 77, 78, 79, + 80, 81, 68, 69, 70, 71, 72, 73, 74, 75, + 0, 76, 77, 78, 79, 80, 81, 103, 65, 66, + 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 104, 65, 66, 67, 0, 0, 0, 0, + 68, 69, 70, 71, 72, 73, 74, 75, 0, 76, + 77, 78, 79, 80, 81, 68, 69, 70, 71, 72, + 73, 74, 75, 0, 76, 77, 78, 79, 80, 81, + 109, 65, 66, 67, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 110, 65, 66, 67, 0, + 0, 0, 0, 68, 69, 70, 71, 72, 73, 74, + 75, 0, 76, 77, 78, 79, 80, 81, 68, 69, + 70, 71, 72, 73, 74, 75, 0, 76, 77, 78, + 79, 80, 81, 111, 65, 66, 67, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 112, 65, + 66, 67, 0, 0, 0, 0, 68, 69, 70, 71, + 72, 73, 74, 75, 0, 76, 77, 78, 79, 80, + 81, 68, 69, 70, 71, 72, 73, 74, 75, 0, + 76, 77, 78, 79, 80, 81, 113, 65, 66, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 97, 65, 66, 0, 0, 0, 0, 0, - 67, 68, 69, 70, 71, 72, 73, 74, 0, 75, - 76, 77, 78, 79, 80, 67, 68, 69, 70, 71, - 72, 73, 74, 0, 75, 76, 77, 78, 79, 80, - 98, 65, 66, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 99, 65, 66, 0, 0, - 0, 0, 0, 67, 68, 69, 70, 71, 72, 73, - 74, 0, 75, 76, 77, 78, 79, 80, 67, 68, - 69, 70, 71, 72, 73, 74, 0, 75, 76, 77, - 78, 79, 80, 100, 65, 66, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 101, 65, - 66, 0, 0, 0, 0, 0, 67, 68, 69, 70, - 71, 72, 73, 74, 0, 75, 76, 77, 78, 79, - 80, 67, 68, 69, 70, 71, 72, 73, 74, 0, - 75, 76, 77, 78, 79, 80, 102, 65, 66, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 103, 65, 66, 0, 0, 0, 0, 0, 67, - 68, 69, 70, 71, 72, 73, 74, 0, 75, 76, - 77, 78, 79, 80, 67, 68, 69, 70, 71, 72, - 73, 74, 0, 75, 76, 77, 78, 79, 80, 108, - 65, 66, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 109, 65, 66, 0, 0, 0, - 0, 0, 67, 68, 69, 70, 71, 72, 73, 74, - 0, 75, 76, 77, 78, 79, 80, 67, 68, 69, - 70, 71, 72, 73, 74, 0, 75, 76, 77, 78, - 79, 80, 110, 65, 66, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 111, 65, 66, - 0, 0, 0, 0, 0, 67, 68, 69, 70, 71, - 72, 73, 74, 0, 75, 76, 77, 78, 79, 80, - 67, 68, 69, 70, 71, 72, 73, 74, 0, 75, - 76, 77, 78, 79, 80, 112, 65, 66, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 113, 65, 66, 0, 0, 0, 0, 0, 67, 68, - 69, 70, 71, 72, 73, 74, 0, 75, 76, 77, - 78, 79, 80, 67, 68, 69, 70, 71, 72, 73, - 74, 0, 75, 76, 77, 78, 79, 80, 117, 65, - 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 122, 65, 66, 0, 0, 0, 0, - 0, 67, 68, 69, 70, 71, 72, 73, 74, 0, - 75, 76, 77, 78, 79, 80, 67, 68, 69, 70, - 71, 72, 73, 74, 0, 75, 76, 77, 78, 79, - 80, 123, 65, 66, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 125, 65, 66, 0, - 0, 0, 0, 0, 67, 68, 69, 70, 71, 72, - 73, 74, 0, 75, 76, 77, 78, 79, 80, 67, - 68, 69, 70, 71, 72, 73, 74, 0, 75, 76, - 77, 78, 79, 80 + 0, 114, 65, 66, 67, 0, 0, 0, 0, 68, + 69, 70, 71, 72, 73, 74, 75, 0, 76, 77, + 78, 79, 80, 81, 68, 69, 70, 71, 72, 73, + 74, 75, 0, 76, 77, 78, 79, 80, 81, 118, + 65, 66, 67, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 123, 65, 66, 67, 0, 0, + 0, 0, 68, 69, 70, 71, 72, 73, 74, 75, + 0, 76, 77, 78, 79, 80, 81, 68, 69, 70, + 71, 72, 73, 74, 75, 0, 76, 77, 78, 79, + 80, 81, 124, 65, 66, 67, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 126, 65, 66, + 67, 0, 0, 0, 0, 68, 69, 70, 71, 72, + 73, 74, 75, 0, 76, 77, 78, 79, 80, 81, + 68, 69, 70, 71, 72, 73, 74, 75, 0, 76, + 77, 78, 79, 80, 81 }; static const yytype_int8 yycheck[] = @@ -747,62 +747,62 @@ static const yytype_int8 yycheck[] = 48, 49, 32, 37, 32, 53, 54, 55, 56, 57, 58, 0, 1, 3, 3, 33, 29, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 32, -1, 33, - 88, 33, 33, 33, 28, 34, 35, 36, 37, 38, - 39, 40, 3, 4, 5, 26, 33, 28, 33, 33, - 33, 33, 33, 33, 33, 30, 33, 115, 116, 3, - 4, 5, -1, 121, -1, 26, 27, 28, 29, 30, + 19, 20, 21, 22, 23, 24, 25, 32, 30, 33, + 33, 89, 33, 33, 28, 34, 35, 36, 37, 38, + 39, 40, 3, 4, 5, 6, 26, 33, 28, 33, + 33, 33, 33, 33, 33, 33, 33, -1, 116, 117, + 3, 4, 5, 6, 122, 26, 27, 28, 29, 30, 31, 32, 33, -1, 35, 36, 37, 38, 39, 40, - -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, + -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, + 33, -1, 35, 36, 37, 38, 39, 40, 3, 4, + 5, 6, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 3, 4, 5, 6, -1, -1, -1, + -1, 26, 27, 28, 29, 30, 31, 32, 33, -1, + 35, 36, 37, 38, 39, 40, 26, 27, 28, 29, + 30, 31, 32, 33, -1, 35, 36, 37, 38, 39, + 40, 3, 4, 5, 6, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 3, 4, 5, 6, + -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, + 32, 33, -1, 35, 36, 37, 38, 39, 40, 26, + 27, 28, 29, 30, 31, 32, 33, -1, 35, 36, + 37, 38, 39, 40, 3, 4, 5, 6, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, + 4, 5, 6, -1, -1, -1, -1, 26, 27, 28, + 29, 30, 31, 32, 33, -1, 35, 36, 37, 38, + 39, 40, 26, 27, 28, 29, 30, 31, 32, 33, -1, 35, 36, 37, 38, 39, 40, 3, 4, 5, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 3, 4, 5, -1, -1, -1, -1, -1, + 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 3, 4, 5, 6, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, -1, 35, 36, 37, 38, 39, 40, 26, 27, 28, 29, 30, 31, 32, 33, -1, 35, 36, 37, 38, 39, 40, - 3, 4, 5, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 3, 4, 5, -1, -1, + 3, 4, 5, 6, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 3, 4, 5, 6, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, -1, 35, 36, 37, 38, 39, 40, 26, 27, 28, 29, 30, 31, 32, 33, -1, 35, 36, 37, - 38, 39, 40, 3, 4, 5, -1, -1, -1, -1, + 38, 39, 40, 3, 4, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, 4, - 5, -1, -1, -1, -1, -1, 26, 27, 28, 29, + 5, 6, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, -1, 35, 36, 37, 38, 39, 40, 26, 27, 28, 29, 30, 31, 32, 33, -1, - 35, 36, 37, 38, 39, 40, 3, 4, 5, -1, + 35, 36, 37, 38, 39, 40, 3, 4, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 3, 4, 5, -1, -1, -1, -1, -1, 26, + -1, 3, 4, 5, 6, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, -1, 35, 36, 37, 38, 39, 40, 26, 27, 28, 29, 30, 31, 32, 33, -1, 35, 36, 37, 38, 39, 40, 3, - 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 3, 4, 5, -1, -1, -1, + 4, 5, 6, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 3, 4, 5, 6, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, -1, 35, 36, 37, 38, 39, 40, 26, 27, 28, 29, 30, 31, 32, 33, -1, 35, 36, 37, 38, - 39, 40, 3, 4, 5, -1, -1, -1, -1, -1, + 39, 40, 3, 4, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, 4, 5, - -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, + 6, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, -1, 35, 36, 37, 38, 39, 40, 26, 27, 28, 29, 30, 31, 32, 33, -1, 35, - 36, 37, 38, 39, 40, 3, 4, 5, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 3, 4, 5, -1, -1, -1, -1, -1, 26, 27, - 28, 29, 30, 31, 32, 33, -1, 35, 36, 37, - 38, 39, 40, 26, 27, 28, 29, 30, 31, 32, - 33, -1, 35, 36, 37, 38, 39, 40, 3, 4, - 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 3, 4, 5, -1, -1, -1, -1, - -1, 26, 27, 28, 29, 30, 31, 32, 33, -1, - 35, 36, 37, 38, 39, 40, 26, 27, 28, 29, - 30, 31, 32, 33, -1, 35, 36, 37, 38, 39, - 40, 3, 4, 5, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 3, 4, 5, -1, - -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, - 32, 33, -1, 35, 36, 37, 38, 39, 40, 26, - 27, 28, 29, 30, 31, 32, 33, -1, 35, 36, - 37, 38, 39, 40 + 36, 37, 38, 39, 40 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -815,13 +815,13 @@ static const yytype_uint8 yystos[] = 39, 40, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 3, 32, 53, 37, 32, 3, 33, 33, 29, 26, 28, 33, 32, 33, 33, 33, 33, 53, - 53, 53, 53, 53, 3, 4, 5, 26, 27, 28, - 29, 30, 31, 32, 33, 35, 36, 37, 38, 39, - 40, 54, 53, 53, 53, 53, 33, 33, 33, 53, - 53, 53, 53, 53, 53, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 27, 30, 28, 53, 3, 3, - 3, 3, 3, 3, 33, 33, 33, 3, 30, 53, - 53, 33, 3, 3, 53, 3 + 53, 53, 53, 53, 3, 4, 5, 6, 26, 27, + 28, 29, 30, 31, 32, 33, 35, 36, 37, 38, + 39, 40, 54, 53, 53, 53, 53, 33, 33, 33, + 53, 53, 53, 53, 53, 53, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 27, 30, 28, 53, 3, + 3, 3, 3, 3, 3, 33, 33, 33, 3, 30, + 53, 53, 33, 3, 3, 53, 3 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ @@ -833,7 +833,7 @@ static const yytype_uint8 yyr1[] = 45, 45, 46, 46, 47, 47, 48, 48, 49, 49, 50, 50, 51, 51, 52, 52, 53, 53, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, - 54, 54, 54, 54 + 54, 54, 54, 54, 54 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ @@ -845,7 +845,7 @@ static const yytype_uint8 yyr2[] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1 + 1, 1, 1, 1, 1 }; @@ -1998,6 +1998,6 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); #endif return yyresult; } -#line 249 "cmFortranParser.y" +#line 250 "cmFortranParser.y" /* End of grammar */ diff --git a/Source/LexerParser/cmFortranParser.y b/Source/LexerParser/cmFortranParser.y index 87f3e0a16ea..1b54dd9f7d9 100644 --- a/Source/LexerParser/cmFortranParser.y +++ b/Source/LexerParser/cmFortranParser.y @@ -244,6 +244,7 @@ misc_code: | RPAREN | COMMA | UNTERMINATED_STRING +| CPP_LINE_DIRECTIVE ; %% From 5239fc5c753502e91a1ea6859842d7fc24a36253 Mon Sep 17 00:00:00 2001 From: Johnny Jazeix Date: Wed, 13 Nov 2019 22:24:12 +0100 Subject: [PATCH 117/662] cmake -E: Add rm with improved semantics over remove and remove_directory --- Help/manual/cmake.1.rst | 24 ++++- Help/release/dev/command_rm.rst | 12 +++ Source/cmcmd.cxx | 92 +++++++++++++++++-- Tests/RunCMake/CMakeLists.txt | 2 +- .../CommandLine/E_rm_bad_argument-result.txt | 1 + .../CommandLine/E_rm_bad_argument-stderr.txt | 1 + .../E_rm_directory_link_existing-check.cmake | 3 + .../E_rm_directory_link_existing-result.txt | 1 + .../E_rm_empty_file_specified-stderr.txt | 1 + .../E_rm_empty_file_specified.cmake | 8 ++ .../E_rm_file_force_existing-check.cmake | 3 + .../E_rm_file_force_existing-result.txt | 1 + .../E_rm_file_force_non_existing-result.txt | 1 + .../E_rm_file_link_existing-check.cmake | 3 + .../E_rm_file_link_existing-result.txt | 1 + .../E_rm_file_link_non_existing-result.txt | 1 + .../E_rm_file_non_force_existing-check.cmake | 3 + .../E_rm_file_non_force_existing-result.txt | 1 + ..._rm_file_non_force_non_existing-result.txt | 1 + ..._rm_file_non_force_non_existing-stderr.txt | 1 + .../E_rm_file_recursive_existing-check.cmake | 3 + .../E_rm_file_recursive_existing-result.txt | 1 + ..._rm_file_recursive_non_existing-result.txt | 1 + ..._rm_file_recursive_non_existing-stderr.txt | 1 + ...recursive_directory_with_files-check.cmake | 3 + ..._recursive_directory_with_files-result.txt | 1 + ...rce_recursive_non_existing_file-result.txt | 1 + .../E_rm_no_file_specified-result.txt | 1 + .../E_rm_no_file_specified-stderr.txt | 1 + ...sive_directory-two-directories-check.cmake | 3 + ...rsive_directory-two-directories-result.txt | 1 + ...rsive_directory-two-directories-stderr.txt | 2 + ...sive_directory-two-directories-check.cmake | 3 + ...rsive_directory-two-directories-result.txt | 1 + ...ursive_directory_link_existing-check.cmake | 3 + ...cursive_directory_link_existing-result.txt | 1 + ...m_recursive_file_link_existing-check.cmake | 3 + ...rm_recursive_file_link_existing-result.txt | 1 + ...ecursive_file_link_non_existing-result.txt | 1 + Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 70 ++++++++++++++ 40 files changed, 248 insertions(+), 15 deletions(-) create mode 100644 Help/release/dev/command_rm.rst create mode 100644 Tests/RunCMake/CommandLine/E_rm_bad_argument-result.txt create mode 100644 Tests/RunCMake/CommandLine/E_rm_bad_argument-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/E_rm_directory_link_existing-check.cmake create mode 100644 Tests/RunCMake/CommandLine/E_rm_directory_link_existing-result.txt create mode 100644 Tests/RunCMake/CommandLine/E_rm_empty_file_specified-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/E_rm_empty_file_specified.cmake create mode 100644 Tests/RunCMake/CommandLine/E_rm_file_force_existing-check.cmake create mode 100644 Tests/RunCMake/CommandLine/E_rm_file_force_existing-result.txt create mode 100644 Tests/RunCMake/CommandLine/E_rm_file_force_non_existing-result.txt create mode 100644 Tests/RunCMake/CommandLine/E_rm_file_link_existing-check.cmake create mode 100644 Tests/RunCMake/CommandLine/E_rm_file_link_existing-result.txt create mode 100644 Tests/RunCMake/CommandLine/E_rm_file_link_non_existing-result.txt create mode 100644 Tests/RunCMake/CommandLine/E_rm_file_non_force_existing-check.cmake create mode 100644 Tests/RunCMake/CommandLine/E_rm_file_non_force_existing-result.txt create mode 100644 Tests/RunCMake/CommandLine/E_rm_file_non_force_non_existing-result.txt create mode 100644 Tests/RunCMake/CommandLine/E_rm_file_non_force_non_existing-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/E_rm_file_recursive_existing-check.cmake create mode 100644 Tests/RunCMake/CommandLine/E_rm_file_recursive_existing-result.txt create mode 100644 Tests/RunCMake/CommandLine/E_rm_file_recursive_non_existing-result.txt create mode 100644 Tests/RunCMake/CommandLine/E_rm_file_recursive_non_existing-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/E_rm_force_recursive_directory_with_files-check.cmake create mode 100644 Tests/RunCMake/CommandLine/E_rm_force_recursive_directory_with_files-result.txt create mode 100644 Tests/RunCMake/CommandLine/E_rm_force_recursive_non_existing_file-result.txt create mode 100644 Tests/RunCMake/CommandLine/E_rm_no_file_specified-result.txt create mode 100644 Tests/RunCMake/CommandLine/E_rm_no_file_specified-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/E_rm_non_recursive_directory-two-directories-check.cmake create mode 100644 Tests/RunCMake/CommandLine/E_rm_non_recursive_directory-two-directories-result.txt create mode 100644 Tests/RunCMake/CommandLine/E_rm_non_recursive_directory-two-directories-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/E_rm_recursive_directory-two-directories-check.cmake create mode 100644 Tests/RunCMake/CommandLine/E_rm_recursive_directory-two-directories-result.txt create mode 100644 Tests/RunCMake/CommandLine/E_rm_recursive_directory_link_existing-check.cmake create mode 100644 Tests/RunCMake/CommandLine/E_rm_recursive_directory_link_existing-result.txt create mode 100644 Tests/RunCMake/CommandLine/E_rm_recursive_file_link_existing-check.cmake create mode 100644 Tests/RunCMake/CommandLine/E_rm_recursive_file_link_existing-result.txt create mode 100644 Tests/RunCMake/CommandLine/E_rm_recursive_file_link_non_existing-result.txt diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index 71110d1de99..6f338662fc9 100644 --- a/Help/manual/cmake.1.rst +++ b/Help/manual/cmake.1.rst @@ -554,22 +554,38 @@ Available commands are: 7a0b54896fe5e70cca6dd643ad6f672614b189bf26f8153061c4d219474b05dad08c4e729af9f4b009f1a1a280cb625454bf587c690f4617c27e3aebdf3b7a2d file2.txt ``remove [-f] ...`` - Remove the file(s). If any of the listed files already do not - exist, the command returns a non-zero exit code, but no message - is logged. The ``-f`` option changes the behavior to return a + .. deprecated:: 3.17 + + Remove the file(s). The planned behaviour was that if any of the + listed files already do not exist, the command returns a non-zero exit code, + but no message is logged. The ``-f`` option changes the behavior to return a zero exit code (i.e. success) in such situations instead. ``remove`` does not follow symlinks. That means it remove only symlinks and not files it point to. + The implementation was buggy and always returned 0. It cannot be fixed without + breaking backwards compatibility. Use ``rm`` instead. + ``remove_directory ...`` - Remove ```` directories and their contents. If a directory does + .. deprecated:: 3.17 + + Remove ```` directories and their contents. If a directory does not exist it will be silently ignored. If ```` is a symlink to a directory, just the symlink will be removed. + Use ``rm`` instead. ``rename `` Rename a file or directory (on one volume). If file with the ```` name already exists, then it will be silently replaced. +``rm [-rRf] ...`` + Remove the files ```` or directories ``dir``. + Use ``-r`` or ``-R`` to remove directories and their contents recursively. + If any of the listed files/directories do not exist, the command returns a + non-zero exit code, but no message is logged. The ``-f`` option changes + the behavior to return a zero exit code (i.e. success) in such + situations instead. + ``server`` Launch :manual:`cmake-server(7)` mode. diff --git a/Help/release/dev/command_rm.rst b/Help/release/dev/command_rm.rst new file mode 100644 index 00000000000..a58362e8df2 --- /dev/null +++ b/Help/release/dev/command_rm.rst @@ -0,0 +1,12 @@ +Command-Line +-------------------- + +* :manual:`cmake(1)` gained a ``rm`` command line + option that can be used to remove directories (with ``-r`` or ``-R`` flag) + and files. + If the ``-f`` flag is not specified, attempting to remove a file that + doesn't exist returns an non-zero error code. + This command deprecates ``remove`` and ``remove_directory``. + The ``remove`` implementation was buggy and always returned 0 when ``force`` + flag was not present and a file didn't exist. It cannot be fixed without + breaking backwards compatibility so we introduced ``rm``. diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index d05e3c81baa..c2fbb43d27a 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -107,10 +107,12 @@ void CMakeCommandUsage(const char* program) << " sha384sum ... - create SHA384 checksum of files\n" << " sha512sum ... - create SHA512 checksum of files\n" << " remove [-f] ... - remove the file(s), use -f to force " - "it\n" - << " remove_directory ... - remove directories and their contents\n" + "it (deprecated: use rm instead)\n" + << " remove_directory ... - remove directories and their contents (deprecated: use rm instead)\n" << " rename oldname newname - rename a file or directory " "(on one volume)\n" + << " rm [-rRf] ... - remove files or directories, use -f to " + "force it, r or R to remove directories and their contents recursively\n" << " server - start cmake in server mode\n" << " sleep ... - sleep for given number of seconds\n" << " tar [cxt][vf][zjJ] file.tar [file/dir1 file/dir2 ...]\n" @@ -172,6 +174,24 @@ static bool cmTarFilesFrom(std::string const& file, return true; } +static bool cmRemoveDirectory(const std::string& dir, bool recursive = true) +{ + if (cmSystemTools::FileIsSymlink(dir)) { + if (!cmSystemTools::RemoveFile(dir)) { + std::cerr << "Error removing directory symlink \"" << dir << "\".\n"; + return false; + } + } else if (!recursive) { + std::cerr << "Error removing directory \"" << dir + << "\" without recursive option.\n"; + return false; + } else if (!cmSystemTools::RemoveADirectory(dir)) { + std::cerr << "Error removing directory \"" << dir << "\".\n"; + return false; + } + return true; +} + static int HandleIWYU(const std::string& runCmd, const std::string& /* sourceFile */, const std::vector& orig_cmd) @@ -706,14 +726,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector const& args) bool return_value = false; for (auto const& arg : cmMakeRange(args).advance(2)) { if (cmSystemTools::FileIsDirectory(arg)) { - if (cmSystemTools::FileIsSymlink(arg)) { - if (!cmSystemTools::RemoveFile(arg)) { - std::cerr << "Error removing directory symlink \"" << arg - << "\".\n"; - return_value = true; - } - } else if (!cmSystemTools::RemoveADirectory(arg)) { - std::cerr << "Error removing directory \"" << arg << "\".\n"; + if (!cmRemoveDirectory(arg)) { return_value = true; } } @@ -739,6 +752,65 @@ int cmcmd::ExecuteCMakeCommand(std::vector const& args) return 0; } + // Remove directories or files with rm + if (args[1] == "rm" && args.size() > 2) { + // If an error occurs, we want to continue removing the remaining + // files/directories. + int return_value = 0; + bool force = false; + bool recursive = false; + bool doing_options = true; + bool at_least_one_file = false; + for (auto const& arg : cmMakeRange(args).advance(2)) { + if (doing_options && cmHasLiteralPrefix(arg, "-")) { + if (arg == "--") { + doing_options = false; + } + if (arg.find('f') != std::string::npos) { + force = true; + } + if (arg.find_first_of("rR") != std::string::npos) { + recursive = true; + } + if (arg.find_first_not_of("-frR") != std::string::npos) { + cmSystemTools::Error("Unknown -E rm argument: " + arg); + return 1; + } + } else { + if (arg.empty()) { + continue; + } + at_least_one_file = true; + // Complain if the -f option was not given and + // either file does not exist or + // file could not be removed and still exists + bool file_exists_or_forced_remove = cmSystemTools::FileExists(arg) || + cmSystemTools::FileIsSymlink(arg) || force; + if (cmSystemTools::FileIsDirectory(arg)) { + if (!cmRemoveDirectory(arg, recursive)) { + return_value = 1; + } + } else if ((!file_exists_or_forced_remove) || + (!cmSystemTools::RemoveFile(arg) && + cmSystemTools::FileExists(arg))) { + if (!file_exists_or_forced_remove) { + cmSystemTools::Error( + "File to remove does not exist and force is not set: " + arg); + } else { + cmSystemTools::Error("File can't be removed and still exist: " + + arg); + } + return_value = 1; + } + } + } + if (!at_least_one_file) { + cmSystemTools::Error("Missing file/directory to remove"); + return 1; + } + return return_value; + } + // Touch file if (args[1] == "touch" && args.size() > 2) { for (auto const& arg : cmMakeRange(args).advance(2)) { diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 0a090a86b11..d4813b7b0b9 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -443,7 +443,7 @@ add_RunCMake_test(target_include_directories) add_RunCMake_test(target_sources) add_RunCMake_test(CheckModules) add_RunCMake_test(CheckIPOSupported) -add_RunCMake_test(CommandLine -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}) +add_RunCMake_test(CommandLine -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DCYGWIN=${CYGWIN}) add_RunCMake_test(CommandLineTar) if(CMAKE_PLATFORM_NO_VERSIONED_SONAME OR (NOT CMAKE_SHARED_LIBRARY_SONAME_FLAG AND NOT CMAKE_SHARED_LIBRARY_SONAME_C_FLAG)) diff --git a/Tests/RunCMake/CommandLine/E_rm_bad_argument-result.txt b/Tests/RunCMake/CommandLine/E_rm_bad_argument-result.txt new file mode 100644 index 00000000000..d00491fd7e5 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_bad_argument-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/E_rm_bad_argument-stderr.txt b/Tests/RunCMake/CommandLine/E_rm_bad_argument-stderr.txt new file mode 100644 index 00000000000..62b963ab98e --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_bad_argument-stderr.txt @@ -0,0 +1 @@ +^CMake Error: Unknown -E rm argument: -rd$ diff --git a/Tests/RunCMake/CommandLine/E_rm_directory_link_existing-check.cmake b/Tests/RunCMake/CommandLine/E_rm_directory_link_existing-check.cmake new file mode 100644 index 00000000000..b1a29a28e6d --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_directory_link_existing-check.cmake @@ -0,0 +1,3 @@ +if(NOT EXISTS ${out}/dir/existing.txt) + set(RunCMake_TEST_FAILED "${out}/dir/existing.txt should exist (we only removed the link to dir folder)") +endif() diff --git a/Tests/RunCMake/CommandLine/E_rm_directory_link_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_directory_link_existing-result.txt new file mode 100644 index 00000000000..573541ac970 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_directory_link_existing-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CommandLine/E_rm_empty_file_specified-stderr.txt b/Tests/RunCMake/CommandLine/E_rm_empty_file_specified-stderr.txt new file mode 100644 index 00000000000..1ac7dbaa89f --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_empty_file_specified-stderr.txt @@ -0,0 +1 @@ +^CMake Error: Missing file/directory to remove$ diff --git a/Tests/RunCMake/CommandLine/E_rm_empty_file_specified.cmake b/Tests/RunCMake/CommandLine/E_rm_empty_file_specified.cmake new file mode 100644 index 00000000000..6cd4edd9b48 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_empty_file_specified.cmake @@ -0,0 +1,8 @@ +execute_process( + COMMAND ${CMAKE_COMMAND} -E rm "" + RESULT_VARIABLE actual_result + ) + +if(NOT "${actual_result}" EQUAL "1") + message(SEND_ERROR "cmake -E rm \"\" should have returned 1, got ${actual_result}") +endif() diff --git a/Tests/RunCMake/CommandLine/E_rm_file_force_existing-check.cmake b/Tests/RunCMake/CommandLine/E_rm_file_force_existing-check.cmake new file mode 100644 index 00000000000..e28b16053e8 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_file_force_existing-check.cmake @@ -0,0 +1,3 @@ +if(EXISTS ${out}/existing.txt) + set(RunCMake_TEST_FAILED "${out}/existing.txt not removed") +endif() diff --git a/Tests/RunCMake/CommandLine/E_rm_file_force_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_file_force_existing-result.txt new file mode 100644 index 00000000000..573541ac970 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_file_force_existing-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CommandLine/E_rm_file_force_non_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_file_force_non_existing-result.txt new file mode 100644 index 00000000000..573541ac970 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_file_force_non_existing-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CommandLine/E_rm_file_link_existing-check.cmake b/Tests/RunCMake/CommandLine/E_rm_file_link_existing-check.cmake new file mode 100644 index 00000000000..a0a9b208e0f --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_file_link_existing-check.cmake @@ -0,0 +1,3 @@ +if(NOT EXISTS ${out}/existing.txt) + set(RunCMake_TEST_FAILED "${out}/existing.txt should exist (we only removed the link)") +endif() diff --git a/Tests/RunCMake/CommandLine/E_rm_file_link_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_file_link_existing-result.txt new file mode 100644 index 00000000000..573541ac970 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_file_link_existing-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CommandLine/E_rm_file_link_non_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_file_link_non_existing-result.txt new file mode 100644 index 00000000000..573541ac970 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_file_link_non_existing-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CommandLine/E_rm_file_non_force_existing-check.cmake b/Tests/RunCMake/CommandLine/E_rm_file_non_force_existing-check.cmake new file mode 100644 index 00000000000..e28b16053e8 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_file_non_force_existing-check.cmake @@ -0,0 +1,3 @@ +if(EXISTS ${out}/existing.txt) + set(RunCMake_TEST_FAILED "${out}/existing.txt not removed") +endif() diff --git a/Tests/RunCMake/CommandLine/E_rm_file_non_force_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_file_non_force_existing-result.txt new file mode 100644 index 00000000000..573541ac970 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_file_non_force_existing-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CommandLine/E_rm_file_non_force_non_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_file_non_force_non_existing-result.txt new file mode 100644 index 00000000000..d00491fd7e5 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_file_non_force_non_existing-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/E_rm_file_non_force_non_existing-stderr.txt b/Tests/RunCMake/CommandLine/E_rm_file_non_force_non_existing-stderr.txt new file mode 100644 index 00000000000..05df88a7322 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_file_non_force_non_existing-stderr.txt @@ -0,0 +1 @@ +^CMake Error: File to remove does not exist and force is not set: .*/rm_tests/not_existing.txt diff --git a/Tests/RunCMake/CommandLine/E_rm_file_recursive_existing-check.cmake b/Tests/RunCMake/CommandLine/E_rm_file_recursive_existing-check.cmake new file mode 100644 index 00000000000..e28b16053e8 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_file_recursive_existing-check.cmake @@ -0,0 +1,3 @@ +if(EXISTS ${out}/existing.txt) + set(RunCMake_TEST_FAILED "${out}/existing.txt not removed") +endif() diff --git a/Tests/RunCMake/CommandLine/E_rm_file_recursive_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_file_recursive_existing-result.txt new file mode 100644 index 00000000000..573541ac970 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_file_recursive_existing-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CommandLine/E_rm_file_recursive_non_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_file_recursive_non_existing-result.txt new file mode 100644 index 00000000000..d00491fd7e5 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_file_recursive_non_existing-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/E_rm_file_recursive_non_existing-stderr.txt b/Tests/RunCMake/CommandLine/E_rm_file_recursive_non_existing-stderr.txt new file mode 100644 index 00000000000..05df88a7322 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_file_recursive_non_existing-stderr.txt @@ -0,0 +1 @@ +^CMake Error: File to remove does not exist and force is not set: .*/rm_tests/not_existing.txt diff --git a/Tests/RunCMake/CommandLine/E_rm_force_recursive_directory_with_files-check.cmake b/Tests/RunCMake/CommandLine/E_rm_force_recursive_directory_with_files-check.cmake new file mode 100644 index 00000000000..1a976cb50ca --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_force_recursive_directory_with_files-check.cmake @@ -0,0 +1,3 @@ +if(EXISTS ${out}) + set(RunCMake_TEST_FAILED "${out} not removed") +endif() diff --git a/Tests/RunCMake/CommandLine/E_rm_force_recursive_directory_with_files-result.txt b/Tests/RunCMake/CommandLine/E_rm_force_recursive_directory_with_files-result.txt new file mode 100644 index 00000000000..573541ac970 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_force_recursive_directory_with_files-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CommandLine/E_rm_force_recursive_non_existing_file-result.txt b/Tests/RunCMake/CommandLine/E_rm_force_recursive_non_existing_file-result.txt new file mode 100644 index 00000000000..573541ac970 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_force_recursive_non_existing_file-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CommandLine/E_rm_no_file_specified-result.txt b/Tests/RunCMake/CommandLine/E_rm_no_file_specified-result.txt new file mode 100644 index 00000000000..d00491fd7e5 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_no_file_specified-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/E_rm_no_file_specified-stderr.txt b/Tests/RunCMake/CommandLine/E_rm_no_file_specified-stderr.txt new file mode 100644 index 00000000000..1ac7dbaa89f --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_no_file_specified-stderr.txt @@ -0,0 +1 @@ +^CMake Error: Missing file/directory to remove$ diff --git a/Tests/RunCMake/CommandLine/E_rm_non_recursive_directory-two-directories-check.cmake b/Tests/RunCMake/CommandLine/E_rm_non_recursive_directory-two-directories-check.cmake new file mode 100644 index 00000000000..609271e43d2 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_non_recursive_directory-two-directories-check.cmake @@ -0,0 +1,3 @@ +if(NOT EXISTS ${out}/d1 OR NOT EXISTS ${out}/d2) + set(RunCMake_TEST_FAILED "${out}/d1 or ${out}/d2 is removed but should not") +endif() diff --git a/Tests/RunCMake/CommandLine/E_rm_non_recursive_directory-two-directories-result.txt b/Tests/RunCMake/CommandLine/E_rm_non_recursive_directory-two-directories-result.txt new file mode 100644 index 00000000000..d00491fd7e5 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_non_recursive_directory-two-directories-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/E_rm_non_recursive_directory-two-directories-stderr.txt b/Tests/RunCMake/CommandLine/E_rm_non_recursive_directory-two-directories-stderr.txt new file mode 100644 index 00000000000..33ea2e3e366 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_non_recursive_directory-two-directories-stderr.txt @@ -0,0 +1,2 @@ +^Error removing directory ".*/rm_tests/d1" without recursive option\. +Error removing directory ".*/rm_tests/d2" without recursive option\.$ diff --git a/Tests/RunCMake/CommandLine/E_rm_recursive_directory-two-directories-check.cmake b/Tests/RunCMake/CommandLine/E_rm_recursive_directory-two-directories-check.cmake new file mode 100644 index 00000000000..5282da75893 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_recursive_directory-two-directories-check.cmake @@ -0,0 +1,3 @@ +if(EXISTS ${out}/d1 OR EXISTS ${out}/d2) + set(RunCMake_TEST_FAILED "${out}/d1 or ${out}/d2 should be removed") +endif() diff --git a/Tests/RunCMake/CommandLine/E_rm_recursive_directory-two-directories-result.txt b/Tests/RunCMake/CommandLine/E_rm_recursive_directory-two-directories-result.txt new file mode 100644 index 00000000000..573541ac970 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_recursive_directory-two-directories-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CommandLine/E_rm_recursive_directory_link_existing-check.cmake b/Tests/RunCMake/CommandLine/E_rm_recursive_directory_link_existing-check.cmake new file mode 100644 index 00000000000..b1a29a28e6d --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_recursive_directory_link_existing-check.cmake @@ -0,0 +1,3 @@ +if(NOT EXISTS ${out}/dir/existing.txt) + set(RunCMake_TEST_FAILED "${out}/dir/existing.txt should exist (we only removed the link to dir folder)") +endif() diff --git a/Tests/RunCMake/CommandLine/E_rm_recursive_directory_link_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_recursive_directory_link_existing-result.txt new file mode 100644 index 00000000000..573541ac970 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_recursive_directory_link_existing-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CommandLine/E_rm_recursive_file_link_existing-check.cmake b/Tests/RunCMake/CommandLine/E_rm_recursive_file_link_existing-check.cmake new file mode 100644 index 00000000000..a0a9b208e0f --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_recursive_file_link_existing-check.cmake @@ -0,0 +1,3 @@ +if(NOT EXISTS ${out}/existing.txt) + set(RunCMake_TEST_FAILED "${out}/existing.txt should exist (we only removed the link)") +endif() diff --git a/Tests/RunCMake/CommandLine/E_rm_recursive_file_link_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_recursive_file_link_existing-result.txt new file mode 100644 index 00000000000..573541ac970 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_recursive_file_link_existing-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CommandLine/E_rm_recursive_file_link_non_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_recursive_file_link_non_existing-result.txt new file mode 100644 index 00000000000..573541ac970 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rm_recursive_file_link_non_existing-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index f903c3d84a9..bd368cb94d6 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -388,6 +388,76 @@ endif() unset(out) unset(outfile) +set(out ${RunCMake_BINARY_DIR}/rm_tests) +file(REMOVE_RECURSE "${out}") +file(MAKE_DIRECTORY ${out}) +file(TOUCH ${out}/existing.txt) +run_cmake_command(E_rm_file_force_existing + ${CMAKE_COMMAND} -E rm -f ${out}/existing.txt) +file(TOUCH ${out}/existing.txt) +run_cmake_command(E_rm_file_non_force_existing + ${CMAKE_COMMAND} -E rm ${out}/existing.txt) +run_cmake_command(E_rm_file_force_non_existing + ${CMAKE_COMMAND} -E rm -f ${out}/not_existing.txt) +run_cmake_command(E_rm_file_non_force_non_existing + ${CMAKE_COMMAND} -E rm ${out}/not_existing.txt) + +file(TOUCH ${out}/existing.txt) +run_cmake_command(E_rm_file_recursive_existing + ${CMAKE_COMMAND} -E rm -r ${out}/existing.txt) +run_cmake_command(E_rm_file_recursive_non_existing + ${CMAKE_COMMAND} -E rm -r ${out}/not_existing.txt) + +file(MAKE_DIRECTORY ${out}/d1 ${out}/d2) +run_cmake_command(E_rm_non_recursive_directory-two-directories + ${CMAKE_COMMAND} -E rm ${out}/d1 ${out}/d2) + +run_cmake_command(E_rm_recursive_directory-two-directories + ${CMAKE_COMMAND} -E rm -R ${out}/d1 ${out}/d2) + +run_cmake_command(E_rm_no_file_specified + ${CMAKE_COMMAND} -E rm -rf) + +run_cmake_command(E_rm_empty_file_specified + ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/E_rm_empty_file_specified.cmake) + +run_cmake_command(E_rm_bad_argument + ${CMAKE_COMMAND} -E rm -rd ${out}/d1 ${out}/d2) + +file(MAKE_DIRECTORY ${out}/d1 ${out}/d2) +file(WRITE ${out}/test.txt "") +run_cmake_command(E_rm_force_recursive_directory_with_files + ${CMAKE_COMMAND} -E rm -rf ${out}/) + +run_cmake_command(E_rm_force_recursive_non_existing_file + ${CMAKE_COMMAND} -E rm -Rf ${out}/test.txt) + +if(NOT WIN32 AND NOT CYGWIN) + file(MAKE_DIRECTORY ${out}) + file(TOUCH ${out}/existing.txt) + file(MAKE_DIRECTORY ${out}/dir) + file(TOUCH ${out}/dir/existing.txt) # add a file in the folder + file(CREATE_LINK ${out}/dir ${out}/link_dir SYMBOLIC) + file(CREATE_LINK ${out}/existing.txt ${out}/existing_file_link.txt SYMBOLIC) + file(CREATE_LINK ${out}/non_existing.txt ${out}/non_existing_file_link.txt SYMBOLIC) + run_cmake_command(E_rm_file_link_existing + ${CMAKE_COMMAND} -E rm ${out}/existing_file_link.txt) + run_cmake_command(E_rm_directory_link_existing + ${CMAKE_COMMAND} -E rm ${out}/link_dir) + run_cmake_command(E_rm_file_link_non_existing + ${CMAKE_COMMAND} -E rm ${out}/non_existing_file_link.txt) + + file(CREATE_LINK ${out}/dir ${out}/link_dir SYMBOLIC) + file(CREATE_LINK ${out}/existing.txt ${out}/existing_file_link.txt SYMBOLIC) + file(CREATE_LINK ${out}/non_existing.txt ${out}/non_existing_file_link.txt SYMBOLIC) + run_cmake_command(E_rm_recursive_file_link_existing + ${CMAKE_COMMAND} -E rm -R ${out}/existing_file_link.txt) + run_cmake_command(E_rm_recursive_directory_link_existing + ${CMAKE_COMMAND} -E rm -r ${out}/link_dir) + run_cmake_command(E_rm_recursive_file_link_non_existing + ${CMAKE_COMMAND} -E rm -r ${out}/non_existing_file_link.txt) +endif() +unset(out) run_cmake_command(E_env-no-command0 ${CMAKE_COMMAND} -E env) run_cmake_command(E_env-no-command1 ${CMAKE_COMMAND} -E env TEST_ENV=1) From 2d0100fac7a51327ce8053b4ab2277aaa96c12a5 Mon Sep 17 00:00:00 2001 From: Johnny Jazeix Date: Wed, 13 Nov 2019 22:24:41 +0100 Subject: [PATCH 118/662] replace remove and remove_directory with rm in tests --- Modules/CMakeAddFortranSubdirectory.cmake | 2 +- Modules/ExternalProject.cmake | 6 +++--- Modules/FindCUDA.cmake | 2 +- Modules/FindCUDA/run_nvcc.cmake | 6 +++--- Modules/Platform/Generic-SDCC-C.cmake | 2 +- Modules/Platform/Windows-GNU.cmake | 2 +- Source/cmLocalUnixMakefileGenerator3.cxx | 2 +- Source/cmNinjaNormalTargetGenerator.cxx | 2 +- Tests/CMakeTestMultipleConfigures/RunCMake.cmake | 6 +++--- Tests/CPackComponentsDEB/CMakeLists.txt | 2 +- Tests/Complex/CMakeLists.txt | 2 +- Tests/Complex/Library/CMakeLists.txt | 2 +- Tests/ComplexOneConfig/CMakeLists.txt | 2 +- Tests/ComplexOneConfig/Library/CMakeLists.txt | 2 +- Tests/CustomCommand/CMakeLists.txt | 4 ++-- Tests/ExportImport/CMakeLists.txt | 2 +- Tests/FortranOnly/CMakeLists.txt | 4 ++-- Tests/JavaExportImport/CMakeLists.txt | 2 +- Tests/LinkDirectory/CMakeLists.txt | 2 +- Tests/MacRuntimePath/CMakeLists.txt | 2 +- Tests/RunCMake/CTestResourceAllocation/ResourceCommon.cmake | 2 +- .../RunCMake/ParseImplicitData/mingw.org-C-GNU-4.9.3.input | 2 +- .../ParseImplicitData/mingw.org-CXX-GNU-4.9.3.input | 2 +- Tests/StagingPrefix/CMakeLists.txt | 2 +- Tests/SubDir/Examples/example1/CMakeLists.txt | 2 +- Tests/SubDirSpaces/Some Examples/example1/CMakeLists.txt | 2 +- Tests/VSMidl/CMakeLists.txt | 4 ++-- Utilities/CMakeLists.txt | 2 +- Utilities/cmcurl/CMake/cmake_uninstall.cmake.in | 2 +- cmake_uninstall.cmake.in | 2 +- 30 files changed, 39 insertions(+), 39 deletions(-) diff --git a/Modules/CMakeAddFortranSubdirectory.cmake b/Modules/CMakeAddFortranSubdirectory.cmake index 2613569d196..09e739dd714 100644 --- a/Modules/CMakeAddFortranSubdirectory.cmake +++ b/Modules/CMakeAddFortranSubdirectory.cmake @@ -155,7 +155,7 @@ function(cmake_add_fortran_subdirectory subdir) # make the external project always run make with each build externalproject_add_step(${project_name}_build forcebuild COMMAND ${CMAKE_COMMAND} - -E remove + -E rm -f ${CMAKE_CURRENT_BUILD_DIR}/${project_name}-prefix/src/${project_name}-stamp/${project_name}-build DEPENDEES configure DEPENDERS build diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index cd4e22d4e6c..1e542663d09 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -1120,7 +1120,7 @@ if(NOT \"${gitclone_infofile}\" IS_NEWER_THAN \"${gitclone_stampfile}\") endif() execute_process( - COMMAND \${CMAKE_COMMAND} -E remove_directory \"${source_dir}\" + COMMAND \${CMAKE_COMMAND} -E rm -rf \"${source_dir}\" RESULT_VARIABLE error_code ) if(error_code) @@ -1196,7 +1196,7 @@ if(NOT \"${hgclone_infofile}\" IS_NEWER_THAN \"${hgclone_stampfile}\") endif() execute_process( - COMMAND \${CMAKE_COMMAND} -E remove_directory \"${source_dir}\" + COMMAND \${CMAKE_COMMAND} -E rm -rf \"${source_dir}\" RESULT_VARIABLE error_code ) if(error_code) @@ -2580,7 +2580,7 @@ function(_ep_add_download_command name) if(IS_DIRECTORY "${url}") get_filename_component(abs_dir "${url}" ABSOLUTE) set(comment "Performing download step (DIR copy) for '${name}'") - set(cmd ${CMAKE_COMMAND} -E remove_directory ${source_dir} + set(cmd ${CMAKE_COMMAND} -E rm -rf ${source_dir} COMMAND ${CMAKE_COMMAND} -E copy_directory ${abs_dir} ${source_dir}) else() get_property(no_extract TARGET "${name}" PROPERTY _EP_DOWNLOAD_NO_EXTRACT SET) diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 85d705c8d66..f1086e7a9e6 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -2006,7 +2006,7 @@ macro(CUDA_BUILD_CLEAN_TARGET) string(TOUPPER ${cuda_clean_target_name} cuda_clean_target_name) endif() add_custom_target(${cuda_clean_target_name} - COMMAND ${CMAKE_COMMAND} -E remove ${CUDA_ADDITIONAL_CLEAN_FILES}) + COMMAND ${CMAKE_COMMAND} -E rm -f ${CUDA_ADDITIONAL_CLEAN_FILES}) # Clear out the variable, so the next time we configure it will be empty. # This is useful so that the files won't persist in the list after targets diff --git a/Modules/FindCUDA/run_nvcc.cmake b/Modules/FindCUDA/run_nvcc.cmake index af15d55e584..ba3543306b5 100644 --- a/Modules/FindCUDA/run_nvcc.cmake +++ b/Modules/FindCUDA/run_nvcc.cmake @@ -174,7 +174,7 @@ endmacro() # Delete the target file cuda_execute_process( "Removing ${generated_file}" - COMMAND "${CMAKE_COMMAND}" -E remove "${generated_file}" + COMMAND "${CMAKE_COMMAND}" -E rm -f "${generated_file}" ) # For CUDA 2.3 and below, -G -M doesn't work, so remove the -G flag @@ -241,7 +241,7 @@ endif() # Delete the temporary file cuda_execute_process( "Removing ${cmake_dependency_file}.tmp and ${NVCC_generated_dependency_file}" - COMMAND "${CMAKE_COMMAND}" -E remove "${cmake_dependency_file}.tmp" "${NVCC_generated_dependency_file}" + COMMAND "${CMAKE_COMMAND}" -E rm -f "${cmake_dependency_file}.tmp" "${NVCC_generated_dependency_file}" ) if(CUDA_result) @@ -267,7 +267,7 @@ if(CUDA_result) # Since nvcc can sometimes leave half done files make sure that we delete the output file. cuda_execute_process( "Removing ${generated_file}" - COMMAND "${CMAKE_COMMAND}" -E remove "${generated_file}" + COMMAND "${CMAKE_COMMAND}" -E rm -f "${generated_file}" ) message(FATAL_ERROR "Error generating file ${generated_file}") else() diff --git a/Modules/Platform/Generic-SDCC-C.cmake b/Modules/Platform/Generic-SDCC-C.cmake index aef4abf173b..8f648a10530 100644 --- a/Modules/Platform/Generic-SDCC-C.cmake +++ b/Modules/Platform/Generic-SDCC-C.cmake @@ -47,7 +47,7 @@ set(CMAKE_C_LINK_EXECUTABLE " -o " + "\"${CMAKE_COMMAND}\" -E rm -f " " -a ") # not supported by sdcc diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake index 71189b169b1..cf853678ec0 100644 --- a/Modules/Platform/Windows-GNU.cmake +++ b/Modules/Platform/Windows-GNU.cmake @@ -124,7 +124,7 @@ macro(__windows_compiler_gnu lang) string(REPLACE "" "-Wl,--whole-archive /objects.a -Wl,--no-whole-archive" CMAKE_${lang}_${rule} "${CMAKE_${lang}_${rule}}") set(CMAKE_${lang}_${rule} - " -E remove -f /objects.a" + " -E rm -f /objects.a" " cr /objects.a " "${CMAKE_${lang}_${rule}}" ) diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 4a70248d6ff..a7703e90bed 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -628,7 +628,7 @@ void cmLocalUnixMakefileGenerator3::WriteMakeVariables( << "# The command to remove a file.\n" << "RM = " << cmakeShellCommand - << " -E remove -f\n" + << " -E rm -f\n" << "\n"; makefileStream << "# Escaping for special characters.\n" diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index beedef4c250..72bef215eae 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -486,7 +486,7 @@ std::vector cmNinjaNormalTargetGenerator::ComputeLinkCmd() std::string cmakeCommand = this->GetLocalGenerator()->ConvertToOutputFormat( cmSystemTools::GetCMakeCommand(), cmOutputConverter::SHELL); - linkCmds.push_back(cmakeCommand + " -E remove $TARGET_FILE"); + linkCmds.push_back(cmakeCommand + " -E rm -f $TARGET_FILE"); } // TODO: Use ARCHIVE_APPEND for archives over a certain size. { diff --git a/Tests/CMakeTestMultipleConfigures/RunCMake.cmake b/Tests/CMakeTestMultipleConfigures/RunCMake.cmake index 96326646b59..a79bfcbffef 100644 --- a/Tests/CMakeTestMultipleConfigures/RunCMake.cmake +++ b/Tests/CMakeTestMultipleConfigures/RunCMake.cmake @@ -21,11 +21,11 @@ set(N 7) # First setup source and binary trees: # -execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory +execute_process(COMMAND ${CMAKE_COMMAND} -E rm -rf ${dir}/Source ) -execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory +execute_process(COMMAND ${CMAKE_COMMAND} -E rm -rf ${dir}/Build ) @@ -69,7 +69,7 @@ foreach(i RANGE 1 ${N}) # Save this iteration of the Build directory: # - execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory + execute_process(COMMAND ${CMAKE_COMMAND} -E rm -rf ${dir}/b${i} ) execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory diff --git a/Tests/CPackComponentsDEB/CMakeLists.txt b/Tests/CPackComponentsDEB/CMakeLists.txt index bc5b6a9473f..4363f1b40c2 100644 --- a/Tests/CPackComponentsDEB/CMakeLists.txt +++ b/Tests/CPackComponentsDEB/CMakeLists.txt @@ -104,7 +104,7 @@ install(FILES ${CPackComponentsDEB_BINARY_DIR}/symtest COMPONENT applications) if(EXISTS "./dirtest") - execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory ./dirtest) + execute_process(COMMAND ${CMAKE_COMMAND} -E rm -rf ./dirtest) endif() # NOTE: directory left empty on purpose execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ./dirtest) diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt index 2e41754425a..9fd85bedf53 100644 --- a/Tests/Complex/CMakeLists.txt +++ b/Tests/Complex/CMakeLists.txt @@ -324,7 +324,7 @@ if (WIN32) ${file} "[${hkey}]" DOC "Registry_Test_Path") exec_program(${CMAKE_COMMAND} ARGS "-E delete_regv \"${hkey}\"") - exec_program(${CMAKE_COMMAND} ARGS "-E remove \"${dir}/${file}\"") + exec_program(${CMAKE_COMMAND} ARGS "-E rm -f \"${dir}/${file}\"") endif () endif () diff --git a/Tests/Complex/Library/CMakeLists.txt b/Tests/Complex/Library/CMakeLists.txt index 64f6dc854a6..df874ef9134 100644 --- a/Tests/Complex/Library/CMakeLists.txt +++ b/Tests/Complex/Library/CMakeLists.txt @@ -131,7 +131,7 @@ if("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM) # Custom target to try preprocessing invocation. add_custom_target(test_preprocess ${MAYBE_ALL} - COMMAND ${CMAKE_COMMAND} -E remove CMakeFiles/create_file.dir/create_file.i + COMMAND ${CMAKE_COMMAND} -E rm -f CMakeFiles/create_file.dir/create_file.i COMMAND ${CMAKE_MAKE_PROGRAM} create_file.i COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/test_preprocess.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt index 628cd4ec3ff..28b73af4a5d 100644 --- a/Tests/ComplexOneConfig/CMakeLists.txt +++ b/Tests/ComplexOneConfig/CMakeLists.txt @@ -281,7 +281,7 @@ if (WIN32) ${file} "[${hkey}]" DOC "Registry_Test_Path") exec_program(${CMAKE_COMMAND} ARGS "-E delete_regv \"${hkey}\"") - exec_program(${CMAKE_COMMAND} ARGS "-E remove \"${dir}/${file}\"") + exec_program(${CMAKE_COMMAND} ARGS "-E rm -f \"${dir}/${file}\"") endif () endif () diff --git a/Tests/ComplexOneConfig/Library/CMakeLists.txt b/Tests/ComplexOneConfig/Library/CMakeLists.txt index 64f6dc854a6..df874ef9134 100644 --- a/Tests/ComplexOneConfig/Library/CMakeLists.txt +++ b/Tests/ComplexOneConfig/Library/CMakeLists.txt @@ -131,7 +131,7 @@ if("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM) # Custom target to try preprocessing invocation. add_custom_target(test_preprocess ${MAYBE_ALL} - COMMAND ${CMAKE_COMMAND} -E remove CMakeFiles/create_file.dir/create_file.i + COMMAND ${CMAKE_COMMAND} -E rm -f CMakeFiles/create_file.dir/create_file.i COMMAND ${CMAKE_MAKE_PROGRAM} create_file.i COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/test_preprocess.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt index e9a9f525f79..e4b50d034fd 100644 --- a/Tests/CustomCommand/CMakeLists.txt +++ b/Tests/CustomCommand/CMakeLists.txt @@ -70,7 +70,7 @@ add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/doc1.h APPEND COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/doc1temp.h ${PROJECT_BINARY_DIR}/doc1.h COMMAND ${CMAKE_COMMAND} -E echo " Removing doc1temp.h." - COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_BINARY_DIR}/doc1temp.h + COMMAND ${CMAKE_COMMAND} -E rm -f ${PROJECT_BINARY_DIR}/doc1temp.h ) # Add custom command to generate foo.h. @@ -412,7 +412,7 @@ add_custom_target(do_check_command_line ALL add_dependencies(do_check_command_line check_command_line) add_custom_target(pre_check_command_line - COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_BINARY_DIR}/check_mark.txt + COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_CURRENT_BINARY_DIR}/check_mark.txt ) add_dependencies(do_check_command_line pre_check_command_line) diff --git a/Tests/ExportImport/CMakeLists.txt b/Tests/ExportImport/CMakeLists.txt index dc621eb2743..d88eb11bbf0 100644 --- a/Tests/ExportImport/CMakeLists.txt +++ b/Tests/ExportImport/CMakeLists.txt @@ -7,7 +7,7 @@ endif() # Wipe out the install tree to make sure the exporter works. add_custom_command( OUTPUT ${ExportImport_BINARY_DIR}/CleanupProject - COMMAND ${CMAKE_COMMAND} -E remove_directory ${ExportImport_BINARY_DIR}/Root + COMMAND ${CMAKE_COMMAND} -E rm -rf ${ExportImport_BINARY_DIR}/Root ) add_custom_target(CleanupTarget ALL DEPENDS ${ExportImport_BINARY_DIR}/CleanupProject) set_property( diff --git a/Tests/FortranOnly/CMakeLists.txt b/Tests/FortranOnly/CMakeLists.txt index de887faa4f5..d945375df37 100644 --- a/Tests/FortranOnly/CMakeLists.txt +++ b/Tests/FortranOnly/CMakeLists.txt @@ -103,11 +103,11 @@ if("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM) # Custom target to try preprocessing invocation. add_custom_target(test_preprocess ${MAYBE_ALL} - COMMAND ${CMAKE_COMMAND} -E remove CMakeFiles/preprocess.dir/preprocess.F.i + COMMAND ${CMAKE_COMMAND} -E rm -f CMakeFiles/preprocess.dir/preprocess.F.i COMMAND ${CMAKE_MAKE_PROGRAM} preprocess.i COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/test_preprocess.cmake # Remove bogus file some compilers leave behind. - COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_SOURCE_DIR}/preprocess.s + COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_CURRENT_SOURCE_DIR}/preprocess.s WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) endif() diff --git a/Tests/JavaExportImport/CMakeLists.txt b/Tests/JavaExportImport/CMakeLists.txt index c70704a0453..7a2d020a195 100644 --- a/Tests/JavaExportImport/CMakeLists.txt +++ b/Tests/JavaExportImport/CMakeLists.txt @@ -9,7 +9,7 @@ find_package(Java COMPONENTS Development) # Wipe out the install tree to make sure the exporter works. add_custom_command( OUTPUT ${JavaExportImport_BINARY_DIR}/CleanupProject - COMMAND ${CMAKE_COMMAND} -E remove_directory ${JavaExportImport_BINARY_DIR}/Root + COMMAND ${CMAKE_COMMAND} -E rm -rf ${JavaExportImport_BINARY_DIR}/Root ) add_custom_target(CleanupTarget ALL DEPENDS ${JavaExportImport_BINARY_DIR}/CleanupProject) set_property( diff --git a/Tests/LinkDirectory/CMakeLists.txt b/Tests/LinkDirectory/CMakeLists.txt index c60de84e96f..c7a270091be 100644 --- a/Tests/LinkDirectory/CMakeLists.txt +++ b/Tests/LinkDirectory/CMakeLists.txt @@ -33,7 +33,7 @@ ExternalProject_Add(ExternalTarget # directly because it does not know the full paths to the libraries. # (The purpose of this test is to check that link_directories works.) ExternalProject_Add_Step(ExternalTarget cleanup - COMMAND ${CMAKE_COMMAND} -E remove_directory ${LinkDirectory_BINARY_DIR}/bin + COMMAND ${CMAKE_COMMAND} -E rm -rf ${LinkDirectory_BINARY_DIR}/bin DEPENDEES download DEPENDERS configure DEPENDS mylibA mylibB diff --git a/Tests/MacRuntimePath/CMakeLists.txt b/Tests/MacRuntimePath/CMakeLists.txt index a3c6fd9a9c3..9f1bf1a1306 100644 --- a/Tests/MacRuntimePath/CMakeLists.txt +++ b/Tests/MacRuntimePath/CMakeLists.txt @@ -7,7 +7,7 @@ endif() # Wipe out the install tree to make sure the exporter works. add_custom_command( OUTPUT ${MacRuntimePath_BINARY_DIR}/CleanupProject - COMMAND ${CMAKE_COMMAND} -E remove_directory ${MacRuntimePath_BINARY_DIR}/Root + COMMAND ${CMAKE_COMMAND} -E rm -rf ${MacRuntimePath_BINARY_DIR}/Root ) add_custom_target(CleanupTarget ALL DEPENDS ${MacRuntimePath_BINARY_DIR}/CleanupProject) set_property( diff --git a/Tests/RunCMake/CTestResourceAllocation/ResourceCommon.cmake b/Tests/RunCMake/CTestResourceAllocation/ResourceCommon.cmake index 7d632999d6b..ef79dce992b 100644 --- a/Tests/RunCMake/CTestResourceAllocation/ResourceCommon.cmake +++ b/Tests/RunCMake/CTestResourceAllocation/ResourceCommon.cmake @@ -1,6 +1,6 @@ function(setup_resource_tests) if(CTEST_RESOURCE_ALLOC_ENABLED) - add_test(NAME ResourceSetup COMMAND "${CMAKE_COMMAND}" -E remove -f "${CMAKE_BINARY_DIR}/ctresalloc.log") + add_test(NAME ResourceSetup COMMAND "${CMAKE_COMMAND}" -E rm -f "${CMAKE_BINARY_DIR}/ctresalloc.log") endif() endfunction() diff --git a/Tests/RunCMake/ParseImplicitData/mingw.org-C-GNU-4.9.3.input b/Tests/RunCMake/ParseImplicitData/mingw.org-C-GNU-4.9.3.input index 81e9ee04b33..b1c4ce0abe5 100644 --- a/Tests/RunCMake/ParseImplicitData/mingw.org-C-GNU-4.9.3.input +++ b/Tests/RunCMake/ParseImplicitData/mingw.org-C-GNU-4.9.3.input @@ -53,7 +53,7 @@ LIBRARY_PATH=c:/DoesNotExist/mingw/bin/../lib/gcc/mingw32/4.9.3/;c:/DoesNotExist COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\cmTC_ab097.dir\CMakeCCompilerABI.c.obj' '-c' '-mtune=generic' '-march=i586' Linking C executable cmTC_ab097.exe "C:\CMake\bin\cmake.exe" -E cmake_link_script CMakeFiles\cmTC_ab097.dir\link.txt --verbose=1 -"C:\CMake\bin\cmake.exe" -E remove -f CMakeFiles\cmTC_ab097.dir/objects.a +"C:\CMake\bin\cmake.exe" -E rm -f CMakeFiles\cmTC_ab097.dir/objects.a C:\DoesNotExist\MinGW\bin\ar.exe cr CMakeFiles\cmTC_ab097.dir/objects.a @CMakeFiles\cmTC_ab097.dir\objects1.rsp C:\DoesNotExist\MinGW\bin\gcc.exe -v -Wl,--whole-archive CMakeFiles\cmTC_ab097.dir/objects.a -Wl,--no-whole-archive -o cmTC_ab097.exe -Wl,--out-implib,libcmTC_ab097.dll.a -Wl,--major-image-version,0,--minor-image-version,0 Using built-in specs. diff --git a/Tests/RunCMake/ParseImplicitData/mingw.org-CXX-GNU-4.9.3.input b/Tests/RunCMake/ParseImplicitData/mingw.org-CXX-GNU-4.9.3.input index cd773402ccc..aae67bb938c 100644 --- a/Tests/RunCMake/ParseImplicitData/mingw.org-CXX-GNU-4.9.3.input +++ b/Tests/RunCMake/ParseImplicitData/mingw.org-CXX-GNU-4.9.3.input @@ -59,7 +59,7 @@ LIBRARY_PATH=c:/DoesNotExist/mingw/bin/../lib/gcc/mingw32/4.9.3/;c:/DoesNotExist COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\cmTC_2b790.dir\CMakeCXXCompilerABI.cpp.obj' '-c' '-shared-libgcc' '-mtune=generic' '-march=i586' Linking CXX executable cmTC_2b790.exe "C:\CMake\bin\cmake.exe" -E cmake_link_script CMakeFiles\cmTC_2b790.dir\link.txt --verbose=1 -"C:\CMake\bin\cmake.exe" -E remove -f CMakeFiles\cmTC_2b790.dir/objects.a +"C:\CMake\bin\cmake.exe" -E rm -f CMakeFiles\cmTC_2b790.dir/objects.a C:\DoesNotExist\MinGW\bin\ar.exe cr CMakeFiles\cmTC_2b790.dir/objects.a @CMakeFiles\cmTC_2b790.dir\objects1.rsp C:\DoesNotExist\MinGW\bin\g++.exe -v -Wl,--whole-archive CMakeFiles\cmTC_2b790.dir/objects.a -Wl,--no-whole-archive -o cmTC_2b790.exe -Wl,--out-implib,libcmTC_2b790.dll.a -Wl,--major-image-version,0,--minor-image-version,0 Using built-in specs. diff --git a/Tests/StagingPrefix/CMakeLists.txt b/Tests/StagingPrefix/CMakeLists.txt index 8d2519ea3a7..9ed5c1243d0 100644 --- a/Tests/StagingPrefix/CMakeLists.txt +++ b/Tests/StagingPrefix/CMakeLists.txt @@ -5,7 +5,7 @@ project(StagingPrefix) # Wipe out the install tree add_custom_command( OUTPUT ${CMAKE_BINARY_DIR}/CleanupProject - COMMAND ${CMAKE_COMMAND} -E remove_directory + COMMAND ${CMAKE_COMMAND} -E rm -rf ${CMAKE_BINARY_DIR}/ConsumerBuild ${CMAKE_BINARY_DIR}/ProducerBuild ${CMAKE_BINARY_DIR}/stage diff --git a/Tests/SubDir/Examples/example1/CMakeLists.txt b/Tests/SubDir/Examples/example1/CMakeLists.txt index 20d065e542f..8ec1c02697c 100644 --- a/Tests/SubDir/Examples/example1/CMakeLists.txt +++ b/Tests/SubDir/Examples/example1/CMakeLists.txt @@ -3,5 +3,5 @@ project(example1) add_executable(example1 example1.cxx) add_custom_command(TARGET example1 POST_BUILD - COMMAND "${CMAKE_COMMAND}" ARGS -E remove ${SUBDIR_BINARY_DIR}/ShouldBeHere + COMMAND "${CMAKE_COMMAND}" ARGS -E rm -f ${SUBDIR_BINARY_DIR}/ShouldBeHere COMMENT "Remove marker file that should exist because this should not be run") diff --git a/Tests/SubDirSpaces/Some Examples/example1/CMakeLists.txt b/Tests/SubDirSpaces/Some Examples/example1/CMakeLists.txt index 20d065e542f..8ec1c02697c 100644 --- a/Tests/SubDirSpaces/Some Examples/example1/CMakeLists.txt +++ b/Tests/SubDirSpaces/Some Examples/example1/CMakeLists.txt @@ -3,5 +3,5 @@ project(example1) add_executable(example1 example1.cxx) add_custom_command(TARGET example1 POST_BUILD - COMMAND "${CMAKE_COMMAND}" ARGS -E remove ${SUBDIR_BINARY_DIR}/ShouldBeHere + COMMAND "${CMAKE_COMMAND}" ARGS -E rm -f ${SUBDIR_BINARY_DIR}/ShouldBeHere COMMENT "Remove marker file that should exist because this should not be run") diff --git a/Tests/VSMidl/CMakeLists.txt b/Tests/VSMidl/CMakeLists.txt index 432506c3ba3..3ff7c270555 100644 --- a/Tests/VSMidl/CMakeLists.txt +++ b/Tests/VSMidl/CMakeLists.txt @@ -56,8 +56,8 @@ set(source_dir "${base_dir}/src") # ExternalProject_Add(clean-${PROJECT_NAME} DOWNLOAD_COMMAND "" - CONFIGURE_COMMAND ${CMAKE_COMMAND} -E remove_directory "${source_dir}" - BUILD_COMMAND ${CMAKE_COMMAND} -E remove_directory "${binary_dir}" + CONFIGURE_COMMAND ${CMAKE_COMMAND} -E rm -rf "${source_dir}" + BUILD_COMMAND ${CMAKE_COMMAND} -E rm -rf "${binary_dir}" INSTALL_COMMAND "" ) diff --git a/Utilities/CMakeLists.txt b/Utilities/CMakeLists.txt index 056454019db..22a3d5a7faf 100644 --- a/Utilities/CMakeLists.txt +++ b/Utilities/CMakeLists.txt @@ -13,7 +13,7 @@ if(CMAKE_DOC_TARBALL) endif() add_custom_command( OUTPUT ${dir}.stamp - COMMAND cmake -E remove_directory ${dir} + COMMAND cmake -E rm -rf ${dir} COMMAND cmake -E tar xf ${CMAKE_DOC_TARBALL} COMMAND cmake -E touch ${dir}.stamp DEPENDS ${CMAKE_DOC_TARBALL} diff --git a/Utilities/cmcurl/CMake/cmake_uninstall.cmake.in b/Utilities/cmcurl/CMake/cmake_uninstall.cmake.in index db8e5367dbc..5178fd8281d 100644 --- a/Utilities/cmcurl/CMake/cmake_uninstall.cmake.in +++ b/Utilities/cmcurl/CMake/cmake_uninstall.cmake.in @@ -13,7 +13,7 @@ foreach(file ${files}) message(STATUS "Uninstalling $ENV{DESTDIR}${file}") if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") exec_program( - "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" + "@CMAKE_COMMAND@" ARGS "-E rm -f \"$ENV{DESTDIR}${file}\"" OUTPUT_VARIABLE rm_out RETURN_VALUE rm_retval ) diff --git a/cmake_uninstall.cmake.in b/cmake_uninstall.cmake.in index d81f62a217f..b5fc700928e 100644 --- a/cmake_uninstall.cmake.in +++ b/cmake_uninstall.cmake.in @@ -8,7 +8,7 @@ foreach(file ${files}) message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") if(EXISTS "$ENV{DESTDIR}${file}") exec_program( - "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" + "@CMAKE_COMMAND@" ARGS "-E rm -f \"$ENV{DESTDIR}${file}\"" OUTPUT_VARIABLE rm_out RETURN_VALUE rm_retval ) From aeb95264e02252aba705166dfb8410baff0e715d Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Thu, 14 Nov 2019 00:01:07 -0500 Subject: [PATCH 119/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index d5688932a54..3cdadcbb36a 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191113) +set(CMake_VERSION_PATCH 20191114) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From 8dd284bf196de65caec90eff8723b59559434149 Mon Sep 17 00:00:00 2001 From: Marc Chevrier Date: Tue, 12 Nov 2019 17:17:27 +0100 Subject: [PATCH 120/662] cmFileLockPool: enhance items management --- Source/cmFileLock.cxx | 25 ++++++++++++++++++ Source/cmFileLock.h | 2 ++ Source/cmFileLockPool.cxx | 52 ++++++++++++++++++++------------------ Source/cmFileLockPool.h | 14 +++++----- Utilities/IWYU/mapping.imp | 2 ++ 5 files changed, 62 insertions(+), 33 deletions(-) diff --git a/Source/cmFileLock.cxx b/Source/cmFileLock.cxx index e90f57140ed..6010233cade 100644 --- a/Source/cmFileLock.cxx +++ b/Source/cmFileLock.cxx @@ -3,11 +3,23 @@ #include "cmFileLock.h" #include +#include #include "cmFileLockResult.h" // Common implementation +cmFileLock::cmFileLock(cmFileLock&& other) noexcept +{ + this->File = other.File; +#if defined(_WIN32) + other.File = INVALID_HANDLE_VALUE; +#else + other.File = -1; +#endif + this->Filename = std::move(other.Filename); +} + cmFileLock::~cmFileLock() { if (!this->Filename.empty()) { @@ -17,6 +29,19 @@ cmFileLock::~cmFileLock() } } +cmFileLock& cmFileLock::operator=(cmFileLock&& other) noexcept +{ + this->File = other.File; +#if defined(_WIN32) + other.File = INVALID_HANDLE_VALUE; +#else + other.File = -1; +#endif + this->Filename = std::move(other.Filename); + + return *this; +} + cmFileLockResult cmFileLock::Lock(const std::string& filename, unsigned long timeout) { diff --git a/Source/cmFileLock.h b/Source/cmFileLock.h index 2130d65dbe8..5fe068e8f19 100644 --- a/Source/cmFileLock.h +++ b/Source/cmFileLock.h @@ -26,7 +26,9 @@ class cmFileLock ~cmFileLock(); cmFileLock(cmFileLock const&) = delete; + cmFileLock(cmFileLock&&) noexcept; cmFileLock& operator=(cmFileLock const&) = delete; + cmFileLock& operator=(cmFileLock&&) noexcept; /** * @brief Lock the file. diff --git a/Source/cmFileLockPool.cxx b/Source/cmFileLockPool.cxx index 8db2db21035..e1f6e948a91 100644 --- a/Source/cmFileLockPool.cxx +++ b/Source/cmFileLockPool.cxx @@ -3,40 +3,34 @@ #include "cmFileLockPool.h" #include +#include -#include "cmAlgorithms.h" #include "cmFileLock.h" #include "cmFileLockResult.h" cmFileLockPool::cmFileLockPool() = default; -cmFileLockPool::~cmFileLockPool() -{ - cmDeleteAll(this->FunctionScopes); - cmDeleteAll(this->FileScopes); -} +cmFileLockPool::~cmFileLockPool() = default; void cmFileLockPool::PushFunctionScope() { - this->FunctionScopes.push_back(new ScopePool()); + this->FunctionScopes.push_back(ScopePool()); } void cmFileLockPool::PopFunctionScope() { assert(!this->FunctionScopes.empty()); - delete this->FunctionScopes.back(); this->FunctionScopes.pop_back(); } void cmFileLockPool::PushFileScope() { - this->FileScopes.push_back(new ScopePool()); + this->FileScopes.push_back(ScopePool()); } void cmFileLockPool::PopFileScope() { assert(!this->FileScopes.empty()); - delete this->FileScopes.back(); this->FileScopes.pop_back(); } @@ -49,7 +43,7 @@ cmFileLockResult cmFileLockPool::LockFunctionScope(const std::string& filename, if (this->FunctionScopes.empty()) { return cmFileLockResult::MakeNoFunction(); } - return this->FunctionScopes.back()->Lock(filename, timeoutSec); + return this->FunctionScopes.back().Lock(filename, timeoutSec); } cmFileLockResult cmFileLockPool::LockFileScope(const std::string& filename, @@ -59,7 +53,7 @@ cmFileLockResult cmFileLockPool::LockFileScope(const std::string& filename, return cmFileLockResult::MakeAlreadyLocked(); } assert(!this->FileScopes.empty()); - return this->FileScopes.back()->Lock(filename, timeoutSec); + return this->FileScopes.back().Lock(filename, timeoutSec); } cmFileLockResult cmFileLockPool::LockProcessScope(const std::string& filename, @@ -74,14 +68,14 @@ cmFileLockResult cmFileLockPool::LockProcessScope(const std::string& filename, cmFileLockResult cmFileLockPool::Release(const std::string& filename) { for (auto& funcScope : this->FunctionScopes) { - const cmFileLockResult result = funcScope->Release(filename); + const cmFileLockResult result = funcScope.Release(filename); if (!result.IsOk()) { return result; } } for (auto& fileScope : this->FileScopes) { - const cmFileLockResult result = fileScope->Release(filename); + const cmFileLockResult result = fileScope.Release(filename); if (!result.IsOk()) { return result; } @@ -93,14 +87,14 @@ cmFileLockResult cmFileLockPool::Release(const std::string& filename) bool cmFileLockPool::IsAlreadyLocked(const std::string& filename) const { for (auto const& funcScope : this->FunctionScopes) { - const bool result = funcScope->IsAlreadyLocked(filename); + const bool result = funcScope.IsAlreadyLocked(filename); if (result) { return true; } } for (auto const& fileScope : this->FileScopes) { - const bool result = fileScope->IsAlreadyLocked(filename); + const bool result = fileScope.IsAlreadyLocked(filename); if (result) { return true; } @@ -111,21 +105,29 @@ bool cmFileLockPool::IsAlreadyLocked(const std::string& filename) const cmFileLockPool::ScopePool::ScopePool() = default; -cmFileLockPool::ScopePool::~ScopePool() +cmFileLockPool::ScopePool::~ScopePool() = default; + +cmFileLockPool::ScopePool::ScopePool(ScopePool&&) noexcept = default; + +cmFileLockPool::ScopePool& cmFileLockPool::ScopePool::operator=( + ScopePool&& other) noexcept { - cmDeleteAll(this->Locks); + if (this != &other) { + this->Locks = std::move(other.Locks); + } + + return *this; } cmFileLockResult cmFileLockPool::ScopePool::Lock(const std::string& filename, unsigned long timeoutSec) { - cmFileLock* lock = new cmFileLock(); - const cmFileLockResult result = lock->Lock(filename, timeoutSec); + cmFileLock lock; + const cmFileLockResult result = lock.Lock(filename, timeoutSec); if (result.IsOk()) { - this->Locks.push_back(lock); + this->Locks.push_back(std::move(lock)); return cmFileLockResult::MakeOk(); } - delete lock; return result; } @@ -133,8 +135,8 @@ cmFileLockResult cmFileLockPool::ScopePool::Release( const std::string& filename) { for (auto& lock : this->Locks) { - if (lock->IsLocked(filename)) { - return lock->Release(); + if (lock.IsLocked(filename)) { + return lock.Release(); } } return cmFileLockResult::MakeOk(); @@ -144,7 +146,7 @@ bool cmFileLockPool::ScopePool::IsAlreadyLocked( const std::string& filename) const { for (auto const& lock : this->Locks) { - if (lock->IsLocked(filename)) { + if (lock.IsLocked(filename)) { return true; } } diff --git a/Source/cmFileLockPool.h b/Source/cmFileLockPool.h index dae68dd011d..d45c82cc41f 100644 --- a/Source/cmFileLockPool.h +++ b/Source/cmFileLockPool.h @@ -8,7 +8,8 @@ #include #include -class cmFileLock; +#include "cmFileLock.h" + class cmFileLockResult; class cmFileLockPool @@ -64,7 +65,9 @@ class cmFileLockPool ~ScopePool(); ScopePool(ScopePool const&) = delete; + ScopePool(ScopePool&&) noexcept; ScopePool& operator=(ScopePool const&) = delete; + ScopePool& operator=(ScopePool&&) noexcept; cmFileLockResult Lock(const std::string& filename, unsigned long timeoutSec); @@ -72,17 +75,12 @@ class cmFileLockPool bool IsAlreadyLocked(const std::string& filename) const; private: - using List = std::vector; - using It = List::iterator; - using CIt = List::const_iterator; + using List = std::vector; List Locks; }; - using List = std::vector; - - using It = List::iterator; - using CIt = List::const_iterator; + using List = std::vector; List FunctionScopes; List FileScopes; diff --git a/Utilities/IWYU/mapping.imp b/Utilities/IWYU/mapping.imp index 5e4c7ba5866..3497b532cad 100644 --- a/Utilities/IWYU/mapping.imp +++ b/Utilities/IWYU/mapping.imp @@ -47,6 +47,8 @@ # HACK: iwyu suggests and each time vector[] is used. # https://github.com/include-what-you-use/include-what-you-use/issues/166 { include: [ "", private, "", public ] }, + { symbol: [ "std::allocator_traits >::value_type", private, "", public ] }, + { symbol: [ "std::allocator_traits >::value_type", private, "", public ] }, { symbol: [ "std::allocator_traits >::value_type", private, "", public ] }, { symbol: [ "std::allocator_traits >::value_type", private, "", public ] }, { symbol: [ "std::allocator_traits >::value_type", private, "", public ] }, From 26367b4bb2be9013d3bc30deef8ef1eda866a5cd Mon Sep 17 00:00:00 2001 From: yacoub Date: Wed, 13 Nov 2019 08:27:02 -0500 Subject: [PATCH 121/662] CPack/NuGet: Do not mangle non-C-identifier chars in dependencies Fixes: #19956 --- Modules/Internal/CPack/CPackNuGet.cmake | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Modules/Internal/CPack/CPackNuGet.cmake b/Modules/Internal/CPack/CPackNuGet.cmake index 82053b221d7..b46a7b175da 100644 --- a/Modules/Internal/CPack/CPackNuGet.cmake +++ b/Modules/Internal/CPack/CPackNuGet.cmake @@ -230,13 +230,11 @@ function(_cpack_nuget_render_spec) foreach(_dep IN LISTS _deps) _cpack_nuget_debug(" checking dependency `${_dep}`") - string(MAKE_C_IDENTIFIER "${_dep}" _dep_id) - - _cpack_nuget_variable_fallback(_ver DEPENDENCIES_${_dep_id}_VERSION) + _cpack_nuget_variable_fallback(_ver DEPENDENCIES_${_dep}_VERSION) if(NOT _ver) - string(TOUPPER "${_dep_id}" _dep_id) - _cpack_nuget_variable_fallback(_ver DEPENDENCIES_${_dep_id}_VERSION) + string(TOUPPER "${_dep}" _dep_upper) + _cpack_nuget_variable_fallback(_ver DEPENDENCIES_${_dep_upper}_VERSION) endif() if(_ver) From a10e11fd7c36a2086223384d35f3d5325ef84f05 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Fri, 15 Nov 2019 00:01:07 -0500 Subject: [PATCH 122/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 3cdadcbb36a..f9e3d4afafe 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191114) +set(CMake_VERSION_PATCH 20191115) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From 9e27e52d4b0fee729f9a3bef710efed290ef9900 Mon Sep 17 00:00:00 2001 From: KWSys Upstream Date: Fri, 15 Nov 2019 08:05:29 -0500 Subject: [PATCH 123/662] KWSys 2019-11-15 (329d8c7c) Code extracted from: https://gitlab.kitware.com/utils/kwsys.git at commit 329d8c7c907353999827c02a7af341e57aff90aa (master). Upstream Shortlog ----------------- Brad King (1): 2581cfd1 SystemTools: Update EnableMSVCDebugHook to simulate "Retry" --- SystemTools.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SystemTools.cxx b/SystemTools.cxx index dcf05daa85e..39873e630d9 100644 --- a/SystemTools.cxx +++ b/SystemTools.cxx @@ -4666,8 +4666,12 @@ void SystemTools::ClassFinalize() # include namespace KWSYS_NAMESPACE { -static int SystemToolsDebugReport(int, char* message, int*) +static int SystemToolsDebugReport(int, char* message, int* ret) { + if (ret) { + // Pretend user clicked on Retry button in popup. + *ret = 1; + } fprintf(stderr, "%s", message); fflush(stderr); return 1; // no further reporting required From a4c19cb895f6275c5ff1a3991a117df1ad27cf15 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 15 Nov 2019 09:23:47 -0500 Subject: [PATCH 124/662] Windows: Restore suppression of error report popups in CI builds On Windows, libuv uses `_CrtSetReportHook` to install a handler it uses to suppress assertions on invalid file descriptors in `_get_osfhandle`. This removes the handler we install in CI environments to suppress interactive popups. Move installation of our handler to after libuv is initialized so that our handler is actually used. Unfortunately this also removes libuv's handler and so may cause Debug builds under CI to abort on invalid file descriptors instead of simply converting them to `INVALID_HANDLE_VALUE`. If this becomes a problem we may need to modify libuv to make its hook more configurable. --- Source/CPack/cpack.cxx | 1 - Source/cmSystemTools.cxx | 2 ++ Source/cmakemain.cxx | 1 - Source/ctest.cxx | 1 - 4 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index d7868f34657..dc316233c92 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -115,7 +115,6 @@ int main(int argc, char const* const* argv) argc = args.argc(); argv = args.argv(); - cmSystemTools::EnableMSVCDebugHook(); cmSystemTools::InitializeLibUV(); cmSystemTools::FindCMakeResources(argv[0]); cmCPackLog log; diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index c4a4220f817..17d32c69970 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -814,6 +814,8 @@ void cmSystemTools::InitializeLibUV() # else _fmode = _O_TEXT; # endif + // Replace libuv's report handler with our own to suppress popups. + cmSystemTools::EnableMSVCDebugHook(); #endif } diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index baf975ecb20..d8179715e1c 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -683,7 +683,6 @@ int main(int ac, char const* const* av) ac = args.argc(); av = args.argv(); - cmSystemTools::EnableMSVCDebugHook(); cmSystemTools::InitializeLibUV(); cmSystemTools::FindCMakeResources(av[0]); if (ac > 1) { diff --git a/Source/ctest.cxx b/Source/ctest.cxx index a7b11cd944e..a9fcc848ab6 100644 --- a/Source/ctest.cxx +++ b/Source/ctest.cxx @@ -164,7 +164,6 @@ int main(int argc, char const* const* argv) argv = encoding_args.argv(); cmSystemTools::DoNotInheritStdPipes(); - cmSystemTools::EnableMSVCDebugHook(); cmSystemTools::InitializeLibUV(); cmSystemTools::FindCMakeResources(argv[0]); From 32c165d2636a65362265d20a16e1f914a53882dd Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 15 Nov 2019 09:28:37 -0500 Subject: [PATCH 125/662] CTest: Consolidate '--repeat-* n' options as `--repeat *:n` Combine `--repeat-until-fail`, `--repeat-until-pass`, and `--repeat-after-timeout` to create a single `--repeat :` option. Retain `--repeat-until-fail` too because that has been available in previous releases. --- Help/manual/ctest.1.rst | 30 +++++----- Help/release/dev/ctest-repeat-until-pass.rst | 9 --- Help/release/dev/ctest-repeat.rst | 10 ++++ Source/cmCTest.cxx | 58 ++++++++----------- Source/ctest.cxx | 6 +- .../CTestCommandLine/RunCMakeTest.cmake | 53 ++++++++--------- .../repeat-after-timeout-bad1-stderr.txt | 1 - .../repeat-after-timeout-bad2-stderr.txt | 1 - ...xt => repeat-opt-after-timeout-stderr.txt} | 0 ...-result.txt => repeat-opt-bad1-result.txt} | 0 .../repeat-opt-bad1-stderr.txt | 1 + ...-result.txt => repeat-opt-bad2-result.txt} | 0 .../repeat-opt-bad2-stderr.txt | 1 + ...-result.txt => repeat-opt-bad3-result.txt} | 0 .../repeat-opt-bad3-stderr.txt | 1 + ...-result.txt => repeat-opt-bad4-result.txt} | 0 .../repeat-opt-bad4-stderr.txt | 1 + ...r.txt => repeat-opt-until-fail-stderr.txt} | 0 .../repeat-opt-until-pass-stderr.txt | 1 + .../repeat-until-fail-and-pass-stderr.txt | 1 - .../repeat-until-fail-and-timeout-stderr.txt | 1 - .../repeat-until-pass-and-fail-result.txt | 1 - .../repeat-until-pass-and-fail-stderr.txt | 1 - .../repeat-until-pass-bad1-result.txt | 1 - .../repeat-until-pass-bad1-stderr.txt | 1 - .../repeat-until-pass-bad2-result.txt | 1 - .../repeat-until-pass-bad2-stderr.txt | 1 - 27 files changed, 82 insertions(+), 99 deletions(-) delete mode 100644 Help/release/dev/ctest-repeat-until-pass.rst create mode 100644 Help/release/dev/ctest-repeat.rst delete mode 100644 Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad1-stderr.txt delete mode 100644 Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad2-stderr.txt rename Tests/RunCMake/CTestCommandLine/{repeat-after-timeout-good-stderr.txt => repeat-opt-after-timeout-stderr.txt} (100%) rename Tests/RunCMake/CTestCommandLine/{repeat-after-timeout-bad1-result.txt => repeat-opt-bad1-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestCommandLine/repeat-opt-bad1-stderr.txt rename Tests/RunCMake/CTestCommandLine/{repeat-after-timeout-bad2-result.txt => repeat-opt-bad2-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestCommandLine/repeat-opt-bad2-stderr.txt rename Tests/RunCMake/CTestCommandLine/{repeat-until-fail-and-pass-result.txt => repeat-opt-bad3-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestCommandLine/repeat-opt-bad3-stderr.txt rename Tests/RunCMake/CTestCommandLine/{repeat-until-fail-and-timeout-result.txt => repeat-opt-bad4-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestCommandLine/repeat-opt-bad4-stderr.txt rename Tests/RunCMake/CTestCommandLine/{repeat-until-pass-good-stderr.txt => repeat-opt-until-fail-stderr.txt} (100%) create mode 100644 Tests/RunCMake/CTestCommandLine/repeat-opt-until-pass-stderr.txt delete mode 100644 Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-pass-stderr.txt delete mode 100644 Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-timeout-stderr.txt delete mode 100644 Tests/RunCMake/CTestCommandLine/repeat-until-pass-and-fail-result.txt delete mode 100644 Tests/RunCMake/CTestCommandLine/repeat-until-pass-and-fail-stderr.txt delete mode 100644 Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad1-result.txt delete mode 100644 Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad1-stderr.txt delete mode 100644 Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad2-result.txt delete mode 100644 Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad2-stderr.txt diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst index 328f5794c4d..2a6cb48b2cf 100644 --- a/Help/manual/ctest.1.rst +++ b/Help/manual/ctest.1.rst @@ -261,23 +261,27 @@ Options fail, subsequent calls to CTest with the ``--rerun-failed`` option will run the set of tests that most recently failed (if any). -``--repeat-until-fail `` - Require each test to run ```` times without failing in order to pass. - - This is useful in finding sporadic failures in test cases. +``--repeat :`` + Run tests repeatedly based on the given ```` up to ```` times. + The modes are: -``--repeat-until-pass `` - Allow each test to run up to ```` times in order to pass. - Repeats tests if they fail for any reason. + ``until-fail`` + Require each test to run ```` times without failing in order to pass. + This is useful in finding sporadic failures in test cases. - This is useful in tolerating sporadic failures in test cases. + ``until-pass`` + Allow each test to run up to ```` times in order to pass. + Repeats tests if they fail for any reason. + This is useful in tolerating sporadic failures in test cases. -``--repeat-after-timeout `` - Allow each test to run up to ```` times in order to pass. - Repeats tests only if they timeout. + ``after-timeout`` + Allow each test to run up to ```` times in order to pass. + Repeats tests only if they timeout. + This is useful in tolerating sporadic timeouts in test cases + on busy machines. - This is useful in tolerating sporadic timeouts in test cases - on busy machines. +``--repeat-until-fail `` + Equivalent to ``--repeat until-fail:``. ``--max-width `` Set the max width for a test name to output. diff --git a/Help/release/dev/ctest-repeat-until-pass.rst b/Help/release/dev/ctest-repeat-until-pass.rst deleted file mode 100644 index b5f6c26281b..00000000000 --- a/Help/release/dev/ctest-repeat-until-pass.rst +++ /dev/null @@ -1,9 +0,0 @@ -ctest-repeat-until-pass ------------------------ - -* The :manual:`ctest(1)` tool learned new ``--repeat-until-pass `` - and ``--repeat-after-timeout `` options to help tolerate sporadic - test failures. - -* The :command:`ctest_test` command gained a ``REPEAT :`` option - to specify conditions in which to repeat tests. diff --git a/Help/release/dev/ctest-repeat.rst b/Help/release/dev/ctest-repeat.rst new file mode 100644 index 00000000000..b1ff59bfdc1 --- /dev/null +++ b/Help/release/dev/ctest-repeat.rst @@ -0,0 +1,10 @@ +ctest-repeat +------------ + +* The :manual:`ctest(1)` tool gained a ``--repeat :`` option + to specify conditions in which to repeat tests. This generalizes + the existing ``--repeat-until-fail `` option to add modes for + ``until-pass`` and ``after-timeout``. + +* The :command:`ctest_test` command gained a ``REPEAT :`` option + to specify conditions in which to repeat tests. diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index a49866ce984..76a2bba85c0 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -21,6 +21,7 @@ #include "cmsys/FStream.hxx" #include "cmsys/Glob.hxx" #include "cmsys/Process.h" +#include "cmsys/RegularExpression.hxx" #include "cmsys/SystemInformation.hxx" #include "cm_curl.h" @@ -1846,7 +1847,7 @@ bool cmCTest::HandleCommandLineArguments(size_t& i, return false; } if (this->Impl->RepeatMode != cmCTest::Repeat::Never) { - errormsg = "At most one '--repeat-*' option may be used."; + errormsg = "At most one '--repeat' option may be used."; return false; } i++; @@ -1862,48 +1863,37 @@ bool cmCTest::HandleCommandLineArguments(size_t& i, } } - if (this->CheckArgument(arg, "--repeat-until-pass")) { + if (this->CheckArgument(arg, "--repeat")) { if (i >= args.size() - 1) { - errormsg = "'--repeat-until-pass' requires an argument"; + errormsg = "'--repeat' requires an argument"; return false; } if (this->Impl->RepeatMode != cmCTest::Repeat::Never) { - errormsg = "At most one '--repeat-*' option may be used."; + errormsg = "At most one '--repeat' option may be used."; return false; } i++; - long repeat = 1; - if (!cmStrToLong(args[i], &repeat)) { - errormsg = - "'--repeat-until-pass' given non-integer value '" + args[i] + "'"; - return false; - } - this->Impl->RepeatCount = static_cast(repeat); - if (repeat > 1) { - this->Impl->RepeatMode = cmCTest::Repeat::UntilPass; - } - } - - if (this->CheckArgument(arg, "--repeat-after-timeout")) { - if (i >= args.size() - 1) { - errormsg = "'--repeat-after-timeout' requires an argument"; - return false; - } - if (this->Impl->RepeatMode != cmCTest::Repeat::Never) { - errormsg = "At most one '--repeat-*' option may be used."; - return false; - } - i++; - long repeat = 1; - if (!cmStrToLong(args[i], &repeat)) { - errormsg = - "'--repeat-after-timeout' given non-integer value '" + args[i] + "'"; + cmsys::RegularExpression repeatRegex( + "^(until-fail|until-pass|after-timeout):([0-9]+)$"); + if (repeatRegex.find(args[i])) { + std::string const& count = repeatRegex.match(2); + unsigned long n = 1; + cmStrToULong(count, &n); // regex guarantees success + this->Impl->RepeatCount = static_cast(n); + if (this->Impl->RepeatCount > 1) { + std::string const& mode = repeatRegex.match(1); + if (mode == "until-fail") { + this->Impl->RepeatMode = cmCTest::Repeat::UntilFail; + } else if (mode == "until-pass") { + this->Impl->RepeatMode = cmCTest::Repeat::UntilPass; + } else if (mode == "after-timeout") { + this->Impl->RepeatMode = cmCTest::Repeat::AfterTimeout; + } + } + } else { + errormsg = "'--repeat' given invalid value '" + args[i] + "'"; return false; } - this->Impl->RepeatCount = static_cast(repeat); - if (repeat > 1) { - this->Impl->RepeatMode = cmCTest::Repeat::AfterTimeout; - } } if (this->CheckArgument(arg, "--test-load") && i < args.size() - 1) { diff --git a/Source/ctest.cxx b/Source/ctest.cxx index a7b11cd944e..1f25492230c 100644 --- a/Source/ctest.cxx +++ b/Source/ctest.cxx @@ -98,11 +98,11 @@ static const char* cmDocumentationOptions[][2] = { "Run a specific number of tests by number." }, { "-U, --union", "Take the Union of -I and -R" }, { "--rerun-failed", "Run only the tests that failed previously" }, - { "--repeat-until-fail ", + { "--repeat until-fail:, --repeat-until-fail ", "Require each test to run times without failing in order to pass" }, - { "--repeat-until-pass ", + { "--repeat until-pass:", "Allow each test to run up to times in order to pass" }, - { "--repeat-after-timeout ", + { "--repeat after-timeout:", "Allow each test to run up to times if it times out" }, { "--max-width ", "Set the max width for a test name to output" }, { "--interactive-debug-mode [0|1]", "Set the interactive mode to 0 or 1." }, diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake index 6a7fd3b55c8..0953504eadb 100644 --- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake @@ -4,14 +4,26 @@ set(RunCMake_TEST_TIMEOUT 60) unset(ENV{CTEST_PARALLEL_LEVEL}) unset(ENV{CTEST_OUTPUT_ON_FAILURE}) -run_cmake_command(repeat-until-pass-bad1 - ${CMAKE_CTEST_COMMAND} --repeat-until-pass +run_cmake_command(repeat-opt-bad1 + ${CMAKE_CTEST_COMMAND} --repeat until-pass ) -run_cmake_command(repeat-until-pass-bad2 - ${CMAKE_CTEST_COMMAND} --repeat-until-pass foo +run_cmake_command(repeat-opt-bad2 + ${CMAKE_CTEST_COMMAND} --repeat until-pass:foo ) -run_cmake_command(repeat-until-pass-good - ${CMAKE_CTEST_COMMAND} --repeat-until-pass 2 +run_cmake_command(repeat-opt-bad3 + ${CMAKE_CTEST_COMMAND} --repeat until-fail:2 --repeat-until-fail 2 + ) +run_cmake_command(repeat-opt-bad4 + ${CMAKE_CTEST_COMMAND} --repeat-until-fail 2 --repeat until-fail:2 + ) +run_cmake_command(repeat-opt-until-pass + ${CMAKE_CTEST_COMMAND} --repeat until-pass:2 + ) +run_cmake_command(repeat-opt-until-fail + ${CMAKE_CTEST_COMMAND} --repeat until-fail:2 + ) +run_cmake_command(repeat-opt-after-timeout + ${CMAKE_CTEST_COMMAND} --repeat after-timeout:2 ) run_cmake_command(repeat-until-fail-bad1 @@ -24,33 +36,13 @@ run_cmake_command(repeat-until-fail-good ${CMAKE_CTEST_COMMAND} --repeat-until-fail 2 ) -run_cmake_command(repeat-after-timeout-bad1 - ${CMAKE_CTEST_COMMAND} --repeat-after-timeout - ) -run_cmake_command(repeat-after-timeout-bad2 - ${CMAKE_CTEST_COMMAND} --repeat-after-timeout foo - ) -run_cmake_command(repeat-after-timeout-good - ${CMAKE_CTEST_COMMAND} --repeat-after-timeout 2 - ) - -run_cmake_command(repeat-until-pass-and-fail - ${CMAKE_CTEST_COMMAND} --repeat-until-pass 2 --repeat-until-fail 2 - ) -run_cmake_command(repeat-until-fail-and-pass - ${CMAKE_CTEST_COMMAND} --repeat-until-fail 2 --repeat-until-pass 2 - ) -run_cmake_command(repeat-until-fail-and-timeout - ${CMAKE_CTEST_COMMAND} --repeat-until-fail 2 --repeat-after-timeout 2 - ) - function(run_repeat_until_pass_tests) # Use a single build tree for a few tests without cleaning. set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/repeat-until-pass-build) run_cmake(repeat-until-pass-cmake) set(RunCMake_TEST_NO_CLEAN 1) run_cmake_command(repeat-until-pass-ctest - ${CMAKE_CTEST_COMMAND} -C Debug --repeat-until-pass 3 + ${CMAKE_CTEST_COMMAND} -C Debug --repeat until-pass:3 ) endfunction() run_repeat_until_pass_tests() @@ -61,7 +53,7 @@ function(run_repeat_after_timeout_tests) run_cmake(repeat-after-timeout-cmake) set(RunCMake_TEST_NO_CLEAN 1) run_cmake_command(repeat-after-timeout-ctest - ${CMAKE_CTEST_COMMAND} -C Debug --repeat-after-timeout 3 + ${CMAKE_CTEST_COMMAND} -C Debug --repeat after-timeout:3 ) endfunction() run_repeat_after_timeout_tests() @@ -72,10 +64,11 @@ function(run_repeat_until_fail_tests) run_cmake(repeat-until-fail-cmake) set(RunCMake_TEST_NO_CLEAN 1) run_cmake_command(repeat-until-fail-ctest - ${CMAKE_CTEST_COMMAND} -C Debug --repeat-until-fail 3 + ${CMAKE_CTEST_COMMAND} -C Debug ${ARGN} ) endfunction() -run_repeat_until_fail_tests() +run_repeat_until_fail_tests(--repeat-until-fail 3) +run_repeat_until_fail_tests(--repeat until-fail:3) function(run_BadCTestTestfile) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/BadCTestTestfile) diff --git a/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad1-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad1-stderr.txt deleted file mode 100644 index aea92b8bb07..00000000000 --- a/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad1-stderr.txt +++ /dev/null @@ -1 +0,0 @@ -^CMake Error: '--repeat-after-timeout' requires an argument$ diff --git a/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad2-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad2-stderr.txt deleted file mode 100644 index c5db55b65ba..00000000000 --- a/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad2-stderr.txt +++ /dev/null @@ -1 +0,0 @@ -^CMake Error: '--repeat-after-timeout' given non-integer value 'foo'$ diff --git a/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-good-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-opt-after-timeout-stderr.txt similarity index 100% rename from Tests/RunCMake/CTestCommandLine/repeat-after-timeout-good-stderr.txt rename to Tests/RunCMake/CTestCommandLine/repeat-opt-after-timeout-stderr.txt diff --git a/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad1-result.txt b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad1-result.txt similarity index 100% rename from Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad1-result.txt rename to Tests/RunCMake/CTestCommandLine/repeat-opt-bad1-result.txt diff --git a/Tests/RunCMake/CTestCommandLine/repeat-opt-bad1-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad1-stderr.txt new file mode 100644 index 00000000000..f6f32416eaa --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad1-stderr.txt @@ -0,0 +1 @@ +^CMake Error: '--repeat' given invalid value 'until-pass'$ diff --git a/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad2-result.txt b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad2-result.txt similarity index 100% rename from Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad2-result.txt rename to Tests/RunCMake/CTestCommandLine/repeat-opt-bad2-result.txt diff --git a/Tests/RunCMake/CTestCommandLine/repeat-opt-bad2-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad2-stderr.txt new file mode 100644 index 00000000000..2f9f32aef66 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad2-stderr.txt @@ -0,0 +1 @@ +^CMake Error: '--repeat' given invalid value 'until-pass:foo'$ diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-pass-result.txt b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad3-result.txt similarity index 100% rename from Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-pass-result.txt rename to Tests/RunCMake/CTestCommandLine/repeat-opt-bad3-result.txt diff --git a/Tests/RunCMake/CTestCommandLine/repeat-opt-bad3-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad3-stderr.txt new file mode 100644 index 00000000000..de4e11bd4ad --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad3-stderr.txt @@ -0,0 +1 @@ +^CMake Error: At most one '--repeat' option may be used\.$ diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-timeout-result.txt b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad4-result.txt similarity index 100% rename from Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-timeout-result.txt rename to Tests/RunCMake/CTestCommandLine/repeat-opt-bad4-result.txt diff --git a/Tests/RunCMake/CTestCommandLine/repeat-opt-bad4-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad4-stderr.txt new file mode 100644 index 00000000000..de4e11bd4ad --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad4-stderr.txt @@ -0,0 +1 @@ +^CMake Error: At most one '--repeat' option may be used\.$ diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-pass-good-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-opt-until-fail-stderr.txt similarity index 100% rename from Tests/RunCMake/CTestCommandLine/repeat-until-pass-good-stderr.txt rename to Tests/RunCMake/CTestCommandLine/repeat-opt-until-fail-stderr.txt diff --git a/Tests/RunCMake/CTestCommandLine/repeat-opt-until-pass-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-opt-until-pass-stderr.txt new file mode 100644 index 00000000000..a7c4b11f762 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/repeat-opt-until-pass-stderr.txt @@ -0,0 +1 @@ +^No tests were found!!!$ diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-pass-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-pass-stderr.txt deleted file mode 100644 index 15ee3a98ea0..00000000000 --- a/Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-pass-stderr.txt +++ /dev/null @@ -1 +0,0 @@ -^CMake Error: At most one '--repeat-\*' option may be used\.$ diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-timeout-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-timeout-stderr.txt deleted file mode 100644 index 15ee3a98ea0..00000000000 --- a/Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-timeout-stderr.txt +++ /dev/null @@ -1 +0,0 @@ -^CMake Error: At most one '--repeat-\*' option may be used\.$ diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-pass-and-fail-result.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-and-fail-result.txt deleted file mode 100644 index d00491fd7e5..00000000000 --- a/Tests/RunCMake/CTestCommandLine/repeat-until-pass-and-fail-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-pass-and-fail-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-and-fail-stderr.txt deleted file mode 100644 index 15ee3a98ea0..00000000000 --- a/Tests/RunCMake/CTestCommandLine/repeat-until-pass-and-fail-stderr.txt +++ /dev/null @@ -1 +0,0 @@ -^CMake Error: At most one '--repeat-\*' option may be used\.$ diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad1-result.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad1-result.txt deleted file mode 100644 index d00491fd7e5..00000000000 --- a/Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad1-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad1-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad1-stderr.txt deleted file mode 100644 index c6afb1d9cfb..00000000000 --- a/Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad1-stderr.txt +++ /dev/null @@ -1 +0,0 @@ -^CMake Error: '--repeat-until-pass' requires an argument$ diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad2-result.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad2-result.txt deleted file mode 100644 index d00491fd7e5..00000000000 --- a/Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad2-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad2-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad2-stderr.txt deleted file mode 100644 index cc3aed53307..00000000000 --- a/Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad2-stderr.txt +++ /dev/null @@ -1 +0,0 @@ -^CMake Error: '--repeat-until-pass' given non-integer value 'foo'$ From c5fb36a4cb8bd3272e2e0b54e3947886ad7eb778 Mon Sep 17 00:00:00 2001 From: Jannick Date: Thu, 7 Nov 2019 01:13:27 +0100 Subject: [PATCH 126/662] FindFLEX: Add policy CMP0098 to run flex in build tree --- Help/manual/cmake-policies.7.rst | 8 +++ Help/policy/CMP0098.rst | 30 +++++++++++ Help/release/dev/FindFLEX-work-dir.rst | 6 +++ Modules/FindFLEX.cmake | 73 +++++++++++++++++++------- Source/cmPolicies.h | 5 +- 5 files changed, 102 insertions(+), 20 deletions(-) create mode 100644 Help/policy/CMP0098.rst create mode 100644 Help/release/dev/FindFLEX-work-dir.rst diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst index 44ea1a8fd04..eceeac72007 100644 --- a/Help/manual/cmake-policies.7.rst +++ b/Help/manual/cmake-policies.7.rst @@ -51,6 +51,14 @@ The :variable:`CMAKE_MINIMUM_REQUIRED_VERSION` variable may also be used to determine whether to report an error on use of deprecated macros or functions. +Policies Introduced by CMake 3.17 +================================= + +.. toctree:: + :maxdepth: 1 + + CMP0098: FindFLEX runs flex in CMAKE_CURRENT_BINARY_DIR when executing. + Policies Introduced by CMake 3.16 ================================= diff --git a/Help/policy/CMP0098.rst b/Help/policy/CMP0098.rst new file mode 100644 index 00000000000..6d1443b764c --- /dev/null +++ b/Help/policy/CMP0098.rst @@ -0,0 +1,30 @@ +CMP0098 +------- + +:module:`FindFLEX` runs ``flex`` in directory +:variable:`CMAKE_CURRENT_BINARY_DIR` when executing. + +The module provides a ``FLEX_TARGET`` macro which generates FLEX output. +In CMake 3.16 and below the macro would generate a custom command that runs +``flex`` in the current source directory. CMake 3.17 and later prefer to +run it in the build directory and use :variable:`CMAKE_CURRENT_BINARY_DIR` +as the ``WORKING_DIRECTORY`` of its :command:`add_custom_command` invocation. +This ensures that any implicitly generated file is written relative to the +build tree rather than the source tree, unless the generated file is +provided as absolute path. + +This policy provides compatibility for projects that have not been updated +to expect the new behavior. + +The ``OLD`` behavior for this policy is for ``FLEX_TARGET`` to use +the current source directory for the ``WORKING_DIRECTORY`` and where +to generate implicit files. The ``NEW`` behavior of this policy is to +use the current binary directory for the ``WORKING_DIRECTORY`` relative to +which implicit files are generated unless provided as absolute path. + +This policy was introduced in CMake version 3.17. Use the +:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly. +Unlike many policies, CMake version |release| does *not* warn +when this policy is not set and simply uses ``OLD`` behavior. + +.. include:: DEPRECATED.txt diff --git a/Help/release/dev/FindFLEX-work-dir.rst b/Help/release/dev/FindFLEX-work-dir.rst new file mode 100644 index 00000000000..3569185e281 --- /dev/null +++ b/Help/release/dev/FindFLEX-work-dir.rst @@ -0,0 +1,6 @@ +FindFLEX-work-dir +----------------- + +* The :module:`FindFLEX` module's ``FLEX_TARGET`` command now runs ``flex`` + with :variable:`CMAKE_CURRENT_BINARY_DIR` as the working directory. + See policy :policy:`CMP0098`. diff --git a/Modules/FindFLEX.cmake b/Modules/FindFLEX.cmake index d22b7ec67a5..90e5f86b412 100644 --- a/Modules/FindFLEX.cmake +++ b/Modules/FindFLEX.cmake @@ -142,8 +142,6 @@ if(FLEX_EXECUTABLE) #============================================================ # macro(FLEX_TARGET Name Input Output) - set(FLEX_TARGET_outputs "${Output}") - set(FLEX_EXECUTABLE_opts "") set(FLEX_TARGET_PARAM_OPTIONS) set(FLEX_TARGET_PARAM_ONE_VALUE_KEYWORDS @@ -165,31 +163,68 @@ if(FLEX_EXECUTABLE) if(NOT "${FLEX_TARGET_ARG_UNPARSED_ARGUMENTS}" STREQUAL "") message(SEND_ERROR ${FLEX_TARGET_usage}) else() + + cmake_policy(GET CMP0098 _flex_CMP0098 + PARENT_SCOPE # undocumented, do not use outside of CMake + ) + set(_flex_INPUT "${Input}") + if("x${_flex_CMP0098}x" STREQUAL "xNEWx") + set(_flex_WORKING_DIR "${CMAKE_CURRENT_BINARY_DIR}") + if(NOT IS_ABSOLUTE "${_flex_INPUT}") + set(_flex_INPUT "${CMAKE_CURRENT_SOURCE_DIR}/${_flex_INPUT}") + endif() + else() + set(_flex_WORKING_DIR "${CMAKE_CURRENT_SOURCE_DIR}") + endif() + unset(_flex_CMP0098) + + set(_flex_OUTPUT "${Output}") + if(NOT IS_ABSOLUTE ${_flex_OUTPUT}) + set(_flex_OUTPUT "${_flex_WORKING_DIR}/${_flex_OUTPUT}") + endif() + set(_flex_TARGET_OUTPUTS "${_flex_OUTPUT}") + + set(_flex_EXE_OPTS "") if(NOT "${FLEX_TARGET_ARG_COMPILE_FLAGS}" STREQUAL "") - set(FLEX_EXECUTABLE_opts "${FLEX_TARGET_ARG_COMPILE_FLAGS}") - separate_arguments(FLEX_EXECUTABLE_opts) + set(_flex_EXE_OPTS "${FLEX_TARGET_ARG_COMPILE_FLAGS}") + separate_arguments(_flex_EXE_OPTS) endif() + + set(_flex_OUTPUT_HEADER "") if(NOT "${FLEX_TARGET_ARG_DEFINES_FILE}" STREQUAL "") - list(APPEND FLEX_TARGET_outputs "${FLEX_TARGET_ARG_DEFINES_FILE}") - list(APPEND FLEX_EXECUTABLE_opts --header-file=${FLEX_TARGET_ARG_DEFINES_FILE}) + set(_flex_OUTPUT_HEADER "${FLEX_TARGET_ARG_DEFINES_FILE}") + if(IS_ABSOLUTE "${_flex_OUTPUT_HEADER}") + set(_flex_OUTPUT_HEADER_ABS "${_flex_OUTPUT_HEADER}") + else() + set(_flex_OUTPUT_HEADER_ABS "${_flex_WORKING_DIR}/${_flex_OUTPUT_HEADER}") + endif() + list(APPEND _flex_TARGET_OUTPUTS "${_flex_OUTPUT_HEADER_ABS}") + list(APPEND _flex_EXE_OPTS --header-file=${_flex_OUTPUT_HEADER_ABS}) endif() - add_custom_command(OUTPUT ${FLEX_TARGET_outputs} - COMMAND ${FLEX_EXECUTABLE} ${FLEX_EXECUTABLE_opts} -o${Output} ${Input} + get_filename_component(_flex_EXE_NAME_WE "${FLEX_EXECUTABLE}" NAME_WE) + add_custom_command(OUTPUT ${_flex_TARGET_OUTPUTS} + COMMAND ${FLEX_EXECUTABLE} ${_flex_EXE_OPTS} -o${_flex_OUTPUT} ${_flex_INPUT} VERBATIM - DEPENDS ${Input} - COMMENT "[FLEX][${Name}] Building scanner with flex ${FLEX_VERSION}" - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + DEPENDS ${_flex_INPUT} + COMMENT "[FLEX][${Name}] Building scanner with ${_flex_EXE_NAME_WE} ${FLEX_VERSION}" + WORKING_DIRECTORY ${_flex_WORKING_DIR}) set(FLEX_${Name}_DEFINED TRUE) - set(FLEX_${Name}_OUTPUTS ${Output}) - set(FLEX_${Name}_INPUT ${Input}) - set(FLEX_${Name}_COMPILE_FLAGS ${FLEX_EXECUTABLE_opts}) - if("${FLEX_TARGET_ARG_DEFINES_FILE}" STREQUAL "") - set(FLEX_${Name}_OUTPUT_HEADER "") - else() - set(FLEX_${Name}_OUTPUT_HEADER ${FLEX_TARGET_ARG_DEFINES_FILE}) - endif() + set(FLEX_${Name}_OUTPUTS ${_flex_TARGET_OUTPUTS}) + set(FLEX_${Name}_INPUT ${_flex_INPUT}) + set(FLEX_${Name}_COMPILE_FLAGS ${_flex_EXE_OPTS}) + set(FLEX_${Name}_OUTPUT_HEADER ${_flex_OUTPUT_HEADER}) + + unset(_flex_EXE_NAME_WE) + unset(_flex_EXE_OPTS) + unset(_flex_INPUT) + unset(_flex_OUTPUT) + unset(_flex_OUTPUT_HEADER) + unset(_flex_OUTPUT_HEADER_ABS) + unset(_flex_TARGET_OUTPUTS) + unset(_flex_WORKING_DIR) + endif() endmacro() #============================================================ diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index 92c80bb4c1f..da322048439 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -290,7 +290,10 @@ class cmMakefile; SELECT(POLICY, CMP0097, \ "ExternalProject_Add with GIT_SUBMODULES \"\" initializes no " \ "submodules.", \ - 3, 16, 0, cmPolicies::WARN) + 3, 16, 0, cmPolicies::WARN) \ + SELECT(POLICY, CMP0098, \ + "FindFLEX runs flex in CMAKE_CURRENT_BINARY_DIR when executing.", 3, \ + 17, 0, cmPolicies::WARN) #define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1) #define CM_FOR_EACH_POLICY_ID(POLICY) \ From 7e86f71eff72a12e903cdd2efccf55ec3d58a106 Mon Sep 17 00:00:00 2001 From: Marc Chevrier Date: Fri, 15 Nov 2019 16:51:54 +0100 Subject: [PATCH 127/662] cmOutputRequiredFilesCommand: Modernize memory management Also use std::string over char* when possible. --- Source/cmOutputRequiredFilesCommand.cxx | 54 ++++++++++++------------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx index e093be019c6..147f97f7317 100644 --- a/Source/cmOutputRequiredFilesCommand.cxx +++ b/Source/cmOutputRequiredFilesCommand.cxx @@ -7,10 +7,11 @@ #include #include +#include + #include "cmsys/FStream.hxx" #include "cmsys/RegularExpression.hxx" -#include "cmAlgorithms.h" #include "cmExecutionStatus.h" #include "cmGeneratorExpression.h" #include "cmMakefile.h" @@ -94,7 +95,7 @@ class cmLBDepend /** * Destructor. */ - ~cmLBDepend() { cmDeleteAll(this->DependInformationMap); } + ~cmLBDepend() = default; cmLBDepend(const cmLBDepend&) = delete; cmLBDepend& operator=(const cmLBDepend&) = delete; @@ -152,9 +153,9 @@ class cmLBDepend * Generate dependencies for the file given. Returns a pointer to * the cmDependInformation object for the file. */ - const cmDependInformation* FindDependencies(const char* file) + const cmDependInformation* FindDependencies(const std::string& file) { - cmDependInformation* info = this->GetDependInformation(file, nullptr); + cmDependInformation* info = this->GetDependInformation(file, ""); this->GenerateDependInformation(info); return info; } @@ -203,7 +204,7 @@ class cmLBDepend } // Add this file and all its dependencies. - this->AddDependency(info, includeFile.c_str()); + this->AddDependency(info, includeFile); /// add the cxx file if it exists std::string cxxFile = includeFile; std::string::size_type pos = cxxFile.rfind('.'); @@ -254,7 +255,7 @@ class cmLBDepend } } if (found) { - this->AddDependency(info, cxxFile.c_str()); + this->AddDependency(info, cxxFile); } } } @@ -264,10 +265,10 @@ class cmLBDepend /** * Add a dependency. Possibly walk it for more dependencies. */ - void AddDependency(cmDependInformation* info, const char* file) + void AddDependency(cmDependInformation* info, const std::string& file) { cmDependInformation* dependInfo = - this->GetDependInformation(file, info->PathOnly.c_str()); + this->GetDependInformation(file, info->PathOnly); this->GenerateDependInformation(dependInfo); info->AddDependencies(dependInfo); } @@ -313,7 +314,7 @@ class cmLBDepend // Dependency hints have been given. Use them to begin the // recursion. for (std::string const& file : cFile.GetDepends()) { - this->AddDependency(info, file.c_str()); + this->AddDependency(info, file); } // Found dependency information. We are done. @@ -361,8 +362,8 @@ class cmLBDepend * Get an instance of cmDependInformation corresponding to the given file * name. */ - cmDependInformation* GetDependInformation(const char* file, - const char* extraPath) + cmDependInformation* GetDependInformation(const std::string& file, + const std::string& extraPath) { // Get the full path for the file so that lookup is unambiguous. std::string fullPath = this->FullPath(file, extraPath); @@ -371,15 +372,16 @@ class cmLBDepend auto result = this->DependInformationMap.find(fullPath); if (result != this->DependInformationMap.end()) { // Found an instance, return it. - return result->second; + return result->second.get(); } // Didn't find an instance. Create a new one and save it. - cmDependInformation* info = new cmDependInformation; + auto info = cm::make_unique(); + auto ptr = info.get(); info->FullPath = fullPath; info->PathOnly = cmSystemTools::GetFilenamePath(fullPath); info->IncludeName = file; - this->DependInformationMap[fullPath] = info; - return info; + this->DependInformationMap[fullPath] = std::move(info); + return ptr; } /** @@ -387,14 +389,9 @@ class cmLBDepend * This uses the include directories. * TODO: Cache path conversions to reduce FileExists calls. */ - std::string FullPath(const char* fname, const char* extraPath) + std::string FullPath(const std::string& fname, const std::string& extraPath) { - DirectoryToFileToPathMapType::iterator m; - if (extraPath) { - m = this->DirectoryToFileToPathMap.find(extraPath); - } else { - m = this->DirectoryToFileToPathMap.find(""); - } + auto m = this->DirectoryToFileToPathMap.find(extraPath); if (m != this->DirectoryToFileToPathMap.end()) { FileToPathMapType& map = m->second; @@ -406,7 +403,7 @@ class cmLBDepend if (cmSystemTools::FileExists(fname, true)) { std::string fp = cmSystemTools::CollapseFullPath(fname); - this->DirectoryToFileToPathMap[extraPath ? extraPath : ""][fname] = fp; + this->DirectoryToFileToPathMap[extraPath][fname] = fp; return fp; } @@ -418,12 +415,12 @@ class cmLBDepend if (cmSystemTools::FileExists(path, true) && !cmSystemTools::FileIsDirectory(path)) { std::string fp = cmSystemTools::CollapseFullPath(path); - this->DirectoryToFileToPathMap[extraPath ? extraPath : ""][fname] = fp; + this->DirectoryToFileToPathMap[extraPath][fname] = fp; return fp; } } - if (extraPath) { + if (!extraPath.empty()) { std::string path = extraPath; if (!path.empty() && path.back() != '/') { path = path + "/"; @@ -438,7 +435,7 @@ class cmLBDepend } // Couldn't find the file. - return std::string(fname); + return fname; } cmMakefile* Makefile; @@ -449,7 +446,8 @@ class cmLBDepend using FileToPathMapType = std::map; using DirectoryToFileToPathMapType = std::map; - using DependInformationMapType = std::map; + using DependInformationMapType = + std::map>; DependInformationMapType DependInformationMap; DirectoryToFileToPathMapType DirectoryToFileToPathMap; }; @@ -476,7 +474,7 @@ bool cmOutputRequiredFilesCommand(std::vector const& args, md.SetMakefile(&status.GetMakefile()); md.AddSearchPath(status.GetMakefile().GetCurrentSourceDirectory()); // find the depends for a file - const cmDependInformation* info = md.FindDependencies(file.c_str()); + const cmDependInformation* info = md.FindDependencies(file); if (info) { // write them out FILE* fout = cmsys::SystemTools::Fopen(outputFile, "w"); From de1d530ef0a638463da87e7a66c26cafc938e986 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Sat, 16 Nov 2019 00:01:09 -0500 Subject: [PATCH 128/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index f9e3d4afafe..c480167b660 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191115) +set(CMake_VERSION_PATCH 20191116) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From 88cfef0821933dfa4e840c793cdb9352d4b4423b Mon Sep 17 00:00:00 2001 From: Sylvain Joubert Date: Tue, 5 Nov 2019 17:07:42 +0100 Subject: [PATCH 129/662] ccmake: redirect stdout/stderr to the displayed logs Use cmSystemTools to report some messages. These should now be caught and displayed properly, both in ccmake and cmake-gui Avoid log display flickering during processing - Don't clear the screen each time the long message form is rendered. It always renders the whole screen again so clearing it only causes flickering. - Add scroll down capabilities to the long message form so that it can draw itself directly in the correct state. This removes the need to programatically scroll down just after that also caused flickering. Fixes #19882 Fixes #13288 --- Source/CursesDialog/ccmake.cxx | 22 ++++++++++++++-- .../CursesDialog/cmCursesLongMessageForm.cxx | 22 ++++++---------- Source/CursesDialog/cmCursesLongMessageForm.h | 13 ++++++---- Source/CursesDialog/cmCursesMainForm.cxx | 26 ++++++++++--------- Source/cmake.cxx | 7 +++-- 5 files changed, 53 insertions(+), 37 deletions(-) diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx index 77321050852..01fce854541 100644 --- a/Source/CursesDialog/ccmake.cxx +++ b/Source/CursesDialog/ccmake.cxx @@ -155,10 +155,28 @@ int main(int argc, char const* const* argv) return 1; } + /* + * The message is stored in a list by the form which will be + * joined by '\n' before display. + * Removing any trailing '\n' avoid extra empty lines in the final results + */ + auto cleanMessage = [](const std::string& message) -> std::string { + auto msg = message; + if (!msg.empty() && msg.back() == '\n') { + msg.pop_back(); + } + return msg; + }; cmSystemTools::SetMessageCallback( - [myform](const std::string& message, const char* title) { - myform->AddError(message, title); + [&](const std::string& message, const char* title) { + myform->AddError(cleanMessage(message), title); }); + cmSystemTools::SetStderrCallback([&](const std::string& message) { + myform->AddError(cleanMessage(message), ""); + }); + cmSystemTools::SetStdoutCallback([&](const std::string& message) { + myform->UpdateProgress(cleanMessage(message), -1); + }); cmCursesForm::CurrentForm = myform; diff --git a/Source/CursesDialog/cmCursesLongMessageForm.cxx b/Source/CursesDialog/cmCursesLongMessageForm.cxx index a69fdee8944..806e663e9e4 100644 --- a/Source/CursesDialog/cmCursesLongMessageForm.cxx +++ b/Source/CursesDialog/cmCursesLongMessageForm.cxx @@ -17,7 +17,9 @@ inline int ctrl(int z) } cmCursesLongMessageForm::cmCursesLongMessageForm( - std::vector const& messages, const char* title) + std::vector const& messages, const char* title, + ScrollBehavior scrollBehavior) + : Scrolling(scrollBehavior) { // Append all messages into on big string this->Messages = cmJoin(messages, "\n"); @@ -109,8 +111,6 @@ void cmCursesLongMessageForm::Render(int /*left*/, int /*top*/, int /*width*/, const char* msg = this->Messages.c_str(); - curses_clear(); - if (this->Fields[0]) { free_field(this->Fields[0]); this->Fields[0] = nullptr; @@ -133,7 +133,11 @@ void cmCursesLongMessageForm::Render(int /*left*/, int /*top*/, int /*width*/, } i++; } - form_driver(this->Form, REQ_BEG_FIELD); + if (this->Scrolling == ScrollBehavior::ScrollDown) { + form_driver(this->Form, REQ_END_FIELD); + } else { + form_driver(this->Form, REQ_BEG_FIELD); + } this->UpdateStatusBar(); touchwin(stdscr); @@ -174,13 +178,3 @@ void cmCursesLongMessageForm::HandleInput() wrefresh(stdscr); } } - -void cmCursesLongMessageForm::ScrollDown() -{ - if (this->Form) { - form_driver(this->Form, REQ_END_FIELD); - this->UpdateStatusBar(); - touchwin(stdscr); - wrefresh(stdscr); - } -} diff --git a/Source/CursesDialog/cmCursesLongMessageForm.h b/Source/CursesDialog/cmCursesLongMessageForm.h index dde5bfffafd..88efe62173e 100644 --- a/Source/CursesDialog/cmCursesLongMessageForm.h +++ b/Source/CursesDialog/cmCursesLongMessageForm.h @@ -14,8 +14,14 @@ class cmCursesLongMessageForm : public cmCursesForm { public: + enum class ScrollBehavior + { + NoScroll, + ScrollDown + }; + cmCursesLongMessageForm(std::vector const& messages, - const char* title); + const char* title, ScrollBehavior scrollBehavior); ~cmCursesLongMessageForm() override; cmCursesLongMessageForm(cmCursesLongMessageForm const&) = delete; @@ -25,10 +31,6 @@ class cmCursesLongMessageForm : public cmCursesForm // Handle user input. void HandleInput() override; - // Description: - // Scroll down to the end of the content - void ScrollDown(); - // Description: // Display form. Use a window of size width x height, starting // at top, left. @@ -47,6 +49,7 @@ class cmCursesLongMessageForm : public cmCursesForm protected: std::string Messages; std::string Title; + ScrollBehavior Scrolling; FIELD* Fields[2]; }; diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index ffc95289666..dff2afed618 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -546,13 +546,13 @@ int cmCursesMainForm::Configure(int noconfigure) if (cmSystemTools::GetErrorOccuredFlag()) { title = "Configure failed with the following output"; } - cmCursesLongMessageForm* msgs = - new cmCursesLongMessageForm(this->Outputs, title); + cmCursesLongMessageForm* msgs = new cmCursesLongMessageForm( + this->Outputs, title, + cmCursesLongMessageForm::ScrollBehavior::ScrollDown); // reset error condition cmSystemTools::ResetErrorOccuredFlag(); CurrentForm = msgs; msgs->Render(1, 1, xx, yy); - msgs->ScrollDown(); msgs->HandleInput(); // If they typed the wrong source directory, we report // an error and exit @@ -603,11 +603,11 @@ int cmCursesMainForm::Generate() if (cmSystemTools::GetErrorOccuredFlag()) { title = "Generate failed with the following output"; } - cmCursesLongMessageForm* msgs = - new cmCursesLongMessageForm(this->Outputs, title); + cmCursesLongMessageForm* msgs = new cmCursesLongMessageForm( + this->Outputs, title, + cmCursesLongMessageForm::ScrollBehavior::ScrollDown); CurrentForm = msgs; msgs->Render(1, 1, xx, yy); - msgs->ScrollDown(); msgs->HandleInput(); // If they typed the wrong source directory, we report // an error and exit @@ -858,8 +858,9 @@ void cmCursesMainForm::HandleInput() this->HelpMessage[1] = ""; } - cmCursesLongMessageForm* msgs = - new cmCursesLongMessageForm(this->HelpMessage, "Help"); + cmCursesLongMessageForm* msgs = new cmCursesLongMessageForm( + this->HelpMessage, "Help", + cmCursesLongMessageForm::ScrollBehavior::NoScroll); CurrentForm = msgs; msgs->Render(1, 1, x, y); msgs->HandleInput(); @@ -871,7 +872,8 @@ void cmCursesMainForm::HandleInput() else if (key == 'l') { getmaxyx(stdscr, y, x); cmCursesLongMessageForm* msgs = new cmCursesLongMessageForm( - this->Outputs, "CMake produced the following output"); + this->Outputs, "CMake produced the following output", + cmCursesLongMessageForm::ScrollBehavior::NoScroll); CurrentForm = msgs; msgs->Render(1, 1, x, y); msgs->HandleInput(); @@ -1048,12 +1050,12 @@ void cmCursesMainForm::DisplayOutputs() int yi; getmaxyx(stdscr, yi, xi); - auto newLogForm = - new cmCursesLongMessageForm(this->Outputs, this->LastProgress.c_str()); + auto newLogForm = new cmCursesLongMessageForm( + this->Outputs, this->LastProgress.c_str(), + cmCursesLongMessageForm::ScrollBehavior::ScrollDown); CurrentForm = newLogForm; this->LogForm.reset(newLogForm); this->LogForm->Render(1, 1, xi, yi); - this->LogForm->ScrollDown(); } const char* cmCursesMainForm::s_ConstHelpMessage = diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 4a6108d9ee1..b1c6e8fd7a4 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -330,9 +330,8 @@ bool cmake::SetCacheArgs(const std::vector& args) } } } else { - std::cerr << "Parse error in command line argument: " << arg << "\n" - << "Should be: VAR:type=value\n"; - cmSystemTools::Error("No cmake script provided."); + cmSystemTools::Error("Parse error in command line argument: " + arg + + "\n" + "Should be: VAR:type=value\n"); return false; } } else if (cmHasLiteralPrefix(arg, "-W")) { @@ -422,7 +421,7 @@ bool cmake::SetCacheArgs(const std::vector& args) return false; } } - std::cout << "loading initial cache file " << path << "\n"; + cmSystemTools::Stdout("loading initial cache file " + path + "\n"); // Resolve script path specified on command line relative to $PWD. path = cmSystemTools::CollapseFullPath(path); this->ReadListFile(args, path); From cf598311ce9c6edb2b7d2a1de945ba7f2418c2fb Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Sun, 17 Nov 2019 00:01:06 -0500 Subject: [PATCH 130/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index c480167b660..be89acf77ad 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191116) +set(CMake_VERSION_PATCH 20191117) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From e56e9c14c5f06341c101e8de2a4876ecf3f5514f Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Mon, 18 Nov 2019 00:01:09 -0500 Subject: [PATCH 131/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index be89acf77ad..743996f91dc 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191117) +set(CMake_VERSION_PATCH 20191118) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From ce99f5ee69a6f8ebbf26d2a82df89b406becaf77 Mon Sep 17 00:00:00 2001 From: Sylvain Joubert Date: Mon, 18 Nov 2019 13:21:08 +0100 Subject: [PATCH 132/662] ccmake: Fix rendering on window resize Repro steps: configure (without errors), the logs are displayed then the cache is displayed again, resize the window up -> the logs are redisplayed after resize instead of the cache The 'CurrentForm' pointer were left pointed to the last log message form, this resets it to the main form when configure or generate is done --- Source/CursesDialog/cmCursesMainForm.cxx | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index dff2afed618..612b432b3f6 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -498,10 +498,6 @@ void cmCursesMainForm::UpdateProgress(const std::string& msg, float prog) int cmCursesMainForm::Configure(int noconfigure) { - int xi; - int yi; - getmaxyx(stdscr, yi, xi); - this->ResetOutputs(); if (noconfigure == 0) { @@ -559,11 +555,13 @@ int cmCursesMainForm::Configure(int noconfigure) if (retVal == -2) { return retVal; } - CurrentForm = this; - this->Render(1, 1, xx, yy); } this->InitializeUI(); + CurrentForm = this; + int xi; + int yi; + getmaxyx(stdscr, yi, xi); this->Render(1, 1, xi, yi); return 0; @@ -571,10 +569,6 @@ int cmCursesMainForm::Configure(int noconfigure) int cmCursesMainForm::Generate() { - int xi; - int yi; - getmaxyx(stdscr, yi, xi); - this->ResetOutputs(); this->UpdateProgress("Generating", 0); @@ -614,11 +608,13 @@ int cmCursesMainForm::Generate() if (retVal == -2) { return retVal; } - CurrentForm = this; - this->Render(1, 1, xx, yy); } this->InitializeUI(); + CurrentForm = this; + int xi; + int yi; + getmaxyx(stdscr, yi, xi); this->Render(1, 1, xi, yi); return 0; From 5cf404d36f24ed8caebceb7083cef7fb44f179f3 Mon Sep 17 00:00:00 2001 From: Johnny Jazeix Date: Mon, 18 Nov 2019 20:12:49 +0100 Subject: [PATCH 133/662] SDCC compiler: use sdar instead of sdcclib as librarian for recent versions Fixes: #19988 --- Help/release/dev/sdcc-new-librarian.rst | 6 +++++ Modules/Platform/Generic-SDCC-C.cmake | 34 +++++++++++++++++-------- 2 files changed, 30 insertions(+), 10 deletions(-) create mode 100644 Help/release/dev/sdcc-new-librarian.rst diff --git a/Help/release/dev/sdcc-new-librarian.rst b/Help/release/dev/sdcc-new-librarian.rst new file mode 100644 index 00000000000..93961ce6b5f --- /dev/null +++ b/Help/release/dev/sdcc-new-librarian.rst @@ -0,0 +1,6 @@ +sdcc-new-librarian +------------------ + +* Since sdcc 3.2.0, sdcclib has been deprecated in favor of sdar as librarian. + Since sdcc 3.8.6, it has been removed from the distribution. + Use sdar if found, else use sdcclib to keep older compatibility. diff --git a/Modules/Platform/Generic-SDCC-C.cmake b/Modules/Platform/Generic-SDCC-C.cmake index 8f648a10530..c51767e83ad 100644 --- a/Modules/Platform/Generic-SDCC-C.cmake +++ b/Modules/Platform/Generic-SDCC-C.cmake @@ -19,14 +19,28 @@ set(CMAKE_DL_LIBS "") set(CMAKE_C_OUTPUT_EXTENSION ".rel") -# find sdcclib as CMAKE_AR -# since cmake may already have searched for "ar", sdcclib has to -# be searched with a different variable name (SDCCLIB_EXECUTABLE) -# and must then be forced into the cache +# find sdar/sdcclib as CMAKE_AR +# since cmake may already have searched for "ar", sdar has to +# be searched with a different variable name (SDCCAR_EXECUTABLE) +# and must then be forced into the cache. +# sdcclib has been deprecated in SDCC 3.2.0 and removed in 3.8.6 +# so we first look for sdar get_filename_component(SDCC_LOCATION "${CMAKE_C_COMPILER}" PATH) -find_program(SDCCLIB_EXECUTABLE sdcclib PATHS "${SDCC_LOCATION}" NO_DEFAULT_PATH) -find_program(SDCCLIB_EXECUTABLE sdcclib) -set(CMAKE_AR "${SDCCLIB_EXECUTABLE}" CACHE FILEPATH "The sdcc librarian" FORCE) +find_program(SDCCAR_EXECUTABLE sdar NAMES sdcclib PATHS "${SDCC_LOCATION}" NO_DEFAULT_PATH) +find_program(SDCCAR_EXECUTABLE sdar NAMES sdcclib) +# for compatibility, in case SDCCLIB_EXECUTABLE is set, we use it +if(DEFINED SDCCLIB_EXECUTABLE) + set(CMAKE_AR "${SDCCLIB_EXECUTABLE}" CACHE FILEPATH "The sdcc librarian" FORCE) +else() + set(CMAKE_AR "${SDCCAR_EXECUTABLE}" CACHE FILEPATH "The sdcc librarian" FORCE) +endif() + + +if("${SDCCAR_EXECUTABLE}" MATCHES "sdcclib") + set(CMAKE_AR_OPTIONS "-a") +else() + set(CMAKE_AR_OPTIONS "-rc") +endif() # CMAKE_C_FLAGS_INIT and CMAKE_EXE_LINKER_FLAGS_INIT should be set in a CMAKE_SYSTEM_PROCESSOR file if(NOT DEFINED CMAKE_C_FLAGS_INIT) @@ -45,10 +59,10 @@ set(CMAKE_C_COMPILE_OBJECT " -o # link object files to an executable set(CMAKE_C_LINK_EXECUTABLE " -o ") -# needs sdcc 2.7.0 + sddclib from cvs +# needs sdcc + sdar/sdcclib set(CMAKE_C_CREATE_STATIC_LIBRARY - "\"${CMAKE_COMMAND}\" -E rm -f " - " -a ") + "\"${CMAKE_COMMAND}\" -E remove " + " ${CMAKE_AR_OPTIONS} ") # not supported by sdcc set(CMAKE_C_CREATE_SHARED_LIBRARY "") From 7d6639bf8d9298d9f4c81fa035cda5d34a6e1622 Mon Sep 17 00:00:00 2001 From: Johnny Jazeix Date: Mon, 18 Nov 2019 22:10:57 +0100 Subject: [PATCH 134/662] CodeLite: Do not pass -j argument with CPU count 0 Fixes: #15054, #16727 --- Source/cmExtraCodeLiteGenerator.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx index 269e8dde29e..3557e5c4cdc 100644 --- a/Source/cmExtraCodeLiteGenerator.cxx +++ b/Source/cmExtraCodeLiteGenerator.cxx @@ -635,7 +635,10 @@ std::string cmExtraCodeLiteGenerator::GetBuildCommand( if (generator == "NMake Makefiles" || generator == "Ninja") { ss << make; } else if (generator == "MinGW Makefiles" || generator == "Unix Makefiles") { - ss << make << " -f$(ProjectPath)/Makefile -j " << this->CpuCount; + ss << make << " -f$(ProjectPath)/Makefile"; + if (this->CpuCount > 0) { + ss << " -j " << this->CpuCount; + } } if (!targetName.empty()) { ss << " " << targetName; From 92c4c852db821bc75ef0a20db4855e3af57ef80d Mon Sep 17 00:00:00 2001 From: Gregor Jasny Date: Mon, 18 Nov 2019 22:01:04 +0100 Subject: [PATCH 135/662] Xcode: Add custom working directory property Closes: #19967 --- Help/manual/cmake-properties.7.rst | 1 + Help/manual/cmake-variables.7.rst | 1 + .../XCODE_SCHEME_WORKING_DIRECTORY.rst | 13 +++++++++ Help/release/dev/xcode-scheme-workdir.rst | 7 +++++ .../CMAKE_XCODE_SCHEME_WORKING_DIRECTORY.rst | 12 ++++++++ Source/cmGlobalXCodeGenerator.cxx | 2 +- Source/cmTarget.cxx | 1 + Source/cmXCodeScheme.cxx | 28 ++++++++++++++++--- Source/cmXCodeScheme.h | 6 +++- .../XcodeSchemaProperty-check.cmake | 1 + .../XcodeProject/XcodeSchemaProperty.cmake | 1 + 11 files changed, 67 insertions(+), 6 deletions(-) create mode 100644 Help/prop_tgt/XCODE_SCHEME_WORKING_DIRECTORY.rst create mode 100644 Help/release/dev/xcode-scheme-workdir.rst create mode 100644 Help/variable/CMAKE_XCODE_SCHEME_WORKING_DIRECTORY.rst diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index 94d08c6b5f8..c5ef09abefe 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -381,6 +381,7 @@ Properties on Targets /prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER /prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN /prop_tgt/XCODE_SCHEME_ARGUMENTS + /prop_tgt/XCODE_SCHEME_WORKING_DIRECTORY /prop_tgt/XCODE_SCHEME_DEBUG_AS_ROOT /prop_tgt/XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING /prop_tgt/XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index 01dd5fdc4cd..0c1d5109956 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -239,6 +239,7 @@ Variables that Change Behavior /variable/CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY /variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER /variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN + /variable/CMAKE_XCODE_SCHEME_WORKING_DIRECTORY /variable/CMAKE_XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING /variable/CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER /variable/CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS diff --git a/Help/prop_tgt/XCODE_SCHEME_WORKING_DIRECTORY.rst b/Help/prop_tgt/XCODE_SCHEME_WORKING_DIRECTORY.rst new file mode 100644 index 00000000000..7ffa74bb438 --- /dev/null +++ b/Help/prop_tgt/XCODE_SCHEME_WORKING_DIRECTORY.rst @@ -0,0 +1,13 @@ +XCODE_SCHEME_WORKING_DIRECTORY +------------------------------ + +Specify the ``Working Directory`` a of the `Run` and `Profile` +action in the generated Xcode scheme. In case the value contains +generator expressions those are evaluated. + +This property is initialized by the value of the variable +:variable:`CMAKE_XCODE_SCHEME_WORKING_DIRECTORY` if it is set +when a target is created. + +Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property +documentation to see all Xcode schema related properties. diff --git a/Help/release/dev/xcode-scheme-workdir.rst b/Help/release/dev/xcode-scheme-workdir.rst new file mode 100644 index 00000000000..8eb5ed88f8d --- /dev/null +++ b/Help/release/dev/xcode-scheme-workdir.rst @@ -0,0 +1,7 @@ +xcode-scheme-workdir +-------------------- + +* The Xcode generator learnt to set the value of the + ``Custom Working Directory`` schema + option with the :prop_tgt:`XCODE_SCHEME_WORKING_DIRECTORY` + target property. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_WORKING_DIRECTORY.rst b/Help/variable/CMAKE_XCODE_SCHEME_WORKING_DIRECTORY.rst new file mode 100644 index 00000000000..cc690f7b1a3 --- /dev/null +++ b/Help/variable/CMAKE_XCODE_SCHEME_WORKING_DIRECTORY.rst @@ -0,0 +1,12 @@ +CMAKE_XCODE_SCHEME_WORKING_DIRECTORY +------------------------------------ + +Specify the ``Working Directory`` a of the `Run` and `Profile` +action in the generated Xcode scheme. + +This variable initializes the +:prop_tgt:`XCODE_SCHEME_WORKING_DIRECTORY` +property on all targets. + +Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property +documentation to see all Xcode schema related properties. diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 154bd8ede93..40e8d4862f2 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -3414,7 +3414,7 @@ bool cmGlobalXCodeGenerator::OutputXCodeSharedSchemes( (root->GetMakefile()->GetCMakeInstance()->GetIsInTryCompile() || obj->GetTarget()->GetPropertyAsBool("XCODE_GENERATE_SCHEME"))) { const std::string& targetName = obj->GetTarget()->GetName(); - cmXCodeScheme schm(obj, testables[targetName], + cmXCodeScheme schm(root, obj, testables[targetName], this->CurrentConfigurationTypes, this->XcodeVersion); schm.WriteXCodeSharedScheme(xcProjDir, diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 14635f7b43d..b9bf7a56119 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -371,6 +371,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, initProp("XCODE_SCHEME_THREAD_SANITIZER_STOP"); initProp("XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER"); initProp("XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP"); + initProp("XCODE_SCHEME_WORKING_DIRECTORY"); initProp("XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER"); initProp("XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP"); initProp("XCODE_SCHEME_MALLOC_SCRIBBLE"); diff --git a/Source/cmXCodeScheme.cxx b/Source/cmXCodeScheme.cxx index afc95f56c50..b34c2f6e148 100644 --- a/Source/cmXCodeScheme.cxx +++ b/Source/cmXCodeScheme.cxx @@ -8,13 +8,16 @@ #include #include "cmGeneratedFileStream.h" +#include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" #include "cmXMLSafe.h" -cmXCodeScheme::cmXCodeScheme(cmXCodeObject* xcObj, TestObjects tests, +cmXCodeScheme::cmXCodeScheme(cmLocalGenerator* lg, cmXCodeObject* xcObj, + TestObjects tests, const std::vector& configList, unsigned int xcVersion) - : Target(xcObj) + : LocalGenerator(lg) + , Target(xcObj) , Tests(std::move(tests)) , TargetName(xcObj->GetTarget()->GetName()) , ConfigList(configList) @@ -135,7 +138,8 @@ void cmXCodeScheme::WriteLaunchAction(cmXMLWriter& xout, xout.Attribute("selectedLauncherIdentifier", "Xcode.DebuggerFoundation.Launcher.LLDB"); xout.Attribute("launchStyle", "0"); - xout.Attribute("useCustomWorkingDirectory", "NO"); + WriteCustomWorkingDirectory(xout, configuration); + xout.Attribute("ignoresPersistentStateOnLaunch", "NO"); WriteLaunchActionBooleanAttribute(xout, "debugDocumentVersioning", "XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING", @@ -355,7 +359,7 @@ void cmXCodeScheme::WriteProfileAction(cmXMLWriter& xout, xout.Attribute("buildConfiguration", configuration); xout.Attribute("shouldUseLaunchSchemeArgsEnv", "YES"); xout.Attribute("savedToolIdentifier", ""); - xout.Attribute("useCustomWorkingDirectory", "NO"); + WriteCustomWorkingDirectory(xout, configuration); WriteLaunchActionBooleanAttribute(xout, "debugDocumentVersioning", "XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING", true); @@ -395,6 +399,22 @@ void cmXCodeScheme::WriteBuildableReference(cmXMLWriter& xout, xout.EndElement(); } +void cmXCodeScheme::WriteCustomWorkingDirectory( + cmXMLWriter& xout, const std::string& configuration) +{ + std::string propertyValue = this->Target->GetTarget()->GetSafeProperty( + "XCODE_SCHEME_WORKING_DIRECTORY"); + if (propertyValue.empty()) { + xout.Attribute("useCustomWorkingDirectory", "NO"); + } else { + xout.Attribute("useCustomWorkingDirectory", "YES"); + + auto customWorkingDirectory = cmGeneratorExpression::Evaluate( + propertyValue, this->LocalGenerator, configuration); + xout.Attribute("customWorkingDirectory", customWorkingDirectory); + } +} + std::string cmXCodeScheme::WriteVersionString() { std::ostringstream v; diff --git a/Source/cmXCodeScheme.h b/Source/cmXCodeScheme.h index dff5e35e394..da4085669f0 100644 --- a/Source/cmXCodeScheme.h +++ b/Source/cmXCodeScheme.h @@ -20,7 +20,7 @@ class cmXCodeScheme public: using TestObjects = std::vector; - cmXCodeScheme(cmXCodeObject* xcObj, TestObjects tests, + cmXCodeScheme(cmLocalGenerator* lg, cmXCodeObject* xcObj, TestObjects tests, const std::vector& configList, unsigned int xcVersion); @@ -28,6 +28,7 @@ class cmXCodeScheme const std::string& container); private: + cmLocalGenerator* const LocalGenerator; const cmXCodeObject* const Target; const TestObjects Tests; const std::string& TargetName; @@ -63,6 +64,9 @@ class cmXCodeScheme void WriteBuildableReference(cmXMLWriter& xout, const cmXCodeObject* xcObj, const std::string& container); + void WriteCustomWorkingDirectory(cmXMLWriter& xout, + const std::string& configuration); + std::string WriteVersionString(); std::string FindConfiguration(const std::string& name); diff --git a/Tests/RunCMake/XcodeProject/XcodeSchemaProperty-check.cmake b/Tests/RunCMake/XcodeProject/XcodeSchemaProperty-check.cmake index 7d83a7034d4..c742f50b434 100644 --- a/Tests/RunCMake/XcodeProject/XcodeSchemaProperty-check.cmake +++ b/Tests/RunCMake/XcodeProject/XcodeSchemaProperty-check.cmake @@ -45,6 +45,7 @@ check_property("ENVIRONMENT" [=[key="FOO"]=]) check_property("ENVIRONMENT" [=[value="foo"]=]) check_property("ENVIRONMENT" [=[key="BAR"]=]) check_property("ENVIRONMENT" [=[value="bar"]=]) +check_property("WORKING_DIRECTORY" [=["/working/dir"]=]) expect_no_schema("NoSchema") diff --git a/Tests/RunCMake/XcodeProject/XcodeSchemaProperty.cmake b/Tests/RunCMake/XcodeProject/XcodeSchemaProperty.cmake index be219f4115e..ce5c0c95931 100644 --- a/Tests/RunCMake/XcodeProject/XcodeSchemaProperty.cmake +++ b/Tests/RunCMake/XcodeProject/XcodeSchemaProperty.cmake @@ -35,6 +35,7 @@ endfunction() create_scheme_for_property(EXECUTABLE myExecutable) create_scheme_for_property(ARGUMENTS "--foo;--bar=baz") create_scheme_for_property(ENVIRONMENT "FOO=foo;BAR=bar") +create_scheme_for_property(WORKING_DIRECTORY "/working/dir") add_executable(NoSchema main.cpp) set_target_properties(NoSchema PROPERTIES XCODE_GENERATE_SCHEME OFF) From 843936f51b4f409d3106857a3954ff2db669becd Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Tue, 19 Nov 2019 00:01:12 -0500 Subject: [PATCH 136/662] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 743996f91dc..8a606d4b6f5 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 16) -set(CMake_VERSION_PATCH 20191118) +set(CMake_VERSION_PATCH 20191119) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) From b4ef7fbaa8257254abba0d7847941baf78fdb6ed Mon Sep 17 00:00:00 2001 From: Sylvain Joubert Date: Mon, 18 Nov 2019 15:23:01 +0100 Subject: [PATCH 137/662] ccmake: Fix crash with cache entries almost the size of the window The previous code: if (curFieldLen < width) { ... strncpy(bar + curFieldLen + 2, help, width - curFieldLen - 2); was not correctly guarded against cache entries whose size were exactly 1 or 2 characters short of the window size. "if (curFieldLen - 2 < width)" would have prevented a copy of negative/max_int characters and a subsequent crash. The whole method was modernized with std::string instead of char* --- Source/CursesDialog/cmCursesMainForm.cxx | 123 +++++++---------------- Source/CursesDialog/cmCursesMainForm.h | 6 +- 2 files changed, 43 insertions(+), 86 deletions(-) diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 612b432b3f6..2c92835159a 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -365,7 +365,7 @@ void cmCursesMainForm::PrintKeys(int process /* = 0 */) // Print the key of the current entry and the CMake version // on the status bar. Designed for a width of 80 chars. -void cmCursesMainForm::UpdateStatusBar(const char* message) +void cmCursesMainForm::UpdateStatusBar(cm::optional message) { int x; int y; @@ -386,94 +386,58 @@ void cmCursesMainForm::UpdateStatusBar(const char* message) return; } - // Get the key of the current entry - FIELD* cur = current_field(this->Form); - int findex = field_index(cur); - cmCursesWidget* lbl = nullptr; - if (findex >= 0) { - lbl = reinterpret_cast( - field_userptr(this->Fields[findex - 2])); - } - char help[128] = ""; - const char* curField = ""; - if (lbl) { - curField = lbl->GetValue(); + // Find the current label index + // Field are grouped by 3, the label should be 2 less than the current index + using size_type = decltype(this->Fields)::size_type; + size_type currentLabelIndex = field_index(current_field(this->Form)) - 2; + + // Use the status message if any, otherwise join the key and help string + std::string bar; + if (message) { + bar = *message; + } else { + // Get the key of the current entry + cmCursesWidget* labelWidget = reinterpret_cast( + field_userptr(this->Fields[currentLabelIndex])); + std::string labelValue = labelWidget->GetValue(); + bar = labelValue + ": "; // Get the help string of the current entry // and add it to the help string - const char* existingValue = - this->CMakeInstance->GetState()->GetCacheEntryValue(curField); + auto cmakeState = this->CMakeInstance->GetState(); + const char* existingValue = cmakeState->GetCacheEntryValue(labelValue); if (existingValue) { - const char* hs = this->CMakeInstance->GetState()->GetCacheEntryProperty( - curField, "HELPSTRING"); - if (hs) { - strncpy(help, hs, 127); - help[127] = '\0'; - } else { - help[0] = 0; - } - } else { - sprintf(help, " "); - } - } - - // Join the key, help string and pad with spaces - // (or truncate) as necessary - char bar[cmCursesMainForm::MAX_WIDTH]; - size_t curFieldLen = strlen(curField); - size_t helpLen = strlen(help); - - size_t width = std::min(x, cmCursesMainForm::MAX_WIDTH); - - if (message) { - curField = message; - curFieldLen = strlen(message); - strncpy(bar, curField, width); - if (curFieldLen < width) { - memset(bar + curFieldLen, ' ', width - curFieldLen); - } - } else { - strncpy(bar, curField, width); - if (curFieldLen < width) { - bar[curFieldLen] = ':'; - bar[curFieldLen + 1] = ' '; - strncpy(bar + curFieldLen + 2, help, width - curFieldLen - 2); - if (curFieldLen + helpLen + 2 < width) { - memset(bar + curFieldLen + helpLen + 2, ' ', - width - (curFieldLen + helpLen + 2)); + auto help = cmakeState->GetCacheEntryProperty(labelValue, "HELPSTRING"); + if (help) { + bar += help; } } } + // Pad with spaces to erase any previous text, + // or truncate as necessary to fit the screen + bar.resize(x, ' '); + curses_move(y - 5, 0); + attron(A_STANDOUT); + char fmt_s[] = "%s"; + printw(fmt_s, bar.c_str()); + attroff(A_STANDOUT); - bar[width] = '\0'; - - // Highlight the current label + // Highlight the current label, reset others // Fields are grouped by 3, the first one being the label // so start at 0 and move up by 3 avoiding the last null entry - using size_type = decltype(this->Fields)::size_type; for (size_type index = 0; index < this->Fields.size() - 1; index += 3) { - bool currentLabel = index == static_cast(findex - 2); + bool currentLabel = index == currentLabelIndex; set_field_fore(this->Fields[index], currentLabel ? A_STANDOUT : A_NORMAL); } - // Display CMake version info on the next line + // Display CMake version under the status bar // We want to display this on the right - char version[cmCursesMainForm::MAX_WIDTH]; - char vertmp[128]; - sprintf(vertmp, "CMake Version %s", cmVersion::GetCMakeVersion()); - size_t sideSpace = (width - strlen(vertmp)); - memset(version, ' ', sideSpace); - sprintf(version + sideSpace, "%s", vertmp); - version[width] = '\0'; - - // Now print both lines - char fmt_s[] = "%s"; - curses_move(y - 5, 0); - attron(A_STANDOUT); - printw(fmt_s, bar); - attroff(A_STANDOUT); - curses_move(y - 4, 0); - printw(fmt_s, version); + std::string version = "CMake Version "; + version += cmVersion::GetCMakeVersion(); + version.resize(std::min(x, version.size())); + curses_move(y - 4, x - static_cast(version.size())); + printw(fmt_s, version.c_str()); + pos_form_cursor(this->Form); } @@ -710,7 +674,7 @@ void cmCursesMainForm::HandleInput() this->PrintKeys(); if (this->SearchMode) { std::string searchstr = "Search: " + this->SearchString; - this->UpdateStatusBar(searchstr.c_str()); + this->UpdateStatusBar(searchstr); this->PrintKeys(1); curses_move(y - 5, static_cast(searchstr.size())); // curses_move(1,1); @@ -1015,15 +979,6 @@ void cmCursesMainForm::JumpToCacheEntry(const char* astr) } else { form_driver(this->Form, REQ_NEXT_FIELD); } - /* - char buffer[1024]; - sprintf(buffer, "Line: %d != %d / %d\n", findex, idx, - this->NumberOfVisibleEntries); - touchwin(stdscr); - refresh(); - this->UpdateStatusBar( buffer ); - usleep(100000); - */ cur = current_field(this->Form); findex = field_index(cur); if (findex == start_index) { diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h index 598fbdfba3c..b7c204d64e3 100644 --- a/Source/CursesDialog/cmCursesMainForm.h +++ b/Source/CursesDialog/cmCursesMainForm.h @@ -10,6 +10,8 @@ #include #include +#include + #include "cmCursesCacheEntryComposite.h" #include "cmCursesForm.h" #include "cmCursesStandardIncludes.h" @@ -67,8 +69,8 @@ class cmCursesMainForm : public cmCursesForm * exception is during a resize. The optional argument specifies the * string to be displayed in the status bar. */ - void UpdateStatusBar() override { this->UpdateStatusBar(nullptr); } - virtual void UpdateStatusBar(const char* message); + void UpdateStatusBar() override { this->UpdateStatusBar(cm::nullopt); } + void UpdateStatusBar(cm::optional message); /** * Display current commands and their keys on the toolbar. This From 5e9ecaae0e191aba8b02243cb94a68983d6ce3f0 Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Tue, 12 Nov 2019 17:17:17 -0800 Subject: [PATCH 138/662] load_cache: Allow READ_WITH_PREFIX mode in cmake scripts --- Help/release/dev/load_cache-script-mode.rst | 5 +++++ Source/cmCommands.cxx | 3 +-- Source/cmLoadCacheCommand.cxx | 8 ++++++++ Tests/RunCMake/CMakeLists.txt | 1 + Tests/RunCMake/load_cache/CMakeLists.txt | 3 +++ Tests/RunCMake/load_cache/NewForm_Project.cmake | 16 ++++++++++++++++ Tests/RunCMake/load_cache/NewForm_Script.cmake | 16 ++++++++++++++++ .../load_cache/OldForm_Script-result.txt | 1 + .../load_cache/OldForm_Script-stderr.txt | 2 ++ Tests/RunCMake/load_cache/OldForm_Script.cmake | 13 +++++++++++++ Tests/RunCMake/load_cache/RunCMakeTest.cmake | 13 +++++++++++++ 11 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 Help/release/dev/load_cache-script-mode.rst create mode 100644 Tests/RunCMake/load_cache/CMakeLists.txt create mode 100644 Tests/RunCMake/load_cache/NewForm_Project.cmake create mode 100644 Tests/RunCMake/load_cache/NewForm_Script.cmake create mode 100644 Tests/RunCMake/load_cache/OldForm_Script-result.txt create mode 100644 Tests/RunCMake/load_cache/OldForm_Script-stderr.txt create mode 100644 Tests/RunCMake/load_cache/OldForm_Script.cmake create mode 100644 Tests/RunCMake/load_cache/RunCMakeTest.cmake diff --git a/Help/release/dev/load_cache-script-mode.rst b/Help/release/dev/load_cache-script-mode.rst new file mode 100644 index 00000000000..d84b08afe8f --- /dev/null +++ b/Help/release/dev/load_cache-script-mode.rst @@ -0,0 +1,5 @@ +load_cache-script-mode +---------------------- + +* The :command:`load_cache(READ_WITH_PREFIX)` command mode is now allowed + when using ``cmake -P`` to :ref:`Run a Script