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 bcc9ea2b3d9cd3b882dbb2a23502b0392cb21d1b (commit) via ad2ed96a85ff2548222093723b923305732a79cb (commit) via 4b017d579d00f1d4d032eda7e179f57bdd1da080 (commit) via 97700e9f5b17b1631f6bfef4fec62dad88dc9319 (commit) via ab3b549ee0dcd79607f8347a9b69c9b029590fbd (commit) via 5ff7fb592e5b9c5a6a0f05055a2bde5623e8cc54 (commit) from cb7fbf1dbbcc88fc7701250db5c3ccdf0ab7396e (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=bcc9ea2b3d9cd3b882dbb2a23502b0392cb21d1b commit bcc9ea2b3d9cd3b882dbb2a23502b0392cb21d1b Merge: ad2ed96 ab3b549 Author: Brad King <brad.k...@kitware.com> AuthorDate: Tue Jan 22 14:41:09 2019 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Tue Jan 22 09:41:23 2019 -0500 Merge topic 'crosscompiling_emulator-fix' ab3b549ee0 CROSSCOMPILING_EMULATOR: Fix test generation for empty value Acked-by: Kitware Robot <kwro...@kitware.com> Merge-request: !2834 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ad2ed96a85ff2548222093723b923305732a79cb commit ad2ed96a85ff2548222093723b923305732a79cb Merge: 4b017d5 97700e9 Author: Brad King <brad.k...@kitware.com> AuthorDate: Tue Jan 22 14:40:33 2019 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Tue Jan 22 09:40:39 2019 -0500 Merge topic 'findgit-imported-target' 97700e9f5b FindGit: Add imported target Acked-by: Kitware Robot <kwro...@kitware.com> Merge-request: !2790 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4b017d579d00f1d4d032eda7e179f57bdd1da080 commit 4b017d579d00f1d4d032eda7e179f57bdd1da080 Merge: cb7fbf1 5ff7fb5 Author: Brad King <brad.k...@kitware.com> AuthorDate: Tue Jan 22 14:38:24 2019 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Tue Jan 22 09:38:30 2019 -0500 Merge topic 'Wcomma' 5ff7fb592e Fixed all but one clang -Wcomma warning Acked-by: Kitware Robot <kwro...@kitware.com> Merge-request: !2828 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=97700e9f5b17b1631f6bfef4fec62dad88dc9319 commit 97700e9f5b17b1631f6bfef4fec62dad88dc9319 Author: Kyle Edwards <kyle.edwa...@kitware.com> AuthorDate: Fri Jan 11 12:01:10 2019 -0500 Commit: Kyle Edwards <kyle.edwa...@kitware.com> CommitDate: Mon Jan 21 10:01:56 2019 -0500 FindGit: Add imported target diff --git a/Help/release/dev/findgit-imported-target.rst b/Help/release/dev/findgit-imported-target.rst new file mode 100644 index 0000000..cabbae5 --- /dev/null +++ b/Help/release/dev/findgit-imported-target.rst @@ -0,0 +1,5 @@ +findgit-imported-target +----------------------- + +* The :module:`FindGit` module now provides an ``IMPORTED`` target for the Git + executable. diff --git a/Modules/FindGit.cmake b/Modules/FindGit.cmake index c447a1a..900e4f5 100644 --- a/Modules/FindGit.cmake +++ b/Modules/FindGit.cmake @@ -5,6 +5,11 @@ FindGit ------- +The module defines the following ``IMPORTED`` targets: + +``Git::Git`` + Executable of the Git command-line client. + The module defines the following variables: ``GIT_EXECUTABLE`` @@ -78,6 +83,12 @@ if(GIT_EXECUTABLE) string(REPLACE "git version " "" GIT_VERSION_STRING "${git_version}") endif() unset(git_version) + + get_property(_findgit_role GLOBAL PROPERTY CMAKE_ROLE) + if(_findgit_role STREQUAL "PROJECT" AND NOT TARGET Git::Git) + add_executable(Git::Git IMPORTED) + set_property(TARGET Git::Git PROPERTY IMPORTED_LOCATION "${GIT_EXECUTABLE}") + endif() endif() include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 86f4c56..c1703cc 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1437,6 +1437,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release add_subdirectory(FindGIF) endif() + if(CMake_TEST_FindGit) + add_subdirectory(FindGit) + endif() + if(CMake_TEST_FindGSL) add_subdirectory(FindGSL) endif() diff --git a/Tests/FindGit/CMakeLists.txt b/Tests/FindGit/CMakeLists.txt new file mode 100644 index 0000000..5d061f4 --- /dev/null +++ b/Tests/FindGit/CMakeLists.txt @@ -0,0 +1,10 @@ +add_test(NAME FindGit.Test COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindGit/Test" + "${CMake_BINARY_DIR}/Tests/FindGit/Test" + ${build_generator_args} + --build-project TestFindGit + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) diff --git a/Tests/FindGit/Test/CMakeLists.txt b/Tests/FindGit/Test/CMakeLists.txt new file mode 100644 index 0000000..26fb372 --- /dev/null +++ b/Tests/FindGit/Test/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.12) +project(TestFindGit NONE) +include(CTest) + +find_package(Git REQUIRED) + +add_test(NAME test_git + COMMAND ${CMAKE_COMMAND} + "-DGIT_EXECUTABLE=${GIT_EXECUTABLE}" + "-DGIT_EXECUTABLE_TARGET=$<TARGET_FILE:Git::Git>" + "-DGIT_VERSION_STRING=${GIT_VERSION_STRING}" + -P "${CMAKE_CURRENT_LIST_DIR}/RunGit.cmake" + ) diff --git a/Tests/FindGit/Test/RunGit.cmake b/Tests/FindGit/Test/RunGit.cmake new file mode 100644 index 0000000..f798cd3 --- /dev/null +++ b/Tests/FindGit/Test/RunGit.cmake @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.12) + +function(run_git exe exe_display) + execute_process(COMMAND ${exe} --version + OUTPUT_VARIABLE output + OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE result + ) + + if(NOT result EQUAL 0) + message(SEND_ERROR "Result of ${exe_display} --version is ${result}, should be 0") + endif() + + if(NOT output STREQUAL "git version ${GIT_VERSION_STRING}") + message(SEND_ERROR "Output of ${exe_display} --version is \"${output}\", should be \"git version ${GIT_VERSION_STRING}\"") + endif() +endfunction() + +run_git("${GIT_EXECUTABLE}" "\${GIT_EXECUTABLE}") +run_git("${GIT_EXECUTABLE_TARGET}" "Git::Git") https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ab3b549ee0dcd79607f8347a9b69c9b029590fbd commit ab3b549ee0dcd79607f8347a9b69c9b029590fbd Author: Kyle Edwards <kyle.edwa...@kitware.com> AuthorDate: Mon Jan 21 09:57:25 2019 -0500 Commit: Kyle Edwards <kyle.edwa...@kitware.com> CommitDate: Mon Jan 21 09:57:25 2019 -0500 CROSSCOMPILING_EMULATOR: Fix test generation for empty value If CROSSCOMPILING_EMULATOR was set to an empty string, and a test was generated with the executable as the command, CMake would segfault upon trying to generate the test file. Fix this. Fixes: #18819 diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx index 1e2ddc7..6032701 100644 --- a/Source/cmTestGenerator.cxx +++ b/Source/cmTestGenerator.cxx @@ -90,7 +90,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os, // Prepend with the emulator when cross compiling if required. const char* emulator = target->GetProperty("CROSSCOMPILING_EMULATOR"); - if (emulator != nullptr) { + if (emulator != nullptr && *emulator) { std::vector<std::string> emulatorWithArgs; cmSystemTools::ExpandListArgument(emulator, emulatorWithArgs); std::string emulatorExe(emulatorWithArgs[0]); diff --git a/Tests/RunCMake/CrosscompilingEmulator/CrosscompilingEmulatorProperty.cmake b/Tests/RunCMake/CrosscompilingEmulator/CrosscompilingEmulatorProperty.cmake index 1aeb510..2fdefc4 100644 --- a/Tests/RunCMake/CrosscompilingEmulator/CrosscompilingEmulatorProperty.cmake +++ b/Tests/RunCMake/CrosscompilingEmulator/CrosscompilingEmulatorProperty.cmake @@ -26,3 +26,9 @@ get_property(emulator TARGET target_without_emulator if(NOT "${emulator}" STREQUAL "") message(SEND_ERROR "Default CROSSCOMPILING_EMULATOR property not set to null") endif() + +add_executable(target_with_empty_emulator simple_src_exiterror.cxx) +set_property(TARGET target_with_empty_emulator PROPERTY CROSSCOMPILING_EMULATOR "") + +enable_testing() +add_test(NAME test_target_with_empty_emulator COMMAND target_with_empty_emulator) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5ff7fb592e5b9c5a6a0f05055a2bde5623e8cc54 commit 5ff7fb592e5b9c5a6a0f05055a2bde5623e8cc54 Author: Sean McBride <s...@rogue-research.com> AuthorDate: Fri Jan 11 20:48:19 2019 -0500 Commit: Sean McBride <s...@rogue-research.com> CommitDate: Fri Jan 11 20:48:19 2019 -0500 Fixed all but one clang -Wcomma warning diff --git a/Source/CTest/cmCTestCVS.cxx b/Source/CTest/cmCTestCVS.cxx index 4fb3273..6e1ada1 100644 --- a/Source/CTest/cmCTestCVS.cxx +++ b/Source/CTest/cmCTestCVS.cxx @@ -111,8 +111,8 @@ public: , Revisions(revs) , Section(SectionHeader) { - this->SetLog(&cvs->Log, prefix), - this->RegexRevision.compile("^revision +([^ ]*) *$"); + this->SetLog(&cvs->Log, prefix); + this->RegexRevision.compile("^revision +([^ ]*) *$"); this->RegexBranches.compile("^branches: .*$"); this->RegexPerson.compile("^date: +([^;]+); +author: +([^;]+);"); } diff --git a/Source/cmExecProgramCommand.cxx b/Source/cmExecProgramCommand.cxx index ea4cd40..e7f8a01 100644 --- a/Source/cmExecProgramCommand.cxx +++ b/Source/cmExecProgramCommand.cxx @@ -217,7 +217,7 @@ bool cmExecProgramCommand::RunCommand(const char* command, std::string& output, int p; cmProcessOutput processOutput(encoding); std::string strdata; - while ((p = cmsysProcess_WaitForData(cp, &data, &length, nullptr), p)) { + while ((p = cmsysProcess_WaitForData(cp, &data, &length, nullptr))) { if (p == cmsysProcess_Pipe_STDOUT || p == cmsysProcess_Pipe_STDERR) { if (verbose) { processOutput.DecodeText(data, length, strdata); diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx index 679a648..b549776 100644 --- a/Source/cmExecuteProcessCommand.cxx +++ b/Source/cmExecuteProcessCommand.cxx @@ -244,7 +244,7 @@ bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args, int p; cmProcessOutput processOutput(encoding); std::string strdata; - while ((p = cmsysProcess_WaitForData(cp, &data, &length, nullptr), p)) { + while ((p = cmsysProcess_WaitForData(cp, &data, &length, nullptr))) { // Put the output in the right place. if (p == cmsysProcess_Pipe_STDOUT && !output_quiet) { if (output_variable.empty()) { diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index d6ab769..068cf5e 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -176,12 +176,14 @@ cmGlobalGenerator* cmGlobalXCodeGenerator::Factory::CreateGlobalGenerator( std::string versionFile; { std::string out; - std::string::size_type pos = 0; - if (cmSystemTools::RunSingleCommand("xcode-select --print-path", &out, - nullptr, nullptr, nullptr, - cmSystemTools::OUTPUT_NONE) && - (pos = out.find(".app/"), pos != std::string::npos)) { - versionFile = out.substr(0, pos + 5) + "Contents/version.plist"; + bool commandResult = cmSystemTools::RunSingleCommand( + "xcode-select --print-path", &out, nullptr, nullptr, nullptr, + cmSystemTools::OUTPUT_NONE); + if (commandResult) { + std::string::size_type pos = out.find(".app/"); + if (pos != std::string::npos) { + versionFile = out.substr(0, pos + 5) + "Contents/version.plist"; + } } } if (!versionFile.empty() && cmSystemTools::FileExists(versionFile.c_str())) { diff --git a/Source/cmProcessTools.cxx b/Source/cmProcessTools.cxx index facde5d..a2bc16f 100644 --- a/Source/cmProcessTools.cxx +++ b/Source/cmProcessTools.cxx @@ -16,7 +16,7 @@ void cmProcessTools::RunProcess(struct cmsysProcess_s* cp, OutputParser* out, cmProcessOutput processOutput(encoding); std::string strdata; while ((out || err) && - (p = cmsysProcess_WaitForData(cp, &data, &length, nullptr), p)) { + (p = cmsysProcess_WaitForData(cp, &data, &length, nullptr))) { if (out && p == cmsysProcess_Pipe_STDOUT) { processOutput.DecodeText(data, length, strdata, 1); if (!out->Process(strdata.c_str(), int(strdata.size()))) { ----------------------------------------------------------------------- Summary of changes: Help/release/dev/findgit-imported-target.rst | 5 +++++ Modules/FindGit.cmake | 11 +++++++++++ Source/CTest/cmCTestCVS.cxx | 4 ++-- Source/cmExecProgramCommand.cxx | 2 +- Source/cmExecuteProcessCommand.cxx | 2 +- Source/cmGlobalXCodeGenerator.cxx | 14 ++++++++------ Source/cmProcessTools.cxx | 2 +- Source/cmTestGenerator.cxx | 2 +- Tests/CMakeLists.txt | 4 ++++ Tests/{FindICU => FindGit}/CMakeLists.txt | 8 ++++---- Tests/FindGit/Test/CMakeLists.txt | 13 +++++++++++++ Tests/FindGit/Test/RunGit.cmake | 20 ++++++++++++++++++++ .../CrosscompilingEmulatorProperty.cmake | 6 ++++++ 13 files changed, 77 insertions(+), 16 deletions(-) create mode 100644 Help/release/dev/findgit-imported-target.rst copy Tests/{FindICU => FindGit}/CMakeLists.txt (55%) create mode 100644 Tests/FindGit/Test/CMakeLists.txt create mode 100644 Tests/FindGit/Test/RunGit.cmake hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org https://cmake.org/mailman/listinfo/cmake-commits