summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CTestCustom.cmake.in1
-rw-r--r--Copyright.txt2
-rw-r--r--Modules/FindPython/Support.cmake2
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/cmFileMonitor.cxx35
-rw-r--r--Source/cmFileMonitor.h3
-rw-r--r--Source/cmInstalledFile.cxx17
-rw-r--r--Source/cmInstalledFile.h4
-rw-r--r--Source/cmOrderDirectories.cxx23
-rw-r--r--Source/cmOrderDirectories.h6
-rw-r--r--Source/cmQtAutoGenInitializer.cxx6
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec.cxx73
-rw-r--r--Tests/QtAutogen/SameName/CMakeLists.txt1
-rw-r--r--Tests/QtAutogen/SameName/main.cpp2
-rw-r--r--Tests/QtAutogen/SameName/object.hh13
15 files changed, 83 insertions, 107 deletions
diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in
index af4bb2d..fb8e099 100644
--- a/CTestCustom.cmake.in
+++ b/CTestCustom.cmake.in
@@ -49,6 +49,7 @@ list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
"WarningMessagesDialog\\.cxx"
"warning.*directory name.*CMake-Xcode.*/bin/.*does not exist.*"
"stl_deque.h:1051"
+ "Tests/CMakeLib/testCTestResourceSpec.cxx:.*warning: missing initializer for member.*cmCTestResourceSpec::.*" # GCC 4.8 disagrees with later compilers on C++11 initializer list conversion
"(Lexer|Parser).*warning.*conversion.*may (alter its value|change the sign)"
"(Lexer|Parser).*warning.*(statement is unreachable|will never be executed)"
"(Lexer|Parser).*warning.*variable.*was set but never used"
diff --git a/Copyright.txt b/Copyright.txt
index f236214..19f3deb 100644
--- a/Copyright.txt
+++ b/Copyright.txt
@@ -1,5 +1,5 @@
CMake - Cross Platform Makefile Generator
-Copyright 2000-2019 Kitware, Inc. and Contributors
+Copyright 2000-2020 Kitware, Inc. and Contributors
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake
index 0d6d2fc..89744ec 100644
--- a/Modules/FindPython/Support.cmake
+++ b/Modules/FindPython/Support.cmake
@@ -2317,7 +2317,7 @@ if(_${_PYTHON_PREFIX}_CMAKE_ROLE STREQUAL "PROJECT")
endif()
else()
if (${_PYTHON_PREFIX}_LIBRARY_RELEASE AND ${_PYTHON_PREFIX}_LIBRARY_DEBUG)
- set_property (TARGET ${_PYTHON_PREFIX}::Python PROPERTY IMPORTED_CONFIGURATIONS RELEASE DEBUG)
+ set_property (TARGET ${__name} PROPERTY IMPORTED_CONFIGURATIONS RELEASE DEBUG)
set_target_properties (${__name}
PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C"
IMPORTED_LOCATION_RELEASE "${${_PYTHON_PREFIX}_LIBRARY_RELEASE}")
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index c917ece..029c4ac 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 20191218)
+set(CMake_VERSION_PATCH 20191220)
#set(CMake_VERSION_RC 0)
set(CMake_VERSION_IS_DIRTY 0)
diff --git a/Source/cmFileMonitor.cxx b/Source/cmFileMonitor.cxx
index ac8a37e..8cfdb2d 100644
--- a/Source/cmFileMonitor.cxx
+++ b/Source/cmFileMonitor.cxx
@@ -7,9 +7,9 @@
#include <unordered_map>
#include <utility>
-#include "cmsys/SystemTools.hxx"
+#include <cm/memory>
-#include "cmAlgorithms.h"
+#include "cmsys/SystemTools.hxx"
namespace {
void on_directory_change(uv_fs_event_t* handle, const char* filename,
@@ -37,12 +37,12 @@ public:
class cmVirtualDirectoryWatcher : public cmIBaseWatcher
{
public:
- ~cmVirtualDirectoryWatcher() override { cmDeleteAll(this->Children); }
+ ~cmVirtualDirectoryWatcher() override = default;
cmIBaseWatcher* Find(const std::string& ps)
{
const auto i = this->Children.find(ps);
- return (i == this->Children.end()) ? nullptr : i->second;
+ return (i == this->Children.end()) ? nullptr : i->second.get();
}
void Trigger(const std::string& pathSegment, int events,
@@ -96,11 +96,7 @@ public:
return result;
}
- void Reset()
- {
- cmDeleteAll(this->Children);
- this->Children.clear();
- }
+ void Reset() { this->Children.clear(); }
void AddChildWatcher(const std::string& ps, cmIBaseWatcher* watcher)
{
@@ -108,11 +104,12 @@ public:
assert(this->Children.find(ps) == this->Children.end());
assert(watcher);
- this->Children.emplace(std::make_pair(ps, watcher));
+ this->Children.emplace(ps, std::unique_ptr<cmIBaseWatcher>(watcher));
}
private:
- std::unordered_map<std::string, cmIBaseWatcher*> Children; // owned!
+ std::unordered_map<std::string, std::unique_ptr<cmIBaseWatcher>>
+ Children; // owned!
};
// Root of all the different (on windows!) root directories:
@@ -295,14 +292,11 @@ void on_fs_close(uv_handle_t* handle)
} // namespace
cmFileMonitor::cmFileMonitor(uv_loop_t* l)
- : Root(new cmRootWatcher(l))
+ : Root(cm::make_unique<cmRootWatcher>(l))
{
}
-cmFileMonitor::~cmFileMonitor()
-{
- delete this->Root;
-}
+cmFileMonitor::~cmFileMonitor() = default;
void cmFileMonitor::MonitorPaths(const std::vector<std::string>& paths,
Callback const& cb)
@@ -316,7 +310,7 @@ void cmFileMonitor::MonitorPaths(const std::vector<std::string>& paths,
if (segmentCount < 2) { // Expect at least rootdir and filename
continue;
}
- cmVirtualDirectoryWatcher* currentWatcher = this->Root;
+ cmVirtualDirectoryWatcher* currentWatcher = this->Root.get();
for (size_t i = 0; i < segmentCount; ++i) {
assert(currentWatcher);
@@ -334,11 +328,12 @@ void cmFileMonitor::MonitorPaths(const std::vector<std::string>& paths,
cmIBaseWatcher* nextWatcher = currentWatcher->Find(currentSegment);
if (!nextWatcher) {
if (rootSegment) { // Root part
- assert(currentWatcher == this->Root);
- nextWatcher = new cmRootDirectoryWatcher(this->Root, currentSegment);
+ assert(currentWatcher == this->Root.get());
+ nextWatcher =
+ new cmRootDirectoryWatcher(this->Root.get(), currentSegment);
assert(currentWatcher->Find(currentSegment) == nextWatcher);
} else if (fileSegment) { // File part
- assert(currentWatcher != this->Root);
+ assert(currentWatcher != this->Root.get());
nextWatcher = new cmFileWatcher(
dynamic_cast<cmRealDirectoryWatcher*>(currentWatcher),
currentSegment, cb);
diff --git a/Source/cmFileMonitor.h b/Source/cmFileMonitor.h
index 7ffc929..b510a2c 100644
--- a/Source/cmFileMonitor.h
+++ b/Source/cmFileMonitor.h
@@ -5,6 +5,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include <functional>
+#include <memory>
#include <string>
#include <vector>
@@ -30,5 +31,5 @@ public:
std::vector<std::string> WatchedDirectories() const;
private:
- cmRootWatcher* Root;
+ std::unique_ptr<cmRootWatcher> Root;
};
diff --git a/Source/cmInstalledFile.cxx b/Source/cmInstalledFile.cxx
index eabe590..a65ae03 100644
--- a/Source/cmInstalledFile.cxx
+++ b/Source/cmInstalledFile.cxx
@@ -4,7 +4,6 @@
#include <utility>
-#include "cmAlgorithms.h"
#include "cmGeneratorExpression.h"
#include "cmListFileCache.h"
#include "cmMakefile.h"
@@ -12,17 +11,11 @@
cmInstalledFile::cmInstalledFile() = default;
-cmInstalledFile::~cmInstalledFile()
-{
- delete NameExpression;
-}
+cmInstalledFile::~cmInstalledFile() = default;
cmInstalledFile::Property::Property() = default;
-cmInstalledFile::Property::~Property()
-{
- cmDeleteAll(this->ValueExpressions);
-}
+cmInstalledFile::Property::~Property() = default;
void cmInstalledFile::SetName(cmMakefile* mf, const std::string& name)
{
@@ -30,7 +23,7 @@ void cmInstalledFile::SetName(cmMakefile* mf, const std::string& name)
cmGeneratorExpression ge(backtrace);
this->Name = name;
- this->NameExpression = ge.Parse(name).release();
+ this->NameExpression = ge.Parse(name);
}
std::string const& cmInstalledFile::GetName() const
@@ -63,7 +56,7 @@ void cmInstalledFile::AppendProperty(cmMakefile const* mf,
cmGeneratorExpression ge(backtrace);
Property& property = this->Properties[prop];
- property.ValueExpressions.push_back(ge.Parse(value).release());
+ property.ValueExpressions.push_back(ge.Parse(value));
}
bool cmInstalledFile::HasProperty(const std::string& prop) const
@@ -84,7 +77,7 @@ bool cmInstalledFile::GetProperty(const std::string& prop,
std::string output;
std::string separator;
- for (auto ve : property.ValueExpressions) {
+ for (const auto& ve : property.ValueExpressions) {
output += separator;
output += ve->GetInput();
separator = ";";
diff --git a/Source/cmInstalledFile.h b/Source/cmInstalledFile.h
index ee809ee..698151e 100644
--- a/Source/cmInstalledFile.h
+++ b/Source/cmInstalledFile.h
@@ -24,7 +24,7 @@ public:
using CompiledGeneratorExpressionPtrType =
std::unique_ptr<cmCompiledGeneratorExpression>;
- using ExpressionVectorType = std::vector<cmCompiledGeneratorExpression*>;
+ using ExpressionVectorType = std::vector<CompiledGeneratorExpressionPtrType>;
struct Property
{
@@ -73,7 +73,7 @@ public:
private:
std::string Name;
- cmCompiledGeneratorExpression* NameExpression = nullptr;
+ CompiledGeneratorExpressionPtrType NameExpression;
PropertyMapType Properties;
};
diff --git a/Source/cmOrderDirectories.cxx b/Source/cmOrderDirectories.cxx
index 9ee7127..0369af0 100644
--- a/Source/cmOrderDirectories.cxx
+++ b/Source/cmOrderDirectories.cxx
@@ -8,9 +8,9 @@
#include <sstream>
#include <vector>
+#include <cm/memory>
#include <cmext/algorithm>
-#include "cmAlgorithms.h"
#include "cmGeneratorTarget.h"
#include "cmGlobalGenerator.h"
#include "cmMessageType.h"
@@ -250,11 +250,7 @@ cmOrderDirectories::cmOrderDirectories(cmGlobalGenerator* gg,
this->Computed = false;
}
-cmOrderDirectories::~cmOrderDirectories()
-{
- cmDeleteAll(this->ConstraintEntries);
- cmDeleteAll(this->ImplicitDirEntries);
-}
+cmOrderDirectories::~cmOrderDirectories() = default;
std::vector<std::string> const& cmOrderDirectories::GetOrderedDirectories()
{
@@ -288,14 +284,16 @@ void cmOrderDirectories::AddRuntimeLibrary(std::string const& fullPath,
if (this->IsImplicitDirectory(dir)) {
this->ImplicitDirEntries.push_back(
- new cmOrderDirectoriesConstraintSOName(this, fullPath, soname));
+ cm::make_unique<cmOrderDirectoriesConstraintSOName>(this, fullPath,
+ soname));
return;
}
}
// Construct the runtime information entry for this library.
this->ConstraintEntries.push_back(
- new cmOrderDirectoriesConstraintSOName(this, fullPath, soname));
+ cm::make_unique<cmOrderDirectoriesConstraintSOName>(this, fullPath,
+ soname));
} else {
// This can happen if the same library is linked multiple times.
// In that case the runtime information check need be done only
@@ -316,14 +314,15 @@ void cmOrderDirectories::AddLinkLibrary(std::string const& fullPath)
std::string dir = cmSystemTools::GetFilenamePath(fullPath);
if (this->IsImplicitDirectory(dir)) {
this->ImplicitDirEntries.push_back(
- new cmOrderDirectoriesConstraintLibrary(this, fullPath));
+ cm::make_unique<cmOrderDirectoriesConstraintLibrary>(this,
+ fullPath));
return;
}
}
// Construct the link library entry.
this->ConstraintEntries.push_back(
- new cmOrderDirectoriesConstraintLibrary(this, fullPath));
+ cm::make_unique<cmOrderDirectoriesConstraintLibrary>(this, fullPath));
}
}
@@ -371,7 +370,7 @@ void cmOrderDirectories::CollectOriginalDirectories()
this->AddOriginalDirectories(this->UserDirectories);
// Add directories containing constraints.
- for (cmOrderDirectoriesConstraint* entry : this->ConstraintEntries) {
+ for (const auto& entry : this->ConstraintEntries) {
entry->AddDirectory();
}
@@ -456,7 +455,7 @@ void cmOrderDirectories::FindImplicitConflicts()
// Check for items in implicit link directories that have conflicts
// in the explicit directories.
std::ostringstream conflicts;
- for (cmOrderDirectoriesConstraint* entry : this->ImplicitDirEntries) {
+ for (const auto& entry : this->ImplicitDirEntries) {
entry->FindImplicitConflicts(conflicts);
}
diff --git a/Source/cmOrderDirectories.h b/Source/cmOrderDirectories.h
index 23c5145..8ce53e0 100644
--- a/Source/cmOrderDirectories.h
+++ b/Source/cmOrderDirectories.h
@@ -6,6 +6,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include <map>
+#include <memory>
#include <set>
#include <string>
#include <utility>
@@ -46,8 +47,9 @@ private:
std::vector<std::string> OrderedDirectories;
- std::vector<cmOrderDirectoriesConstraint*> ConstraintEntries;
- std::vector<cmOrderDirectoriesConstraint*> ImplicitDirEntries;
+ std::vector<std::unique_ptr<cmOrderDirectoriesConstraint>> ConstraintEntries;
+ std::vector<std::unique_ptr<cmOrderDirectoriesConstraint>>
+ ImplicitDirEntries;
std::vector<std::string> UserDirectories;
std::vector<std::string> LanguageDirectories;
cmsys::RegularExpression RemoveLibraryExtension;
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index 921e2b2..ab47f3f 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -763,7 +763,8 @@ bool cmQtAutoGenInitializer::InitScanFiles()
// Register files that will be scanned by moc or uic
if (this->MocOrUicEnabled()) {
- if (cm->IsHeaderExtension(extLower)) {
+ // FIXME: Add a policy to include .hh files.
+ if (cm->IsHeaderExtension(extLower) && extLower != "hh") {
addMUFile(makeMUFile(sf, fullPath, true), true);
} else if (cm->IsSourceExtension(extLower)) {
addMUFile(makeMUFile(sf, fullPath, true), false);
@@ -875,7 +876,8 @@ bool cmQtAutoGenInitializer::InitScanFiles()
std::string const& extLower =
cmSystemTools::LowerCase(sf->GetExtension());
- if (cm->IsHeaderExtension(extLower)) {
+ // FIXME: Add a policy to include .hh files.
+ if (cm->IsHeaderExtension(extLower) && extLower != "hh") {
if (!cmContains(this->AutogenTarget.Headers, sf)) {
auto muf = makeMUFile(sf, fullPath, false);
if (muf->SkipMoc || muf->SkipUic) {
diff --git a/Tests/CMakeLib/testCTestResourceSpec.cxx b/Tests/CMakeLib/testCTestResourceSpec.cxx
index b69003d..99bee56 100644
--- a/Tests/CMakeLib/testCTestResourceSpec.cxx
+++ b/Tests/CMakeLib/testCTestResourceSpec.cxx
@@ -21,43 +21,42 @@ static const std::vector<ExpectedSpec> expectedResourceSpecs = {
{"threads", {
}},
}}}},
- {"spec2.json", true, {{{
- }}}},
- {"spec3.json", false, {{{}}}},
- {"spec4.json", false, {{{}}}},
- {"spec5.json", false, {{{}}}},
- {"spec6.json", false, {{{}}}},
- {"spec7.json", false, {{{}}}},
- {"spec8.json", false, {{{}}}},
- {"spec9.json", false, {{{}}}},
- {"spec10.json", false, {{{}}}},
- {"spec11.json", false, {{{}}}},
- {"spec12.json", false, {{{}}}},
- {"spec13.json", false, {{{}}}},
- {"spec14.json", true, {{{}}}},
- {"spec15.json", true, {{{}}}},
- {"spec16.json", true, {{{}}}},
- {"spec17.json", false, {{{}}}},
- {"spec18.json", false, {{{}}}},
- {"spec19.json", false, {{{}}}},
- {"spec20.json", true, {{{}}}},
- {"spec21.json", false, {{{}}}},
- {"spec22.json", false, {{{}}}},
- {"spec23.json", false, {{{}}}},
- {"spec24.json", false, {{{}}}},
- {"spec25.json", false, {{{}}}},
- {"spec26.json", false, {{{}}}},
- {"spec27.json", false, {{{}}}},
- {"spec28.json", false, {{{}}}},
- {"spec29.json", false, {{{}}}},
- {"spec30.json", false, {{{}}}},
- {"spec31.json", false, {{{}}}},
- {"spec32.json", false, {{{}}}},
- {"spec33.json", false, {{{}}}},
- {"spec34.json", false, {{{}}}},
- {"spec35.json", false, {{{}}}},
- {"spec36.json", false, {{{}}}},
- {"noexist.json", false, {{{}}}},
+ {"spec2.json", true, {}},
+ {"spec3.json", false, {}},
+ {"spec4.json", false, {}},
+ {"spec5.json", false, {}},
+ {"spec6.json", false, {}},
+ {"spec7.json", false, {}},
+ {"spec8.json", false, {}},
+ {"spec9.json", false, {}},
+ {"spec10.json", false, {}},
+ {"spec11.json", false, {}},
+ {"spec12.json", false, {}},
+ {"spec13.json", false, {}},
+ {"spec14.json", true, {}},
+ {"spec15.json", true, {}},
+ {"spec16.json", true, {}},
+ {"spec17.json", false, {}},
+ {"spec18.json", false, {}},
+ {"spec19.json", false, {}},
+ {"spec20.json", true, {}},
+ {"spec21.json", false, {}},
+ {"spec22.json", false, {}},
+ {"spec23.json", false, {}},
+ {"spec24.json", false, {}},
+ {"spec25.json", false, {}},
+ {"spec26.json", false, {}},
+ {"spec27.json", false, {}},
+ {"spec28.json", false, {}},
+ {"spec29.json", false, {}},
+ {"spec30.json", false, {}},
+ {"spec31.json", false, {}},
+ {"spec32.json", false, {}},
+ {"spec33.json", false, {}},
+ {"spec34.json", false, {}},
+ {"spec35.json", false, {}},
+ {"spec36.json", false, {}},
+ {"noexist.json", false, {}},
/* clang-format on */
};
diff --git a/Tests/QtAutogen/SameName/CMakeLists.txt b/Tests/QtAutogen/SameName/CMakeLists.txt
index 1919cc7..cd29a2a 100644
--- a/Tests/QtAutogen/SameName/CMakeLists.txt
+++ b/Tests/QtAutogen/SameName/CMakeLists.txt
@@ -18,7 +18,6 @@ add_executable(sameName
ccc/data.qrc
item.cpp
object.h
- object.hh
object.h++
object.hpp
object.hxx
diff --git a/Tests/QtAutogen/SameName/main.cpp b/Tests/QtAutogen/SameName/main.cpp
index 725f4cd..19a6f6d 100644
--- a/Tests/QtAutogen/SameName/main.cpp
+++ b/Tests/QtAutogen/SameName/main.cpp
@@ -6,7 +6,6 @@
#include "item.hpp"
#include "object.h"
#include "object.h++"
-#include "object.hh"
#include "object.hpp"
#include "object.hxx"
#include "object_upper_ext.H"
@@ -22,7 +21,6 @@ int main(int argv, char** args)
::ccc::Item ccc_item;
// Object instances
::Object_h obj_h;
- ::Object_hh obj_hh;
::Object_hplpl obj_hplpl;
::Object_hpp obj_hpp;
::Object_hxx obj_hxx;
diff --git a/Tests/QtAutogen/SameName/object.hh b/Tests/QtAutogen/SameName/object.hh
deleted file mode 100644
index 3e16f83..0000000
--- a/Tests/QtAutogen/SameName/object.hh
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef OBJECT_HH
-#define OBJECT_HH
-
-#include <QObject>
-
-class Object_hh : public QObject
-{
- Q_OBJECT
- Q_SLOT
- void go(){};
-};
-
-#endif