[Cmake-commits] CMake branch, master, updated. v3.13.0-rc1-69-g7a0f516

Kitware Robot kwrobot at kitware.com
Thu Oct 11 07:35:15 EDT 2018


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  7a0f516ecdbc2ecc50123b54c223f917fc2864d3 (commit)
       via  2e1fe8fabed9485a5466305624f75c0318780d80 (commit)
       via  a6e0158712bd25256fb66cf21c047b81d65bc4fe (commit)
       via  f460bbd4c8afab56f93b9831f1f4d8336480fcc5 (commit)
       via  045b0beae13366420186337170d70e73ec96ebca (commit)
       via  0813581859bd61a9d30c97aa893030bea85f134e (commit)
      from  8563e29c81c23b758350ba1716ef3c6213b8c615 (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=7a0f516ecdbc2ecc50123b54c223f917fc2864d3
commit 7a0f516ecdbc2ecc50123b54c223f917fc2864d3
Merge: 2e1fe8f 045b0be
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Oct 11 11:33:21 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu Oct 11 07:33:39 2018 -0400

    Merge topic 'FindwxWidgets-optional'
    
    045b0beae1 FindwxWidgets: implement detailed components status on Windows
    0813581859 FindwxWidgets: honor OPTIONAL_COMPONENTS
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2447


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2e1fe8fabed9485a5466305624f75c0318780d80
commit 2e1fe8fabed9485a5466305624f75c0318780d80
Merge: 8563e29 a6e0158
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Oct 11 11:32:44 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu Oct 11 07:32:54 2018 -0400

    Merge topic 'ctest-done'
    
    a6e0158712 ctest_submit: Add support for a "Done" part
    f460bbd4c8 ctest_submit: Refactor file list to use a vector instead of a set
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Acked-by: Zack Galbreath <zack.galbreath at kitware.com>
    Merge-request: !2405


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a6e0158712bd25256fb66cf21c047b81d65bc4fe
commit a6e0158712bd25256fb66cf21c047b81d65bc4fe
Author:     Betsy McPhail <betsy.mcphail at kitware.com>
AuthorDate: Thu Oct 4 11:34:27 2018 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Oct 10 06:55:59 2018 -0400

    ctest_submit: Add support for a "Done" part
    
    Teach CTest to submit Done.xml. Submission of this file indicates to
    CDash that a build is complete and no more files will be uploaded. It
    contains the build id returned by CDash and the current time.
    
    This file is submitted last for a given build when using the
    `ctest_submit()` command.
    
    If submitting by PARTS, use `ctest_submit(PARTS Done)`.

diff --git a/Help/command/ctest_submit.rst b/Help/command/ctest_submit.rst
index 2ba6bef..426475c 100644
--- a/Help/command/ctest_submit.rst
+++ b/Help/command/ctest_submit.rst
@@ -33,6 +33,7 @@ The options are:
     ExtraFiles = Files listed by CTEST_EXTRA_SUBMIT_FILES
     Upload     = Files prepared for upload by ctest_upload(), in Upload.xml
     Submit     = nothing
+    Done       = Build is complete, in Done.xml
 
 ``FILES <file>...``
   Specify an explicit list of specific files to be submitted.
diff --git a/Help/release/dev/ctest-done.rst b/Help/release/dev/ctest-done.rst
new file mode 100644
index 0000000..9ec0e24
--- /dev/null
+++ b/Help/release/dev/ctest-done.rst
@@ -0,0 +1,5 @@
+ctest-done
+----------
+
+* The :command:`ctest_submit` command learned a new ``Done`` part that can be used
+  to inform CDash that a build is complete and that no more parts will be uploaded.
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index 38b5411..6ad0e03 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -56,6 +56,7 @@ public:
   std::string Filename;
   std::string MD5;
   std::string Message;
+  std::string BuildID;
 
 private:
   std::vector<char> CurrentValue;
@@ -97,6 +98,8 @@ private:
       this->MD5 = this->GetCurrentValue();
     } else if (name == "message") {
       this->Message = this->GetCurrentValue();
+    } else if (name == "buildId") {
+      this->BuildID = this->GetCurrentValue();
     }
   }
 };
