[Cmake-commits] CMake branch, master, updated. v3.9.3-950-geae3765
Kitware Robot
kwrobot at kitware.com
Mon Sep 25 09:05:13 EDT 2017
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, master has been updated
via eae3765b67b653d3f00afa44a60719a387262af8 (commit)
via 10fb8059873799740b0d207b78bbb129561b3f6d (commit)
via 7c2979a5c5401da2e4c2c508abf173a4b9907bb2 (commit)
via 62bdc587ebbf3e607faef5e2f005cf88d11da32f (commit)
via f29b9702e030ab4208b43ba27fcb3e66a1949485 (commit)
via bb535bedc0ec95c046ef8685bd3c7877249cc55e (commit)
via 6d20eda21a539839f7c1ccd3f70700a0123ad8b1 (commit)
via 0332ec72b287ae464a67002fb6b9057e772f19af (commit)
via cf3990365a8b1b9777a832b321eeeefc29716fd4 (commit)
via 6e2b18535bf3ffd9400d73462fd2a0f1a609664e (commit)
via 44d3a76d4af3aebcb9bcb15fc003010fd0ae1d76 (commit)
via 0a8e23ad6e7a634d2e66537b3faea179436efcc6 (commit)
via dd5324ab1e68d745e0e83e0d0fe75fd5c9774bfa (commit)
via d3b6f2914037662916ab4512e1069fbc82bdb29e (commit)
via a5dd159990e11619280258efea089c2e47793e7a (commit)
via 9a24ab6b6386efbfa2ea9a07a3fe10f6f013fe8c (commit)
via c2d6835c178b37301c3d0cec9e575c59913fd617 (commit)
from f6f1b229874a35c2f9eda29cb737dab3f67f4db9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=eae3765b67b653d3f00afa44a60719a387262af8
commit eae3765b67b653d3f00afa44a60719a387262af8
Merge: 10fb805 0332ec7
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Sep 25 13:02:57 2017 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Sep 25 09:03:12 2017 -0400
Merge topic 'load_command-cleanup'
0332ec72 cmCPluginAPI: remove explicit casts to void*
cf399036 cmCPluginAPI: do not check pointer before calling free()
6e2b1853 cmCPluginAPI: use strdup() instead of open coding it
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !1305
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=10fb8059873799740b0d207b78bbb129561b3f6d
commit 10fb8059873799740b0d207b78bbb129561b3f6d
Merge: 7c2979a d3b6f29
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Sep 25 13:00:55 2017 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Sep 25 09:00:59 2017 -0400
Merge topic 'FindOpenACC'
d3b6f291 FindOpenACC: Add module to detect compiler support for OpenACC
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !1209
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7c2979a5c5401da2e4c2c508abf173a4b9907bb2
commit 7c2979a5c5401da2e4c2c508abf173a4b9907bb2
Merge: 62bdc58 0a8e23a
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Sep 25 13:00:11 2017 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Sep 25 09:00:16 2017 -0400
Merge topic 'rc-missing-better-error'
0a8e23ad Windows: Improve link-time error messages when rc or mt fail
c2d6835c cmSystemTools: Teach RunSingleCommand another way to report exceptions
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !1260
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=62bdc587ebbf3e607faef5e2f005cf88d11da32f
commit 62bdc587ebbf3e607faef5e2f005cf88d11da32f
Merge: f29b970 9a24ab6
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Sep 25 12:58:21 2017 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Sep 25 08:58:25 2017 -0400
Merge topic 'cpackifw-options'
9a24ab6b CPackIFW: Add some options
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !1298
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f29b9702e030ab4208b43ba27fcb3e66a1949485
commit f29b9702e030ab4208b43ba27fcb3e66a1949485
Merge: bb535be 44d3a76
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Sep 25 12:57:38 2017 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Sep 25 08:57:41 2017 -0400
Merge topic 'cxx17-no-bind1st'
44d3a76d Avoid using std::bind1st that is removed in C++17
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !1304
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bb535bedc0ec95c046ef8685bd3c7877249cc55e
commit bb535bedc0ec95c046ef8685bd3c7877249cc55e
Merge: 6d20eda dd5324a
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Sep 25 12:55:57 2017 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Sep 25 08:56:00 2017 -0400
Merge topic 'FindOpenMP-CMP0054'
dd5324ab FindOpenMP: Avoid CMP0054 warnings
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !1303
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6d20eda21a539839f7c1ccd3f70700a0123ad8b1
commit 6d20eda21a539839f7c1ccd3f70700a0123ad8b1
Merge: f6f1b22 a5dd159
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Sep 25 12:55:20 2017 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Sep 25 08:55:24 2017 -0400
Merge topic 'test-fix-msvc-standard-default'
a5dd1599 Tests: Fix RunCMake.try_compile CxxStandard case on MSVC
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !1302
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0332ec72b287ae464a67002fb6b9057e772f19af
commit 0332ec72b287ae464a67002fb6b9057e772f19af
Author: Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Sat Sep 23 14:57:51 2017 +0200
Commit: Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Sat Sep 23 15:30:44 2017 +0200
cmCPluginAPI: remove explicit casts to void*
diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx
index eee18c0..e1e11af 100644
--- a/Source/cmCPluginAPI.cxx
+++ b/Source/cmCPluginAPI.cxx
@@ -505,13 +505,12 @@ cmCPluginAPISourceFileMap cmCPluginAPISourceFiles;
void* CCONV cmCreateSourceFile(void)
{
- return (void*)new cmCPluginAPISourceFile;
+ return new cmCPluginAPISourceFile;
}
void* CCONV cmCreateNewSourceFile(void*)
{
- cmCPluginAPISourceFile* sf = new cmCPluginAPISourceFile;
- return (void*)sf;
+ return new cmCPluginAPISourceFile;
}
void CCONV cmDestroySourceFile(void* arg)
@@ -544,7 +543,7 @@ void CCONV* cmGetSource(void* arg, const char* name)
cmCPluginAPISourceFileMap::value_type entry(rsf, sf);
i = cmCPluginAPISourceFiles.insert(entry).first;
}
- return (void*)i->second;
+ return i->second;
}
return nullptr;
}
@@ -573,7 +572,7 @@ void* CCONV cmAddSource(void* arg, void* arg2)
// Store the proxy in the map so it can be re-used and deleted later.
cmCPluginAPISourceFiles[rsf] = sf;
- return (void*)sf;
+ return sf;
}
const char* CCONV cmSourceFileGetSourceName(void* arg)
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cf3990365a8b1b9777a832b321eeeefc29716fd4
commit cf3990365a8b1b9777a832b321eeeefc29716fd4
Author: Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Sat Sep 23 14:57:34 2017 +0200
Commit: Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Sat Sep 23 15:30:44 2017 +0200
cmCPluginAPI: do not check pointer before calling free()
diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx
index 8b6fd97..eee18c0 100644
--- a/Source/cmCPluginAPI.cxx
+++ b/Source/cmCPluginAPI.cxx
@@ -454,9 +454,7 @@ void CCONV cmFreeArguments(int argc, char** argv)
for (i = 0; i < argc; ++i) {
free(argv[i]);
}
- if (argv) {
- free(argv);
- }
+ free(argv);
}
int CCONV cmGetTotalArgumentSize(int argc, char** argv)
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6e2b18535bf3ffd9400d73462fd2a0f1a609664e
commit 6e2b18535bf3ffd9400d73462fd2a0f1a609664e
Author: Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Sat Sep 23 14:39:20 2017 +0200
Commit: Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Sat Sep 23 15:30:44 2017 +0200
cmCPluginAPI: use strdup() instead of open coding it
diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx
index e259f4d..8b6fd97 100644
--- a/Source/cmCPluginAPI.cxx
+++ b/Source/cmCPluginAPI.cxx
@@ -405,14 +405,8 @@ char CCONV* cmExpandVariablesInString(void* arg, const char* source,
{
cmMakefile* mf = static_cast<cmMakefile*>(arg);
std::string barf = source;
- std::string result = mf->ExpandVariablesInString(
- barf, (escapeQuotes ? true : false), (atOnly ? true : false));
- char* res = static_cast<char*>(malloc(result.size() + 1));
- if (!result.empty()) {
- strcpy(res, result.c_str());
- }
- res[result.size()] = '\0';
- return res;
+ std::string result = mf->ExpandVariablesInString(barf, escapeQuotes, atOnly);
+ return strdup(result.c_str());
}
int CCONV cmExecuteCommand(void* arg, const char* name, int numArgs,
@@ -762,25 +756,19 @@ void CCONV cmSourceFileSetName2(void* arg, const char* name, const char* dir,
char* CCONV cmGetFilenameWithoutExtension(const char* name)
{
std::string sres = cmSystemTools::GetFilenameWithoutExtension(name);
- char* result = (char*)malloc(sres.size() + 1);
- strcpy(result, sres.c_str());
- return result;
+ return strdup(sres.c_str());
}
char* CCONV cmGetFilenamePath(const char* name)
{
std::string sres = cmSystemTools::GetFilenamePath(name);
- char* result = (char*)malloc(sres.size() + 1);
- strcpy(result, sres.c_str());
- return result;
+ return strdup(sres.c_str());
}
char* CCONV cmCapitalized(const char* name)
{
std::string sres = cmSystemTools::Capitalized(name);
- char* result = (char*)malloc(sres.size() + 1);
- strcpy(result, sres.c_str());
- return result;
+ return strdup(sres.c_str());
}
void CCONV cmCopyFileIfDifferent(const char* name1, const char* name2)
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=44d3a76d4af3aebcb9bcb15fc003010fd0ae1d76
commit 44d3a76d4af3aebcb9bcb15fc003010fd0ae1d76
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 22 14:06:33 2017 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Sat Sep 23 06:49:48 2017 -0400
Avoid using std::bind1st that is removed in C++17
Use a lambda instead now that we require C++11.
diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h
index b6ea75a..69d0ed6 100644
--- a/Source/cmAlgorithms.h
+++ b/Source/cmAlgorithms.h
@@ -370,8 +370,7 @@ std::string cmWrap(char prefix, Range const& r, char suffix,
template <typename Range, typename T>
typename Range::const_iterator cmFindNot(Range const& r, T const& t)
{
- return std::find_if(r.begin(), r.end(),
- std::bind1st(std::not_equal_to<T>(), t));
+ return std::find_if(r.begin(), r.end(), [&t](T const& i) { return i != t; });
}
template <typename Range>
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index df02f84..50ed0ed 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -5,7 +5,6 @@
#include "cmsys/FStream.hxx"
#include "cmsys/Terminal.h"
#include <algorithm>
-#include <functional>
#include <sstream>
#include <stdio.h>
#include <utility>
@@ -2073,7 +2072,7 @@ void cmLocalUnixMakefileGenerator3::CreateCDCommand(
std::string outputForExisting = this->ConvertToOutputForExisting(tgtDir);
std::string prefix = cd_cmd + outputForExisting + " && ";
std::transform(commands.begin(), commands.end(), commands.begin(),
- std::bind1st(std::plus<std::string>(), prefix));
+ [&prefix](std::string const& s) { return prefix + s; });
}
}
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0a8e23ad6e7a634d2e66537b3faea179436efcc6
commit 0a8e23ad6e7a634d2e66537b3faea179436efcc6
Author: Jonathan Marler <johnnymarler at gmail.com>
AuthorDate: Fri Sep 22 04:45:05 2017 -0600
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Sep 22 13:57:08 2017 -0400
Windows: Improve link-time error messages when rc or mt fail
We run extra tools during linking on Windows to deal with manifests.
Report more information when these tools fail. For example, if the
Windows SDK is not installed with VS then `rc.exe` will be missing.
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index e152cdb..62a0094 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -1537,8 +1537,34 @@ int cmcmd::VisualStudioLink(std::vector<std::string> const& args, int type)
return vsLink.Link();
}
+enum NumberFormat
+{
+ FORMAT_DECIMAL,
+ FORMAT_HEX
+};
+struct NumberFormatter
+{
+ NumberFormat Format;
+ int Value;
+ NumberFormatter(NumberFormat format, int value)
+ : Format(format)
+ , Value(value)
+ {
+ }
+};
+std::ostream& operator<<(std::ostream& stream,
+ NumberFormatter const& formatter)
+{
+ if (formatter.Format == FORMAT_DECIMAL) {
+ stream << formatter.Value;
+ } else {
+ stream << "0x" << std::hex << formatter.Value;
+ }
+ return stream;
+}
static bool RunCommand(const char* comment, std::vector<std::string>& command,
- bool verbose, int* retCodeOut = nullptr)
+ bool verbose, NumberFormat exitFormat,
+ int* retCodeOut = nullptr)
{
if (verbose) {
std::cout << comment << ":\n";
@@ -1546,31 +1572,33 @@ static bool RunCommand(const char* comment, std::vector<std::string>& command,
}
std::string output;
int retCode = 0;
- // use rc command to create .res file
- bool res = cmSystemTools::RunSingleCommand(
+ bool commandResult = cmSystemTools::RunSingleCommand(
command, &output, &output, &retCode, nullptr, cmSystemTools::OUTPUT_NONE);
- // always print the output of the command, unless
- // it is the dumb rc command banner, but if the command
- // returned an error code then print the output anyway as
- // the banner may be mixed with some other important information.
- if (output.find("Resource Compiler Version") == std::string::npos || !res ||
- retCode) {
- std::cout << output;
- }
- if (!res) {
- std::cout << comment << " failed to run." << std::endl;
- return false;
- }
- // if retCodeOut is requested then always return true
- // and set the retCodeOut to retCode
+ bool returnValue;
if (retCodeOut) {
- *retCodeOut = retCode;
- return true;
- }
- if (retCode != 0) {
- std::cout << comment << " failed. with " << retCode << "\n";
- }
- return retCode == 0;
+ if (!commandResult) {
+ *retCodeOut = (retCode == 0) ? -1 : retCode;
+ } else {
+ *retCodeOut = retCode;
+ }
+ returnValue = true; // always return true if retCodeOut is requested
+ } else {
+ returnValue = commandResult && (retCode == 0);
+ }
+ if (!commandResult || retCode) {
+ std::cout << comment << ": command \"" << cmJoin(command, " ")
+ << "\" failed (exit code "
+ << NumberFormatter(exitFormat, retCode)
+ << ") with the following output:\n"
+ << output;
+ } else {
+ // always print the output of the command, unless
+ // it is the dumb rc command banner
+ if (output.find("Resource Compiler Version") == std::string::npos) {
+ std::cout << output;
+ }
+ }
+ return returnValue;
}
bool cmVSLink::Parse(std::vector<std::string>::const_iterator argBeg,
@@ -1720,10 +1748,10 @@ int cmVSLink::LinkIncremental()
// Compile the resource file.
std::vector<std::string> rcCommand;
- rcCommand.push_back(cmSystemTools::FindProgram("rc.exe"));
+ rcCommand.push_back("rc");
rcCommand.push_back("/fo" + this->ManifestFileRes);
rcCommand.push_back(this->ManifestFileRC);
- if (!RunCommand("RC Pass 1", rcCommand, this->Verbose)) {
+ if (!RunCommand("RC Pass 1", rcCommand, this->Verbose, FORMAT_DECIMAL)) {
return -1;
}
@@ -1731,7 +1759,8 @@ int cmVSLink::LinkIncremental()
this->LinkCommand.push_back(this->ManifestFileRes);
// Run the link command (possibly generates intermediate manifest).
- if (!RunCommand("LINK Pass 1", this->LinkCommand, this->Verbose)) {
+ if (!RunCommand("LINK Pass 1", this->LinkCommand, this->Verbose,
+ FORMAT_DECIMAL)) {
return -1;
}
@@ -1745,12 +1774,13 @@ int cmVSLink::LinkIncremental()
}
// Compile the resource file again.
- if (!RunCommand("RC Pass 2", rcCommand, this->Verbose)) {
+ if (!RunCommand("RC Pass 2", rcCommand, this->Verbose, FORMAT_DECIMAL)) {
return -1;
}
// Link incrementally again to use the updated resource.
- if (!RunCommand("FINAL LINK", this->LinkCommand, this->Verbose)) {
+ if (!RunCommand("FINAL LINK", this->LinkCommand, this->Verbose,
+ FORMAT_DECIMAL)) {
return -1;
}
return 0;
@@ -1759,7 +1789,7 @@ int cmVSLink::LinkIncremental()
int cmVSLink::LinkNonIncremental()
{
// Run the link command (possibly generates intermediate manifest).
- if (!RunCommand("LINK", this->LinkCommand, this->Verbose)) {
+ if (!RunCommand("LINK", this->LinkCommand, this->Verbose, FORMAT_DECIMAL)) {
return -1;
}
@@ -1777,7 +1807,7 @@ int cmVSLink::LinkNonIncremental()
int cmVSLink::RunMT(std::string const& out, bool notify)
{
std::vector<std::string> mtCommand;
- mtCommand.push_back(cmSystemTools::FindProgram("mt.exe"));
+ mtCommand.push_back("mt");
mtCommand.push_back("/nologo");
mtCommand.push_back("/manifest");
if (this->LinkGeneratesManifest) {
@@ -1792,7 +1822,7 @@ int cmVSLink::RunMT(std::string const& out, bool notify)
mtCommand.push_back("/notify_update");
}
int mtRet = 0;
- if (!RunCommand("MT", mtCommand, this->Verbose, &mtRet)) {
+ if (!RunCommand("MT", mtCommand, this->Verbose, FORMAT_HEX, &mtRet)) {
return -1;
}
return mtRet;
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dd5324ab1e68d745e0e83e0d0fe75fd5c9774bfa
commit dd5324ab1e68d745e0e83e0d0fe75fd5c9774bfa
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 22 13:47:01 2017 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Sep 22 13:50:35 2017 -0400
FindOpenMP: Avoid CMP0054 warnings
When invoked in projects that don't set CMP0054 to NEW, FindOpenMP
triggers a warning:
CMake Warning (dev) at .../Modules/FindOpenMP.cmake:... (if):
Policy CMP0054 is not set...Quoted variables like "c" will no
longer be dereferenced when the policy is set to NEW. Since
the policy is not set the OLD behavior will be used.
Set the policy within the module's scope to avoid this.
Fixes: #17292
diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake
index 4a3edf9..595b0b3 100644
--- a/Modules/FindOpenMP.cmake
+++ b/Modules/FindOpenMP.cmake
@@ -75,6 +75,7 @@
# the OpenMP specification implemented by the ``<lang>`` compiler.
cmake_policy(PUSH)
+cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced
cmake_policy(SET CMP0057 NEW) # if IN_LIST
function(_OPENMP_FLAG_CANDIDATES LANG)
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d3b6f2914037662916ab4512e1069fbc82bdb29e
commit d3b6f2914037662916ab4512e1069fbc82bdb29e
Author: Tin Huynh <ahuynh at nvidia.com>
AuthorDate: Thu Aug 24 17:26:52 2017 -0700
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Sep 22 10:42:27 2017 -0400
FindOpenACC: Add module to detect compiler support for OpenACC
diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst
index fdc3597..8f4b252 100644
--- a/Help/manual/cmake-modules.7.rst
+++ b/Help/manual/cmake-modules.7.rst
@@ -153,6 +153,7 @@ All Modules
/module/FindMPEG2
/module/FindMPEG
/module/FindMPI
+ /module/FindOpenACC
/module/FindOpenAL
/module/FindOpenCL
/module/FindOpenGL
diff --git a/Help/module/FindOpenACC.rst b/Help/module/FindOpenACC.rst
new file mode 100644
index 0000000..dda3308
--- /dev/null
+++ b/Help/module/FindOpenACC.rst
@@ -0,0 +1 @@
+.. cmake-module:: ../../Modules/FindOpenACC.cmake
diff --git a/Help/release/dev/FindOpenACC.rst b/Help/release/dev/FindOpenACC.rst
new file mode 100644
index 0000000..f6acbdf
--- /dev/null
+++ b/Help/release/dev/FindOpenACC.rst
@@ -0,0 +1,5 @@
+FindOpenACC
+-----------
+
+* A :module:`FindOpenACC` module was added to detect compiler support
+ for OpenACC. Currently only supports PGI, GNU and Cray compilers.
diff --git a/Modules/FindOpenACC.cmake b/Modules/FindOpenACC.cmake
new file mode 100644
index 0000000..775cc18
--- /dev/null
+++ b/Modules/FindOpenACC.cmake
@@ -0,0 +1,252 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#[=======================================================================[.rst:
+FindOpenACC
+-----------
+
+Detect OpenACC support by the compiler.
+
+This module can be used to detect OpenACC support in a compiler.
+If the compiler supports OpenACC, the flags required to compile with
+OpenACC support are returned in variables for the different languages.
+Currently, only PGI, GNU and Cray compilers are supported.
+
+Variables
+^^^^^^^^^
+
+This module will set the following variables per language in your
+project, where ``<lang>`` is one of C, CXX, or Fortran:
+
+``OpenACC_<lang>_FOUND``
+ Variable indicating if OpenACC support for ``<lang>`` was detected.
+``OpenACC_<lang>_FLAGS``
+ OpenACC compiler flags for ``<lang>``, separated by spaces.
+
+The module will also try to provide the OpenACC version variables:
+
+``OpenACC_<lang>_SPEC_DATE``
+ Date of the OpenACC specification implemented by the ``<lang>`` compiler.
+``OpenACC_<lang>_VERSION_MAJOR``
+ Major version of OpenACC implemented by the ``<lang>`` compiler.
+``OpenACC_<lang>_VERSION_MINOR``
+ Minor version of OpenACC implemented by the ``<lang>`` compiler.
+``OpenACC_<lang>_VERSION``
+ OpenACC version implemented by the ``<lang>`` compiler.
+
+The specification date is formatted as given in the OpenACC standard:
+``yyyymm`` where ``yyyy`` and ``mm`` represents the year and month of
+the OpenACC specification implemented by the ``<lang>`` compiler.
+
+Input Variables
+^^^^^^^^^^^^^^^
+
+``OpenACC_ACCEL_TARGET=<target>``
+If set, will the correct target accelerator flag set to the <target> will
+be returned with OpenACC_<lang>_FLAGS.
+#]=======================================================================]
+
+set(OpenACC_C_CXX_TEST_SOURCE
+"
+int main(){
+#ifndef _OPENACC
+ breaks_on_purpose
+#endif
+}
+"
+)
+set(OpenACC_Fortran_TEST_SOURCE
+"
+program test
+#ifndef _OPENACC
+ breaks_on_purpose
+#endif
+endprogram test
+"
+)
+set(OpenACC_C_CXX_CHECK_VERSION_SOURCE
+"
+#include <stdio.h>
+const char accver_str[] = { 'I', 'N', 'F', 'O', ':', 'O', 'p', 'e', 'n', 'A',
+ 'C', 'C', '-', 'd', 'a', 't', 'e', '[',
+ ('0' + ((_OPENACC/100000)%10)),
+ ('0' + ((_OPENACC/10000)%10)),
+ ('0' + ((_OPENACC/1000)%10)),
+ ('0' + ((_OPENACC/100)%10)),
+ ('0' + ((_OPENACC/10)%10)),
+ ('0' + ((_OPENACC/1)%10)),
+ ']', '\\0' };
+int main()
+{
+ puts(accver_str);
+}
+")
+set(OpenACC_Fortran_CHECK_VERSION_SOURCE
+"
+ program acc_ver
+ implicit none
+ integer, parameter :: zero = ichar('0')
+ character, dimension(25), parameter :: accver_str =&
+ (/ 'I', 'N', 'F', 'O', ':', 'O', 'p', 'e', 'n', 'A', 'C', 'C', '-',&
+ 'd', 'a', 't', 'e', '[',&
+ char(zero + mod(_OPENACC/100000, 10)),&
+ char(zero + mod(_OPENACC/10000, 10)),&
+ char(zero + mod(_OPENACC/1000, 10)),&
+ char(zero + mod(_OPENACC/100, 10)),&
+ char(zero + mod(_OPENACC/10, 10)),&
+ char(zero + mod(_OPENACC/1, 10)), ']' /)
+ print *, accver_str
+ end program acc_ver
+"
+)
+
+
+function(_OPENACC_WRITE_SOURCE_FILE LANG SRC_FILE_CONTENT_VAR SRC_FILE_NAME SRC_FILE_FULLPATH)
+ set(WORK_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindOpenACC)
+ if("${LANG}" STREQUAL "C")
+ set(SRC_FILE "${WORK_DIR}/${SRC_FILE_NAME}.c")
+ file(WRITE "${SRC_FILE}" "${OpenACC_C_CXX_${SRC_FILE_CONTENT_VAR}}")
+ elseif("${LANG}" STREQUAL "CXX")
+ set(SRC_FILE "${WORK_DIR}/${SRC_FILE_NAME}.cpp")
+ file(WRITE "${SRC_FILE}" "${OpenACC_C_CXX_${SRC_FILE_CONTENT_VAR}}")
+ elseif("${LANG}" STREQUAL "Fortran")
+ set(SRC_FILE "${WORK_DIR}/${SRC_FILE_NAME}.F90")
+ file(WRITE "${SRC_FILE}_in" "${OpenACC_Fortran_${SRC_FILE_CONTENT_VAR}}")
+ configure_file("${SRC_FILE}_in" "${SRC_FILE}" @ONLY)
+ endif()
+ set(${SRC_FILE_FULLPATH} "${SRC_FILE}" PARENT_SCOPE)
+endfunction()
+
+
+function(_OPENACC_GET_FLAGS_CANDIDATE LANG FLAG_VAR)
+ set(ACC_FLAG_PGI "-acc")
+ set(ACC_FLAG_GNU "-fopenacc")
+ set(ACC_FLAG_Cray "-h acc")
+
+ if(DEFINED ACC_FLAG_${CMAKE_${LANG}_COMPILER_ID})
+ set("${FLAG_VAR}" "${ACC_FLAG_${CMAKE_${LANG}_COMPILER_ID}}" PARENT_SCOPE)
+ else()
+ # Fall back to a few common flags.
+ set("${FLAG_VAR}" ${ACC_FLAG_GNU} ${ACC_FLAG_PGI})
+ endif()
+
+endfunction()
+
+
+function(_OPENACC_GET_ACCEL_TARGET_FLAG LANG TARGET FLAG_VAR)
+ # Find target accelerator flags.
+ set(ACC_TARGET_FLAG_PGI "-ta")
+ if(DEFINED ACC_TARGET_FLAG_${CMAKE_${LANG}_COMPILER_ID})
+ set("${FLAG_VAR}" "${ACC_TARGET_FLAG_${CMAKE_${LANG}_COMPILER_ID}}=${TARGET}" PARENT_SCOPE)
+ endif()
+endfunction()
+
+
+function(_OPENACC_GET_VERBOSE_FLAG LANG FLAG_VAR)
+ # Find compiler's verbose flag for OpenACC.
+ set(ACC_VERBOSE_FLAG_PGI "-Minfo=accel")
+ if(DEFINED ACC_VERBOSE_FLAG_${CMAKE_${LANG}_COMPILER_ID})
+ set("${FLAG_VAR}" "${ACC_VERBOSE_FLAG_${CMAKE_${LANG}_COMPILER_ID}}" PARENT_SCOPE)
+ endif()
+endfunction()
+
+
+function(_OPENACC_GET_FLAGS LANG FLAG_VAR)
+ set(FLAG_CANDIDATES "")
+ _OPENACC_GET_FLAGS_CANDIDATE("${LANG}" FLAG_CANDIDATES)
+ _OPENACC_WRITE_SOURCE_FILE("${LANG}" "TEST_SOURCE" OpenACCTryFlag _OPENACC_TEST_SRC)
+
+ foreach(FLAG IN LISTS FLAG_CANDIDATES)
+ try_compile(OpenACC_FLAG_TEST_RESULT ${CMAKE_BINARY_DIR} ${_OPENACC_TEST_SRC}
+ CMAKE_FLAGS "-DCOMPILE_DEFINITIONS:STRING=${FLAG}"
+ OUTPUT_VARIABLE OpenACC_TRY_COMPILE_OUTPUT
+ )
+ if(OpenACC_FLAG_TEST_RESULT)
+ set("${FLAG_VAR}" "${FLAG}")
+ if(DEFINED OpenACC_ACCEL_TARGET)
+ _OPENACC_GET_ACCEL_TARGET_FLAG("${LANG}" "${OpenACC_ACCEL_TARGET}" TARGET_FLAG)
+ string(APPEND "${FLAG_VAR}" " ${TARGET_FLAG}")
+ endif()
+
+ if(CMAKE_VERBOSE_MAKEFILE)
+ # -Minfo=accel prints out OpenACC's messages on optimizations.
+ _OPENACC_GET_VERBOSE_FLAG("${LANG}" OpenACC_VERBOSE_FLAG)
+ string(APPEND "${FLAG_VAR}" " ${OpenACC_VERBOSE_FLAG}")
+ endif()
+ set("${FLAG_VAR}" "${${FLAG_VAR}}" PARENT_SCOPE)
+ break()
+ endif()
+ endforeach()
+
+endfunction()
+
+
+function(_OPENACC_GET_SPEC_DATE LANG SPEC_DATE)
+ _OPENACC_WRITE_SOURCE_FILE("${LANG}" "CHECK_VERSION_SOURCE" OpenACCCheckVersion _OPENACC_TEST_SRC)
+
+ set(BIN_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindOpenACC/accver_${LANG}.bin")
+ try_compile(OpenACC_SPECTEST_${LANG} "${CMAKE_BINARY_DIR}" "${_OPENACC_TEST_SRC}"
+ CMAKE_FLAGS "-DCOMPILE_DEFINITIONS:STRING=${OpenACC_${LANG}_FLAGS}"
+ COPY_FILE ${BIN_FILE}
+ OUTPUT_VARIABLE OUTPUT)
+
+ if(${OpenACC_SPECTEST_${LANG}})
+ file(STRINGS ${BIN_FILE} specstr LIMIT_COUNT 1 REGEX "INFO:OpenACC-date")
+ set(regex_spec_date ".*INFO:OpenACC-date\\[0*([^]]*)\\].*")
+ if("${specstr}" MATCHES "${regex_spec_date}")
+ set(${SPEC_DATE} "${CMAKE_MATCH_1}" PARENT_SCOPE)
+ endif()
+ endif()
+endfunction()
+
+
+macro(_OPENACC_SET_VERSION_BY_SPEC_DATE LANG)
+ set(OpenACC_SPEC_DATE_MAP
+ # Combined versions, 2.5 onwards
+ "201510=2.5"
+ # 2013 08 is the corrected version.
+ "201308=2.0"
+ "201306=2.0"
+ "201111=1.0"
+ )
+
+ string(REGEX MATCHALL "${OpenACC_${LANG}_SPEC_DATE}=([0-9]+)\\.([0-9]+)" _version_match "${OpenACC_SPEC_DATE_MAP}")
+ if(NOT _version_match STREQUAL "")
+ set(OpenACC_${LANG}_VERSION_MAJOR ${CMAKE_MATCH_1})
+ set(OpenACC_${LANG}_VERSION_MINOR ${CMAKE_MATCH_2})
+ set(OpenACC_${LANG}_VERSION "${OpenACC_${LANG}_VERSION_MAJOR}.${OpenACC_${LANG}_VERSION_MINOR}")
+ else()
+ unset(OpenACC_${LANG}_VERSION_MAJOR)
+ unset(OpenACC_${LANG}_VERSION_MINOR)
+ unset(OpenACC_${LANG}_VERSION)
+ endif()
+ unset(_version_match)
+ unset(OpenACC_SPEC_DATE_MAP)
+endmacro()
+
+
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+foreach (LANG IN ITEMS C CXX Fortran)
+ if(CMAKE_${LANG}_COMPILER_LOADED)
+ set(OpenACC_${LANG}_FIND_QUIETLY ${OpenACC_FIND_QUIETLY})
+ set(OpenACC_${LANG}_FIND_REQUIRED ${OpenACC_FIND_REQUIRED})
+ set(OpenACC_${LANG}_FIND_VERSION ${OpenACC_FIND_VERSION})
+ set(OpenACC_${LANG}_FIND_VERSION_EXACT ${OpenACC_FIND_VERSION_EXACT})
+
+ if(NOT DEFINED OpenACC_${LANG}_FLAGS)
+ _OPENACC_GET_FLAGS("${LANG}" OpenACC_${LANG}_FLAGS)
+ endif()
+ _OPENACC_GET_SPEC_DATE("${LANG}" OpenACC_${LANG}_SPEC_DATE)
+ _OPENACC_SET_VERSION_BY_SPEC_DATE("${LANG}")
+
+ find_package_handle_standard_args(OpenACC_${LANG}
+ REQUIRED_VARS OpenACC_${LANG}_FLAGS
+ VERSION_VAR OpenACC_${LANG}_VERSION
+ )
+ endif()
+endforeach()
+
+unset(OpenACC_C_CXX_TEST_SOURCE)
+unset(OpenACC_Fortran_TEST_SOURCE)
+unset(OpenACC_C_CXX_CHECK_VERSION_SOURCE)
+unset(OpenACC_Fortran_CHECK_VERSION_SOURCE)
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a5dd159990e11619280258efea089c2e47793e7a
commit a5dd159990e11619280258efea089c2e47793e7a
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 22 09:33:31 2017 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Sep 22 09:41:07 2017 -0400
Tests: Fix RunCMake.try_compile CxxStandard case on MSVC
In post-3.9 development we've taught CMake to understand C++ language
standards for MSVC. The RunCMake.try_compile test needs to know whether
to expect support or not. Previously we depended on the host CMake
version to know this, but CMake 3.9 and below do not. Add special logic
to the test to account for this.
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 73fa8fb..aa4c5ac 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -227,20 +227,38 @@ add_RunCMake_test(separate_arguments)
add_RunCMake_test(set_property)
add_RunCMake_test(string)
add_RunCMake_test(test_include_dirs)
-foreach(var
- CMAKE_C_COMPILER_ID
- CMAKE_C_COMPILER_VERSION
- CMAKE_C_STANDARD_DEFAULT
- CMAKE_CXX_COMPILER_ID
- CMAKE_CXX_COMPILER_VERSION
- CMAKE_CXX_STANDARD_DEFAULT
- CMake_TEST_CUDA
- )
- if(DEFINED ${var})
- list(APPEND try_compile_ARGS -D${var}=${${var}})
+
+function(add_RunCMake_test_try_compile)
+ if(CMAKE_VERSION VERSION_LESS 3.9.20170907 AND "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC")
+ # Older CMake versions do not know about MSVC language standards.
+ # Approximate our logic from MSVC-CXX.cmake.
+ if ((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.0.24215.1 AND
+ CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.10) OR
+ CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.10.25017)
+ set(CMAKE_CXX_STANDARD_DEFAULT 14)
+ elseif (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0)
+ set(CMAKE_CXX_STANDARD_DEFAULT "")
+ else()
+ unset(CMAKE_CXX_STANDARD_DEFAULT)
+ endif()
endif()
-endforeach()
-add_RunCMake_test(try_compile)
+ foreach(var
+ CMAKE_C_COMPILER_ID
+ CMAKE_C_COMPILER_VERSION
+ CMAKE_C_STANDARD_DEFAULT
+ CMAKE_CXX_COMPILER_ID
+ CMAKE_CXX_COMPILER_VERSION
+ CMAKE_CXX_STANDARD_DEFAULT
+ CMake_TEST_CUDA
+ )
+ if(DEFINED ${var})
+ list(APPEND try_compile_ARGS -D${var}=${${var}})
+ endif()
+ endforeach()
+ add_RunCMake_test(try_compile)
+endfunction()
+add_RunCMake_test_try_compile()
+
add_RunCMake_test(try_run)
add_RunCMake_test(set)
add_RunCMake_test(variable_watch)
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9a24ab6b6386efbfa2ea9a07a3fe10f6f013fe8c
commit 9a24ab6b6386efbfa2ea9a07a3fe10f6f013fe8c
Author: Konstantin Podsvirov <konstantin at podsvirov.pro>
AuthorDate: Thu Sep 21 21:34:33 2017 +0300
Commit: Konstantin Podsvirov <konstantin at podsvirov.pro>
CommitDate: Thu Sep 21 21:34:33 2017 +0300
CPackIFW: Add some options
The `CPackIFW` module `cpack_ifw_configure_component` and
`cpack_ifw_configure_component_group` commands gained a new
`REPLACES` and `CHECKABLE` options.
diff --git a/Help/release/dev/cpackifw-options.rst b/Help/release/dev/cpackifw-options.rst
new file mode 100644
index 0000000..7c471f4
--- /dev/null
+++ b/Help/release/dev/cpackifw-options.rst
@@ -0,0 +1,6 @@
+cpackifw-options
+----------------
+
+* The :module:`CPackIFW` module :command:`cpack_ifw_configure_component` and
+ :command:`cpack_ifw_configure_component_group` commands gained a new
+ ``REPLACES`` and ``CHECKABLE`` options.
diff --git a/Modules/CPackIFW.cmake b/Modules/CPackIFW.cmake
index 0b42c83..8d8b070 100644
--- a/Modules/CPackIFW.cmake
+++ b/Modules/CPackIFW.cmake
@@ -323,7 +323,9 @@
# [LICENSES <display_name> <file_path> ...]
# [DEFAULT <value>]
# [USER_INTERFACES <file_path> <file_path> ...]
-# [TRANSLATIONS <file_path> <file_path> ...])
+# [TRANSLATIONS <file_path> <file_path> ...]
+# [REPLACES <comp_id> ...]
+# [CHECKABLE <value>])
#
# This command should be called after :command:`cpack_add_component` command.
#
@@ -404,6 +406,15 @@
# ``TRANSLATIONS``
# is a list of <file_path> ('.qm' files) representing translations to load.
#
+# ``REPLACES``
+# list of identifiers of component or component group to replace.
+#
+# ``CHECKABLE``
+# Possible values are: TRUE, FALSE.
+# Set to FALSE if you want to hide the checkbox for an item.
+# This is useful when only a few subcomponents should be selected
+# instead of all.
+#
#
# .. command:: cpack_ifw_configure_component_group
#
@@ -426,7 +437,9 @@
# [LICENSES <display_name> <file_path> ...]
# [DEFAULT <value>]
# [USER_INTERFACES <file_path> <file_path> ...]
-# [TRANSLATIONS <file_path> <file_path> ...])
+# [TRANSLATIONS <file_path> <file_path> ...]
+# [REPLACES <comp_id> ...]
+# [CHECKABLE <value>])
#
# This command should be called after :command:`cpack_add_component_group`
# command.
@@ -499,6 +512,15 @@
# ``TRANSLATIONS``
# is a list of <file_path> ('.qm' files) representing translations to load.
#
+# ``REPLACES``
+# list of identifiers of component or component group to replace.
+#
+# ``CHECKABLE``
+# Possible values are: TRUE, FALSE.
+# Set to FALSE if you want to hide the checkbox for an item.
+# This is useful when only a few subcomponents should be selected
+# instead of all.
+#
#
# .. command:: cpack_ifw_add_repository
#
@@ -882,8 +904,8 @@ macro(cpack_ifw_configure_component compname)
string(TOUPPER ${compname} _CPACK_IFWCOMP_UNAME)
set(_IFW_OPT COMMON ESSENTIAL VIRTUAL FORCED_INSTALLATION REQUIRES_ADMIN_RIGHTS)
- set(_IFW_ARGS NAME VERSION RELEASE_DATE SCRIPT PRIORITY SORTING_PRIORITY UPDATE_TEXT DEFAULT)
- set(_IFW_MULTI_ARGS DISPLAY_NAME DESCRIPTION DEPENDS DEPENDENCIES AUTO_DEPEND_ON LICENSES USER_INTERFACES TRANSLATIONS)
+ set(_IFW_ARGS NAME VERSION RELEASE_DATE SCRIPT PRIORITY SORTING_PRIORITY UPDATE_TEXT DEFAULT CHECKABLE)
+ set(_IFW_MULTI_ARGS DISPLAY_NAME DESCRIPTION DEPENDS DEPENDENCIES AUTO_DEPEND_ON LICENSES USER_INTERFACES TRANSLATIONS REPLACES)
cmake_parse_arguments(CPACK_IFW_COMPONENT_${_CPACK_IFWCOMP_UNAME} "${_IFW_OPT}" "${_IFW_ARGS}" "${_IFW_MULTI_ARGS}" ${ARGN})
_cpack_ifw_resolve_script(CPACK_IFW_COMPONENT_${_CPACK_IFWCOMP_UNAME}_SCRIPT)
@@ -923,8 +945,8 @@ macro(cpack_ifw_configure_component_group grpname)
string(TOUPPER ${grpname} _CPACK_IFWGRP_UNAME)
set(_IFW_OPT VIRTUAL FORCED_INSTALLATION REQUIRES_ADMIN_RIGHTS)
- set(_IFW_ARGS NAME VERSION RELEASE_DATE SCRIPT PRIORITY SORTING_PRIORITY UPDATE_TEXT DEFAULT)
- set(_IFW_MULTI_ARGS DISPLAY_NAME DESCRIPTION DEPENDS DEPENDENCIES AUTO_DEPEND_ON LICENSES USER_INTERFACES TRANSLATIONS)
+ set(_IFW_ARGS NAME VERSION RELEASE_DATE SCRIPT PRIORITY SORTING_PRIORITY UPDATE_TEXT DEFAULT CHECKABLE)
+ set(_IFW_MULTI_ARGS DISPLAY_NAME DESCRIPTION DEPENDS DEPENDENCIES AUTO_DEPEND_ON LICENSES USER_INTERFACES TRANSLATIONS REPLACES)
cmake_parse_arguments(CPACK_IFW_COMPONENT_GROUP_${_CPACK_IFWGRP_UNAME} "${_IFW_OPT}" "${_IFW_ARGS}" "${_IFW_MULTI_ARGS}" ${ARGN})
_cpack_ifw_resolve_script(CPACK_IFW_COMPONENT_GROUP_${_CPACK_IFWGRP_UNAME}_SCRIPT)
diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx
index 7b23005..d3ce15c 100644
--- a/Source/CPack/IFW/cmCPackIFWPackage.cxx
+++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx
@@ -482,6 +482,15 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
this->ForcedInstallation = "false";
}
+ // Replaces
+ option = prefix + "REPLACES";
+ if (this->IsSetToEmpty(option)) {
+ this->Replaces.clear();
+ } else if (const char* value = this->GetOption(option)) {
+ this->Replaces.clear();
+ cmSystemTools::ExpandListArgument(value, this->Replaces);
+ }
+
// Requires admin rights
option = prefix + "REQUIRES_ADMIN_RIGHTS";
if (this->IsSetToEmpty(option)) {
@@ -492,6 +501,16 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
this->RequiresAdminRights = "false";
}
+ // Checkable
+ option = prefix + "CHECKABLE";
+ if (this->IsSetToEmpty(option)) {
+ this->Checkable.clear();
+ } else if (this->IsOn(option)) {
+ this->Checkable = "true";
+ } else if (this->IsSetToOff(option)) {
+ this->Checkable = "false";
+ }
+
return 1;
}
@@ -652,6 +671,19 @@ void cmCPackIFWPackage::GeneratePackageFile()
xout.Element("ForcedInstallation", this->ForcedInstallation);
}
+ // Replaces
+ if (!this->Replaces.empty()) {
+ std::ostringstream replaces;
+ std::vector<std::string>::iterator it = this->Replaces.begin();
+ replaces << *it;
+ ++it;
+ while (it != this->Replaces.end()) {
+ replaces << "," << *it;
+ ++it;
+ }
+ xout.Element("Replaces", replaces.str());
+ }
+
if (!this->RequiresAdminRights.empty()) {
xout.Element("RequiresAdminRights", this->RequiresAdminRights);
}
@@ -672,6 +704,11 @@ void cmCPackIFWPackage::GeneratePackageFile()
xout.Element("SortingPriority", this->SortingPriority);
}
+ // Checkable
+ if (!this->Checkable.empty()) {
+ xout.Element("Checkable", this->Checkable);
+ }
+
xout.EndElement();
xout.EndDocument();
}
diff --git a/Source/CPack/IFW/cmCPackIFWPackage.h b/Source/CPack/IFW/cmCPackIFWPackage.h
index cec59b0..ae41146 100644
--- a/Source/CPack/IFW/cmCPackIFWPackage.h
+++ b/Source/CPack/IFW/cmCPackIFWPackage.h
@@ -114,9 +114,15 @@ public:
/// Determines that the package must always be installed
std::string ForcedInstallation;
+ /// List of components to replace
+ std::vector<std::string> Replaces;
+
/// Package needs to be installed with elevated permissions
std::string RequiresAdminRights;
+ /// Set to false if you want to hide the checkbox for an item
+ std::string Checkable;
+
public:
// Internal implementation
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c2d6835c178b37301c3d0cec9e575c59913fd617
commit c2d6835c178b37301c3d0cec9e575c59913fd617
Author: Jonathan Marler <johnnymarler at gmail.com>
AuthorDate: Tue Sep 19 09:07:27 2017 -0600
Commit: Brad King <brad.king at kitware.com>
CommitDate: Wed Sep 20 14:17:13 2017 -0400
cmSystemTools: Teach RunSingleCommand another way to report exceptions
If the caller captures stdout but not stderr then report exceptions
through stdout instead of dropping them.
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 5f2737d..e548b1f 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -803,6 +803,8 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string> const& command,
}
if (captureStdErr) {
captureStdErr->append(exception_str, strlen(exception_str));
+ } else if (captureStdOut) {
+ captureStdOut->append(exception_str, strlen(exception_str));
}
result = false;
} else if (cmsysProcess_GetState(cp) == cmsysProcess_State_Error) {
@@ -812,6 +814,8 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string> const& command,
}
if (captureStdErr) {
captureStdErr->append(error_str, strlen(error_str));
+ } else if (captureStdOut) {
+ captureStdOut->append(error_str, strlen(error_str));
}
result = false;
} else if (cmsysProcess_GetState(cp) == cmsysProcess_State_Expired) {
-----------------------------------------------------------------------
Summary of changes:
Help/manual/cmake-modules.7.rst | 1 +
Help/module/FindOpenACC.rst | 1 +
Help/release/dev/FindOpenACC.rst | 5 +
Help/release/dev/cpackifw-options.rst | 6 +
Modules/CPackIFW.cmake | 34 +++-
Modules/FindOpenACC.cmake | 252 ++++++++++++++++++++++++++++++
Modules/FindOpenMP.cmake | 1 +
Source/CPack/IFW/cmCPackIFWPackage.cxx | 37 +++++
Source/CPack/IFW/cmCPackIFWPackage.h | 6 +
Source/cmAlgorithms.h | 3 +-
Source/cmCPluginAPI.cxx | 35 ++---
Source/cmLocalUnixMakefileGenerator3.cxx | 3 +-
Source/cmSystemTools.cxx | 4 +
Source/cmcmd.cxx | 94 +++++++----
Tests/RunCMake/CMakeLists.txt | 44 ++++--
15 files changed, 446 insertions(+), 80 deletions(-)
create mode 100644 Help/module/FindOpenACC.rst
create mode 100644 Help/release/dev/FindOpenACC.rst
create mode 100644 Help/release/dev/cpackifw-options.rst
create mode 100644 Modules/FindOpenACC.cmake
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list