summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/manual/cmake-file-api.7.rst2
-rw-r--r--Help/manual/cmake-properties.7.rst2
-rw-r--r--Help/manual/cmake.1.rst16
-rw-r--r--Help/prop_dir/ADDITIONAL_CLEAN_FILES.rst15
-rw-r--r--Help/prop_tgt/ADDITIONAL_CLEAN_FILES.rst17
-rw-r--r--Help/variable/CMAKE_LANG_COMPILER_ID.rst1
-rw-r--r--Modules/CheckCXXSymbolExists.cmake2
-rw-r--r--Modules/FindEnvModules.cmake6
-rw-r--r--Modules/Internal/CPack/CPackNuGet.cmake2
-rw-r--r--Source/QtDialog/CMakeSetupDialog.cxx2
-rw-r--r--Source/cmFileAPI.cxx63
-rw-r--r--Source/cmFileAPI.h5
-rw-r--r--Source/cmQtAutoGenInitializer.cxx6
-rw-r--r--Source/cmServerProtocol.cxx2
-rw-r--r--Source/cmake.cxx9
-rw-r--r--Source/cmake.h4
-rw-r--r--Source/cmcmd.cxx6
-rw-r--r--Tests/RunCMake/CommandLine/E_capabilities-stdout.txt2
18 files changed, 115 insertions, 47 deletions
diff --git a/Help/manual/cmake-file-api.7.rst b/Help/manual/cmake-file-api.7.rst
index f3e0208..04b6ed2 100644
--- a/Help/manual/cmake-file-api.7.rst
+++ b/Help/manual/cmake-file-api.7.rst
@@ -379,6 +379,8 @@ finds the file missing, that means a concurrent CMake has generated
a new reply. The client may simply start again by reading the new
reply index file.
+.. _`file-api object kinds`:
+
Object Kinds
============
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index 25aab8d..77b1ae8 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -62,7 +62,6 @@ Properties on Directories
:maxdepth: 1
/prop_dir/ADDITIONAL_CLEAN_FILES
- /prop_dir/ADDITIONAL_MAKE_CLEAN_FILES
/prop_dir/BINARY_DIR
/prop_dir/BUILDSYSTEM_TARGETS
/prop_dir/CACHE_VARIABLES
@@ -505,6 +504,7 @@ Deprecated Properties on Directories
.. toctree::
:maxdepth: 1
+ /prop_dir/ADDITIONAL_MAKE_CLEAN_FILES
/prop_dir/COMPILE_DEFINITIONS_CONFIG
/prop_dir/TEST_INCLUDE_FILE
diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst
index f1d02eb..13cba71 100644
--- a/Help/manual/cmake.1.rst
+++ b/Help/manual/cmake.1.rst
@@ -423,6 +423,22 @@ Available commands are:
A list of strings with all the extra generators compatible with
the generator.
+ ``fileApi``
+ Optional member that is present when the :manual:`cmake-file-api(7)`
+ is available. The value is a JSON object with one member:
+
+ ``requests``
+ A JSON array containing zero or more supported file-api requests.
+ Each request is a JSON object with members:
+
+ ``kind``
+ Specifies one of the supported :ref:`file-api object kinds`.
+
+ ``version``
+ A JSON array whose elements are each a JSON object containing
+ ``major`` and ``minor`` members specifying non-negative integer
+ version components.
+
``serverMode``
``true`` if cmake supports server-mode and ``false`` otherwise.
diff --git a/Help/prop_dir/ADDITIONAL_CLEAN_FILES.rst b/Help/prop_dir/ADDITIONAL_CLEAN_FILES.rst
index 54a78ef..051d22a 100644
--- a/Help/prop_dir/ADDITIONAL_CLEAN_FILES.rst
+++ b/Help/prop_dir/ADDITIONAL_CLEAN_FILES.rst
@@ -1,16 +1,21 @@
ADDITIONAL_CLEAN_FILES
----------------------
-Additional files to remove during the clean stage.
+A :ref:`;-list <CMake Language Lists>` of files or directories that will be
+removed as a part of the global ``clean`` target. It is useful for
+specifying generated files or directories that are used by multiple targets
+or by CMake itself, or that are generated in ways which cannot be captured as
+outputs or byproducts of custom commands.
-A :ref:`;-list <CMake Language Lists>` of files that will be removed as a
-part of the ``clean`` target.
+If an additional clean file is specific to a single target only, then the
+:prop_tgt:`ADDITIONAL_CLEAN_FILES` target property would usually be a better
+choice than this directory property.
Relative paths are allowed and are interpreted relative to the
current binary directory.
-Arguments to :prop_dir:`ADDITIONAL_CLEAN_FILES` may use
+Contents of ``ADDITIONAL_CLEAN_FILES`` may use
:manual:`generator expressions <cmake-generator-expressions(7)>`.
This property only works for the :generator:`Ninja` and the Makefile
-generators. It is ignored on other generators.
+generators. It is ignored by other generators.
diff --git a/Help/prop_tgt/ADDITIONAL_CLEAN_FILES.rst b/Help/prop_tgt/ADDITIONAL_CLEAN_FILES.rst
index 856bb38..3b9d965 100644
--- a/Help/prop_tgt/ADDITIONAL_CLEAN_FILES.rst
+++ b/Help/prop_tgt/ADDITIONAL_CLEAN_FILES.rst
@@ -1,16 +1,23 @@
ADDITIONAL_CLEAN_FILES
----------------------
-Additional files to remove during the clean stage.
+A :ref:`;-list <CMake Language Lists>` of files or directories that will be
+removed as a part of the global ``clean`` target. It can be used to specify
+files and directories that are generated as part of building the target or
+that are directly associated with the target in some way (e.g. created as a
+result of running the target).
-A :ref:`;-list <CMake Language Lists>` of files that will be removed as a
-part of the ``clean`` target.
+For custom targets, if such files can be captured as outputs or byproducts
+instead, then that should be preferred over adding them to this property.
+If an additional clean file is used by multiple targets or isn't
+target-specific, then the :prop_dir:`ADDITIONAL_CLEAN_FILES` directory
+property may be the more appropriate property to use.
Relative paths are allowed and are interpreted relative to the
current binary directory.
-Arguments to :prop_tgt:`ADDITIONAL_CLEAN_FILES` may use
+Contents of ``ADDITIONAL_CLEAN_FILES`` may use
:manual:`generator expressions <cmake-generator-expressions(7)>`.
This property only works for the :generator:`Ninja` and the Makefile
-generators. It is ignored on other generators.
+generators. It is ignored by other generators.
diff --git a/Help/variable/CMAKE_LANG_COMPILER_ID.rst b/Help/variable/CMAKE_LANG_COMPILER_ID.rst
index 16d97ee..8eb4fb6 100644
--- a/Help/variable/CMAKE_LANG_COMPILER_ID.rst
+++ b/Help/variable/CMAKE_LANG_COMPILER_ID.rst
@@ -35,6 +35,7 @@ include:
TI = Texas Instruments (ti.com)
TinyCC = Tiny C Compiler (tinycc.org)
XL, VisualAge, zOS = IBM XL (ibm.com)
+ XLClang = IBM Clang-based XL (ibm.com)
This variable is not guaranteed to be defined for all compilers or
languages.
diff --git a/Modules/CheckCXXSymbolExists.cmake b/Modules/CheckCXXSymbolExists.cmake
index 970e301..2cccd09 100644
--- a/Modules/CheckCXXSymbolExists.cmake
+++ b/Modules/CheckCXXSymbolExists.cmake
@@ -24,7 +24,7 @@ Check if a symbol exists as a function, variable, or macro in C++
as a function or variable then the symbol must also be available for
linking. If the symbol is a type or enum value it will not be
recognized (consider using :module:`CheckTypeSize`
- or :module:`CheckCSourceCompiles`).
+ or :module:`CheckCXXSourceCompiles`).
The following variables may be set before calling this macro to modify
the way the check is run:
diff --git a/Modules/FindEnvModules.cmake b/Modules/FindEnvModules.cmake
index e39ec97..4dd5116 100644
--- a/Modules/FindEnvModules.cmake
+++ b/Modules/FindEnvModules.cmake
@@ -53,7 +53,7 @@ Result Variables
This module will set the following variables in your project:
``EnvModules_FOUND``
- Found the a compatible environment modules framework
+ True if a compatible environment modules framework was found.
Cache Variables
^^^^^^^^^^^^^^^
@@ -61,7 +61,7 @@ Cache Variables
The following cache variable will be set:
``EnvModules_COMMAND``
- The low level module command to use. Currently supported are
+ The low level module command to use. Currently supported
implementations are the Lua based Lmod and TCL based EnvironmentModules.
Environment Variables
@@ -74,7 +74,7 @@ Environment Variables
Provided Functions
^^^^^^^^^^^^^^^^^^
-This defines the following cmake functions for interacting with environment
+This defines the following CMake functions for interacting with environment
modules:
.. command:: env_module
diff --git a/Modules/Internal/CPack/CPackNuGet.cmake b/Modules/Internal/CPack/CPackNuGet.cmake
index 198ccad..4b2ce92 100644
--- a/Modules/Internal/CPack/CPackNuGet.cmake
+++ b/Modules/Internal/CPack/CPackNuGet.cmake
@@ -276,7 +276,7 @@ function(_cpack_nuget_make_files_tag)
set(_CPACK_NUGET_FILES_TAG "<files>\n${_files} </files>" PARENT_SCOPE)
endfunction()
-find_program(NUGET_EXECUTABLE NuGet)
+find_program(NUGET_EXECUTABLE nuget)
_cpack_nuget_debug_var(NUGET_EXECUTABLE)
if(NOT NUGET_EXECUTABLE)
message(FATAL_ERROR "NuGet executable not found")
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index 5f6ccca..e98cdcf 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -862,7 +862,7 @@ void CMakeSetupDialog::doAbout()
"built using Qt %2 (qt-project.org).\n"
#ifdef USE_LGPL
"\n"
- "The Qt Toolkit is Copyright (C) Digia Plc and/or its subsidiary(-ies).\n"
+ "The Qt Toolkit is Copyright (C) The Qt Company Ltd.\n"
"Qt is licensed under terms of the GNU LGPLv" USE_LGPL ", available at:\n"
" \"%3\""
#endif
diff --git a/Source/cmFileAPI.cxx b/Source/cmFileAPI.cxx
index 34b6b33..ba42669 100644
--- a/Source/cmFileAPI.cxx
+++ b/Source/cmFileAPI.cxx
@@ -413,6 +413,14 @@ std::string cmFileAPI::ObjectName(Object const& o)
return name;
}
+Json::Value cmFileAPI::BuildVersion(unsigned int major, unsigned int minor)
+{
+ Json::Value version;
+ version["major"] = major;
+ version["minor"] = minor;
+ return version;
+}
+
Json::Value cmFileAPI::BuildObject(Object const& object)
{
Json::Value value;
@@ -680,10 +688,9 @@ Json::Value cmFileAPI::BuildCodeModel(Object const& object)
Json::Value codemodel = cmFileAPICodemodelDump(*this, object.Version);
codemodel["kind"] = this->ObjectKindName(object.Kind);
- Json::Value& version = codemodel["version"] = Json::objectValue;
+ Json::Value& version = codemodel["version"];
if (object.Version == 2) {
- version["major"] = 2;
- version["minor"] = CodeModelV2Minor;
+ version = BuildVersion(2, CodeModelV2Minor);
} else {
return codemodel; // should be unreachable
}
@@ -716,10 +723,9 @@ Json::Value cmFileAPI::BuildCache(Object const& object)
Json::Value cache = cmFileAPICacheDump(*this, object.Version);
cache["kind"] = this->ObjectKindName(object.Kind);
- Json::Value& version = cache["version"] = Json::objectValue;
+ Json::Value& version = cache["version"];
if (object.Version == 2) {
- version["major"] = 2;
- version["minor"] = CacheV2Minor;
+ version = BuildVersion(2, CacheV2Minor);
} else {
return cache; // should be unreachable
}
@@ -752,10 +758,9 @@ Json::Value cmFileAPI::BuildCMakeFiles(Object const& object)
Json::Value cmakeFiles = cmFileAPICMakeFilesDump(*this, object.Version);
cmakeFiles["kind"] = this->ObjectKindName(object.Kind);
- Json::Value& version = cmakeFiles["version"] = Json::objectValue;
+ Json::Value& version = cmakeFiles["version"];
if (object.Version == 1) {
- version["major"] = 1;
- version["minor"] = CMakeFilesV1Minor;
+ version = BuildVersion(1, CMakeFilesV1Minor);
} else {
return cmakeFiles; // should be unreachable
}
@@ -788,13 +793,43 @@ Json::Value cmFileAPI::BuildInternalTest(Object const& object)
{
Json::Value test = Json::objectValue;
test["kind"] = this->ObjectKindName(object.Kind);
- Json::Value& version = test["version"] = Json::objectValue;
+ Json::Value& version = test["version"];
if (object.Version == 2) {
- version["major"] = 2;
- version["minor"] = InternalTestV2Minor;
+ version = BuildVersion(2, InternalTestV2Minor);
} else {
- version["major"] = 1;
- version["minor"] = InternalTestV1Minor;
+ version = BuildVersion(1, InternalTestV1Minor);
}
return test;
}
+
+Json::Value cmFileAPI::ReportCapabilities()
+{
+ Json::Value capabilities = Json::objectValue;
+ Json::Value& requests = capabilities["requests"] = Json::arrayValue;
+
+ {
+ Json::Value request = Json::objectValue;
+ request["kind"] = ObjectKindName(ObjectKind::CodeModel);
+ Json::Value& versions = request["version"] = Json::arrayValue;
+ versions.append(BuildVersion(2, CodeModelV2Minor));
+ requests.append(std::move(request)); // NOLINT(*)
+ }
+
+ {
+ Json::Value request = Json::objectValue;
+ request["kind"] = ObjectKindName(ObjectKind::Cache);
+ Json::Value& versions = request["version"] = Json::arrayValue;
+ versions.append(BuildVersion(2, CacheV2Minor));
+ requests.append(std::move(request)); // NOLINT(*)
+ }
+
+ {
+ Json::Value request = Json::objectValue;
+ request["kind"] = ObjectKindName(ObjectKind::CMakeFiles);
+ Json::Value& versions = request["version"] = Json::arrayValue;
+ versions.append(BuildVersion(1, CMakeFilesV1Minor));
+ requests.append(std::move(request)); // NOLINT(*)
+ }
+
+ return capabilities;
+}
diff --git a/Source/cmFileAPI.h b/Source/cmFileAPI.h
index 341b072..602efa8 100644
--- a/Source/cmFileAPI.h
+++ b/Source/cmFileAPI.h
@@ -36,6 +36,9 @@ public:
and holding the original object. Other JSON types are unchanged. */
Json::Value MaybeJsonFile(Json::Value in, std::string const& prefix);
+ /** Report file-api capabilities for cmake -E capabilities. */
+ static Json::Value ReportCapabilities();
+
private:
cmake* CMakeInstance;
@@ -162,6 +165,8 @@ private:
static const char* ObjectKindName(ObjectKind kind);
static std::string ObjectName(Object const& o);
+ static Json::Value BuildVersion(unsigned int major, unsigned int minor);
+
Json::Value BuildObject(Object const& object);
ClientRequests BuildClientRequests(Json::Value const& requests);
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index 265daf6..9985f93 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -721,9 +721,9 @@ bool cmQtAutoGenInitializer::InitScanFiles()
MUFile const& muf = *pair.second;
if (muf.MocIt || muf.UicIt) {
// Search for the default header file and a private header
- std::string const& realPath = muf.RealPath;
- std::string basePath = cmQtAutoGen::SubDirPrefix(realPath);
- basePath += cmSystemTools::GetFilenameWithoutLastExtension(realPath);
+ std::string const& srcPath = muf.SF->GetFullPath();
+ std::string basePath = cmQtAutoGen::SubDirPrefix(srcPath);
+ basePath += cmSystemTools::GetFilenameWithoutLastExtension(srcPath);
for (auto const& suffix : suffixes) {
std::string const suffixedPath = basePath + suffix;
for (auto const& ext : exts) {
diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx
index dad8821..558391f 100644
--- a/Source/cmServerProtocol.cxx
+++ b/Source/cmServerProtocol.cxx
@@ -630,7 +630,7 @@ cmServerResponse cmServerProtocol1::ProcessGlobalSettings(
Json::Value obj = Json::objectValue;
// Capabilities information:
- obj[kCAPABILITIES_KEY] = cm->ReportCapabilitiesJson(true);
+ obj[kCAPABILITIES_KEY] = cm->ReportCapabilitiesJson();
obj[kDEBUG_OUTPUT_KEY] = cm->GetDebugOutput();
obj[kTRACE_KEY] = cm->GetTrace();
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index f0b53f4..3772f09 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -248,7 +248,7 @@ Json::Value cmake::ReportVersionJson() const
return version;
}
-Json::Value cmake::ReportCapabilitiesJson(bool haveServerMode) const
+Json::Value cmake::ReportCapabilitiesJson() const
{
Json::Value obj = Json::objectValue;
@@ -284,18 +284,19 @@ Json::Value cmake::ReportCapabilitiesJson(bool haveServerMode) const
generators.append(i.second);
}
obj["generators"] = generators;
- obj["serverMode"] = haveServerMode;
+ obj["fileApi"] = cmFileAPI::ReportCapabilities();
+ obj["serverMode"] = true;
return obj;
}
#endif
-std::string cmake::ReportCapabilities(bool haveServerMode) const
+std::string cmake::ReportCapabilities() const
{
std::string result;
#if defined(CMAKE_BUILD_WITH_CMAKE)
Json::FastWriter writer;
- result = writer.write(this->ReportCapabilitiesJson(haveServerMode));
+ result = writer.write(this->ReportCapabilitiesJson());
#else
result = "Not supported";
#endif
diff --git a/Source/cmake.h b/Source/cmake.h
index 4de9d28..fa4409a 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -136,9 +136,9 @@ public:
#if defined(CMAKE_BUILD_WITH_CMAKE)
Json::Value ReportVersionJson() const;
- Json::Value ReportCapabilitiesJson(bool haveServerMode) const;
+ Json::Value ReportCapabilitiesJson() const;
#endif
- std::string ReportCapabilities(bool haveServerMode) const;
+ std::string ReportCapabilities() const;
//@{
/**
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index a983d30..86082e5 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -734,11 +734,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args)
return 1;
}
cmake cm(cmake::RoleInternal, cmState::Unknown);
-#if defined(CMAKE_BUILD_WITH_CMAKE)
- std::cout << cm.ReportCapabilities(true);
-#else
- std::cout << cm.ReportCapabilities(false);
-#endif
+ std::cout << cm.ReportCapabilities();
return 0;
}
diff --git a/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt b/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt
index 6c5ea44..b4b170e 100644
--- a/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt
+++ b/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt
@@ -1 +1 @@
-^{.*}$
+^{"fileApi":{"requests":\[{"kind":"codemodel","version":\[{"major":2,"minor":0}]},{"kind":"cache","version":\[{"major":2,"minor":0}]},{"kind":"cmakeFiles","version":\[{"major":1,"minor":0}]}]},"generators":\[.*\],"serverMode":true,"version":{.*}}$