@@ -645,6 +648,7 @@ void cmCTestSubmitHandler::ParseResponse(
                  "   Submission failed: " << parser.Message << std::endl);
       return;
     }
+    this->CTest->SetBuildID(parser.BuildID);
   }
   output = cmSystemTools::UpperCase(output);
   if (output.find("WARNING") != std::string::npos) {
@@ -1414,6 +1418,12 @@ int cmCTestSubmitHandler::ProcessHandler()
     files.erase(files.begin() + endPos, files.end());
   }
 
+  // Submit Done.xml last
+  if (this->SubmitPart[cmCTest::PartDone]) {
+    this->CTest->GenerateDoneFile();
+    files.push_back("Done.xml");
+  }
+
   if (ofs) {
     ofs << "Upload files:" << std::endl;
     int cnt = 0;
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 908eea1..d0d5db6 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -294,6 +294,7 @@ cmCTest::cmCTest()
   this->SuppressUpdatingCTestConfiguration = false;
   this->DartVersion = 1;
   this->DropSiteCDash = false;
+  this->BuildID = "";
   this->OutputTestOutputOnTestFailure = false;
   this->RepeatTests = 1; // default to run each test once
   this->RepeatUntilFail = false;
@@ -320,6 +321,7 @@ cmCTest::cmCTest()
   this->Parts[PartNotes].SetName("Notes");
   this->Parts[PartExtraFiles].SetName("ExtraFiles");
   this->Parts[PartUpload].SetName("Upload");
+  this->Parts[PartDone].SetName("Done");
 
   // Fill the part name-to-id map.
   for (Part p = PartStart; p != PartCount; p = Part(p + 1)) {
@@ -612,6 +614,7 @@ bool cmCTest::InitializeFromCommand(cmCTestStartCommand* command)
   std::string bld_dir = this->GetCTestConfiguration("BuildDirectory");
   this->DartVersion = 1;
   this->DropSiteCDash = false;
+  this->BuildID = "";
   for (Part p = PartStart; p != PartCount; p = Part(p + 1)) {
     this->Parts[p].SubmitFiles.clear();
   }
@@ -1565,6 +1568,24 @@ int cmCTest::GenerateNotesFile(const char* cfiles)
   return this->GenerateNotesFile(files);
 }
 
+int cmCTest::GenerateDoneFile()
+{
+  cmGeneratedFileStream ofs;
+  if (!this->OpenOutputFile(this->CurrentTag, "Done.xml", ofs)) {
+    cmCTestLog(this, ERROR_MESSAGE, "Cannot open done file" << std::endl);
+    return 1;
+  }
+  cmXMLWriter xml(ofs);
+  xml.StartDocument();
+  xml.StartElement("Done");
+  xml.Element("buildId", this->BuildID);
+  xml.Element("time", std::chrono::system_clock::now());
+  xml.EndElement(); // Done
+  xml.EndDocument();
+
+  return 0;
+}
+
 std::string cmCTest::Base64GzipEncodeFile(std::string const& file)
 {
   std::string tarFile = file + "_temp.tar.gz";
diff --git a/Source/cmCTest.h b/Source/cmCTest.h
index 345b538..1ee002a 100644
--- a/Source/cmCTest.h
+++ b/Source/cmCTest.h
@@ -50,6 +50,7 @@ public:
     PartNotes,
     PartExtraFiles,
     PartUpload,
+    PartDone,
     PartCount // Update names in constructor when adding a part
   };
 
@@ -373,6 +374,9 @@ public:
   /** Create XML file that contains all the notes specified */
   int GenerateNotesFile(const VectorOfStrings& files);
 
+  /** Create XML file to indicate that build is complete */
+  int GenerateDoneFile();
+
   /** Submit extra files to the server */
   bool SubmitExtraFiles(const char* files);
   bool SubmitExtraFiles(const VectorOfStrings& files);
@@ -405,6 +409,10 @@ public:
   int GetDartVersion() { return this->DartVersion; }
   int GetDropSiteCDash() { return this->DropSiteCDash; }
 
+  /** The Build ID is assigned by CDash */
+  void SetBuildID(const std::string& id) { this->BuildID = id; }
+  std::string GetBuildID() { return this->BuildID; }
+
   /** Add file to be submitted */
   void AddSubmitFile(Part part, const char* name);
   std::vector<std::string> const& GetSubmitFiles(Part part)
@@ -607,6 +615,8 @@ private:
   int DartVersion;
   bool DropSiteCDash;
 
+  std::string BuildID;
+
   std::vector<std::string> InitialCommandLineArguments;
 
   int SubmitIndex;
diff --git a/Tests/RunCMake/ctest_submit/PARTSDone-result.txt b/Tests/RunCMake/ctest_submit/PARTSDone-result.txt
new file mode 100644
index 0000000..b57e2de
--- /dev/null
+++ b/Tests/RunCMake/ctest_submit/PARTSDone-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/ctest_submit/PARTSDone-stderr.txt b/Tests/RunCMake/ctest_submit/PARTSDone-stderr.txt
new file mode 100644
index 0000000..0020a0f
--- /dev/null
+++ b/Tests/RunCMake/ctest_submit/PARTSDone-stderr.txt
@@ -0,0 +1,3 @@
+ *Error when uploading file: .*/Done.xml
+ *Error message was: ([Cc]ould *n.t resolve host:? '?-no-site-'?.*|The requested URL returned error:.*)
+ *Problems when submitting via HTTP
diff --git a/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake b/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake
index 952368d..178f0cb 100644
--- a/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake
@@ -24,6 +24,7 @@ run_ctest_submit(BadFILES FILES bad-file)
 run_ctest_submit(RepeatRETURN_VALUE RETURN_VALUE res RETURN_VALUE res)
 run_ctest_submit(PARTSCDashUpload PARTS Configure CDASH_UPLOAD)
 run_ctest_submit(PARTSCDashUploadType PARTS Configure CDASH_UPLOAD_TYPE)
+run_ctest_submit(PARTSDone PARTS Done)
 run_ctest_submit(CDashUploadPARTS CDASH_UPLOAD bad-upload PARTS)
 run_ctest_submit(CDashUploadFILES CDASH_UPLOAD bad-upload FILES)
 run_ctest_submit(CDashUploadNone CDASH_UPLOAD)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f460bbd4c8afab56f93b9831f1f4d8336480fcc5
commit f460bbd4c8afab56f93b9831f1f4d8336480fcc5
Author:     Betsy McPhail <betsy.mcphail at kitware.com>
AuthorDate: Thu Oct 4 11:34:27 2018 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Oct 10 06:55:05 2018 -0400

    ctest_submit: Refactor file list to use a vector instead of a set
    
    Remove duplicates in a way that preserves order.

diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index ecf309a..38b5411 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -12,6 +12,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+#include "cmAlgorithms.h"
 #include "cmCTest.h"
 #include "cmCTestCurl.h"
 #include "cmCTestScriptHandler.h"
@@ -152,10 +153,9 @@ void cmCTestSubmitHandler::Initialize()
   this->Files.clear();
 }
 
-bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix,
-                                          const std::set<std::string>& files,
-                                          const std::string& remoteprefix,
-                                          const std::string& url)
+bool cmCTestSubmitHandler::SubmitUsingFTP(
+  const std::string& localprefix, const std::vector<std::string>& files,
+  const std::string& remoteprefix, const std::string& url)
 {
   CURL* curl;
   CURLcode res;
@@ -299,10 +299,9 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix,
 }
 
 // Uploading files is simpler
-bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
-                                           const std::set<std::string>& files,
-                                           const std::string& remoteprefix,
-                                           const std::string& url)
+bool cmCTestSubmitHandler::SubmitUsingHTTP(
+  const std::string& localprefix, const std::vector<std::string>& files,
+  const std::string& remoteprefix, const std::string& url)
 {
   CURL* curl;
   CURLcode res;
@@ -662,9 +661,9 @@ void cmCTestSubmitHandler::ParseResponse(
   }
 }
 
-bool cmCTestSubmitHandler::TriggerUsingHTTP(const std::set<std::string>& files,
-                                            const std::string& remoteprefix,
-                                            const std::string& url)
+bool cmCTestSubmitHandler::TriggerUsingHTTP(
+  const std::vector<std::string>& files, const std::string& remoteprefix,
+  const std::string& url)
 {
   CURL* curl;
   char error_buffer[1024];
@@ -792,11 +791,10 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(const std::set<std::string>& files,
   return true;
 }
 
-bool cmCTestSubmitHandler::SubmitUsingSCP(const std::string& scp_command,
-                                          const std::string& localprefix,
-                                          const std::set<std::string>& files,
-                                          const std::string& remoteprefix,
-                                          const std::string& url)
+bool cmCTestSubmitHandler::SubmitUsingSCP(
+  const std::string& scp_command, const std::string& localprefix,
+  const std::vector<std::string>& files, const std::string& remoteprefix,
+  const std::string& url)
 {
   if (scp_command.empty() || localprefix.empty() || files.empty() ||
       remoteprefix.empty() || url.empty()) {
@@ -890,7 +888,7 @@ bool cmCTestSubmitHandler::SubmitUsingSCP(const std::string& scp_command,
 }
 
 bool cmCTestSubmitHandler::SubmitUsingCP(const std::string& localprefix,
-                                         const std::set<std::string>& files,
+                                         const std::vector<std::string>& files,
                                          const std::string& remoteprefix,
                                          const std::string& destination)
 {
@@ -925,7 +923,7 @@ bool cmCTestSubmitHandler::SubmitUsingCP(const std::string& localprefix,
 
 #if defined(CTEST_USE_XMLRPC)
 bool cmCTestSubmitHandler::SubmitUsingXMLRPC(
-  const std::string& localprefix, const std::set<std::string>& files,
+  const std::string& localprefix, const std::vector<std::string>& files,
   const std::string& remoteprefix, const std::string& url)
 {
   xmlrpc_env env;
@@ -1020,7 +1018,7 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(
 }
 #else
 bool cmCTestSubmitHandler::SubmitUsingXMLRPC(
-  std::string const& /*unused*/, std::set<std::string> const& /*unused*/,
+  std::string const& /*unused*/, std::vector<std::string> const& /*unused*/,
   std::string const& /*unused*/, std::string const& /*unused*/)
 {
   return false;
@@ -1351,13 +1349,13 @@ int cmCTestSubmitHandler::ProcessHandler()
   cmGeneratedFileStream ofs;
   this->StartLogFile("Submit", ofs);
 
-  cmCTest::SetOfStrings files;
+  std::vector<std::string> files;
   std::string prefix = this->GetSubmitResultsPrefix();
 
   if (!this->Files.empty()) {
     // Submit the explicitly selected files:
     //
-    files.insert(this->Files.begin(), this->Files.end());
+    files.insert(files.end(), this->Files.begin(), this->Files.end());
   }
 
   // Add to the list of files to submit from any selected, existing parts:
@@ -1404,7 +1402,16 @@ int cmCTestSubmitHandler::ProcessHandler()
 
     // Submit files from this part.
     std::vector<std::string> const& pfiles = this->CTest->GetSubmitFiles(p);
-    files.insert(pfiles.begin(), pfiles.end());
+    files.insert(files.end(), pfiles.begin(), pfiles.end());
+  }
+
+  // Make sure files are unique, but preserve order.
+  {
+    // This endPos intermediate is needed to work around non-conformant C++11
+    // standard libraries that have erase(iterator,iterator) instead of
+    // erase(const_iterator,const_iterator).
+    size_t endPos = cmRemoveDuplicates(files) - files.cbegin();
+    files.erase(files.begin() + endPos, files.end());
   }
 
   if (ofs) {
diff --git a/Source/CTest/cmCTestSubmitHandler.h b/Source/CTest/cmCTestSubmitHandler.h
index b4d0e77..66f2173 100644
--- a/Source/CTest/cmCTestSubmitHandler.h
+++ b/Source/CTest/cmCTestSubmitHandler.h
@@ -57,27 +57,27 @@ private:
    * Submit file using various ways
    */
   bool SubmitUsingFTP(const std::string& localprefix,
-                      const std::set<std::string>& files,
+                      const std::vector<std::string>& files,
                       const std::string& remoteprefix, const std::string& url);
   bool SubmitUsingHTTP(const std::string& localprefix,
-                       const std::set<std::string>& files,
+                       const std::vector<std::string>& files,
                        const std::string& remoteprefix,
                        const std::string& url);
   bool SubmitUsingSCP(const std::string& scp_command,
                       const std::string& localprefix,
-                      const std::set<std::string>& files,
+                      const std::vector<std::string>& files,
                       const std::string& remoteprefix, const std::string& url);
 
   bool SubmitUsingCP(const std::string& localprefix,
-                     const std::set<std::string>& files,
+                     const std::vector<std::string>& files,
                      const std::string& remoteprefix, const std::string& url);
 
-  bool TriggerUsingHTTP(const std::set<std::string>& files,
+  bool TriggerUsingHTTP(const std::vector<std::string>& files,
                         const std::string& remoteprefix,
                         const std::string& url);
 
   bool SubmitUsingXMLRPC(const std::string& localprefix,
-                         const std::set<std::string>& files,
+                         const std::vector<std::string>& files,
                          const std::string& remoteprefix,
                          const std::string& url);
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=045b0beae13366420186337170d70e73ec96ebca
commit 045b0beae13366420186337170d70e73ec96ebca
Author:     Tomasz Słodkowicz <slodki at users.noreply.github.com>
AuthorDate: Thu Oct 4 23:57:24 2018 +0200
Commit:     Tomasz Słodkowicz <slodki at users.noreply.github.com>
CommitDate: Wed Oct 10 08:45:56 2018 +0200

    FindwxWidgets: implement detailed components status on Windows

diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake
index e61c84e..e366842 100644
--- a/Modules/FindwxWidgets.cmake
+++ b/Modules/FindwxWidgets.cmake
@@ -396,6 +396,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
           list(APPEND wxWidgets_LIBRARIES
             debug ${WX_${LIB}d} optimized ${WX_${LIB}}
             )
+          set(wxWidgets_${LIB}_FOUND TRUE)
         elseif(NOT wxWidgets_FIND_REQUIRED_${LIB})
           DBG_MSG_V("- ignored optional missing WX_${LIB}=${WX_${LIB}} or WX_${LIB}d=${WX_${LIB}d}")
         else()
@@ -410,6 +411,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
         if(WX_${LIB}${_DBG})
           DBG_MSG_V("Found ${LIB}${_DBG}")
           list(APPEND wxWidgets_LIBRARIES ${WX_${LIB}${_DBG}})
+          set(wxWidgets_${LIB}_FOUND TRUE)
         elseif(NOT wxWidgets_FIND_REQUIRED_${LIB})
           DBG_MSG_V("- ignored optional missing WX_${LIB}${_DBG}=${WX_${LIB}${_DBG}}")
         else()
@@ -978,10 +980,18 @@ DBG_MSG("wxWidgets_USE_FILE        : ${wxWidgets_USE_FILE}")
 
 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 
+# FIXME: set wxWidgets_<comp>_FOUND for wx-config branch
+#        and use HANDLE_COMPONENTS on Unix too
+if(wxWidgets_FIND_STYLE STREQUAL "win32")
+  set(wxWidgets_HANDLE_COMPONENTS "HANDLE_COMPONENTS")
+endif()
+
 find_package_handle_standard_args(wxWidgets
   REQUIRED_VARS wxWidgets_LIBRARIES wxWidgets_INCLUDE_DIRS
   VERSION_VAR   wxWidgets_VERSION_STRING
+  ${wxWidgets_HANDLE_COMPONENTS}
   )
+unset(wxWidgets_HANDLE_COMPONENTS)
 
 #=====================================================================
 # Macros for use in wxWidgets apps.

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0813581859bd61a9d30c97aa893030bea85f134e
commit 0813581859bd61a9d30c97aa893030bea85f134e
Author:     Tomasz Słodkowicz <slodki at users.noreply.github.com>
AuthorDate: Thu Oct 4 23:52:30 2018 +0200
Commit:     Tomasz Słodkowicz <slodki at users.noreply.github.com>
CommitDate: Thu Oct 4 23:52:30 2018 +0200

    FindwxWidgets: honor OPTIONAL_COMPONENTS

diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake
index f2d6285..e61c84e 100644
--- a/Modules/FindwxWidgets.cmake
+++ b/Modules/FindwxWidgets.cmake
@@ -12,7 +12,7 @@
 # modules that you will use, you need to name them as components to the
 # package:
 #
-# find_package(wxWidgets COMPONENTS core base ...)
+# find_package(wxWidgets COMPONENTS core base ... OPTIONAL_COMPONENTS net ...)
 #
 # There are two search branches: a windows style and a unix style.  For
 # windows, the following variables are searched for and set to defaults
@@ -89,7 +89,7 @@
 # ::
 #
 #    # Note that for MinGW users the order of libs is important!
-#    find_package(wxWidgets COMPONENTS net gl core base)
+#    find_package(wxWidgets COMPONENTS gl core base OPTIONAL_COMPONENTS net)
 #    if(wxWidgets_FOUND)
 #      include(${wxWidgets_USE_FILE})
 #      # and for each of your dependent executable/library targets:
@@ -102,7 +102,7 @@
 #
 # ::
 #
-#    find_package(wxWidgets REQUIRED net gl core base)
+#    find_package(wxWidgets REQUIRED gl core base OPTIONAL_COMPONENTS net)
 #    include(${wxWidgets_USE_FILE})
 #    # and for each of your dependent executable/library targets:
 #    target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES})
@@ -396,6 +396,8 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
           list(APPEND wxWidgets_LIBRARIES
             debug ${WX_${LIB}d} optimized ${WX_${LIB}}
             )
+        elseif(NOT wxWidgets_FIND_REQUIRED_${LIB})
+          DBG_MSG_V("- ignored optional missing WX_${LIB}=${WX_${LIB}} or WX_${LIB}d=${WX_${LIB}d}")
         else()
           DBG_MSG_V("- not found due to missing WX_${LIB}=${WX_${LIB}} or WX_${LIB}d=${WX_${LIB}d}")
           set(wxWidgets_FOUND FALSE)
@@ -408,9 +410,10 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
         if(WX_${LIB}${_DBG})
           DBG_MSG_V("Found ${LIB}${_DBG}")
           list(APPEND wxWidgets_LIBRARIES ${WX_${LIB}${_DBG}})
+        elseif(NOT wxWidgets_FIND_REQUIRED_${LIB})
+          DBG_MSG_V("- ignored optional missing WX_${LIB}${_DBG}=${WX_${LIB}${_DBG}}")
         else()
-          DBG_MSG_V(
-            "- not found due to missing WX_${LIB}${_DBG}=${WX_${LIB}${_DBG}}")
+          DBG_MSG_V("- not found due to missing WX_${LIB}${_DBG}=${WX_${LIB}${_DBG}}")
           set(wxWidgets_FOUND FALSE)
         endif()
       endforeach()
@@ -803,11 +806,24 @@ else()
       # - NOTE: wx-config doesn't verify that the libs requested exist
       #         it just produces the names. Maybe a TRY_COMPILE would
       #         be useful here...
-      string(REPLACE ";" ","
-        wxWidgets_FIND_COMPONENTS "${wxWidgets_FIND_COMPONENTS}")
+      unset(_cmp_req)
+      unset(_cmp_opt)
+      foreach(_cmp IN LISTS wxWidgets_FIND_COMPONENTS)
+        if(wxWidgets_FIND_REQUIRED_${_cmp})
+          list(APPEND _cmp_req "${_cmp}")
+        else()
+          list(APPEND _cmp_opt "${_cmp}")
+        endif()
+      endforeach()
+      DBG_MSG_V("wxWidgets required components : ${_cmp_req}")
+      DBG_MSG_V("wxWidgets optional components : ${_cmp_opt}")
+      if(DEFINED _cmp_opt)
+        string(REPLACE ";" "," _cmp_opt "--optional-libs ${_cmp_opt}")
+      endif()
+      string(REPLACE ";" "," _cmp_req "${_cmp_req}")
       execute_process(
         COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}"
-          ${wxWidgets_SELECT_OPTIONS} --libs ${wxWidgets_FIND_COMPONENTS}
+          ${wxWidgets_SELECT_OPTIONS} --libs ${_cmp_req} ${_cmp_opt}
         OUTPUT_VARIABLE wxWidgets_LIBRARIES
         RESULT_VARIABLE RET
         ERROR_QUIET
@@ -833,8 +849,10 @@ else()
 
       else()
         set(wxWidgets_FOUND FALSE)
-        DBG_MSG("${wxWidgets_CONFIG_EXECUTABLE} --libs ${wxWidgets_FIND_COMPONENTS} FAILED with RET=${RET}")
+        DBG_MSG("${wxWidgets_CONFIG_EXECUTABLE} --libs ${_cmp_req} ${_cmp_opt} FAILED with RET=${RET}")
       endif()
+      unset(_cmp_req)
+      unset(_cmp_opt)
     endif()
 
     # When using wx-config in MSYS, the include paths are UNIX style paths which may or may

-----------------------------------------------------------------------

Summary of changes:
 Help/command/ctest_submit.rst                      |  1 +
 Help/release/dev/ctest-done.rst                    |  5 ++
 Modules/FindwxWidgets.cmake                        | 46 ++++++++++++----
 Source/CTest/cmCTestSubmitHandler.cxx              | 61 ++++++++++++++--------
 Source/CTest/cmCTestSubmitHandler.h                | 12 ++---
 Source/cmCTest.cxx                                 | 21 ++++++++
 Source/cmCTest.h                                   | 10 ++++
 ...ETURN_VALUE-result.txt => PARTSDone-result.txt} |  0
 ...SubmitQuiet-stderr.txt => PARTSDone-stderr.txt} |  2 +-
 Tests/RunCMake/ctest_submit/RunCMakeTest.cmake     |  1 +
 10 files changed, 121 insertions(+), 38 deletions(-)
 create mode 100644 Help/release/dev/ctest-done.rst
 copy Tests/RunCMake/ctest_submit/{RepeatRETURN_VALUE-result.txt => PARTSDone-result.txt} (100%)
 copy Tests/RunCMake/ctest_submit/{CDashSubmitQuiet-stderr.txt => PARTSDone-stderr.txt} (75%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list