From kwrobot at kitware.com Fri Jun 1 00:05:12 2018 From: kwrobot at kitware.com (Kitware Robot) Date: Fri, 1 Jun 2018 00:05:12 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.11.3-868-g6292873 Message-ID: <20180601040514.4F720111812@public.kitware.com> 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 629287304565de8711b9fa6982bdf83c3f443e55 (commit) from e4f170b1967738ddd56f1c21a23559af532291ea (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=629287304565de8711b9fa6982bdf83c3f443e55 commit 629287304565de8711b9fa6982bdf83c3f443e55 Author: Kitware Robot AuthorDate: Fri Jun 1 00:01:05 2018 -0400 Commit: Kitware Robot CommitDate: Fri Jun 1 00:01:05 2018 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 0171ae8..a717d6a 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 11) -set(CMake_VERSION_PATCH 20180531) +set(CMake_VERSION_PATCH 20180601) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Fri Jun 1 09:55:07 2018 From: kwrobot at kitware.com (Kitware Robot) Date: Fri, 1 Jun 2018 09:55:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.11.3-880-gb671e47 Message-ID: <20180601135507.2BC51111F65@public.kitware.com> 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 b671e4799f0e418448681a21120e8e87a97de5dc (commit) via 4144b78013448f01360cabedd92426bb177a94b7 (commit) via 5ba76299f8bc3d13a1a3a5542c46cf7c438be675 (commit) via b1662b1f96b0e74d2c21b1532be63e773eaae881 (commit) via 86121ffd1c38531e7137bfb25d7c47b2ca9b56c9 (commit) via bbbcbb1a48b22a581f8793ac2b6ca549b388ed2f (commit) via 1c5b1ad4088fc98287448a68771ec2601174a392 (commit) via 6a64292fa722c15b8af63e3b0b4dcef5dbfacc8e (commit) via 1c87844856f7995bccc30c32567540be948f80da (commit) via 5852acffa4b67a614df3343bcb29e6b9511d0704 (commit) via 41685c8ba0902cff1241886d966e796cecb82ae3 (commit) via 2930a198f610e729d73df6771d70119adac6df2e (commit) from 629287304565de8711b9fa6982bdf83c3f443e55 (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=b671e4799f0e418448681a21120e8e87a97de5dc commit b671e4799f0e418448681a21120e8e87a97de5dc Merge: 4144b78 86121ff Author: Brad King AuthorDate: Fri Jun 1 13:48:21 2018 +0000 Commit: Kitware Robot CommitDate: Fri Jun 1 09:50:18 2018 -0400 Merge topic 'update-prebuilt-openssl' 86121ffd1c Utilities/Release: Update to openssl-1.1.0h Acked-by: Kitware Robot Merge-request: !2119 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4144b78013448f01360cabedd92426bb177a94b7 commit 4144b78013448f01360cabedd92426bb177a94b7 Merge: 5ba7629 5852acf Author: Brad King AuthorDate: Fri Jun 1 13:48:56 2018 +0000 Commit: Kitware Robot CommitDate: Fri Jun 1 09:49:37 2018 -0400 Merge topic 'autogen_autorcc_multi_config' 5852acffa4 Autogen: Add AUTORCC configuration change test 41685c8ba0 Autogen: Let AUTORCC generate output for all configurations 2930a198f6 Autogen: Add lock file to AUTORCC commands Acked-by: Kitware Robot Merge-request: !2117 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5ba76299f8bc3d13a1a3a5542c46cf7c438be675 commit 5ba76299f8bc3d13a1a3a5542c46cf7c438be675 Merge: b1662b1 bbbcbb1 Author: Brad King AuthorDate: Fri Jun 1 13:48:09 2018 +0000 Commit: Kitware Robot CommitDate: Fri Jun 1 09:48:51 2018 -0400 Merge topic 'nolint_typedef_testdriver' bbbcbb1a48 TestDriver: Disable clang-tidy 'modernize-use-using' Acked-by: Kitware Robot Merge-request: !2118 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b1662b1f96b0e74d2c21b1532be63e773eaae881 commit b1662b1f96b0e74d2c21b1532be63e773eaae881 Merge: 6292873 1c5b1ad Author: Brad King AuthorDate: Fri Jun 1 13:47:53 2018 +0000 Commit: Kitware Robot CommitDate: Fri Jun 1 09:48:04 2018 -0400 Merge topic 'alsa-target' 1c5b1ad408 FindALSA: add testcase 6a64292fa7 FindALSA: reformat docs 1c87844856 FindALSA: provide an imported target Acked-by: Kitware Robot Merge-request: !2112 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=86121ffd1c38531e7137bfb25d7c47b2ca9b56c9 commit 86121ffd1c38531e7137bfb25d7c47b2ca9b56c9 Author: Brad King AuthorDate: Thu May 31 11:24:41 2018 -0400 Commit: Brad King CommitDate: Thu May 31 11:24:41 2018 -0400 Utilities/Release: Update to openssl-1.1.0h Update the prebuilt binary build configurations for machines where we build our own OpenSSL library to use a newer version. diff --git a/Utilities/Release/linux64_release.cmake b/Utilities/Release/linux64_release.cmake index 2fd4f12..04a74ac 100644 --- a/Utilities/Release/linux64_release.cmake +++ b/Utilities/Release/linux64_release.cmake @@ -29,9 +29,9 @@ CURSES_LIBRARY:FILEPATH=/home/kitware/ncurses-5.9/lib/libncurses.a CURSES_INCLUDE_PATH:PATH=/home/kitware/ncurses-5.9/include FORM_LIBRARY:FILEPATH=/home/kitware/ncurses-5.9/lib/libform.a CMAKE_USE_OPENSSL:BOOL=ON -OPENSSL_CRYPTO_LIBRARY:STRING=/home/kitware/openssl-1.1.0g/lib/libcrypto.a;-pthread -OPENSSL_INCLUDE_DIR:PATH=/home/kitware/openssl-1.1.0g/include -OPENSSL_SSL_LIBRARY:FILEPATH=/home/kitware/openssl-1.1.0g/lib/libssl.a +OPENSSL_CRYPTO_LIBRARY:STRING=/home/kitware/openssl-1.1.0h/lib/libcrypto.a;-pthread +OPENSSL_INCLUDE_DIR:PATH=/home/kitware/openssl-1.1.0h/include +OPENSSL_SSL_LIBRARY:FILEPATH=/home/kitware/openssl-1.1.0h/lib/libssl.a PYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 CPACK_SYSTEM_NAME:STRING=Linux-x86_64 BUILD_QtDialog:BOOL=TRUE https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bbbcbb1a48b22a581f8793ac2b6ca549b388ed2f commit bbbcbb1a48b22a581f8793ac2b6ca549b388ed2f Author: Sylvain Joubert AuthorDate: Thu May 31 13:51:40 2018 +0200 Commit: Sylvain Joubert CommitDate: Thu May 31 13:51:40 2018 +0200 TestDriver: Disable clang-tidy 'modernize-use-using' diff --git a/Templates/TestDriver.cxx.in b/Templates/TestDriver.cxx.in index ff3c869..d71f290 100644 --- a/Templates/TestDriver.cxx.in +++ b/Templates/TestDriver.cxx.in @@ -20,8 +20,8 @@ /* Create map. */ -typedef int (*MainFuncPointer)(int, char* []); -typedef struct +typedef int (*MainFuncPointer)(int, char* []); /* NOLINT */ +typedef struct /* NOLINT */ { const char* name; MainFuncPointer func; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1c5b1ad4088fc98287448a68771ec2601174a392 commit 1c5b1ad4088fc98287448a68771ec2601174a392 Author: Rolf Eike Beer AuthorDate: Thu May 31 09:35:00 2018 +0200 Commit: Rolf Eike Beer CommitDate: Thu May 31 09:35:53 2018 +0200 FindALSA: add testcase diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 0e94388..886e392 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1368,6 +1368,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release endif() endif() + if(CMake_TEST_FindALSA) + add_subdirectory(FindALSA) + endif() + if(CMake_TEST_CUDA) add_subdirectory(Cuda) add_subdirectory(CudaOnly) diff --git a/Tests/FindALSA/CMakeLists.txt b/Tests/FindALSA/CMakeLists.txt new file mode 100644 index 0000000..891f7a4 --- /dev/null +++ b/Tests/FindALSA/CMakeLists.txt @@ -0,0 +1,10 @@ +add_test(NAME FindALSA.Test COMMAND + ${CMAKE_CTEST_COMMAND} -C $ + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindALSA/Test" + "${CMake_BINARY_DIR}/Tests/FindALSA/Test" + ${build_generator_args} + --build-project TestFindALSA + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $ + ) diff --git a/Tests/FindALSA/Test/CMakeLists.txt b/Tests/FindALSA/Test/CMakeLists.txt new file mode 100644 index 0000000..2829740 --- /dev/null +++ b/Tests/FindALSA/Test/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.10) +project(TestFindALSA C) +include(CTest) + +find_package(ALSA REQUIRED) + +add_definitions(-DCMAKE_EXPECTED_ALSA_VERSION="${ALSA_VERSION_STRING}") + +add_executable(test_tgt main.c) +target_link_libraries(test_tgt ALSA::ALSA) +add_test(NAME test_tgt COMMAND test_tgt) + +add_executable(test_var main.c) +target_include_directories(test_var PRIVATE ${ALSA_INCLUDE_DIRS}) +target_link_libraries(test_var PRIVATE ${ALSA_LIBRARIES}) +add_test(NAME test_var COMMAND test_var) diff --git a/Tests/FindALSA/Test/main.c b/Tests/FindALSA/Test/main.c new file mode 100644 index 0000000..d3303d0 --- /dev/null +++ b/Tests/FindALSA/Test/main.c @@ -0,0 +1,10 @@ +#include +#include +#include + +int main() +{ + printf("Found ALSA version %s, expected version %s\n", + snd_asoundlib_version(), CMAKE_EXPECTED_ALSA_VERSION); + return strcmp(snd_asoundlib_version(), CMAKE_EXPECTED_ALSA_VERSION); +} https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6a64292fa722c15b8af63e3b0b4dcef5dbfacc8e commit 6a64292fa722c15b8af63e3b0b4dcef5dbfacc8e Author: Rolf Eike Beer AuthorDate: Mon May 28 15:52:08 2018 +0200 Commit: Rolf Eike Beer CommitDate: Thu May 31 09:35:53 2018 +0200 FindALSA: reformat docs diff --git a/Modules/FindALSA.cmake b/Modules/FindALSA.cmake index 84b6ec5..c9cfd60 100644 --- a/Modules/FindALSA.cmake +++ b/Modules/FindALSA.cmake @@ -18,20 +18,27 @@ # Result Variables # ^^^^^^^^^^^^^^^^ # -# :: +# This module defines the following variables: # -# This module defines the following variables: -# ALSA_FOUND - True if ALSA_INCLUDE_DIR & ALSA_LIBRARY are found -# ALSA_LIBRARIES - Set when ALSA_LIBRARY is found -# ALSA_INCLUDE_DIRS - Set when ALSA_INCLUDE_DIR is found +# ``ALSA_FOUND`` +# True if ALSA_INCLUDE_DIR & ALSA_LIBRARY are found # +# ``ALSA_LIBRARIES`` +# List of libraries when using ALSA. # +# ``ALSA_INCLUDE_DIRS`` +# Where to find the ALSA headers. # -# :: +# Cache variables +# ^^^^^^^^^^^^^^^ # -# ALSA_INCLUDE_DIR - where to find asoundlib.h, etc. -# ALSA_LIBRARY - the asound library -# ALSA_VERSION_STRING - the version of alsa found (since CMake 2.8.8) +# The following cache variables may also be set: +# +# ``ALSA_INCLUDE_DIR`` +# the ALSA include directory +# +# ``ALSA_LIBRARY`` +# the absolute path of the asound library find_path(ALSA_INCLUDE_DIR NAMES alsa/asoundlib.h DOC "The ALSA (asound) include directory" https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1c87844856f7995bccc30c32567540be948f80da commit 1c87844856f7995bccc30c32567540be948f80da Author: Rolf Eike Beer AuthorDate: Mon May 28 15:47:23 2018 +0200 Commit: Rolf Eike Beer CommitDate: Thu May 31 09:35:53 2018 +0200 FindALSA: provide an imported target diff --git a/Help/release/dev/alsa-target.rst b/Help/release/dev/alsa-target.rst new file mode 100644 index 0000000..e970580 --- /dev/null +++ b/Help/release/dev/alsa-target.rst @@ -0,0 +1,4 @@ +alsa-target +----------- + +* The :module:`FindALSA` module now provides imported targets. diff --git a/Modules/FindALSA.cmake b/Modules/FindALSA.cmake index fa9a434..84b6ec5 100644 --- a/Modules/FindALSA.cmake +++ b/Modules/FindALSA.cmake @@ -9,6 +9,15 @@ # # Find the alsa libraries (asound) # +# IMPORTED Targets +# ^^^^^^^^^^^^^^^^ +# +# This module defines :prop_tgt:`IMPORTED` target ``ALSA::ALSA``, if +# ALSA has been found. +# +# Result Variables +# ^^^^^^^^^^^^^^^^ +# # :: # # This module defines the following variables: @@ -47,6 +56,11 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(ALSA if(ALSA_FOUND) set( ALSA_LIBRARIES ${ALSA_LIBRARY} ) set( ALSA_INCLUDE_DIRS ${ALSA_INCLUDE_DIR} ) + if(NOT TARGET ALSA::ALSA) + add_library(ALSA::ALSA UNKNOWN IMPORTED) + set_target_properties(ALSA::ALSA PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${ALSA_INCLUDE_DIRS}") + set_property(TARGET ALSA::ALSA APPEND PROPERTY IMPORTED_LOCATION "${ALSA_LIBRARY}") + endif() endif() mark_as_advanced(ALSA_INCLUDE_DIR ALSA_LIBRARY) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5852acffa4b67a614df3343bcb29e6b9511d0704 commit 5852acffa4b67a614df3343bcb29e6b9511d0704 Author: Sebastian Holtermann AuthorDate: Fri May 25 11:40:23 2018 +0200 Commit: Sebastian Holtermann CommitDate: Wed May 30 17:45:01 2018 +0200 Autogen: Add AUTORCC configuration change test diff --git a/Tests/QtAutogen/CommonTests.cmake b/Tests/QtAutogen/CommonTests.cmake index 982a296..cd05aeb 100644 --- a/Tests/QtAutogen/CommonTests.cmake +++ b/Tests/QtAutogen/CommonTests.cmake @@ -43,3 +43,4 @@ if(NOT QT_TEST_VERSION STREQUAL 4) ADD_AUTOGEN_TEST(RerunMocPlugin) endif() ADD_AUTOGEN_TEST(RerunRccDepends) +ADD_AUTOGEN_TEST(RerunRccConfigChange) diff --git a/Tests/QtAutogen/RerunRccConfigChange/CMakeLists.txt b/Tests/QtAutogen/RerunRccConfigChange/CMakeLists.txt new file mode 100644 index 0000000..f09865d --- /dev/null +++ b/Tests/QtAutogen/RerunRccConfigChange/CMakeLists.txt @@ -0,0 +1,41 @@ +cmake_minimum_required(VERSION 3.11.2) +project(RerunRccConfigChange) +include("../AutogenTest.cmake") + +# Tests rcc rebuilding after a configuration change + +# Dummy executable to generate a clean target +add_executable(dummy dummy.cpp) + +# When a .qrc or a file listed in a .qrc file changes, +# the target must be rebuilt +set(timeformat "%Y%j%H%M%S") +set(rccDepSD "${CMAKE_CURRENT_SOURCE_DIR}/RccConfigChange") +set(rccDepBD "${CMAKE_CURRENT_BINARY_DIR}/RccConfigChange") + +# Initial build +try_compile(RCC_DEPENDS + "${rccDepBD}" + "${rccDepSD}" + RccConfigChange + CMAKE_FLAGS "-DQT_TEST_VERSION=${QT_TEST_VERSION}" + "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}" + OUTPUT_VARIABLE output +) +if (NOT RCC_DEPENDS) + message(SEND_ERROR "Initial build of rccConfigChange failed. Output: ${output}") +endif() + +# - Rebuild Release +message("Rebuilding rccConfigChange in Release configuration") +execute_process(COMMAND "${CMAKE_COMMAND}" --build . --config Release WORKING_DIRECTORY "${rccDepBD}" RESULT_VARIABLE result) +if (result) + message(SEND_ERROR "Release build of rccConfigChange failed.") +endif() + +# - Rebuild Debug +message("Rebuilding rccConfigChange in Debug configuration") +execute_process(COMMAND "${CMAKE_COMMAND}" --build . --config Debug WORKING_DIRECTORY "${rccDepBD}" RESULT_VARIABLE result) +if (result) + message(SEND_ERROR "Debug build of rccConfigChange failed.") +endif() diff --git a/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/CMakeLists.txt b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/CMakeLists.txt new file mode 100644 index 0000000..3cddf5c --- /dev/null +++ b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.11.2) +project(RccConfigChange) +include("../../AutogenTest.cmake") + +# Enable AUTORCC for all targets +set(CMAKE_AUTORCC ON) + +# Initial resource files setup +configure_file(resGen/input1.txt.in resGen/input1.txt COPYONLY) +configure_file(resGen/input2.txt.in resGen/input2.txt COPYONLY) +configure_file(resGen.qrc.in resGen.qrc COPYONLY) + +# Generated qrc file with dependency +add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/resGen.qrc + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/resGen.qrc.in + COMMAND ${CMAKE_COMMAND} -E sleep 2 + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/resGen.qrc.in ${CMAKE_CURRENT_BINARY_DIR}/resGen.qrc +) + +# Target that uses a plain .qrc file +add_executable(rccConfigChangePlain main.cpp resPlain.qrc) +target_link_libraries(rccConfigChangePlain ${QT_QTCORE_TARGET}) + +# Target that uses a GENERATED .qrc file +add_executable(rccConfigChangeGen main.cpp ${CMAKE_CURRENT_BINARY_DIR}/resGen.qrc ) +target_link_libraries(rccConfigChangeGen ${QT_QTCORE_TARGET}) diff --git a/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/main.cpp b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/main.cpp new file mode 100644 index 0000000..766b775 --- /dev/null +++ b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/main.cpp @@ -0,0 +1,5 @@ + +int main() +{ + return 0; +} diff --git a/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resGen.qrc.in b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resGen.qrc.in new file mode 100644 index 0000000..9674772 --- /dev/null +++ b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resGen.qrc.in @@ -0,0 +1,6 @@ + + + resGen/input1.txt + resGen/input2.txt + + diff --git a/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resGen/input1.txt.in b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resGen/input1.txt.in new file mode 100644 index 0000000..4f24589 --- /dev/null +++ b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resGen/input1.txt.in @@ -0,0 +1 @@ +Generated resource input. diff --git a/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resGen/input2.txt.in b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resGen/input2.txt.in new file mode 100644 index 0000000..4f24589 --- /dev/null +++ b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resGen/input2.txt.in @@ -0,0 +1 @@ +Generated resource input. diff --git a/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resPlain.qrc b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resPlain.qrc new file mode 100644 index 0000000..e448726 --- /dev/null +++ b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resPlain.qrc @@ -0,0 +1,6 @@ + + + resPlain/input1.txt + resPlain/input2.txt + + diff --git a/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resPlain/input1.txt b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resPlain/input1.txt new file mode 100644 index 0000000..03969c6 --- /dev/null +++ b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resPlain/input1.txt @@ -0,0 +1 @@ +Plain resource input. diff --git a/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resPlain/input2.txt b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resPlain/input2.txt new file mode 100644 index 0000000..03969c6 --- /dev/null +++ b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resPlain/input2.txt @@ -0,0 +1 @@ +Plain resource input. diff --git a/Tests/QtAutogen/RerunRccConfigChange/dummy.cpp b/Tests/QtAutogen/RerunRccConfigChange/dummy.cpp new file mode 100644 index 0000000..4837a76 --- /dev/null +++ b/Tests/QtAutogen/RerunRccConfigChange/dummy.cpp @@ -0,0 +1,5 @@ + +int main(int argv, char** args) +{ + return 0; +} https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=41685c8ba0902cff1241886d966e796cecb82ae3 commit 41685c8ba0902cff1241886d966e796cecb82ae3 Author: Sebastian Holtermann AuthorDate: Wed May 30 17:23:23 2018 +0200 Commit: Sebastian Holtermann CommitDate: Wed May 30 17:45:01 2018 +0200 Autogen: Let AUTORCC generate output for all configurations For multi configuration generators let AUTORCC generate the rcc output for all configurations. This is a workaround for the incomplete `$` support in the DEPENDS and OUTPUT clauses of a custom_command/custom_target. Since we can't depend on the per-config rcc output file we somehow must ensure the successful rcc build for one configuration doesn't shadow the need to rcc rebuild for a second configuration. Closes #18006 diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index 59f4eb8..d59f3a7 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -628,14 +628,26 @@ void cmQtAutoGenInitializer::InitCustomTargets() std::vector ccOutput; ccOutput.push_back(qrc.RccFile); + cmCustomCommandLines commandLines; - { + if (this->MultiConfig) { + // Build for all configurations + for (std::string const& config : this->ConfigsList) { + cmCustomCommandLine currentLine; + currentLine.push_back(cmSystemTools::GetCMakeCommand()); + currentLine.push_back("-E"); + currentLine.push_back("cmake_autorcc"); + currentLine.push_back(qrc.InfoFile); + currentLine.push_back(config); + commandLines.push_back(std::move(currentLine)); + } + } else { cmCustomCommandLine currentLine; currentLine.push_back(cmSystemTools::GetCMakeCommand()); currentLine.push_back("-E"); currentLine.push_back("cmake_autorcc"); currentLine.push_back(qrc.InfoFile); - currentLine.push_back("$"); + currentLine.push_back("$"); commandLines.push_back(std::move(currentLine)); } std::string ccComment = "Automatic RCC for "; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2930a198f610e729d73df6771d70119adac6df2e commit 2930a198f610e729d73df6771d70119adac6df2e Author: Sebastian Holtermann AuthorDate: Wed May 30 16:34:09 2018 +0200 Commit: Sebastian Holtermann CommitDate: Wed May 30 17:45:01 2018 +0200 Autogen: Add lock file to AUTORCC commands By using a per .qrc lock file in AUTORCC, the same `cmake -E cmake_autorcc ...` command can be called concurrently. diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index 566a2a9..59f4eb8 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -588,8 +588,13 @@ void cmQtAutoGenInitializer::InitCustomTargets() if (!qrc.Unique) { base += qrc.PathChecksum; } + + qrc.LockFile = base; + qrc.LockFile += ".lock"; + qrc.InfoFile = base; qrc.InfoFile += "Info.cmake"; + qrc.SettingsFile = base; qrc.SettingsFile += "Settings.txt"; } @@ -1043,6 +1048,7 @@ void cmQtAutoGenInitializer::SetupCustomTargets() CWrite("ARCC_RCC_LIST_OPTIONS", cmJoin(this->RccListOptions, ";")); ofs << "# Rcc job\n"; + CWrite("ARCC_LOCK_FILE", qrc.LockFile); CWrite("ARCC_SOURCE", qrc.QrcFile); CWrite("ARCC_OUTPUT_CHECKSUM", qrc.PathChecksum); CWrite("ARCC_OUTPUT_NAME", diff --git a/Source/cmQtAutoGenInitializer.h b/Source/cmQtAutoGenInitializer.h index 2a47e46..5fbf0cb 100644 --- a/Source/cmQtAutoGenInitializer.h +++ b/Source/cmQtAutoGenInitializer.h @@ -32,6 +32,7 @@ public: } public: + std::string LockFile; std::string QrcFile; std::string QrcName; std::string PathChecksum; diff --git a/Source/cmQtAutoGenerator.cxx b/Source/cmQtAutoGenerator.cxx index bf184d8..750e1ed 100644 --- a/Source/cmQtAutoGenerator.cxx +++ b/Source/cmQtAutoGenerator.cxx @@ -367,10 +367,11 @@ bool cmQtAutoGenerator::FileSystem::FileRemove(std::string const& filename) return cmSystemTools::RemoveFile(filename); } -bool cmQtAutoGenerator::FileSystem::Touch(std::string const& filename) +bool cmQtAutoGenerator::FileSystem::Touch(std::string const& filename, + bool create) { std::lock_guard lock(Mutex_); - return cmSystemTools::Touch(filename, false); + return cmSystemTools::Touch(filename, create); } bool cmQtAutoGenerator::FileSystem::MakeDirectory(std::string const& dirname) diff --git a/Source/cmQtAutoGenerator.h b/Source/cmQtAutoGenerator.h index 299e4c2..4e38413 100644 --- a/Source/cmQtAutoGenerator.h +++ b/Source/cmQtAutoGenerator.h @@ -124,7 +124,7 @@ public: bool FileDiffers(std::string const& filename, std::string const& content); bool FileRemove(std::string const& filename); - bool Touch(std::string const& filename); + bool Touch(std::string const& filename, bool create = false); // -- Directory access bool MakeDirectory(std::string const& dirname); diff --git a/Source/cmQtAutoGeneratorRcc.cxx b/Source/cmQtAutoGeneratorRcc.cxx index 84ec5e2..fdb556a 100644 --- a/Source/cmQtAutoGeneratorRcc.cxx +++ b/Source/cmQtAutoGeneratorRcc.cxx @@ -5,6 +5,7 @@ #include "cmAlgorithms.h" #include "cmCryptoHash.h" +#include "cmFileLockResult.h" #include "cmMakefile.h" #include "cmSystemTools.h" #include "cmUVHandlePtr.h" @@ -89,6 +90,7 @@ bool cmQtAutoGeneratorRcc::Init(cmMakefile* makefile) RccListOptions_ = InfoGetList("ARCC_RCC_LIST_OPTIONS"); // - Job + LockFile_ = InfoGet("ARCC_LOCK_FILE"); QrcFile_ = InfoGet("ARCC_SOURCE"); QrcFileName_ = cmSystemTools::GetFilenameName(QrcFile_); QrcFileDir_ = cmSystemTools::GetFilenamePath(QrcFile_); @@ -101,6 +103,10 @@ bool cmQtAutoGeneratorRcc::Init(cmMakefile* makefile) SettingsFile_ = InfoGetConfig("ARCC_SETTINGS_FILE"); // - Validity checks + if (LockFile_.empty()) { + Log().ErrorFile(GeneratorT::RCC, InfoFile(), "Lock file name missing"); + return false; + } if (SettingsFile_.empty()) { Log().ErrorFile(GeneratorT::RCC, InfoFile(), "Settings file name missing"); return false; @@ -170,8 +176,11 @@ void cmQtAutoGeneratorRcc::PollStage() switch (Stage_) { // -- Initialize case StageT::SETTINGS_READ: - SettingsFileRead(); - SetStage(StageT::TEST_QRC_RCC_FILES); + if (SettingsFileRead()) { + SetStage(StageT::TEST_QRC_RCC_FILES); + } else { + SetStage(StageT::FINISH); + } break; // -- Change detection @@ -252,7 +261,7 @@ std::string cmQtAutoGeneratorRcc::MultiConfigOutput() const return res; } -void cmQtAutoGeneratorRcc::SettingsFileRead() +bool cmQtAutoGeneratorRcc::SettingsFileRead() { // Compose current settings strings { @@ -278,21 +287,51 @@ void cmQtAutoGeneratorRcc::SettingsFileRead() } } + // Make sure the settings file exists + if (!FileSys().FileExists(SettingsFile_, true)) { + // Touch the settings file to make sure it exists + FileSys().Touch(SettingsFile_, true); + } + + // Lock the lock file + { + // Make sure the lock file exists + if (!FileSys().FileExists(LockFile_, true)) { + if (!FileSys().Touch(LockFile_, true)) { + Log().ErrorFile(GeneratorT::RCC, LockFile_, + "Lock file creation failed"); + Error_ = true; + return false; + } + } + // Lock the lock file + cmFileLockResult lockResult = + LockFileLock_.Lock(LockFile_, static_cast(-1)); + if (!lockResult.IsOk()) { + Log().ErrorFile(GeneratorT::RCC, LockFile_, + "File lock failed: " + lockResult.GetOutputMessage()); + Error_ = true; + return false; + } + } + // Read old settings { std::string content; if (FileSys().FileRead(content, SettingsFile_)) { SettingsChanged_ = (SettingsString_ != SettingsFind(content, "rcc")); - // In case any setting changed remove the old settings file. + // In case any setting changed clear the old settings file. // This triggers a full rebuild on the next run if the current // build is aborted before writing the current settings in the end. if (SettingsChanged_) { - FileSys().FileRemove(SettingsFile_); + FileSys().FileWrite(GeneratorT::RCC, SettingsFile_, ""); } } else { SettingsChanged_ = true; } } + + return true; } void cmQtAutoGeneratorRcc::SettingsFileWrite() @@ -315,6 +354,9 @@ void cmQtAutoGeneratorRcc::SettingsFileWrite() Error_ = true; } } + + // Unlock the lock file + LockFileLock_.Release(); } bool cmQtAutoGeneratorRcc::TestQrcRccFiles() diff --git a/Source/cmQtAutoGeneratorRcc.h b/Source/cmQtAutoGeneratorRcc.h index 55e0998..74cec36 100644 --- a/Source/cmQtAutoGeneratorRcc.h +++ b/Source/cmQtAutoGeneratorRcc.h @@ -5,6 +5,7 @@ #include "cmConfigure.h" // IWYU pragma: keep +#include "cmFileLock.h" #include "cmQtAutoGenerator.h" #include "cm_uv.h" @@ -48,7 +49,7 @@ private: void PollStage(); void SetStage(StageT stage); // -- Settings file - void SettingsFileRead(); + bool SettingsFileRead(); void SettingsFileWrite(); // -- Tests bool TestQrcRccFiles(); @@ -77,6 +78,8 @@ private: std::string RccExecutable_; std::vector RccListOptions_; // -- Job + std::string LockFile_; + cmFileLock LockFileLock_; std::string QrcFile_; std::string QrcFileName_; std::string QrcFileDir_; ----------------------------------------------------------------------- Summary of changes: Help/release/dev/alsa-target.rst | 4 ++ Modules/FindALSA.cmake | 39 +++++++++++---- Source/cmQtAutoGenInitializer.cxx | 22 ++++++++- Source/cmQtAutoGenInitializer.h | 1 + Source/cmQtAutoGenerator.cxx | 5 +- Source/cmQtAutoGenerator.h | 2 +- Source/cmQtAutoGeneratorRcc.cxx | 52 ++++++++++++++++++-- Source/cmQtAutoGeneratorRcc.h | 5 +- Templates/TestDriver.cxx.in | 4 +- Tests/CMakeLists.txt | 4 ++ Tests/{FindICU => FindALSA}/CMakeLists.txt | 8 +-- Tests/FindALSA/Test/CMakeLists.txt | 16 ++++++ Tests/FindALSA/Test/main.c | 10 ++++ Tests/QtAutogen/CommonTests.cmake | 1 + .../QtAutogen/RerunRccConfigChange/CMakeLists.txt | 41 +++++++++++++++ .../RccConfigChange/CMakeLists.txt | 26 ++++++++++ .../RccConfigChange}/main.cpp | 0 .../RccConfigChange/resGen.qrc.in | 6 +++ .../RccConfigChange/resGen/input1.txt.in} | 0 .../RccConfigChange/resGen/input2.txt.in} | 0 .../RccConfigChange/resPlain.qrc | 6 +++ .../RccConfigChange/resPlain/input1.txt | 1 + .../RccConfigChange/resPlain/input2.txt | 1 + .../dummy.cpp | 0 Utilities/Release/linux64_release.cmake | 6 +-- 25 files changed, 231 insertions(+), 29 deletions(-) create mode 100644 Help/release/dev/alsa-target.rst copy Tests/{FindICU => FindALSA}/CMakeLists.txt (55%) create mode 100644 Tests/FindALSA/Test/CMakeLists.txt create mode 100644 Tests/FindALSA/Test/main.c create mode 100644 Tests/QtAutogen/RerunRccConfigChange/CMakeLists.txt create mode 100644 Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/CMakeLists.txt copy Tests/QtAutogen/{RerunRccDepends/RccDepends => RerunRccConfigChange/RccConfigChange}/main.cpp (100%) create mode 100644 Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resGen.qrc.in copy Tests/QtAutogen/{RerunRccDepends/RccDepends/resGen/input.txt.in => RerunRccConfigChange/RccConfigChange/resGen/input1.txt.in} (100%) copy Tests/QtAutogen/{RerunRccDepends/RccDepends/resGen/input.txt.in => RerunRccConfigChange/RccConfigChange/resGen/input2.txt.in} (100%) create mode 100644 Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resPlain.qrc create mode 100644 Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resPlain/input1.txt create mode 100644 Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resPlain/input2.txt copy Tests/QtAutogen/{RerunMocBasic => RerunRccConfigChange}/dummy.cpp (100%) hooks/post-receive -- CMake From kwrobot at kitware.com Fri Jun 1 12:55:06 2018 From: kwrobot at kitware.com (Kitware Robot) Date: Fri, 1 Jun 2018 12:55:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.11.3-886-geed0df9 Message-ID: <20180601165506.0CD791119EB@public.kitware.com> 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 eed0df951d95d48e7856107175a2baba212c3206 (commit) via d7204e649ed4ebb19bb341b4e49eb51514364922 (commit) via 12fed3edb107c949671043196fa94c542b45452a (commit) via 523c443d135f6474cf5a9d0372b3cc364fc7ebe5 (commit) via eb7ec19c1c639e91b812763ead3a56e97d20aec4 (commit) via b67a5bf175702ec2f464d1a09da31337fa98e8d9 (commit) from b671e4799f0e418448681a21120e8e87a97de5dc (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=eed0df951d95d48e7856107175a2baba212c3206 commit eed0df951d95d48e7856107175a2baba212c3206 Merge: b671e47 d7204e6 Author: Brad King AuthorDate: Fri Jun 1 16:52:10 2018 +0000 Commit: Kitware Robot CommitDate: Fri Jun 1 12:52:38 2018 -0400 Merge topic 'clang-format-6.0' d7204e649e Revise C++ coding style using clang-format-6.0 12fed3edb1 Empty commit at end of history preceding clang-format-6.0 style transition 523c443d13 clang-format.bash: update to clang-format-6.0 eb7ec19c1c clang-format: Add comments to suppress some formatting b67a5bf175 Tests/VSWinStorePhone: Do not format managed source Acked-by: Kitware Robot Acked-by: Sebastian Holtermann Merge-request: !2123 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d7204e649ed4ebb19bb341b4e49eb51514364922 commit d7204e649ed4ebb19bb341b4e49eb51514364922 Author: Kitware Robot AuthorDate: Fri Jun 1 09:53:41 2018 -0400 Commit: Brad King CommitDate: Fri Jun 1 09:53:42 2018 -0400 Revise C++ coding style using clang-format-6.0 Run the `clang-format.bash` script to update all our C and C++ code to a new style defined by `.clang-format`. Use `clang-format` version 6.0. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit. diff --git a/Modules/CMakeCCompilerABI.c b/Modules/CMakeCCompilerABI.c index 55f9a9b..08cf39b 100644 --- a/Modules/CMakeCCompilerABI.c +++ b/Modules/CMakeCCompilerABI.c @@ -1,9 +1,9 @@ #ifdef __cplusplus -#error "A C++ compiler has been selected for C." +# error "A C++ compiler has been selected for C." #endif #ifdef __CLASSIC_C__ -#define const +# define const #endif #include "CMakeCompilerABI.h" diff --git a/Modules/CMakeCUDACompilerABI.cu b/Modules/CMakeCUDACompilerABI.cu index 99bacef..702a7c5 100644 --- a/Modules/CMakeCUDACompilerABI.cu +++ b/Modules/CMakeCUDACompilerABI.cu @@ -1,5 +1,5 @@ #ifndef __CUDACC__ -#error "A C or C++ compiler has been selected for CUDA" +# error "A C or C++ compiler has been selected for CUDA" #endif #include "CMakeCompilerABI.h" diff --git a/Modules/CMakeCXXCompilerABI.cpp b/Modules/CMakeCXXCompilerABI.cpp index 2dee883..2360534 100644 --- a/Modules/CMakeCXXCompilerABI.cpp +++ b/Modules/CMakeCXXCompilerABI.cpp @@ -1,5 +1,5 @@ #ifndef __cplusplus -#error "A C compiler has been selected for C++." +# error "A C compiler has been selected for C++." #endif #include "CMakeCompilerABI.h" diff --git a/Modules/CMakeCompilerABI.h b/Modules/CMakeCompilerABI.h index 1f9abb1..6f36b03 100644 --- a/Modules/CMakeCompilerABI.h +++ b/Modules/CMakeCompilerABI.h @@ -11,27 +11,27 @@ const char info_sizeof_dptr[] = { /* Application Binary Interface. */ #if defined(__sgi) && defined(_ABIO32) -#define ABI_ID "ELF O32" +# define ABI_ID "ELF O32" #elif defined(__sgi) && defined(_ABIN32) -#define ABI_ID "ELF N32" +# define ABI_ID "ELF N32" #elif defined(__sgi) && defined(_ABI64) -#define ABI_ID "ELF 64" +# define ABI_ID "ELF 64" /* Check for (some) ARM ABIs. * See e.g. http://wiki.debian.org/ArmEabiPort for some information on this. */ #elif defined(__GNU__) && defined(__ELF__) && defined(__ARM_EABI__) -#define ABI_ID "ELF ARMEABI" +# define ABI_ID "ELF ARMEABI" #elif defined(__GNU__) && defined(__ELF__) && defined(__ARMEB__) -#define ABI_ID "ELF ARM" +# define ABI_ID "ELF ARM" #elif defined(__GNU__) && defined(__ELF__) && defined(__ARMEL__) -#define ABI_ID "ELF ARM" +# define ABI_ID "ELF ARM" #elif defined(__linux__) && defined(__ELF__) && defined(__amd64__) && \ defined(__ILP32__) -#define ABI_ID "ELF X32" +# define ABI_ID "ELF X32" #elif defined(__ELF__) -#define ABI_ID "ELF" +# define ABI_ID "ELF" #endif #if defined(ABI_ID) diff --git a/Modules/CheckFunctionExists.c b/Modules/CheckFunctionExists.c index 224e340..13435e0 100644 --- a/Modules/CheckFunctionExists.c +++ b/Modules/CheckFunctionExists.c @@ -1,19 +1,19 @@ #ifdef CHECK_FUNCTION_EXISTS -#ifdef __cplusplus +# ifdef __cplusplus extern "C" -#endif +# endif char CHECK_FUNCTION_EXISTS(void); -#ifdef __CLASSIC_C__ +# ifdef __CLASSIC_C__ int main() { int ac; char* av[]; -#else +# else int main(int ac, char* av[]) { -#endif +# endif CHECK_FUNCTION_EXISTS(); if (ac > 1000) { return *av[0]; @@ -23,6 +23,6 @@ int main(int ac, char* av[]) #else /* CHECK_FUNCTION_EXISTS */ -#error "CHECK_FUNCTION_EXISTS has to specify the function" +# error "CHECK_FUNCTION_EXISTS has to specify the function" #endif /* CHECK_FUNCTION_EXISTS */ diff --git a/Modules/CheckVariableExists.c b/Modules/CheckVariableExists.c index 6e94877..d68afb4 100644 --- a/Modules/CheckVariableExists.c +++ b/Modules/CheckVariableExists.c @@ -2,15 +2,15 @@ extern int CHECK_VARIABLE_EXISTS; -#ifdef __CLASSIC_C__ +# ifdef __CLASSIC_C__ int main() { int ac; char* av[]; -#else +# else int main(int ac, char* av[]) { -#endif +# endif if (ac > 1000) { return *av[0]; } @@ -19,6 +19,6 @@ int main(int ac, char* av[]) #else /* CHECK_VARIABLE_EXISTS */ -#error "CHECK_VARIABLE_EXISTS has to specify the variable" +# error "CHECK_VARIABLE_EXISTS has to specify the variable" #endif /* CHECK_VARIABLE_EXISTS */ diff --git a/Modules/FindMPI/libver_mpi.c b/Modules/FindMPI/libver_mpi.c index be9d19d..18d4a60 100644 --- a/Modules/FindMPI/libver_mpi.c +++ b/Modules/FindMPI/libver_mpi.c @@ -1,9 +1,9 @@ #include #ifdef __cplusplus -#include +# include #else -#include +# include #endif int main(int argc, char* argv[]) diff --git a/Modules/FindMPI/test_mpi.c b/Modules/FindMPI/test_mpi.c index b8a308a..05cec89 100644 --- a/Modules/FindMPI/test_mpi.c +++ b/Modules/FindMPI/test_mpi.c @@ -1,9 +1,9 @@ #include #ifdef __cplusplus -#include +# include #else -#include +# include #endif #if defined(MPI_VERSION) && defined(MPI_SUBVERSION) @@ -21,11 +21,11 @@ const char mpiver_str[] = { 'I', 'N', int main(int argc, char* argv[]) { #if defined(MPI_VERSION) && defined(MPI_SUBVERSION) -#ifdef __cplusplus +# ifdef __cplusplus std::puts(mpiver_str); -#else +# else puts(mpiver_str); -#endif +# endif #endif #ifdef TEST_MPI_MPICXX MPI::MPI_Init(&argc, &argv); diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx index 9f1a15e..cf8334a 100644 --- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx +++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx @@ -61,7 +61,8 @@ int cmCPackIFWGenerator::PackageFiles() ifwCmd += " --repository " + rd; } } else { - cmCPackIFWLogger(WARNING, "The \"CPACK_IFW_REPOSITORIES_DIRECTORIES\" " + cmCPackIFWLogger(WARNING, + "The \"CPACK_IFW_REPOSITORIES_DIRECTORIES\" " << "variable is set, but content will be skipped, " << "because this feature available only since " << "QtIFW 3.1. Please update your QtIFW instance." @@ -93,7 +94,8 @@ int cmCPackIFWGenerator::PackageFiles() ofs << "# Run command: " << ifwCmd << std::endl << "# Output:" << std::endl << output << std::endl; - cmCPackIFWLogger(ERROR, "Problem running IFW command: " + cmCPackIFWLogger(ERROR, + "Problem running IFW command: " << ifwCmd << std::endl << "Please check " << ifwTmpFile << " for errors" << std::endl); @@ -102,15 +104,16 @@ int cmCPackIFWGenerator::PackageFiles() if (!this->Repository.RepositoryUpdate.empty() && !this->Repository.PatchUpdatesXml()) { - cmCPackIFWLogger(WARNING, "Problem patch IFW \"Updates\" " + cmCPackIFWLogger(WARNING, + "Problem patch IFW \"Updates\" " << "file: " << this->toplevel + "/repository/Updates.xml" << std::endl); } - cmCPackIFWLogger(OUTPUT, "- repository: " << this->toplevel - << "/repository generated" - << std::endl); + cmCPackIFWLogger(OUTPUT, + "- repository: " << this->toplevel + << "/repository generated" << std::endl); } // Run binary creator @@ -145,7 +148,8 @@ int cmCPackIFWGenerator::PackageFiles() ifwCmd += " --repository " + rd; } } else { - cmCPackIFWLogger(WARNING, "The \"CPACK_IFW_REPOSITORIES_DIRECTORIES\" " + cmCPackIFWLogger(WARNING, + "The \"CPACK_IFW_REPOSITORIES_DIRECTORIES\" " << "variable is set, but content will be skipped, " << "because this feature available only since " << "QtIFW 3.1. Please update your QtIFW instance." @@ -203,7 +207,8 @@ int cmCPackIFWGenerator::PackageFiles() ofs << "# Run command: " << ifwCmd << std::endl << "# Output:" << std::endl << output << std::endl; - cmCPackIFWLogger(ERROR, "Problem running IFW command: " + cmCPackIFWLogger(ERROR, + "Problem running IFW command: " << ifwCmd << std::endl << "Please check " << ifwTmpFile << " for errors" << std::endl); @@ -257,8 +262,9 @@ int cmCPackIFWGenerator::InitializeInternal() } if (this->BinCreator.empty()) { - cmCPackIFWLogger(ERROR, "Cannot find QtIFW compiler \"binarycreator\": " - "likely it is not installed, or not in your PATH" + cmCPackIFWLogger(ERROR, + "Cannot find QtIFW compiler \"binarycreator\": " + "likely it is not installed, or not in your PATH" << std::endl); return 0; } @@ -415,7 +421,8 @@ cmCPackComponent* cmCPackIFWGenerator::GetComponent( } } else { this->Packages.erase(name); - cmCPackIFWLogger(ERROR, "Cannot configure package \"" + cmCPackIFWLogger(ERROR, + "Cannot configure package \"" << name << "\" for component \"" << component->Name << "\"" << std::endl); } @@ -450,7 +457,8 @@ cmCPackComponentGroup* cmCPackIFWGenerator::GetComponentGroup( this->BinaryPackages.insert(package); } else { this->Packages.erase(name); - cmCPackIFWLogger(ERROR, "Cannot configure package \"" + cmCPackIFWLogger(ERROR, + "Cannot configure package \"" << name << "\" for component group \"" << group->Name << "\"" << std::endl); } @@ -596,7 +604,8 @@ cmCPackIFWRepository* cmCPackIFWGenerator::GetRepository( } else { this->Repositories.erase(repositoryName); repository = nullptr; - cmCPackIFWLogger(WARNING, "Invalid repository \"" + cmCPackIFWLogger(WARNING, + "Invalid repository \"" << repositoryName << "\"" << " configuration. Repository will be skipped." << std::endl); diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.h b/Source/CPack/IFW/cmCPackIFWGenerator.h index 919dd46..0430122 100644 --- a/Source/CPack/IFW/cmCPackIFWGenerator.h +++ b/Source/CPack/IFW/cmCPackIFWGenerator.h @@ -22,7 +22,9 @@ * * http://qt-project.org/doc/qtinstallerframework/index.html */ -class cmCPackIFWGenerator : public cmCPackGenerator, public cmCPackIFWCommon +class cmCPackIFWGenerator + : public cmCPackGenerator + , public cmCPackIFWCommon { public: cmCPackTypeMacro(cmCPackIFWGenerator, cmCPackGenerator); diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx index 05a852d..36cf08c 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx +++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx @@ -24,7 +24,8 @@ void cmCPackIFWInstaller::printSkippedOptionWarning( const std::string& optionName, const std::string& optionValue) { cmCPackIFWLogger( - WARNING, "Option " + WARNING, + "Option " << optionName << " is set to \"" << optionValue << "\" but will be skipped because the specified file does not exist." << std::endl); @@ -146,7 +147,8 @@ void cmCPackIFWInstaller::ConfigureFromOptions() if (this->WizardStyle != "Modern" && this->WizardStyle != "Aero" && this->WizardStyle != "Mac" && this->WizardStyle != "Classic") { cmCPackIFWLogger( - WARNING, "Option CPACK_IFW_PACKAGE_WIZARD_STYLE has unknown value \"" + WARNING, + "Option CPACK_IFW_PACKAGE_WIZARD_STYLE has unknown value \"" << option << "\". Expected values are: Modern, Aero, Mac, Classic." << std::endl); } @@ -469,7 +471,8 @@ void cmCPackIFWInstaller::GenerateInstallerFile() cmsys::SystemTools::CopyFileIfDifferent(this->Resources[i], path); resources.push_back(std::move(name)); } else { - cmCPackIFWLogger(WARNING, "Can't copy resources from \"" + cmCPackIFWLogger(WARNING, + "Can't copy resources from \"" << this->Resources[i] << "\". Resource will be skipped." << std::endl); } diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx index d3ce15c..4c84612 100644 --- a/Source/CPack/IFW/cmCPackIFWPackage.cxx +++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx @@ -226,7 +226,8 @@ int cmCPackIFWPackage::ConfigureFromComponent(cmCPackComponent* component) if (const char* option = this->GetOption(prefix + "PRIORITY")) { this->SortingPriority = option; cmCPackIFWLogger( - WARNING, "The \"PRIORITY\" option is set " + WARNING, + "The \"PRIORITY\" option is set " << "for component \"" << component->Name << "\", but there option is " << "deprecated. Please use \"SORTING_PRIORITY\" option instead." << std::endl); @@ -303,7 +304,8 @@ int cmCPackIFWPackage::ConfigureFromGroup(cmCPackComponentGroup* group) if (const char* option = this->GetOption(prefix + "PRIORITY")) { this->SortingPriority = option; cmCPackIFWLogger( - WARNING, "The \"PRIORITY\" option is set " + WARNING, + "The \"PRIORITY\" option is set " << "for component group \"" << group->Name << "\", but there option is " << "deprecated. Please use \"SORTING_PRIORITY\" option instead." diff --git a/Source/CPack/WiX/cmCMakeToWixPath.cxx b/Source/CPack/WiX/cmCMakeToWixPath.cxx index 0b0e42a..b3889cf 100644 --- a/Source/CPack/WiX/cmCMakeToWixPath.cxx +++ b/Source/CPack/WiX/cmCMakeToWixPath.cxx @@ -8,7 +8,7 @@ #include #ifdef __CYGWIN__ -#include +# include std::string CMakeToWixPath(const std::string& cygpath) { std::vector winpath_chars; diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index a0bc0ea..e06efda 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -23,9 +23,9 @@ #include "cmsys/SystemTools.hxx" #ifdef _WIN32 -#include // for GUID generation (windows only) +# include // for GUID generation (windows only) #else -#include // for GUID generation (libuuid) +# include // for GUID generation (libuuid) #endif #include "cmCMakeToWixPath.h" @@ -55,8 +55,8 @@ bool cmCPackWIXGenerator::RunWiXCommand(std::string const& command) { std::string logFileName = this->CPackTopLevel + "/wix.log"; - cmCPackLogger(cmCPackLog::LOG_DEBUG, "Running WiX command: " << command - << std::endl); + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "Running WiX command: " << command << std::endl); std::string output; @@ -71,8 +71,9 @@ bool cmCPackWIXGenerator::RunWiXCommand(std::string const& command) logFile.close(); if (!status || returnValue) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running WiX candle. " - "Please check '" + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Problem running WiX candle. " + "Please check '" << logFileName << "' for errors." << std::endl); return false; @@ -137,8 +138,8 @@ bool cmCPackWIXGenerator::RunLightCommand(std::string const& objectFiles) int cmCPackWIXGenerator::PackageFiles() { if (!PackageFilesImpl() || cmSystemTools::GetErrorOccuredFlag()) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Fatal WiX Generator Error" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Fatal WiX Generator Error" << std::endl); return false; } @@ -148,8 +149,8 @@ int cmCPackWIXGenerator::PackageFiles() bool cmCPackWIXGenerator::InitializeWiXConfiguration() { if (!ReadListFile("CPackWIX.cmake")) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Error while executing CPackWIX.cmake" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Error while executing CPackWIX.cmake" << std::endl); return false; } @@ -166,12 +167,13 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration() std::string guid = GenerateGUID(); SetOption("CPACK_WIX_UPGRADE_GUID", guid.c_str()); - cmCPackLogger( - cmCPackLog::LOG_WARNING, "CPACK_WIX_UPGRADE_GUID implicitly set to " - << guid << " . " - "Please refer to the documentation on how and why " - "you might want to set this explicitly." - << std::endl); + cmCPackLogger(cmCPackLog::LOG_WARNING, + "CPACK_WIX_UPGRADE_GUID implicitly set to " + << guid + << " . " + "Please refer to the documentation on how and why " + "you might want to set this explicitly." + << std::endl); } if (!RequireOption("CPACK_TOPLEVEL_DIRECTORY", this->CPackTopLevel)) { @@ -370,8 +372,9 @@ void cmCPackWIXGenerator::CreateWiXPropertiesIncludeFile() includeFile.AddAttribute("Id", "FindInstallLocation"); includeFile.AddAttribute("Root", "HKLM"); includeFile.AddAttribute( - "Key", "Software\\Microsoft\\Windows\\" - "CurrentVersion\\Uninstall\\[WIX_UPGRADE_DETECTED]"); + "Key", + "Software\\Microsoft\\Windows\\" + "CurrentVersion\\Uninstall\\[WIX_UPGRADE_DETECTED]"); includeFile.AddAttribute("Name", "InstallLocation"); includeFile.AddAttribute("Type", "raw"); includeFile.EndElement("RegistrySearch"); @@ -613,8 +616,9 @@ bool cmCPackWIXGenerator::GenerateMainSourceFileFromTemplate() std::string mainSourceFilePath = this->CPackTopLevel + "/main.wxs"; if (!ConfigureFile(wixTemplate.c_str(), mainSourceFilePath.c_str())) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Failed creating '" - << mainSourceFilePath << "'' from template." << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Failed creating '" << mainSourceFilePath + << "'' from template." << std::endl); return false; } @@ -957,8 +961,8 @@ bool cmCPackWIXGenerator::RequireOption(std::string const& name, return true; } else { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Required variable " - << name << " not set" << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Required variable " << name << " not set" << std::endl); return false; } diff --git a/Source/CPack/WiX/cmWIXAccessControlList.cxx b/Source/CPack/WiX/cmWIXAccessControlList.cxx index 1603bf8..563de02 100644 --- a/Source/CPack/WiX/cmWIXAccessControlList.cxx +++ b/Source/CPack/WiX/cmWIXAccessControlList.cxx @@ -66,8 +66,9 @@ void cmWIXAccessControlList::CreatePermissionElement(std::string const& entry) void cmWIXAccessControlList::ReportError(std::string const& entry, std::string const& message) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Failed processing ACL entry '" - << entry << "': " << message << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Failed processing ACL entry '" << entry << "': " << message + << std::endl); } bool cmWIXAccessControlList::IsBooleanAttribute(std::string const& name) diff --git a/Source/CPack/WiX/cmWIXPatch.cxx b/Source/CPack/WiX/cmWIXPatch.cxx index dec95fb..ca232f9 100644 --- a/Source/CPack/WiX/cmWIXPatch.cxx +++ b/Source/CPack/WiX/cmWIXPatch.cxx @@ -13,8 +13,9 @@ bool cmWIXPatch::LoadFragments(std::string const& patchFilePath) { cmWIXPatchParser parser(Fragments, Logger); if (!parser.ParseFile(patchFilePath.c_str())) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Failed parsing XML patch file: '" - << patchFilePath << "'" << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Failed parsing XML patch file: '" << patchFilePath << "'" + << std::endl); return false; } diff --git a/Source/CPack/WiX/cmWIXSourceWriter.cxx b/Source/CPack/WiX/cmWIXSourceWriter.cxx index dc730e0..6adf80b 100644 --- a/Source/CPack/WiX/cmWIXSourceWriter.cxx +++ b/Source/CPack/WiX/cmWIXSourceWriter.cxx @@ -32,7 +32,8 @@ cmWIXSourceWriter::cmWIXSourceWriter(cmCPackLog* logger, cmWIXSourceWriter::~cmWIXSourceWriter() { if (Elements.size() > 1) { - cmCPackLogger(cmCPackLog::LOG_ERROR, Elements.size() - 1 + cmCPackLogger(cmCPackLog::LOG_ERROR, + Elements.size() - 1 << " WiX elements were still open when closing '" << SourceFilename << "'" << std::endl); return; @@ -65,7 +66,8 @@ void cmWIXSourceWriter::EndElement(std::string const& name) } if (Elements.back() != name) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "WiX element <" + cmCPackLogger(cmCPackLog::LOG_ERROR, + "WiX element <" << Elements.back() << "> can not be closed by in '" << SourceFilename << "'" << std::endl); return; diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx index 00fbdab..b734bb4 100644 --- a/Source/CPack/cmCPackArchiveGenerator.cxx +++ b/Source/CPack/cmCPackArchiveGenerator.cxx @@ -87,8 +87,9 @@ int cmCPackArchiveGenerator::addOneComponentToArchive( cmCPackLogger(cmCPackLog::LOG_DEBUG, "Adding file: " << rp << std::endl); archive.Add(rp, 0, nullptr, false); if (!archive) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "ERROR while packaging files: " - << archive.GetError() << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "ERROR while packaging files: " << archive.GetError() + << std::endl); return 0; } } @@ -111,7 +112,8 @@ int cmCPackArchiveGenerator::addOneComponentToArchive( } \ cmArchiveWrite archive(gf, this->Compress, this->ArchiveFormat); \ if (!(archive)) { \ - cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem to create archive < " \ + cmCPackLogger(cmCPackLog::LOG_ERROR, \ + "Problem to create archive < " \ << (filename) << ">. ERROR =" << (archive).GetError() \ << std::endl); \ return 0; \ @@ -148,7 +150,8 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup) // Does the component belong to a group? if (comp.second.Group == nullptr) { cmCPackLogger( - cmCPackLog::LOG_VERBOSE, "Component <" + cmCPackLog::LOG_VERBOSE, + "Component <" << comp.second.Name << "> does not belong to any group, package it separately." << std::endl); @@ -258,7 +261,8 @@ int cmCPackArchiveGenerator::PackageFiles() std::string rp = cmSystemTools::RelativePath(toplevel, file); archive.Add(rp, 0, nullptr, false); if (!archive) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem while adding file< " + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Problem while adding file< " << file << "> to archive <" << packageFileNames[0] << "> .ERROR =" << archive.GetError() << std::endl); return 0; diff --git a/Source/CPack/cmCPackBundleGenerator.cxx b/Source/CPack/cmCPackBundleGenerator.cxx index f47ca7a..f8fd108 100644 --- a/Source/CPack/cmCPackBundleGenerator.cxx +++ b/Source/CPack/cmCPackBundleGenerator.cxx @@ -32,8 +32,8 @@ int cmCPackBundleGenerator::InitializeInternal() "codesign", std::vector(), false); if (codesign_path.empty()) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot locate codesign command" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Cannot locate codesign command" << std::endl); return 0; } this->SetOptionIfNotSet("CPACK_COMMAND_CODESIGN", codesign_path.c_str()); @@ -59,8 +59,8 @@ int cmCPackBundleGenerator::ConstructBundle() ? this->GetOption("CPACK_BUNDLE_NAME") : ""; if (cpack_bundle_name.empty()) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "CPACK_BUNDLE_NAME must be set." - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "CPACK_BUNDLE_NAME must be set." << std::endl); return 0; } @@ -69,8 +69,8 @@ int cmCPackBundleGenerator::ConstructBundle() ? this->GetOption("CPACK_BUNDLE_PLIST") : ""; if (cpack_bundle_plist.empty()) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "CPACK_BUNDLE_PLIST must be set." - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "CPACK_BUNDLE_PLIST must be set." << std::endl); return 0; } @@ -79,8 +79,8 @@ int cmCPackBundleGenerator::ConstructBundle() ? this->GetOption("CPACK_BUNDLE_ICON") : ""; if (cpack_bundle_icon.empty()) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "CPACK_BUNDLE_ICON must be set." - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "CPACK_BUNDLE_ICON must be set." << std::endl); return 0; } @@ -269,8 +269,8 @@ int cmCPackBundleGenerator::SignBundle(const std::string& src_dir) return 0; } - cmCPackLogger(cmCPackLog::LOG_OUTPUT, "- Application has been codesigned" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_OUTPUT, + "- Application has been codesigned" << std::endl); cmCPackLogger(cmCPackLog::LOG_VERBOSE, (this->GetOption("CPACK_BUNDLE_APPLE_ENTITLEMENTS") ? "with entitlement sandboxing" diff --git a/Source/CPack/cmCPackCygwinSourceGenerator.cxx b/Source/CPack/cmCPackCygwinSourceGenerator.cxx index 2c289f6..889f29a 100644 --- a/Source/CPack/cmCPackCygwinSourceGenerator.cxx +++ b/Source/CPack/cmCPackCygwinSourceGenerator.cxx @@ -15,8 +15,8 @@ // system tools because it is not implemented robustly enough to move // files across directories. #ifdef _WIN32 -#include "cm_sys_stat.h" -#include +# include "cm_sys_stat.h" +# include #endif cmCPackCygwinSourceGenerator::cmCPackCygwinSourceGenerator() @@ -73,7 +73,8 @@ int cmCPackCygwinSourceGenerator::PackageFiles() if (!cmSystemTools::CopyFileAlways( this->GetOption("CPACK_CYGWIN_PATCH_FILE"), this->GetOption("CPACK_TOPLEVEL_DIRECTORY"))) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "problem copying: [" + cmCPackLogger(cmCPackLog::LOG_ERROR, + "problem copying: [" << this->GetOption("CPACK_CYGWIN_PATCH_FILE") << "]\nto\n[" << this->GetOption("CPACK_TOPLEVEL_DIRECTORY") << "]\n"); return 0; @@ -87,7 +88,8 @@ int cmCPackCygwinSourceGenerator::PackageFiles() if (!cmSystemTools::CopyFileAlways( this->GetOption("CPACK_CYGWIN_BUILD_SCRIPT"), this->GetOption("CPACK_TOPLEVEL_DIRECTORY"))) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "problem copying: " + cmCPackLogger(cmCPackLog::LOG_ERROR, + "problem copying: " << this->GetOption("CPACK_CYGWIN_BUILD_SCRIPT") << "\nto\n" << this->GetOption("CPACK_TOPLEVEL_DIRECTORY") << "]\n"); return 0; @@ -96,7 +98,8 @@ int cmCPackCygwinSourceGenerator::PackageFiles() outerTarFile += "-"; const char* patch = this->GetOption("CPACK_CYGWIN_PATCH_NUMBER"); if (!patch) { - cmCPackLogger(cmCPackLog::LOG_WARNING, "CPACK_CYGWIN_PATCH_NUMBER" + cmCPackLogger(cmCPackLog::LOG_WARNING, + "CPACK_CYGWIN_PATCH_NUMBER" << " not specified, defaulting to 1\n"); patch = "1"; } @@ -147,7 +150,8 @@ const char* cmCPackCygwinSourceGenerator::GetOutputExtension() this->OutputExtension = "-"; const char* patch = this->GetOption("CPACK_CYGWIN_PATCH_NUMBER"); if (!patch) { - cmCPackLogger(cmCPackLog::LOG_WARNING, "CPACK_CYGWIN_PATCH_NUMBER" + cmCPackLogger(cmCPackLog::LOG_WARNING, + "CPACK_CYGWIN_PATCH_NUMBER" << " not specified, defaulting to 1\n"); patch = "1"; } diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index 8ec54f8..93cdf41 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -62,8 +62,8 @@ int cmCPackDebGenerator::PackageOnePack(std::string const& initialTopLevel, this->SetOption("CPACK_DEB_PACKAGE_COMPONENT_PART_PATH", component_path.c_str()); if (!this->ReadListFile("CPackDeb.cmake")) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Error while execution CPackDeb.cmake" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Error while execution CPackDeb.cmake" << std::endl); retval = 0; return retval; } @@ -115,7 +115,8 @@ int cmCPackDebGenerator::PackageComponents(bool ignoreGroup) // Does the component belong to a group? if (comp.second.Group == nullptr) { cmCPackLogger( - cmCPackLog::LOG_VERBOSE, "Component <" + cmCPackLog::LOG_VERBOSE, + "Component <" << comp.second.Name << "> does not belong to any group, package it separately." << std::endl); @@ -179,8 +180,8 @@ int cmCPackDebGenerator::PackageComponentsAllInOne( component_path.c_str()); } if (!this->ReadListFile("CPackDeb.cmake")) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Error while execution CPackDeb.cmake" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Error while execution CPackDeb.cmake" << std::endl); retval = 0; return retval; } @@ -413,7 +414,8 @@ int cmCPackDebGenerator::createDeb() cmGeneratedFileStream fileStream_data_tar; fileStream_data_tar.Open(filename_data_tar.c_str(), false, true); if (!fileStream_data_tar) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Error opening the file \"" + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Error opening the file \"" << filename_data_tar << "\" for writing" << std::endl); return 0; } @@ -430,9 +432,9 @@ int cmCPackDebGenerator::createDeb() // e.g. /opt/bin/foo, /usr/bin/bar and /usr/bin/baz would // give /usr and /opt size_t topLevelLength = strGenWDIR.length(); - cmCPackLogger(cmCPackLog::LOG_DEBUG, "WDIR: \"" - << strGenWDIR << "\", length = " << topLevelLength - << std::endl); + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "WDIR: \"" << strGenWDIR << "\", length = " << topLevelLength + << std::endl); std::set orderedFiles; // we have to reconstruct the parent folders as well @@ -448,13 +450,13 @@ int cmCPackDebGenerator::createDeb() } for (std::string const& file : orderedFiles) { - cmCPackLogger(cmCPackLog::LOG_DEBUG, "FILEIT: \"" << file << "\"" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "FILEIT: \"" << file << "\"" << std::endl); std::string::size_type slashPos = file.find('/', topLevelLength + 1); std::string relativeDir = file.substr(topLevelLength, slashPos - topLevelLength); - cmCPackLogger(cmCPackLog::LOG_DEBUG, "RELATIVEDIR: \"" - << relativeDir << "\"" << std::endl); + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "RELATIVEDIR: \"" << relativeDir << "\"" << std::endl); #ifdef WIN32 std::string mode_t_adt_filename = file + ":cmake_mode_t"; @@ -477,7 +479,8 @@ int cmCPackDebGenerator::createDeb() // do not recurse because the loop will do it if (!data_tar.Add(file, topLevelLength, ".", false)) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem adding file to tar:" + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Problem adding file to tar:" << std::endl << "#top level directory: " << strGenWDIR << std::endl << "#file: " << file << std::endl @@ -505,8 +508,8 @@ int cmCPackDebGenerator::createDeb() std::string output = cmSystemTools::ComputeFileHash(file, cmCryptoHash::AlgoMD5); if (output.empty()) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem computing the md5 of " - << file << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Problem computing the md5 of " << file << std::endl); } output += " " + file + "\n"; @@ -527,9 +530,10 @@ int cmCPackDebGenerator::createDeb() cmGeneratedFileStream fileStream_control_tar; fileStream_control_tar.Open(filename_control_tar.c_str(), false, true); if (!fileStream_control_tar) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Error opening the file \"" - << filename_control_tar << "\" for writing" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Error opening the file \"" << filename_control_tar + << "\" for writing" + << std::endl); return 0; } cmArchiveWrite control_tar(fileStream_control_tar, @@ -557,7 +561,8 @@ int cmCPackDebGenerator::createDeb() // adds control and md5sums if (!control_tar.Add(md5filename, strGenWDIR.length(), ".") || !control_tar.Add(strGenWDIR + "/control", strGenWDIR.length(), ".")) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Error adding file to tar:" + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Error adding file to tar:" << std::endl << "#top level directory: " << strGenWDIR << std::endl << "#file: \"control\" or \"md5sums\"" << std::endl @@ -568,7 +573,8 @@ int cmCPackDebGenerator::createDeb() // adds generated shlibs file if (gen_shibs) { if (!control_tar.Add(shlibsfilename, strGenWDIR.length(), ".")) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Error adding file to tar:" + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Error adding file to tar:" << std::endl << "#top level directory: " << strGenWDIR << std::endl << "#file: \"shlibs\"" << std::endl @@ -581,7 +587,8 @@ int cmCPackDebGenerator::createDeb() if (this->IsOn("GEN_CPACK_DEBIAN_GENERATE_POSTINST")) { control_tar.SetPermissions(permission755); if (!control_tar.Add(postinst, strGenWDIR.length(), ".")) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Error adding file to tar:" + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Error adding file to tar:" << std::endl << "#top level directory: " << strGenWDIR << std::endl << "#file: \"postinst\"" << std::endl @@ -594,7 +601,8 @@ int cmCPackDebGenerator::createDeb() if (this->IsOn("GEN_CPACK_DEBIAN_GENERATE_POSTRM")) { control_tar.SetPermissions(permission755); if (!control_tar.Add(postrm, strGenWDIR.length(), ".")) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Error adding file to tar:" + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Error adding file to tar:" << std::endl << "#top level directory: " << strGenWDIR << std::endl << "#file: \"postinst\"" << std::endl @@ -659,7 +667,8 @@ int cmCPackDebGenerator::createDeb() if (!deb.Add(tlDir + "debian-binary", tlDir.length()) || !deb.Add(tlDir + "control.tar.gz", tlDir.length()) || !deb.Add(tlDir + "data.tar" + compression_suffix, tlDir.length())) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Error creating debian package:" + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Error creating debian package:" << std::endl << "#top level directory: " << outputDir << std::endl << "#file: " << outputName << std::endl diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx index e95b96df..5616523 100644 --- a/Source/CPack/cmCPackDragNDropGenerator.cxx +++ b/Source/CPack/cmCPackDragNDropGenerator.cxx @@ -21,7 +21,7 @@ // For the old LocaleStringToLangAndRegionCodes() function, to convert // to the old Script Manager RegionCode values needed for the 'LPic' data // structure used for generating multi-lingual SLAs. -#include +# include #endif static const char* SLAHeader = @@ -77,8 +77,8 @@ int cmCPackDragNDropGenerator::InitializeInternal() const std::string hdiutil_path = cmSystemTools::FindProgram("hdiutil", std::vector(), false); if (hdiutil_path.empty()) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot locate hdiutil command" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Cannot locate hdiutil command" << std::endl); return 0; } this->SetOptionIfNotSet("CPACK_COMMAND_HDIUTIL", hdiutil_path.c_str()); @@ -86,16 +86,16 @@ int cmCPackDragNDropGenerator::InitializeInternal() const std::string setfile_path = cmSystemTools::FindProgram("SetFile", paths, false); if (setfile_path.empty()) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot locate SetFile command" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Cannot locate SetFile command" << std::endl); return 0; } this->SetOptionIfNotSet("CPACK_COMMAND_SETFILE", setfile_path.c_str()); const std::string rez_path = cmSystemTools::FindProgram("Rez", paths, false); if (rez_path.empty()) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot locate Rez command" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Cannot locate Rez command" << std::endl); return 0; } this->SetOptionIfNotSet("CPACK_COMMAND_REZ", rez_path.c_str()); @@ -124,8 +124,8 @@ int cmCPackDragNDropGenerator::InitializeInternal() return 0; } if (!cmSystemTools::FileExists(slaDirectory, false)) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "CPACK_DMG_SLA_DIR does not exist" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "CPACK_DMG_SLA_DIR does not exist" << std::endl); return 0; } @@ -140,14 +140,16 @@ int cmCPackDragNDropGenerator::InitializeInternal() for (auto const& language : languages) { std::string license = slaDirectory + "/" + language + ".license.txt"; if (!singleLicense && !cmSystemTools::FileExists(license)) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Missing license file " - << language << ".license.txt" << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Missing license file " << language << ".license.txt" + << std::endl); return 0; } std::string menu = slaDirectory + "/" + language + ".menu.txt"; if (!cmSystemTools::FileExists(menu)) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Missing menu file " - << language << ".menu.txt" << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Missing menu file " << language << ".menu.txt" + << std::endl); return 0; } } @@ -212,8 +214,9 @@ bool cmCPackDragNDropGenerator::CopyFile(std::ostringstream& source, { if (!cmSystemTools::CopyFileIfDifferent(source.str().c_str(), target.str().c_str())) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Error copying " - << source.str() << " to " << target.str() << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Error copying " << source.str() << " to " << target.str() + << std::endl); return false; } @@ -248,8 +251,8 @@ bool cmCPackDragNDropGenerator::RunCommand(std::ostringstream& command, this->GeneratorVerbose, cmDuration::zero()); if (!result || exit_code) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Error executing: " << command.str() - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Error executing: " << command.str() << std::endl); return false; } @@ -400,8 +403,8 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, std::ostringstream dummy_padding; dummy_padding << staging.str() << "/.dummy-padding-file"; if (!this->CreateEmptyFile(dummy_padding, 1048576)) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Error creating dummy padding file." - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Error creating dummy padding file." << std::endl); return 0; } @@ -460,8 +463,8 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, std::ostringstream dummy_padding; dummy_padding << temp_mount << "/.dummy-padding-file"; if (!cmSystemTools::RemoveFile(dummy_padding.str())) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Error removing dummy padding file." - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Error removing dummy padding file." << std::endl); had_error = true; } @@ -565,8 +568,9 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, CFLocaleCreateCanonicalLanguageIdentifierFromString( nullptr, language_cfstring); if (!iso_language) { - cmCPackLogger(cmCPackLog::LOG_ERROR, languages[i] - << " is not a recognized language" << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + languages[i] << " is not a recognized language" + << std::endl); } char iso_language_cstr[65]; CFStringGetCString(iso_language, iso_language_cstr, @@ -638,9 +642,10 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, ofs.Close(); if (have_write_license_error) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Error writing license file to SLA." - << std::endl - << error << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Error writing license file to SLA." << std::endl + << error + << std::endl); return 0; } @@ -692,9 +697,9 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, embed_sla_command << "\"" << temp_image << "\""; if (!this->RunCommand(embed_sla_command, &error)) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Error adding SLA." << std::endl - << error - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Error adding SLA." << std::endl + << error << std::endl); return 0; } @@ -726,9 +731,10 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, std::string convert_error; if (!this->RunCommand(final_image_command, &convert_error)) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Error compressing disk image." - << std::endl - << convert_error << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Error compressing disk image." << std::endl + << convert_error + << std::endl); return 0; } diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 64aba10..f15445b 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -25,8 +25,8 @@ #include "cmake.h" #if defined(__HAIKU__) -#include -#include +# include +# include #endif cmCPackGenerator::cmCPackGenerator() @@ -61,9 +61,10 @@ int cmCPackGenerator::PrepareNames() // checks CPACK_SET_DESTDIR support if (IsOn("CPACK_SET_DESTDIR")) { if (SETDESTDIR_UNSUPPORTED == SupportsSetDestdir()) { - cmCPackLogger( - cmCPackLog::LOG_ERROR, "CPACK_SET_DESTDIR is set to ON but the '" - << Name << "' generator does NOT support it." << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "CPACK_SET_DESTDIR is set to ON but the '" + << Name << "' generator does NOT support it." + << std::endl); return 0; } if (SETDESTDIR_SHOULD_NOT_BE_USED == SupportsSetDestdir()) { @@ -92,8 +93,8 @@ int cmCPackGenerator::PrepareNames() std::string outName = pfname; tempDirectory += "/" + outName; if (!this->GetOutputExtension()) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "No output extension specified" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "No output extension specified" << std::endl); return 0; } outName += this->GetOutputExtension(); @@ -125,8 +126,8 @@ int cmCPackGenerator::PrepareNames() "Look for: CPACK_PACKAGE_DESCRIPTION_FILE" << std::endl); const char* descFileName = this->GetOption("CPACK_PACKAGE_DESCRIPTION_FILE"); if (descFileName) { - cmCPackLogger(cmCPackLog::LOG_DEBUG, "Look for: " << descFileName - << std::endl); + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "Look for: " << descFileName << std::endl); if (!cmSystemTools::FileExists(descFileName)) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find description file name: [" @@ -161,8 +162,9 @@ int cmCPackGenerator::PrepareNames() const char* algoSignature = this->GetOption("CPACK_PACKAGE_CHECKSUM"); if (algoSignature) { if (!cmCryptoHash::New(algoSignature)) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot recognize algorithm: " - << algoSignature << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Cannot recognize algorithm: " << algoSignature + << std::endl); return 0; } } @@ -215,7 +217,8 @@ int cmCPackGenerator::InstallProject() cmSystemTools::ExpandListArgument(default_dir_install_permissions, items); for (const auto& arg : items) { if (!cmFSPermissions::stringToModeT(arg, default_dir_mode_v)) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Invalid permission value '" + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Invalid permission value '" << arg << "'." " CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS " @@ -289,10 +292,11 @@ int cmCPackGenerator::InstallProjectViaInstallCommands( ofs << "# Run command: " << ic << std::endl << "# Output:" << std::endl << output << std::endl; - cmCPackLogger( - cmCPackLog::LOG_ERROR, "Problem running install command: " - << ic << std::endl - << "Please check " << tmpFile << " for errors" << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Problem running install command: " + << ic << std::endl + << "Please check " << tmpFile << " for errors" + << std::endl); return 0; } } @@ -376,8 +380,9 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories( } std::string filePath = tempDir; filePath += "/" + subdir + "/" + cmSystemTools::RelativePath(top, gf); - cmCPackLogger(cmCPackLog::LOG_DEBUG, "Copy file: " - << inFile << " -> " << filePath << std::endl); + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "Copy file: " << inFile << " -> " << filePath + << std::endl); /* If the file is a symlink we will have to re-create it */ if (cmSystemTools::FileIsSymlink(inFile)) { std::string targetFile; @@ -392,8 +397,9 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories( filePath.c_str()) && cmSystemTools::CopyFileTime(inFile.c_str(), filePath.c_str()))) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem copying file: " - << inFile << " -> " << filePath << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Problem copying file: " << inFile << " -> " + << filePath << std::endl); return 0; } } @@ -402,40 +408,44 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories( std::string curDir = cmSystemTools::GetCurrentWorkingDirectory(); std::string goToDir = tempDir; goToDir += "/" + subdir; - cmCPackLogger(cmCPackLog::LOG_DEBUG, "Change dir to: " << goToDir - << std::endl); + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "Change dir to: " << goToDir << std::endl); cmWorkingDirectory workdir(goToDir); if (workdir.Failed()) { - cmCPackLogger( - cmCPackLog::LOG_ERROR, "Failed to change working directory to " - << goToDir << " : " << std::strerror(workdir.GetLastResult()) - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Failed to change working directory to " + << goToDir << " : " + << std::strerror(workdir.GetLastResult()) + << std::endl); return 0; } for (auto const& symlinked : symlinkedFiles) { - cmCPackLogger(cmCPackLog::LOG_DEBUG, "Will create a symlink: " - << symlinked.second << "--> " << symlinked.first - << std::endl); + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "Will create a symlink: " << symlinked.second << "--> " + << symlinked.first + << std::endl); // make sure directory exists for symlink std::string destDir = cmSystemTools::GetFilenamePath(symlinked.second); if (!destDir.empty() && !cmSystemTools::MakeDirectory(destDir, default_dir_mode)) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot create dir: " + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Cannot create dir: " << destDir << "\nTrying to create symlink: " << symlinked.second << "--> " << symlinked.first << std::endl); } if (!cmSystemTools::CreateSymlink(symlinked.first, symlinked.second)) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot create symlink: " + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Cannot create symlink: " << symlinked.second << "--> " << symlinked.first << std::endl); return 0; } } - cmCPackLogger(cmCPackLog::LOG_DEBUG, "Going back to: " << curDir - << std::endl); + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "Going back to: " << curDir << std::endl); } } } @@ -447,8 +457,8 @@ int cmCPackGenerator::InstallProjectViaInstallScript( { const char* cmakeScripts = this->GetOption("CPACK_INSTALL_SCRIPT"); if (cmakeScripts && *cmakeScripts) { - cmCPackLogger(cmCPackLog::LOG_OUTPUT, "- Install scripts: " << cmakeScripts - << std::endl); + cmCPackLogger(cmCPackLog::LOG_OUTPUT, + "- Install scripts: " << cmakeScripts << std::endl); std::vector cmakeScriptsVector; cmSystemTools::ExpandListArgument(cmakeScripts, cmakeScriptsVector); for (std::string const& installScript : cmakeScriptsVector) { @@ -603,8 +613,9 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( preinstall, buildConfig, "", false); cmCPackLogger(cmCPackLog::LOG_DEBUG, "- Install command: " << buildCommand << std::endl); - cmCPackLogger(cmCPackLog::LOG_OUTPUT, "- Run preinstall target for: " - << installProjectName << std::endl); + cmCPackLogger(cmCPackLog::LOG_OUTPUT, + "- Run preinstall target for: " << installProjectName + << std::endl); std::string output; int retVal = 1; bool resB = cmSystemTools::RunSingleCommand( @@ -619,10 +630,11 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( << "# Directory: " << installDirectory << std::endl << "# Output:" << std::endl << output << std::endl; - cmCPackLogger( - cmCPackLog::LOG_ERROR, "Problem running install command: " - << buildCommand << std::endl - << "Please check " << tmpFile << " for errors" << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Problem running install command: " + << buildCommand << std::endl + << "Please check " << tmpFile << " for errors" + << std::endl); return 0; } } @@ -636,8 +648,9 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( std::string tempInstallDirectory = baseTempInstallDirectory; installComponent = component; if (componentInstall) { - cmCPackLogger(cmCPackLog::LOG_OUTPUT, "- Install component: " - << installComponent << std::endl); + cmCPackLogger(cmCPackLog::LOG_OUTPUT, + "- Install component: " << installComponent + << std::endl); } cmake cm(cmake::RoleScript); @@ -733,8 +746,8 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( */ cmSystemTools::PutEnv(std::string("DESTDIR=") + tempInstallDirectory); - cmCPackLogger(cmCPackLog::LOG_DEBUG, "- Creating directory: '" - << dir << "'" << std::endl); + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "- Creating directory: '" << dir << "'" << std::endl); if (!cmsys::SystemTools::MakeDirectory(dir, default_dir_mode)) { cmCPackLogger( @@ -840,7 +853,8 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( localFileName = localFileName.substr(localFileName.find_first_not_of('/')); Components[installComponent].Files.push_back(localFileName); - cmCPackLogger(cmCPackLog::LOG_DEBUG, "Adding file <" + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "Adding file <" << localFileName << "> to component <" << installComponent << ">" << std::endl); } @@ -912,16 +926,16 @@ void cmCPackGenerator::SetOption(const std::string& op, const char* value) this->MakefileMap->RemoveDefinition(op); return; } - cmCPackLogger(cmCPackLog::LOG_DEBUG, this->GetNameOfClass() - << "::SetOption(" << op << ", " << value << ")" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_DEBUG, + this->GetNameOfClass() << "::SetOption(" << op << ", " << value + << ")" << std::endl); this->MakefileMap->AddDefinition(op, value); } int cmCPackGenerator::DoPackage() { - cmCPackLogger(cmCPackLog::LOG_OUTPUT, "Create package using " << this->Name - << std::endl); + cmCPackLogger(cmCPackLog::LOG_OUTPUT, + "Create package using " << this->Name << std::endl); // Prepare CPack internal name and check // values for many CPACK_xxx vars @@ -939,8 +953,9 @@ int cmCPackGenerator::DoPackage() const char* toplevelDirectory = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); if (cmSystemTools::FileExists(toplevelDirectory)) { - cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Remove toplevel directory: " - << toplevelDirectory << std::endl); + cmCPackLogger(cmCPackLog::LOG_VERBOSE, + "Remove toplevel directory: " << toplevelDirectory + << std::endl); if (!cmSystemTools::RepeatedRemoveDirectory(toplevelDirectory)) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem removing toplevel directory: " @@ -949,8 +964,8 @@ int cmCPackGenerator::DoPackage() } } } - cmCPackLogger(cmCPackLog::LOG_DEBUG, "About to install project " - << std::endl); + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "About to install project " << std::endl); if (!this->InstallProject()) { return 0; @@ -975,12 +990,13 @@ int cmCPackGenerator::DoPackage() } cmCPackLogger(cmCPackLog::LOG_OUTPUT, "Create package" << std::endl); - cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Package files to: " + cmCPackLogger(cmCPackLog::LOG_VERBOSE, + "Package files to: " << (tempPackageFileName ? tempPackageFileName : "(NULL)") << std::endl); if (cmSystemTools::FileExists(tempPackageFileName)) { - cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Remove old package file" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_VERBOSE, + "Remove old package file" << std::endl); cmSystemTools::RemoveFile(tempPackageFileName); } if (cmSystemTools::IsOn( @@ -1006,8 +1022,8 @@ int cmCPackGenerator::DoPackage() std::string()); if (!this->PackageFiles() || cmSystemTools::GetErrorOccuredFlag()) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem compressing the directory" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Problem compressing the directory" << std::endl); return 0; } } @@ -1022,8 +1038,9 @@ int cmCPackGenerator::DoPackage() * - the initially provided name may have changed * (because the specific generator did 'normalize' it) */ - cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Copying final package(s) [" - << packageFileNames.size() << "]:" << std::endl); + cmCPackLogger(cmCPackLog::LOG_VERBOSE, + "Copying final package(s) [" << packageFileNames.size() + << "]:" << std::endl); /* now copy package one by one */ for (std::string const& pkgFileName : packageFileNames) { std::string tmpPF(this->GetOption("CPACK_OUTPUT_FILE_PREFIX")); @@ -1031,20 +1048,23 @@ int cmCPackGenerator::DoPackage() tempPackageFileName = pkgFileName.c_str(); tmpPF += "/" + filename; const char* packageFileName = tmpPF.c_str(); - cmCPackLogger(cmCPackLog::LOG_DEBUG, "Copy final package(s): " + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "Copy final package(s): " << (tempPackageFileName ? tempPackageFileName : "(NULL)") << " to " << (packageFileName ? packageFileName : "(NULL)") << std::endl); if (!cmSystemTools::CopyFileIfDifferent(tempPackageFileName, packageFileName)) { cmCPackLogger( - cmCPackLog::LOG_ERROR, "Problem copying the package: " + cmCPackLog::LOG_ERROR, + "Problem copying the package: " << (tempPackageFileName ? tempPackageFileName : "(NULL)") << " to " << (packageFileName ? packageFileName : "(NULL)") << std::endl); return 0; } - cmCPackLogger(cmCPackLog::LOG_OUTPUT, "- package: " - << packageFileName << " generated." << std::endl); + cmCPackLogger(cmCPackLog::LOG_OUTPUT, + "- package: " << packageFileName << " generated." + << std::endl); /* Generate checksum file */ if (crypto) { @@ -1053,13 +1073,15 @@ int cmCPackGenerator::DoPackage() hashFile += "." + cmSystemTools::LowerCase(algo); cmsys::ofstream outF(hashFile.c_str()); if (!outF) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot create checksum file: " - << hashFile << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Cannot create checksum file: " << hashFile + << std::endl); return 0; } outF << crypto->HashFile(packageFileName) << " " << filename << "\n"; - cmCPackLogger(cmCPackLog::LOG_OUTPUT, "- checksum file: " - << hashFile << " generated." << std::endl); + cmCPackLogger(cmCPackLog::LOG_OUTPUT, + "- checksum file: " << hashFile << " generated." + << std::endl); } } @@ -1179,7 +1201,8 @@ const char* cmCPackGenerator::GetInstallPath() const char* cmCPackGenerator::GetPackagingInstallPrefix() { - cmCPackLogger(cmCPackLog::LOG_DEBUG, "GetPackagingInstallPrefix: '" + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "GetPackagingInstallPrefix: '" << this->GetOption("CPACK_PACKAGING_INSTALL_PREFIX") << "'" << std::endl); @@ -1188,11 +1211,12 @@ const char* cmCPackGenerator::GetPackagingInstallPrefix() std::string cmCPackGenerator::FindTemplate(const char* name) { - cmCPackLogger(cmCPackLog::LOG_DEBUG, "Look for template: " - << (name ? name : "(NULL)") << std::endl); + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "Look for template: " << (name ? name : "(NULL)") + << std::endl); std::string ffile = this->MakefileMap->GetModulesFile(name); - cmCPackLogger(cmCPackLog::LOG_DEBUG, "Found template: " << ffile - << std::endl); + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "Found template: " << ffile << std::endl); return ffile; } @@ -1260,10 +1284,10 @@ int cmCPackGenerator::PrepareGroupingKind() } if (!groupingType.empty()) { - cmCPackLogger(cmCPackLog::LOG_VERBOSE, "[" - << this->Name << "]" - << " requested component grouping = " << groupingType - << std::endl); + cmCPackLogger(cmCPackLog::LOG_VERBOSE, + "[" << this->Name << "]" + << " requested component grouping = " << groupingType + << std::endl); if (groupingType == "ALL_COMPONENTS_IN_ONE") { method = ONE_PACKAGE; } else if (groupingType == "IGNORE") { @@ -1272,11 +1296,11 @@ int cmCPackGenerator::PrepareGroupingKind() method = ONE_PACKAGE_PER_GROUP; } else { cmCPackLogger( - cmCPackLog::LOG_WARNING, "[" - << this->Name << "]" - << " requested component grouping type <" << groupingType - << "> UNKNOWN not in (ALL_COMPONENTS_IN_ONE,IGNORE,ONE_PER_GROUP)" - << std::endl); + cmCPackLog::LOG_WARNING, + "[" << this->Name << "]" + << " requested component grouping type <" << groupingType + << "> UNKNOWN not in (ALL_COMPONENTS_IN_ONE,IGNORE,ONE_PER_GROUP)" + << std::endl); } } @@ -1290,11 +1314,11 @@ int cmCPackGenerator::PrepareGroupingKind() method = ONE_PACKAGE_PER_COMPONENT; } cmCPackLogger( - cmCPackLog::LOG_WARNING, "[" - << this->Name << "]" - << " One package per component group requested, " - << "but NO component groups exist: Ignoring component group." - << std::endl); + cmCPackLog::LOG_WARNING, + "[" << this->Name << "]" + << " One package per component group requested, " + << "but NO component groups exist: Ignoring component group." + << std::endl); } // if user specified packaging method, override the default packaging method @@ -1305,10 +1329,10 @@ int cmCPackGenerator::PrepareGroupingKind() const char* method_names[] = { "ALL_COMPONENTS_IN_ONE", "IGNORE_GROUPS", "ONE_PER_GROUP" }; - cmCPackLogger(cmCPackLog::LOG_VERBOSE, "[" - << this->Name << "]" - << " requested component grouping = " - << method_names[componentPackageMethod] << std::endl); + cmCPackLogger(cmCPackLog::LOG_VERBOSE, + "[" << this->Name << "]" + << " requested component grouping = " + << method_names[componentPackageMethod] << std::endl); return 1; } @@ -1371,7 +1395,8 @@ bool cmCPackGenerator::SupportsComponentInstallation() const bool cmCPackGenerator::WantsComponentInstallation() const { - return (!IsOn("CPACK_MONOLITHIC_INSTALL") && SupportsComponentInstallation() + return (!IsOn("CPACK_MONOLITHIC_INSTALL") && + SupportsComponentInstallation() // check that we have at least one group or component && (!this->ComponentGroups.empty() || !this->Components.empty())); } diff --git a/Source/CPack/cmCPackGeneratorFactory.cxx b/Source/CPack/cmCPackGeneratorFactory.cxx index a395a8f..d47e5ed 100644 --- a/Source/CPack/cmCPackGeneratorFactory.cxx +++ b/Source/CPack/cmCPackGeneratorFactory.cxx @@ -9,7 +9,7 @@ #include "cmAlgorithms.h" #include "cmCPack7zGenerator.h" #ifdef HAVE_FREEBSD_PKG -#include "cmCPackFreeBSDGenerator.h" +# include "cmCPackFreeBSDGenerator.h" #endif #include "cmCPackDebGenerator.h" #include "cmCPackGenerator.h" @@ -24,25 +24,25 @@ #include "cmCPackZIPGenerator.h" #ifdef __APPLE__ -#include "cmCPackBundleGenerator.h" -#include "cmCPackDragNDropGenerator.h" -#include "cmCPackOSXX11Generator.h" -#include "cmCPackPackageMakerGenerator.h" -#include "cmCPackProductBuildGenerator.h" +# include "cmCPackBundleGenerator.h" +# include "cmCPackDragNDropGenerator.h" +# include "cmCPackOSXX11Generator.h" +# include "cmCPackPackageMakerGenerator.h" +# include "cmCPackProductBuildGenerator.h" #endif #ifdef __CYGWIN__ -#include "cmCPackCygwinBinaryGenerator.h" -#include "cmCPackCygwinSourceGenerator.h" +# include "cmCPackCygwinBinaryGenerator.h" +# include "cmCPackCygwinSourceGenerator.h" #endif #if !defined(_WIN32) && !defined(__QNXNTO__) && !defined(__BEOS__) && \ !defined(__HAIKU__) -#include "cmCPackRPMGenerator.h" +# include "cmCPackRPMGenerator.h" #endif #if defined(_WIN32) || (defined(__CYGWIN__) && defined(HAVE_LIBUUID)) -#include "WiX/cmCPackWIXGenerator.h" +# include "WiX/cmCPackWIXGenerator.h" #endif cmCPackGeneratorFactory::cmCPackGeneratorFactory() diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index 3f7164a..a893a0f 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -20,9 +20,9 @@ /* NSIS uses different command line syntax on Windows and others */ #ifdef _WIN32 -#define NSIS_OPT "/" +# define NSIS_OPT "/" #else -#define NSIS_OPT "-" +# define NSIS_OPT "-" #endif cmCPackNSISGenerator::cmCPackNSISGenerator(bool nsis64) @@ -81,8 +81,8 @@ int cmCPackNSISGenerator::PackageFiles() str << " Delete \"" << outputDir << "\\" << fileN << "\"" << std::endl; } - cmCPackLogger(cmCPackLog::LOG_DEBUG, "Uninstall Files: " << str.str() - << std::endl); + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "Uninstall Files: " << str.str() << std::endl); this->SetOptionIfNotSet("CPACK_NSIS_DELETE_FILES", str.str().c_str()); std::vector dirs; this->GetListOfSubdirectories(toplevel.c_str(), dirs); @@ -117,12 +117,13 @@ int cmCPackNSISGenerator::PackageFiles() this->Components[componentName].Directories.push_back(std::move(fileN)); } } - cmCPackLogger(cmCPackLog::LOG_DEBUG, "Uninstall Dirs: " << dstr.str() - << std::endl); + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "Uninstall Dirs: " << dstr.str() << std::endl); this->SetOptionIfNotSet("CPACK_NSIS_DELETE_DIRECTORIES", dstr.str().c_str()); - cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: " - << nsisInFileName << " to " << nsisFileName << std::endl); + cmCPackLogger(cmCPackLog::LOG_VERBOSE, + "Configure file: " << nsisInFileName << " to " << nsisFileName + << std::endl); if (this->IsSet("CPACK_NSIS_MUI_ICON") || this->IsSet("CPACK_NSIS_MUI_UNIICON")) { std::string installerIconCode; @@ -308,10 +309,11 @@ int cmCPackNSISGenerator::PackageFiles() ofs << "# Run command: " << nsisCmd << std::endl << "# Output:" << std::endl << output << std::endl; - cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running NSIS command: " - << nsisCmd << std::endl - << "Please check " << tmpFile << " for errors" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Problem running NSIS command: " << nsisCmd << std::endl + << "Please check " + << tmpFile << " for errors" + << std::endl); return 0; } return 1; @@ -329,28 +331,31 @@ int cmCPackNSISGenerator::InitializeInternal() this->SetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY", nullptr); } - cmCPackLogger(cmCPackLog::LOG_DEBUG, "cmCPackNSISGenerator::Initialize()" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "cmCPackNSISGenerator::Initialize()" << std::endl); std::vector path; std::string nsisPath; bool gotRegValue = false; #ifdef _WIN32 if (Nsis64) { - if (!gotRegValue && cmsys::SystemTools::ReadRegistryValue( - "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS\\Unicode", - nsisPath, cmsys::SystemTools::KeyWOW64_64)) { + if (!gotRegValue && + cmsys::SystemTools::ReadRegistryValue( + "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS\\Unicode", nsisPath, + cmsys::SystemTools::KeyWOW64_64)) { gotRegValue = true; } - if (!gotRegValue && cmsys::SystemTools::ReadRegistryValue( - "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS", nsisPath, - cmsys::SystemTools::KeyWOW64_64)) { + if (!gotRegValue && + cmsys::SystemTools::ReadRegistryValue( + "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS", nsisPath, + cmsys::SystemTools::KeyWOW64_64)) { gotRegValue = true; } } - if (!gotRegValue && cmsys::SystemTools::ReadRegistryValue( - "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS\\Unicode", - nsisPath, cmsys::SystemTools::KeyWOW64_32)) { + if (!gotRegValue && + cmsys::SystemTools::ReadRegistryValue( + "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS\\Unicode", nsisPath, + cmsys::SystemTools::KeyWOW64_32)) { gotRegValue = true; } if (!gotRegValue && @@ -358,13 +363,15 @@ int cmCPackNSISGenerator::InitializeInternal() "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS\\Unicode", nsisPath)) { gotRegValue = true; } - if (!gotRegValue && cmsys::SystemTools::ReadRegistryValue( - "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS", nsisPath, - cmsys::SystemTools::KeyWOW64_32)) { + if (!gotRegValue && + cmsys::SystemTools::ReadRegistryValue( + "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS", nsisPath, + cmsys::SystemTools::KeyWOW64_32)) { gotRegValue = true; } - if (!gotRegValue && cmsys::SystemTools::ReadRegistryValue( - "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS", nsisPath)) { + if (!gotRegValue && + cmsys::SystemTools::ReadRegistryValue( + "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS", nsisPath)) { gotRegValue = true; } @@ -395,8 +402,8 @@ int cmCPackNSISGenerator::InitializeInternal() } std::string nsisCmd = "\"" + nsisPath + "\" " NSIS_OPT "VERSION"; - cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Test NSIS version: " << nsisCmd - << std::endl); + cmCPackLogger(cmCPackLog::LOG_VERBOSE, + "Test NSIS version: " << nsisCmd << std::endl); std::string output; int retVal = 1; bool resS = cmSystemTools::RunSingleCommand( @@ -413,17 +420,18 @@ int cmCPackNSISGenerator::InitializeInternal() ofs << "# Run command: " << nsisCmd << std::endl << "# Output:" << std::endl << output << std::endl; - cmCPackLogger( - cmCPackLog::LOG_ERROR, "Problem checking NSIS version with command: " - << nsisCmd << std::endl - << "Please check " << tmpFile << " for errors" << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Problem checking NSIS version with command: " + << nsisCmd << std::endl + << "Please check " << tmpFile << " for errors" + << std::endl); return 0; } if (versionRex.find(output)) { double nsisVersion = atof(versionRex.match(1).c_str()); double minNSISVersion = 2.09; - cmCPackLogger(cmCPackLog::LOG_DEBUG, "NSIS Version: " << nsisVersion - << std::endl); + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "NSIS Version: " << nsisVersion << std::endl); if (nsisVersion < minNSISVersion) { cmCPackLogger(cmCPackLog::LOG_ERROR, "CPack requires NSIS Version 2.09 or greater. " @@ -434,8 +442,8 @@ int cmCPackNSISGenerator::InitializeInternal() } if (versionRexCVS.find(output)) { // No version check for NSIS cvs build - cmCPackLogger(cmCPackLog::LOG_DEBUG, "NSIS Version: CVS " - << versionRexCVS.match(1) << std::endl); + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "NSIS Version: CVS " << versionRexCVS.match(1) << std::endl); } this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM", nsisPath.c_str()); this->SetOptionIfNotSet("CPACK_NSIS_EXECUTABLES_DIRECTORY", "bin"); @@ -447,8 +455,9 @@ int cmCPackNSISGenerator::InitializeInternal() this->GetOption("CPACK_NSIS_EXECUTABLES_DIRECTORY"); std::vector cpackPackageDesktopLinksVector; if (cpackPackageDeskTopLinks) { - cmCPackLogger(cmCPackLog::LOG_DEBUG, "CPACK_CREATE_DESKTOP_LINKS: " - << cpackPackageDeskTopLinks << std::endl); + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "CPACK_CREATE_DESKTOP_LINKS: " << cpackPackageDeskTopLinks + << std::endl); cmSystemTools::ExpandListArgument(cpackPackageDeskTopLinks, cpackPackageDesktopLinksVector); @@ -457,7 +466,8 @@ int cmCPackNSISGenerator::InitializeInternal() "CPACK_CREATE_DESKTOP_LINKS: " << cpdl << std::endl); } } else { - cmCPackLogger(cmCPackLog::LOG_DEBUG, "CPACK_CREATE_DESKTOP_LINKS: " + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "CPACK_CREATE_DESKTOP_LINKS: " << "not set" << std::endl); } @@ -465,8 +475,9 @@ int cmCPackNSISGenerator::InitializeInternal() std::ostringstream deleteStr; if (cpackPackageExecutables) { - cmCPackLogger(cmCPackLog::LOG_DEBUG, "The cpackPackageExecutables: " - << cpackPackageExecutables << "." << std::endl); + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "The cpackPackageExecutables: " << cpackPackageExecutables + << "." << std::endl); std::vector cpackPackageExecutablesVector; cmSystemTools::ExpandListArgument(cpackPackageExecutables, cpackPackageExecutablesVector); @@ -683,8 +694,9 @@ std::string cmCPackNSISGenerator::CreateComponentDescription( << std::endl); if (cmSystemTools::FileExists(archiveFile, true)) { if (!cmSystemTools::RemoveFile(archiveFile)) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Unable to remove archive file " - << archiveFile << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Unable to remove archive file " << archiveFile + << std::endl); return ""; } } @@ -694,8 +706,8 @@ std::string cmCPackNSISGenerator::CreateComponentDescription( this->ReadListFile("CPackZIP.cmake"); if (!this->IsSet("ZIP_EXECUTABLE")) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Unable to find ZIP program" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Unable to find ZIP program" << std::endl); return ""; } } @@ -746,10 +758,11 @@ std::string cmCPackNSISGenerator::CreateComponentDescription( ofs << "# Run command: " << cmd << std::endl << "# Output:" << std::endl << output << std::endl; - cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running zip command: " - << cmd << std::endl - << "Please check " << tmpFile << " for errors" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Problem running zip command: " << cmd << std::endl + << "Please check " + << tmpFile << " for errors" + << std::endl); return ""; } diff --git a/Source/CPack/cmCPackNuGetGenerator.cxx b/Source/CPack/cmCPackNuGetGenerator.cxx index 2ebfb3d..2ae8cba 100644 --- a/Source/CPack/cmCPackNuGetGenerator.cxx +++ b/Source/CPack/cmCPackNuGetGenerator.cxx @@ -92,7 +92,8 @@ void cmCPackNuGetGenerator::SetupGroupComponentVariables(bool ignoreGroup) // Does the component belong to a group? if (comp.second.Group == nullptr) { cmCPackLogger( - cmCPackLog::LOG_VERBOSE, "Component <" + cmCPackLog::LOG_VERBOSE, + "Component <" << comp.second.Name << "> does not belong to any group, package it separately." << std::endl); diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx index e750de3..dab7283 100644 --- a/Source/CPack/cmCPackOSXX11Generator.cxx +++ b/Source/CPack/cmCPackOSXX11Generator.cxx @@ -27,8 +27,9 @@ int cmCPackOSXX11Generator::PackageFiles() const char* cpackPackageExecutables = this->GetOption("CPACK_PACKAGE_EXECUTABLES"); if (cpackPackageExecutables) { - cmCPackLogger(cmCPackLog::LOG_DEBUG, "The cpackPackageExecutables: " - << cpackPackageExecutables << "." << std::endl); + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "The cpackPackageExecutables: " << cpackPackageExecutables + << "." << std::endl); std::ostringstream str; std::ostringstream deleteStr; std::vector cpackPackageExecutablesVector; @@ -78,7 +79,8 @@ int cmCPackOSXX11Generator::PackageFiles() if (iconFile) { std::string iconFileName = cmsys::SystemTools::GetFilenameName(iconFile); if (!cmSystemTools::FileExists(iconFile)) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find icon file: " + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Cannot find icon file: " << iconFile << ". Please check CPACK_PACKAGE_ICON setting." << std::endl); @@ -109,8 +111,8 @@ int cmCPackOSXX11Generator::PackageFiles() !this->CopyResourcePlistFile("OSXScriptLauncher", appdir, this->GetOption("CPACK_PACKAGE_FILE_NAME"), true)) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem copying the resource files" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Problem copying the resource files" << std::endl); return 0; } @@ -147,8 +149,9 @@ int cmCPackOSXX11Generator::PackageFiles() dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM_DISK_IMAGE") << "\" create -ov -fs HFS+ -format UDZO -srcfolder \"" << diskImageDirectory << "\" \"" << packageFileNames[0] << "\""; - cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Compress disk image using command: " - << dmgCmd.str() << std::endl); + cmCPackLogger(cmCPackLog::LOG_VERBOSE, + "Compress disk image using command: " << dmgCmd.str() + << std::endl); // since we get random dashboard failures with this one // try running it more than once int retVal = 1; @@ -170,7 +173,8 @@ int cmCPackOSXX11Generator::PackageFiles() ofs << "# Run command: " << dmgCmd.str() << std::endl << "# Output:" << std::endl << output << std::endl; - cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running hdiutil command: " + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Problem running hdiutil command: " << dmgCmd.str() << std::endl << "Please check " << tmpFile << " for errors" << std::endl); @@ -182,13 +186,13 @@ int cmCPackOSXX11Generator::PackageFiles() int cmCPackOSXX11Generator::InitializeInternal() { - cmCPackLogger(cmCPackLog::LOG_DEBUG, "cmCPackOSXX11Generator::Initialize()" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "cmCPackOSXX11Generator::Initialize()" << std::endl); std::vector path; std::string pkgPath = cmSystemTools::FindProgram("hdiutil", path, false); if (pkgPath.empty()) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find hdiutil compiler" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Cannot find hdiutil compiler" << std::endl); return 0; } this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM_DISK_IMAGE", @@ -263,8 +267,9 @@ bool cmCPackOSXX11Generator::CopyResourcePlistFile( destFileName += "/"; destFileName += outputFileName; - cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: " - << inFileName << " to " << destFileName << std::endl); + cmCPackLogger(cmCPackLog::LOG_VERBOSE, + "Configure file: " << inFileName << " to " << destFileName + << std::endl); this->ConfigureFile(inFileName.c_str(), destFileName.c_str(), copyOnly); return true; } diff --git a/Source/CPack/cmCPackPKGGenerator.cxx b/Source/CPack/cmCPackPKGGenerator.cxx index 9ea8540..bdda386 100644 --- a/Source/CPack/cmCPackPKGGenerator.cxx +++ b/Source/CPack/cmCPackPKGGenerator.cxx @@ -26,8 +26,8 @@ bool cmCPackPKGGenerator::SupportsComponentInstallation() const int cmCPackPKGGenerator::InitializeInternal() { - cmCPackLogger(cmCPackLog::LOG_DEBUG, "cmCPackPKGGenerator::Initialize()" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "cmCPackPKGGenerator::Initialize()" << std::endl); return this->Superclass::InitializeInternal(); } @@ -52,8 +52,9 @@ void cmCPackPKGGenerator::WriteDistributionFile(const char* metapackageFile) std::string distributionTemplate = this->FindTemplate("CPack.distribution.dist.in"); if (distributionTemplate.empty()) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find input file: " - << distributionTemplate << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Cannot find input file: " << distributionTemplate + << std::endl); return; } @@ -270,23 +271,26 @@ bool cmCPackPKGGenerator::CopyCreateResourceFile(const std::string& name, std::string cpackVar = "CPACK_RESOURCE_FILE_" + uname; const char* inFileName = this->GetOption(cpackVar); if (!inFileName) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "CPack option: " - << cpackVar.c_str() - << " not specified. It should point to " - << (!name.empty() ? name : "") << ".rtf, " << name - << ".html, or " << name << ".txt file" << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "CPack option: " << cpackVar.c_str() + << " not specified. It should point to " + << (!name.empty() ? name : "") + << ".rtf, " << name << ".html, or " << name + << ".txt file" << std::endl); return false; } if (!cmSystemTools::FileExists(inFileName)) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find " - << (!name.empty() ? name : "") - << " resource file: " << inFileName << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Cannot find " << (!name.empty() ? name : "") + << " resource file: " << inFileName + << std::endl); return false; } std::string ext = cmSystemTools::GetFilenameLastExtension(inFileName); if (ext != ".rtfd" && ext != ".rtf" && ext != ".html" && ext != ".txt") { cmCPackLogger( - cmCPackLog::LOG_ERROR, "Bad file extension specified: " + cmCPackLog::LOG_ERROR, + "Bad file extension specified: " << ext << ". Currently only .rtfd, .rtf, .html, and .txt files allowed." << std::endl); @@ -330,8 +334,9 @@ bool cmCPackPKGGenerator::CopyResourcePlistFile(const std::string& name, destFileName += "/"; destFileName += outName; - cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: " - << inFileName << " to " << destFileName << std::endl); + cmCPackLogger(cmCPackLog::LOG_VERBOSE, + "Configure file: " << inFileName << " to " << destFileName + << std::endl); this->ConfigureFile(inFileName.c_str(), destFileName.c_str()); return true; } diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx index c515b85..5b1a641 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.cxx +++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx @@ -251,8 +251,8 @@ int cmCPackPackageMakerGenerator::PackageFiles() !this->CopyCreateResourceFile("Welcome", resDir) || !this->CopyResourcePlistFile("Info.plist") || !this->CopyResourcePlistFile("Description.plist")) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem copying the resource files" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Problem copying the resource files" << std::endl); return 0; } @@ -311,7 +311,8 @@ int cmCPackPackageMakerGenerator::PackageFiles() ofs << "# Run command: " << dmgCmd.str() << std::endl << "# Output:" << std::endl << output << std::endl; - cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running hdiutil command: " + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Problem running hdiutil command: " << dmgCmd.str() << std::endl << "Please check " << tmpFile << " for errors" << std::endl); @@ -357,8 +358,8 @@ int cmCPackPackageMakerGenerator::InitializeInternal() } else { pkgPath = cmSystemTools::FindProgram("PackageMaker", paths, false); if (pkgPath.empty()) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find PackageMaker compiler" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Cannot find PackageMaker compiler" << std::endl); return 0; } this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM", pkgPath.c_str()); @@ -415,12 +416,13 @@ int cmCPackPackageMakerGenerator::InitializeInternal() } this->PackageMakerVersion = atof(rexVersion.match(1).c_str()); if (this->PackageMakerVersion < 1.0) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Require PackageMaker 1.0 or higher" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Require PackageMaker 1.0 or higher" << std::endl); return 0; } - cmCPackLogger(cmCPackLog::LOG_DEBUG, "PackageMaker version is: " - << this->PackageMakerVersion << std::endl); + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "PackageMaker version is: " << this->PackageMakerVersion + << std::endl); // Determine the package compatibility version. If it wasn't // specified by the user, we define it based on which features the @@ -448,8 +450,8 @@ int cmCPackPackageMakerGenerator::InitializeInternal() std::vector no_paths; pkgPath = cmSystemTools::FindProgram("hdiutil", no_paths, false); if (pkgPath.empty()) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find hdiutil compiler" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Cannot find hdiutil compiler" << std::endl); return 0; } this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM_DISK_IMAGE", @@ -470,17 +472,18 @@ bool cmCPackPackageMakerGenerator::RunPackageMaker(const char* command, bool res = cmSystemTools::RunSingleCommand( command, &output, &output, &retVal, nullptr, this->GeneratorVerbose, cmDuration::zero()); - cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Done running package maker" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_VERBOSE, + "Done running package maker" << std::endl); if (!res || retVal) { cmGeneratedFileStream ofs(tmpFile.c_str()); ofs << "# Run command: " << command << std::endl << "# Output:" << std::endl << output << std::endl; - cmCPackLogger( - cmCPackLog::LOG_ERROR, "Problem running PackageMaker command: " - << command << std::endl - << "Please check " << tmpFile << " for errors" << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Problem running PackageMaker command: " + << command << std::endl + << "Please check " << tmpFile << " for errors" + << std::endl); return false; } // sometimes the command finishes but the directory is not yet @@ -505,8 +508,9 @@ bool cmCPackPackageMakerGenerator::GenerateComponentPackage( const char* packageFile, const char* packageDir, const cmCPackComponent& component) { - cmCPackLogger(cmCPackLog::LOG_OUTPUT, "- Building component package: " - << packageFile << std::endl); + cmCPackLogger(cmCPackLog::LOG_OUTPUT, + "- Building component package: " << packageFile + << std::endl); // The command that will be used to run PackageMaker std::ostringstream pkgCmd; diff --git a/Source/CPack/cmCPackProductBuildGenerator.cxx b/Source/CPack/cmCPackProductBuildGenerator.cxx index 57cf7ea..4ca0fa8 100644 --- a/Source/CPack/cmCPackProductBuildGenerator.cxx +++ b/Source/CPack/cmCPackProductBuildGenerator.cxx @@ -67,8 +67,8 @@ int cmCPackProductBuildGenerator::PackageFiles() this->GetOption("CPACK_PRODUCTBUILD_RESOURCES_DIR"); if (!cmSystemTools::CopyADirectory(userResDir, resDir)) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem copying the resource files" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Problem copying the resource files" << std::endl); return 0; } } @@ -121,16 +121,16 @@ int cmCPackProductBuildGenerator::InitializeInternal() std::string program = cmSystemTools::FindProgram("pkgbuild", no_paths, false); if (program.empty()) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find pkgbuild executable" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Cannot find pkgbuild executable" << std::endl); return 0; } this->SetOptionIfNotSet("CPACK_COMMAND_PKGBUILD", program.c_str()); program = cmSystemTools::FindProgram("productbuild", no_paths, false); if (program.empty()) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find productbuild executable" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Cannot find productbuild executable" << std::endl); return 0; } this->SetOptionIfNotSet("CPACK_COMMAND_PRODUCTBUILD", program.c_str()); @@ -172,8 +172,9 @@ bool cmCPackProductBuildGenerator::GenerateComponentPackage( packageFile += '/'; packageFile += packageFileName; - cmCPackLogger(cmCPackLog::LOG_OUTPUT, "- Building component package: " - << packageFile << std::endl); + cmCPackLogger(cmCPackLog::LOG_OUTPUT, + "- Building component package: " << packageFile + << std::endl); const char* comp_name = component ? component->Name.c_str() : nullptr; diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx index e40b74d..c389884 100644 --- a/Source/CPack/cmCPackRPMGenerator.cxx +++ b/Source/CPack/cmCPackRPMGenerator.cxx @@ -90,8 +90,8 @@ int cmCPackRPMGenerator::PackageOnePack(std::string const& initialToplevel, this->SetOption("CPACK_RPM_PACKAGE_COMPONENT_PART_PATH", component_path.c_str()); if (!this->ReadListFile("CPackRPM.cmake")) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Error while execution CPackRPM.cmake" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Error while execution CPackRPM.cmake" << std::endl); retval = 0; } @@ -165,7 +165,8 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup) } if (shouldSet) { - cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Setting " + cmCPackLogger(cmCPackLog::LOG_VERBOSE, + "Setting " << "CPACK_RPM_DEBUGINFO_PACKAGE because " << "CPACK_RPM_DEBUGINFO_SINGLE_PACKAGE is set but " << " none of the " @@ -203,8 +204,9 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup) continue; } - cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Packaging component group: " - << compGIt->first << std::endl); + cmCPackLogger(cmCPackLog::LOG_VERBOSE, + "Packaging component group: " << compGIt->first + << std::endl); retval &= PackageOnePack(initialTopLevel, compGIt->first); } // Handle Orphan components (components not belonging to any groups) @@ -226,7 +228,8 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup) } cmCPackLogger( - cmCPackLog::LOG_VERBOSE, "Component <" + cmCPackLog::LOG_VERBOSE, + "Component <" << compIt->second.Name << "> does not belong to any group, package it separately." << std::endl); @@ -242,7 +245,8 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup) } else if (mainCompIt != this->Components.end()) { retval &= PackageOnePack(initialTopLevel, mainCompIt->first); } else { - cmCPackLogger(cmCPackLog::LOG_ERROR, "CPACK_RPM_MAIN_COMPONENT set" + cmCPackLogger(cmCPackLog::LOG_ERROR, + "CPACK_RPM_MAIN_COMPONENT set" << " to non existing component.\n"); retval = 0; } @@ -276,7 +280,8 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup) if (mainCompIt != this->Components.end()) { retval &= PackageOnePack(initialTopLevel, mainCompIt->first); } else { - cmCPackLogger(cmCPackLog::LOG_ERROR, "CPACK_RPM_MAIN_COMPONENT set" + cmCPackLogger(cmCPackLog::LOG_ERROR, + "CPACK_RPM_MAIN_COMPONENT set" << " to non existing component.\n"); retval = 0; } @@ -290,8 +295,9 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup) std::map::iterator compGIt; for (compGIt = this->ComponentGroups.begin(); compGIt != this->ComponentGroups.end(); ++compGIt) { - cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Packaging component group: " - << compGIt->first << std::endl); + cmCPackLogger(cmCPackLog::LOG_VERBOSE, + "Packaging component group: " << compGIt->first + << std::endl); retval &= PackageOnePack(initialTopLevel, compGIt->first); } // Handle Orphan components (components not belonging to any groups) @@ -301,7 +307,8 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup) // Does the component belong to a group? if (compIt->second.Group == nullptr) { cmCPackLogger( - cmCPackLog::LOG_VERBOSE, "Component <" + cmCPackLog::LOG_VERBOSE, + "Component <" << compIt->second.Name << "> does not belong to any group, package it separately." << std::endl); @@ -320,7 +327,8 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup) } } else { cmCPackLogger( - cmCPackLog::LOG_ERROR, "CPACK_RPM_MAIN_COMPONENT not set but" + cmCPackLog::LOG_ERROR, + "CPACK_RPM_MAIN_COMPONENT not set but" << " it is mandatory with CPACK_RPM_DEBUGINFO_SINGLE_PACKAGE" << " being set.\n"); retval = 0; @@ -380,8 +388,8 @@ int cmCPackRPMGenerator::PackageComponentsAllInOne( if (this->ReadListFile("CPackRPM.cmake")) { AddGeneratedPackageNames(); } else { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Error while execution CPackRPM.cmake" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Error while execution CPackRPM.cmake" << std::endl); retval = 0; } diff --git a/Source/CPack/cmCPackSTGZGenerator.cxx b/Source/CPack/cmCPackSTGZGenerator.cxx index 3d7fd3c..ef0d118 100644 --- a/Source/CPack/cmCPackSTGZGenerator.cxx +++ b/Source/CPack/cmCPackSTGZGenerator.cxx @@ -56,7 +56,7 @@ int cmCPackSTGZGenerator::PackageFiles() S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IWOTH | S_IXOTH #endif - ); + ); } return retval; } @@ -100,8 +100,8 @@ int cmCPackSTGZGenerator::GenerateHeader(std::ostream* os) ++ptr; } counter++; - cmCPackLogger(cmCPackLog::LOG_DEBUG, "Number of lines: " << counter - << std::endl); + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "Number of lines: " << counter << std::endl); char buffer[1024]; sprintf(buffer, "%d", counter); cmSystemTools::ReplaceString(res, headerLengthTag, buffer); diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index 87ef5b6..c083945 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -13,7 +13,7 @@ #include #if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE) -#include "cmsys/ConsoleBuf.hxx" +# include "cmsys/ConsoleBuf.hxx" #endif #include "cmCPackGenerator.h" @@ -82,8 +82,9 @@ int cpackDefinitionArgument(const char* argument, const char* cValue, std::string key = value.substr(0, pos); value = value.c_str() + pos + 1; def->Map[key] = value; - cmCPack_Log(def->Log, cmCPackLog::LOG_DEBUG, "Set CPack variable: " - << key << " to \"" << value << "\"" << std::endl); + cmCPack_Log(def->Log, cmCPackLog::LOG_DEBUG, + "Set CPack variable: " << key << " to \"" << value << "\"" + << std::endl); return 1; } @@ -320,8 +321,8 @@ int main(int argc, char const* const* argv) } const char* genList = globalMF.GetDefinition("CPACK_GENERATOR"); if (!genList) { - cmCPack_Log(&log, cmCPackLog::LOG_ERROR, "CPack generator not specified" - << std::endl); + cmCPack_Log(&log, cmCPackLog::LOG_ERROR, + "CPack generator not specified" << std::endl); } else { std::vector generatorsVector; cmSystemTools::ExpandListArgument(genList, generatorsVector); @@ -384,8 +385,9 @@ int main(int argc, char const* const* argv) } if (parsed) { const char* projName = mf->GetDefinition("CPACK_PACKAGE_NAME"); - cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE, "Use generator: " - << cpackGenerator->GetNameOfClass() << std::endl); + cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE, + "Use generator: " << cpackGenerator->GetNameOfClass() + << std::endl); cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE, "For project: " << projName << std::endl); diff --git a/Source/CTest/cmCTestBZR.cxx b/Source/CTest/cmCTestBZR.cxx index 0152200..365f267 100644 --- a/Source/CTest/cmCTestBZR.cxx +++ b/Source/CTest/cmCTestBZR.cxx @@ -155,8 +155,9 @@ bool cmCTestBZR::NoteOldRevision() { this->OldRevision = this->LoadInfo(); this->Log << "Revision before update: " << this->OldRevision << "\n"; - cmCTestLog(this->CTest, HANDLER_OUTPUT, " Old revision of repository is: " - << this->OldRevision << "\n"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + " Old revision of repository is: " << this->OldRevision + << "\n"); this->PriorRev.Rev = this->OldRevision; return true; } @@ -165,14 +166,16 @@ bool cmCTestBZR::NoteNewRevision() { this->NewRevision = this->LoadInfo(); this->Log << "Revision after update: " << this->NewRevision << "\n"; - cmCTestLog(this->CTest, HANDLER_OUTPUT, " New revision of repository is: " - << this->NewRevision << "\n"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + " New revision of repository is: " << this->NewRevision + << "\n"); this->Log << "URL = " << this->URL << "\n"; return true; } -class cmCTestBZR::LogParser : public cmCTestVC::OutputLogger, - private cmXMLParser +class cmCTestBZR::LogParser + : public cmCTestVC::OutputLogger + , private cmXMLParser { public: LogParser(cmCTestBZR* bzr, const char* prefix) diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index ce6fbc7..8527d54 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -299,7 +299,8 @@ int cmCTestBuildHandler::ProcessHandler() this->ErrorWarningFileLineRegex.push_back(std::move(r)); } else { cmCTestLog( - this->CTest, ERROR_MESSAGE, "Problem Compiling regular expression: " + this->CTest, ERROR_MESSAGE, + "Problem Compiling regular expression: " << cmCTestWarningErrorFileLine[entry].RegularExpressionString << std::endl); } @@ -331,8 +332,8 @@ int cmCTestBuildHandler::ProcessHandler() cmGeneratedFileStream ofs; auto elapsed_time_start = std::chrono::steady_clock::now(); if (!this->StartLogFile("Build", ofs)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot create build log file" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Cannot create build log file" << std::endl); } // Create lists of regular expression strings for errors, error exceptions, @@ -352,7 +353,7 @@ int cmCTestBuildHandler::ProcessHandler() this->CustomWarningExceptions.push_back(cmCTestWarningExceptions[cc]); } -// Pre-compile regular expressions objects for all regular expressions + // Pre-compile regular expressions objects for all regular expressions #define cmCTestBuildHandlerPopulateRegexVector(strings, regexes) \ regexes.clear(); \ @@ -452,8 +453,8 @@ int cmCTestBuildHandler::ProcessHandler() // Generate XML output cmGeneratedFileStream xofs; if (!this->StartResultingXML(cmCTest::PartBuild, "Build", xofs)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot create build XML file" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Cannot create build XML file" << std::endl); return -1; } cmXMLWriter xml(xofs); @@ -466,19 +467,20 @@ int cmCTestBuildHandler::ProcessHandler() this->GenerateXMLFooter(xml, elapsed_build_time); if (res != cmsysProcess_State_Exited || retVal || this->TotalErrors > 0) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Error(s) when building project" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Error(s) when building project" << std::endl); } // Display message about number of errors and warnings - cmCTestLog(this->CTest, HANDLER_OUTPUT, " " - << this->TotalErrors - << (this->TotalErrors >= this->MaxErrors ? " or more" : "") - << " Compiler errors" << std::endl); - cmCTestLog(this->CTest, HANDLER_OUTPUT, " " - << this->TotalWarnings - << (this->TotalWarnings >= this->MaxWarnings ? " or more" : "") - << " Compiler warnings" << std::endl); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + " " << this->TotalErrors + << (this->TotalErrors >= this->MaxErrors ? " or more" : "") + << " Compiler errors" << std::endl); + cmCTestLog( + this->CTest, HANDLER_OUTPUT, + " " << this->TotalWarnings + << (this->TotalWarnings >= this->MaxWarnings ? " or more" : "") + << " Compiler warnings" << std::endl); return retVal; } @@ -779,8 +781,8 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, int* retVal, } argv.push_back(nullptr); - cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run command:", - this->Quiet); + cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Run command:", this->Quiet); for (char const* arg : argv) { if (!arg) { break; @@ -812,7 +814,8 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, int* retVal, cmProcessOutput processOutput(encoding); std::string strdata; cmCTestOptionalLog( - this->CTest, HANDLER_PROGRESS_OUTPUT, " Each symbol represents " + this->CTest, HANDLER_PROGRESS_OUTPUT, + " Each symbol represents " << tick_len << " bytes of output." << std::endl << (this->UseCTestLaunch ? "" @@ -868,7 +871,8 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, int* retVal, &this->BuildProcessingQueue); this->ProcessBuffer(nullptr, 0, tick, tick_len, ofs, &this->BuildProcessingErrorQueue); - cmCTestOptionalLog(this->CTest, HANDLER_PROGRESS_OUTPUT, " Size of output: " + cmCTestOptionalLog(this->CTest, HANDLER_PROGRESS_OUTPUT, + " Size of output: " << ((this->BuildOutputLogSize + 512) / 1024) << "K" << std::endl, this->Quiet); @@ -921,8 +925,9 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, int* retVal, errorwarning.Error = true; this->ErrorsAndWarnings.push_back(std::move(errorwarning)); this->TotalErrors++; - cmCTestLog(this->CTest, ERROR_MESSAGE, "There was an error: " - << cmsysProcess_GetErrorString(cp) << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "There was an error: " << cmsysProcess_GetErrorString(cp) + << std::endl); } cmsysProcess_Delete(cp); @@ -1049,7 +1054,8 @@ void cmCTestBuildHandler::ProcessBuffer(const char* data, size_t length, this->LastTickChar, this->Quiet); tickDisplayed = true; if (tick % tick_line_len == 0 && tick > 0) { - cmCTestOptionalLog(this->CTest, HANDLER_PROGRESS_OUTPUT, " Size: " + cmCTestOptionalLog(this->CTest, HANDLER_PROGRESS_OUTPUT, + " Size: " << ((this->BuildOutputLogSize + 512) / 1024) << "K" << std::endl << " ", @@ -1103,7 +1109,8 @@ int cmCTestBuildHandler::ProcessSingleLine(const char* data) for (cmsys::RegularExpression& rx : this->ErrorExceptionRegex) { if (rx.find(data)) { errorLine = 0; - cmCTestOptionalLog(this->CTest, DEBUG, " Not an error Line: " + cmCTestOptionalLog(this->CTest, DEBUG, + " Not an error Line: " << data << " (matches: " << this->CustomErrorExceptions[wrxCnt] << ")" << std::endl, @@ -1119,7 +1126,8 @@ int cmCTestBuildHandler::ProcessSingleLine(const char* data) for (cmsys::RegularExpression& rx : this->WarningMatchRegex) { if (rx.find(data)) { warningLine = 1; - cmCTestOptionalLog(this->CTest, DEBUG, " Warning Line: " + cmCTestOptionalLog(this->CTest, DEBUG, + " Warning Line: " << data << " (matches: " << this->CustomWarningMatches[wrxCnt] << ")" << std::endl, @@ -1134,7 +1142,8 @@ int cmCTestBuildHandler::ProcessSingleLine(const char* data) for (cmsys::RegularExpression& rx : this->WarningExceptionRegex) { if (rx.find(data)) { warningLine = 0; - cmCTestOptionalLog(this->CTest, DEBUG, " Not a warning Line: " + cmCTestOptionalLog(this->CTest, DEBUG, + " Not a warning Line: " << data << " (matches: " << this->CustomWarningExceptions[wrxCnt] << ")" << std::endl, diff --git a/Source/CTest/cmCTestCVS.cxx b/Source/CTest/cmCTestCVS.cxx index 5779935..4fb3273 100644 --- a/Source/CTest/cmCTestCVS.cxx +++ b/Source/CTest/cmCTestCVS.cxx @@ -134,8 +134,9 @@ private: bool ProcessLine() override { - if (this->Line == ("=======================================" - "======================================")) { + if (this->Line == + ("=======================================" + "======================================")) { // This line ends the revision list. if (this->Section == SectionRevisions) { this->FinishRevision(); diff --git a/Source/CTest/cmCTestConfigureHandler.cxx b/Source/CTest/cmCTestConfigureHandler.cxx index 821a94a..5967b74 100644 --- a/Source/CTest/cmCTestConfigureHandler.cxx +++ b/Source/CTest/cmCTestConfigureHandler.cxx @@ -51,8 +51,8 @@ int cmCTestConfigureHandler::ProcessHandler() if (!this->CTest->GetShowOnly()) { cmGeneratedFileStream os; if (!this->StartResultingXML(cmCTest::PartConfigure, "Configure", os)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot open configure file" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Cannot open configure file" << std::endl); return 1; } std::string start_time = this->CTest->CurrentTime(); diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index bafbe9a..43a2bae 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -197,10 +197,10 @@ bool cmCTestCoverageHandler::ShouldIDoCoverage(std::string const& file, for (cmsys::RegularExpression& rx : this->CustomCoverageExcludeRegex) { if (rx.find(file)) { - cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " File " - << file << " is excluded in CTestCustom.ctest" - << std::endl; - , this->Quiet); + cmCTestOptionalLog( + this->CTest, HANDLER_VERBOSE_OUTPUT, + " File " << file << " is excluded in CTestCustom.ctest" << std::endl; + , this->Quiet); return false; } } @@ -391,8 +391,8 @@ int cmCTestCoverageHandler::ProcessHandler() if (!this->StartResultingXML(cmCTest::PartCoverage, "Coverage", covSumFile)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot open coverage summary file." - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Cannot open coverage summary file." << std::endl); return -1; } covSumFile.setf(std::ios::fixed, std::ios::floatfield); @@ -429,9 +429,10 @@ int cmCTestCoverageHandler::ProcessHandler() this->Quiet); file_count++; if (file_count % 50 == 0) { - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " processed: " - << file_count << " out of " - << cont.TotalCoverage.size() << std::endl, + cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, + " processed: " << file_count << " out of " + << cont.TotalCoverage.size() + << std::endl, this->Quiet); cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " ", this->Quiet); } @@ -524,8 +525,9 @@ int cmCTestCoverageHandler::ProcessHandler() float cper = 0; float cmet = 0; if (tested + untested > 0) { - cper = (100 * SAFEDIV(static_cast(tested), - static_cast(tested + untested))); + cper = (100 * + SAFEDIV(static_cast(tested), + static_cast(tested + untested))); cmet = (SAFEDIV(static_cast(tested + 10), static_cast(tested + untested + 10))); } @@ -629,14 +631,14 @@ int cmCTestCoverageHandler::ProcessHandler() covSumXML.EndElement(); // Coverage this->CTest->EndXML(covSumXML); - cmCTestLog(this->CTest, HANDLER_OUTPUT, "" - << std::endl - << "\tCovered LOC: " << total_tested << std::endl - << "\tNot covered LOC: " << total_untested << std::endl - << "\tTotal LOC: " << total_lines << std::endl - << "\tPercentage Coverage: " - << std::setiosflags(std::ios::fixed) << std::setprecision(2) - << (percent_coverage) << "%" << std::endl); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + "" << std::endl + << "\tCovered LOC: " << total_tested << std::endl + << "\tNot covered LOC: " << total_untested << std::endl + << "\tTotal LOC: " << total_lines << std::endl + << "\tPercentage Coverage: " + << std::setiosflags(std::ios::fixed) << std::setprecision(2) + << (percent_coverage) << "%" << std::endl); ofs << "\tCovered LOC: " << total_tested << std::endl << "\tNot covered LOC: " << total_untested << std::endl @@ -677,9 +679,9 @@ void cmCTestCoverageHandler::PopulateCustomVectors(cmMakefile* mf) // Compare file names: fnc(fn1) == fnc(fn2) // fnc == file name compare // #ifdef _WIN32 -#define fnc(s) cmSystemTools::LowerCase(s) +# define fnc(s) cmSystemTools::LowerCase(s) #else -#define fnc(s) s +# define fnc(s) s #endif bool IsFileInDir(const std::string& infile, const std::string& indir) @@ -1045,7 +1047,8 @@ int cmCTestCoverageHandler::HandleGCovCoverage( continue; } if (retVal != 0) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Coverage command returned: " + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Coverage command returned: " << retVal << " while processing: " << f << std::endl); cmCTestLog(this->CTest, ERROR_MESSAGE, "Command produced error: " << cont->Error << std::endl); @@ -1077,8 +1080,8 @@ int cmCTestCoverageHandler::HandleGCovCoverage( gcovStyle = 1; } if (gcovStyle != 1) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown gcov output style e1" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Unknown gcov output style e1" << std::endl); cont->Error++; break; } @@ -1090,8 +1093,8 @@ int cmCTestCoverageHandler::HandleGCovCoverage( gcovStyle = 1; } if (gcovStyle != 1) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown gcov output style e2" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Unknown gcov output style e2" << std::endl); cont->Error++; break; } @@ -1102,8 +1105,8 @@ int cmCTestCoverageHandler::HandleGCovCoverage( gcovStyle = 2; } if (gcovStyle != 2) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown gcov output style e3" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Unknown gcov output style e3" << std::endl); cont->Error++; break; } @@ -1115,8 +1118,8 @@ int cmCTestCoverageHandler::HandleGCovCoverage( gcovStyle = 2; } if (gcovStyle != 2) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown gcov output style e4" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Unknown gcov output style e4" << std::endl); cont->Error++; break; } @@ -1125,8 +1128,8 @@ int cmCTestCoverageHandler::HandleGCovCoverage( gcovStyle = 2; } if (gcovStyle != 2) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown gcov output style e5" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Unknown gcov output style e5" << std::endl); cont->Error++; break; } @@ -1137,8 +1140,8 @@ int cmCTestCoverageHandler::HandleGCovCoverage( gcovStyle = 2; } if (gcovStyle != 2) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown gcov output style e6" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Unknown gcov output style e6" << std::endl); cont->Error++; break; } @@ -1152,37 +1155,40 @@ int cmCTestCoverageHandler::HandleGCovCoverage( gcovStyle = 2; } if (gcovStyle != 2) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown gcov output style e7" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Unknown gcov output style e7" << std::endl); cont->Error++; break; } - cmCTestOptionalLog(this->CTest, WARNING, "Warning: Cannot open file: " - << st2re5.match(1) << std::endl, + cmCTestOptionalLog(this->CTest, WARNING, + "Warning: Cannot open file: " << st2re5.match(1) + << std::endl, this->Quiet); } else if (st2re6.find(line.c_str())) { if (gcovStyle == 0) { gcovStyle = 2; } if (gcovStyle != 2) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown gcov output style e8" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Unknown gcov output style e8" << std::endl); cont->Error++; break; } - cmCTestOptionalLog(this->CTest, WARNING, "Warning: File: " - << st2re6.match(1) << " is newer than " - << st2re6.match(2) << std::endl, + cmCTestOptionalLog(this->CTest, WARNING, + "Warning: File: " << st2re6.match(1) + << " is newer than " + << st2re6.match(2) << std::endl, this->Quiet); } else { // gcov 4.7 can have output lines saying "No executable lines" and // "Removing 'filename.gcov'"... Don't log those as "errors." if (line != "No executable lines" && !cmSystemTools::StringStartsWith(line.c_str(), "Removing ")) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown gcov output line: [" - << line << "]" << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Unknown gcov output line: [" << line << "]" + << std::endl); cont->Error++; // abort(); } @@ -1418,7 +1424,8 @@ int cmCTestCoverageHandler::HandleLCovCoverage( continue; } if (retVal != 0) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Coverage command returned: " + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Coverage command returned: " << retVal << " while processing: " << f << std::endl); cmCTestLog(this->CTest, ERROR_MESSAGE, "Command produced error: " << cont->Error << std::endl); @@ -1817,7 +1824,8 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch( "run covbr: " << std::endl, this->Quiet); if (!this->RunBullseyeCommand(cont, "covbr", nullptr, outputFile)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "error running covbr for." + cmCTestLog(this->CTest, ERROR_MESSAGE, + "error running covbr for." << "\n"); return -1; } @@ -1981,8 +1989,8 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary( cmXMLWriter xml(covSumFile); if (!this->StartResultingXML(cmCTest::PartCoverage, "Coverage", covSumFile)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot open coverage summary file." - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Cannot open coverage summary file." << std::endl); return 0; } this->CTest->StartXML(xml, this->AppendXML); @@ -2198,7 +2206,8 @@ bool cmCTestCoverageHandler::ParseBullsEyeCovsrcLine( } // should be at the end now if (pos != std::string::npos) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Error parsing input : " + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Error parsing input : " << inputLine << " last pos not npos = " << pos << "\n"); } return true; diff --git a/Source/CTest/cmCTestCurl.cxx b/Source/CTest/cmCTestCurl.cxx index 7b5ea60..f7b5930 100644 --- a/Source/CTest/cmCTestCurl.cxx +++ b/Source/CTest/cmCTestCurl.cxx @@ -175,7 +175,8 @@ bool cmCTestCurl::UploadFile(std::string const& local_file, "Curl debug: [" << curlDebug << "]\n", this->Quiet); } if (response.empty()) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "No response from server.\n" + cmCTestLog(this->CTest, ERROR_MESSAGE, + "No response from server.\n" << curlDebug); return false; } @@ -186,7 +187,8 @@ bool cmCTestCurl::HttpRequest(std::string const& url, std::string const& fields, std::string& response) { response.clear(); - cmCTestOptionalLog(this->CTest, DEBUG, "HttpRequest\n" + cmCTestOptionalLog(this->CTest, DEBUG, + "HttpRequest\n" << "url: " << url << "\n" << "fields " << fields << "\n", this->Quiet); diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx index e85af5e..b919c79 100644 --- a/Source/CTest/cmCTestGIT.cxx +++ b/Source/CTest/cmCTestGIT.cxx @@ -70,8 +70,9 @@ std::string cmCTestGIT::GetWorkingRevision() bool cmCTestGIT::NoteOldRevision() { this->OldRevision = this->GetWorkingRevision(); - cmCTestLog(this->CTest, HANDLER_OUTPUT, " Old revision of repository is: " - << this->OldRevision << "\n"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + " Old revision of repository is: " << this->OldRevision + << "\n"); this->PriorRev.Rev = this->OldRevision; return true; } @@ -79,8 +80,9 @@ bool cmCTestGIT::NoteOldRevision() bool cmCTestGIT::NoteNewRevision() { this->NewRevision = this->GetWorkingRevision(); - cmCTestLog(this->CTest, HANDLER_OUTPUT, " New revision of repository is: " - << this->NewRevision << "\n"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + " New revision of repository is: " << this->NewRevision + << "\n"); return true; } diff --git a/Source/CTest/cmCTestGenericHandler.cxx b/Source/CTest/cmCTestGenericHandler.cxx index ce8f709..dc1bba0 100644 --- a/Source/CTest/cmCTestGenericHandler.cxx +++ b/Source/CTest/cmCTestGenericHandler.cxx @@ -100,8 +100,9 @@ bool cmCTestGenericHandler::StartResultingXML(cmCTest::Part part, } if (!this->CTest->OpenOutputFile(this->CTest->GetCurrentTag(), ostr.str(), xofs, true)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot create resulting XML file: " - << ostr.str() << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Cannot create resulting XML file: " << ostr.str() + << std::endl); return false; } this->CTest->AddSubmitFile(part, ostr.str().c_str()); diff --git a/Source/CTest/cmCTestHG.cxx b/Source/CTest/cmCTestHG.cxx index 525dacc..c3c5da4 100644 --- a/Source/CTest/cmCTestHG.cxx +++ b/Source/CTest/cmCTestHG.cxx @@ -107,8 +107,9 @@ std::string cmCTestHG::GetWorkingRevision() bool cmCTestHG::NoteOldRevision() { this->OldRevision = this->GetWorkingRevision(); - cmCTestLog(this->CTest, HANDLER_OUTPUT, " Old revision of repository is: " - << this->OldRevision << "\n"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + " Old revision of repository is: " << this->OldRevision + << "\n"); this->PriorRev.Rev = this->OldRevision; return true; } @@ -116,8 +117,9 @@ bool cmCTestHG::NoteOldRevision() bool cmCTestHG::NoteNewRevision() { this->NewRevision = this->GetWorkingRevision(); - cmCTestLog(this->CTest, HANDLER_OUTPUT, " New revision of repository is: " - << this->NewRevision << "\n"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + " New revision of repository is: " << this->NewRevision + << "\n"); return true; } @@ -157,8 +159,9 @@ bool cmCTestHG::UpdateImpl() return this->RunUpdateCommand(&hg_update[0], &out, &err); } -class cmCTestHG::LogParser : public cmCTestVC::OutputLogger, - private cmXMLParser +class cmCTestHG::LogParser + : public cmCTestVC::OutputLogger + , private cmXMLParser { public: LogParser(cmCTestHG* hg, const char* prefix) @@ -168,6 +171,7 @@ public: this->InitializeParser(); } ~LogParser() override { this->CleanupParser(); } + private: cmCTestHG* HG; diff --git a/Source/CTest/cmCTestHandlerCommand.cxx b/Source/CTest/cmCTestHandlerCommand.cxx index 1fff2fa..8863dc8 100644 --- a/Source/CTest/cmCTestHandlerCommand.cxx +++ b/Source/CTest/cmCTestHandlerCommand.cxx @@ -158,13 +158,14 @@ bool cmCTestHandlerCommand::InitialPass(std::vector const& args, "BuildDirectory", cmSystemTools::CollapseFullPath(bdir).c_str(), this->Quiet); } else { - cmCTestLog(this->CTest, ERROR_MESSAGE, "CTEST_BINARY_DIRECTORY not set" - << std::endl;); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "CTEST_BINARY_DIRECTORY not set" << std::endl;); } } if (this->Values[ct_SOURCE]) { - cmCTestLog(this->CTest, DEBUG, "Set source directory to: " - << this->Values[ct_SOURCE] << std::endl); + cmCTestLog(this->CTest, DEBUG, + "Set source directory to: " << this->Values[ct_SOURCE] + << std::endl); this->CTest->SetCTestConfiguration( "SourceDirectory", cmSystemTools::CollapseFullPath(this->Values[ct_SOURCE]).c_str(), @@ -186,8 +187,9 @@ bool cmCTestHandlerCommand::InitialPass(std::vector const& args, cmCTestLog(this->CTest, DEBUG, "Initialize handler" << std::endl;); cmCTestGenericHandler* handler = this->InitializeHandler(); if (!handler) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot instantiate test handler " - << this->GetName() << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Cannot instantiate test handler " << this->GetName() + << std::endl); if (capureCMakeError) { this->Makefile->AddDefinition(this->Values[ct_CAPTURE_CMAKE_ERROR], "-1"); @@ -226,8 +228,8 @@ bool cmCTestHandlerCommand::InitialPass(std::vector const& args, if (capureCMakeError) { this->Makefile->AddDefinition(this->Values[ct_CAPTURE_CMAKE_ERROR], "-1"); - cmCTestLog(this->CTest, ERROR_MESSAGE, this->GetName() - << " " << this->GetError() << "\n"); + cmCTestLog(this->CTest, ERROR_MESSAGE, + this->GetName() << " " << this->GetError() << "\n"); // return success because failure is recorded in CAPTURE_CMAKE_ERROR return true; } @@ -303,8 +305,8 @@ bool cmCTestHandlerCommand::CheckArgumentValue(std::string const& arg) return true; } this->Values[k] = arg.c_str(); - cmCTestLog(this->CTest, DEBUG, "Set " << this->Arguments[k] << " to " - << arg << "\n"); + cmCTestLog(this->CTest, DEBUG, + "Set " << this->Arguments[k] << " to " << arg << "\n"); return true; } return false; diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx index e078645..0bffde3 100644 --- a/Source/CTest/cmCTestLaunch.cxx +++ b/Source/CTest/cmCTestLaunch.cxx @@ -21,9 +21,9 @@ #include "cmake.h" #ifdef _WIN32 -#include // for _O_BINARY -#include // for _setmode -#include // for std{out,err} and fileno +# include // for _O_BINARY +# include // for _setmode +# include // for std{out,err} and fileno #endif cmCTestLaunch::cmCTestLaunch(int argc, const char* const* argv) diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index cb1d947..04d1839 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -37,8 +37,9 @@ static CatToErrorType cmCTestMemCheckBoundsChecker[] = { static void xmlReportError(int line, const char* msg, void* data) { cmCTest* ctest = static_cast(data); - cmCTestLog(ctest, ERROR_MESSAGE, "Error parsing XML in stream at line " - << line << ": " << msg << std::endl); + cmCTestLog(ctest, ERROR_MESSAGE, + "Error parsing XML in stream at line " << line << ": " << msg + << std::endl); } // parse the xml file containing the results of last BoundsChecker run @@ -366,10 +367,10 @@ void cmCTestMemCheckHandler::GenerateDartOutput(cmXMLWriter& xml) const int maxTestNameWidth = this->CTest->GetMaxTestNameWidth(); std::string outname = result.Name + " "; outname.resize(maxTestNameWidth + 4, '.'); - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, cc + 1 - << "/" << total << " MemCheck: #" - << result.TestCount << ": " << outname - << " Defects: " << memoryErrors << std::endl, + cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, + cc + 1 << "/" << total << " MemCheck: #" + << result.TestCount << ": " << outname + << " Defects: " << memoryErrors << std::endl, this->Quiet); } xml.StartElement("Log"); @@ -773,8 +774,9 @@ bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput( } } if (cc == this->ResultStrings.size()) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown Purify memory fault: " - << pfW.match(1) << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Unknown Purify memory fault: " << pfW.match(1) + << std::endl); ostr << "*** Unknown Purify memory fault: " << pfW.match(1) << std::endl; } @@ -918,11 +920,12 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput( break; // stop the copy of output if we are full } } - cmCTestOptionalLog( - this->CTest, DEBUG, "End test (elapsed: " - << cmDurationTo(std::chrono::steady_clock::now() - sttime) - << "s)" << std::endl, - this->Quiet); + cmCTestOptionalLog(this->CTest, DEBUG, + "End test (elapsed: " + << cmDurationTo( + std::chrono::steady_clock::now() - sttime) + << "s)" << std::endl, + this->Quiet); log = ostr.str(); this->DefectCount += defects; return defects == 0; @@ -963,11 +966,12 @@ bool cmCTestMemCheckHandler::ProcessMemCheckBoundsCheckerOutput( results[err]++; defects++; } - cmCTestOptionalLog( - this->CTest, DEBUG, "End test (elapsed: " - << cmDurationTo(std::chrono::steady_clock::now() - sttime) - << "s)" << std::endl, - this->Quiet); + cmCTestOptionalLog(this->CTest, DEBUG, + "End test (elapsed: " + << cmDurationTo( + std::chrono::steady_clock::now() - sttime) + << "s)" << std::endl, + this->Quiet); if (defects) { // only put the output of Bounds Checker if there were // errors or leaks detected diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 14b5caa..dcef8a0 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -124,8 +124,9 @@ bool cmCTestMultiProcessHandler::StartTestProcess(int test) std::chrono::system_clock::time_point stop_time = this->CTest->GetStopTime(); if (stop_time != std::chrono::system_clock::time_point() && stop_time <= std::chrono::system_clock::now()) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "The stop time has been passed. " - "Stopping all tests." + cmCTestLog(this->CTest, ERROR_MESSAGE, + "The stop time has been passed. " + "Stopping all tests." << std::endl); this->StopTimePassed = true; return false; @@ -330,10 +331,10 @@ void cmCTestMultiProcessHandler::StartNextTests() bool testLoadOk = true; if (this->TestLoad > 0) { if (processors <= spareLoad) { - cmCTestLog(this->CTest, DEBUG, "OK to run " - << GetName(test) << ", it requires " << processors - << " procs & system load is: " << systemLoad - << std::endl); + cmCTestLog(this->CTest, DEBUG, + "OK to run " << GetName(test) << ", it requires " + << processors << " procs & system load is: " + << systemLoad << std::endl); allTestsFailedTestLoadCheck = false; } else { testLoadOk = false; @@ -712,8 +713,8 @@ void cmCTestMultiProcessHandler::PrintTestList() if (!p.Labels.empty()) // print the labels { - cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Labels:", - this->Quiet); + cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Labels:", this->Quiet); } for (std::string const& label : p.Labels) { cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " " << label, @@ -747,7 +748,8 @@ void cmCTestMultiProcessHandler::PrintTestList() cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, std::endl, this->Quiet); } - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, std::endl + cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, + std::endl << "Total Tests: " << this->Total << std::endl, this->Quiet); } diff --git a/Source/CTest/cmCTestMultiProcessHandler.h b/Source/CTest/cmCTestMultiProcessHandler.h index 19e1a35..203170e 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.h +++ b/Source/CTest/cmCTestMultiProcessHandler.h @@ -74,6 +74,7 @@ public: cmCTestTestHandler* GetTestHandler() { return this->TestHandler; } void SetQuiet(bool b) { this->Quiet = b; } + protected: // Start the next test or tests as many as are allowed by // ParallelLevel diff --git a/Source/CTest/cmCTestP4.cxx b/Source/CTest/cmCTestP4.cxx index fdf8932..511dbd2 100644 --- a/Source/CTest/cmCTestP4.cxx +++ b/Source/CTest/cmCTestP4.cxx @@ -372,8 +372,9 @@ bool cmCTestP4::NoteOldRevision() { this->OldRevision = this->GetWorkingRevision(); - cmCTestLog(this->CTest, HANDLER_OUTPUT, " Old revision of repository is: " - << this->OldRevision << "\n"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + " Old revision of repository is: " << this->OldRevision + << "\n"); this->PriorRev.Rev = this->OldRevision; return true; } @@ -382,8 +383,9 @@ bool cmCTestP4::NoteNewRevision() { this->NewRevision = this->GetWorkingRevision(); - cmCTestLog(this->CTest, HANDLER_OUTPUT, " New revision of repository is: " - << this->NewRevision << "\n"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + " New revision of repository is: " << this->NewRevision + << "\n"); return true; } @@ -398,7 +400,8 @@ bool cmCTestP4::LoadRevisions() // If any revision is unknown it means we couldn't contact the server. // Do not process updates if (this->OldRevision == "" || this->NewRevision == "") { - cmCTestLog(this->CTest, HANDLER_OUTPUT, " At least one of the revisions " + cmCTestLog(this->CTest, HANDLER_OUTPUT, + " At least one of the revisions " << "is unknown. No repository changes will be reported.\n"); return false; } diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 8d8ebaa..e729eeb 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -41,8 +41,8 @@ cmCTestRunTest::cmCTestRunTest(cmCTestMultiProcessHandler& multiHandler) void cmCTestRunTest::CheckOutput(std::string const& line) { - cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, this->GetIndex() - << ": " << line << std::endl); + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + this->GetIndex() << ": " << line << std::endl); this->ProcessOutput += line; this->ProcessOutput += "\n"; @@ -50,7 +50,8 @@ void cmCTestRunTest::CheckOutput(std::string const& line) if (!this->TestProperties->TimeoutRegularExpressions.empty()) { for (auto& reg : this->TestProperties->TimeoutRegularExpressions) { if (reg.first.find(this->ProcessOutput.c_str())) { - cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, this->GetIndex() + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + this->GetIndex() << ": " << "Test timeout changed to " << std::chrono::duration_cast( @@ -380,10 +381,10 @@ void cmCTestRunTest::MemCheckPostProcess() if (!this->TestHandler->MemCheck) { return; } - cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, this->Index - << ": process test output now: " - << this->TestProperties->Name << " " - << this->TestResult.Name << std::endl, + cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + this->Index << ": process test output now: " + << this->TestProperties->Name << " " + << this->TestResult.Name << std::endl, this->TestHandler->GetQuiet()); cmCTestMemCheckHandler* handler = static_cast(this->TestHandler); @@ -425,7 +426,8 @@ void cmCTestRunTest::StartFailure(std::string const& output) bool cmCTestRunTest::StartTest(size_t total) { this->TotalNumberOfTests = total; // save for rerun case - cmCTestLog(this->CTest, HANDLER_OUTPUT, std::setw(2 * getNumWidth(total) + 8) + cmCTestLog(this->CTest, HANDLER_OUTPUT, + std::setw(2 * getNumWidth(total) + 8) << "Start " << std::setw(getNumWidth(this->TestHandler->GetMaxIndex())) << this->TestProperties->Index << ": " @@ -592,20 +594,21 @@ void cmCTestRunTest::ComputeArguments() this->TestResult.FullCommandLine = testCommand; // Print the test command in verbose mode - cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + std::endl << this->Index << ": " << (this->TestHandler->MemCheck ? "MemCheck" : "Test") << " command: " << testCommand << std::endl); // Print any test-specific env vars in verbose mode if (!this->TestProperties->Environment.empty()) { - cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, this->Index - << ": " - << "Environment variables: " << std::endl); + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + this->Index << ": " + << "Environment variables: " << std::endl); } for (std::string const& env : this->TestProperties->Environment) { - cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, this->Index << ": " << env - << std::endl); + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + this->Index << ": " << env << std::endl); } } @@ -658,10 +661,11 @@ bool cmCTestRunTest::ForkProcess(cmDuration testTimeOut, bool explicitTimeout, if (testTimeOut == cmDuration::zero() && explicitTimeout) { timeout = cmDuration::zero(); } - cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, this->Index - << ": " - << "Test timeout computed to be: " - << cmDurationTo(timeout) << "\n", + cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + this->Index << ": " + << "Test timeout computed to be: " + << cmDurationTo(timeout) + << "\n", this->TestHandler->GetQuiet()); this->TestProcess->SetTimeout(timeout); @@ -687,20 +691,20 @@ void cmCTestRunTest::WriteLogOutputTop(size_t completed, size_t total) // got for run until pass. Trick is when this is called we don't // yet know if we are passing or failing. if (this->NumberOfRunsLeft == 1) { - cmCTestLog(this->CTest, HANDLER_OUTPUT, std::setw(getNumWidth(total)) - << completed << "/"); - cmCTestLog(this->CTest, HANDLER_OUTPUT, std::setw(getNumWidth(total)) - << total << " "); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + std::setw(getNumWidth(total)) << completed << "/"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + std::setw(getNumWidth(total)) << total << " "); } // if this is one of several runs of a test just print blank space // to keep things neat else { - cmCTestLog(this->CTest, HANDLER_OUTPUT, std::setw(getNumWidth(total)) - << " " - << " "); - cmCTestLog(this->CTest, HANDLER_OUTPUT, std::setw(getNumWidth(total)) - << " " - << " "); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + std::setw(getNumWidth(total)) << " " + << " "); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + std::setw(getNumWidth(total)) << " " + << " "); } if (this->TestHandler->MemCheck) { @@ -746,8 +750,8 @@ void cmCTestRunTest::WriteLogOutputTop(size_t completed, size_t total) << std::endl; cmCTestLog(this->CTest, HANDLER_OUTPUT, outname.c_str()); - cmCTestLog(this->CTest, DEBUG, "Testing " << this->TestProperties->Name - << " ... "); + cmCTestLog(this->CTest, DEBUG, + "Testing " << this->TestProperties->Name << " ... "); } void cmCTestRunTest::FinalizeTest() diff --git a/Source/CTest/cmCTestSVN.cxx b/Source/CTest/cmCTestSVN.cxx index 73184fc..58d9b3d 100644 --- a/Source/CTest/cmCTestSVN.cxx +++ b/Source/CTest/cmCTestSVN.cxx @@ -107,9 +107,10 @@ bool cmCTestSVN::NoteOldRevision() svninfo.OldRevision = this->LoadInfo(svninfo); this->Log << "Revision for repository '" << svninfo.LocalPath << "' before update: " << svninfo.OldRevision << "\n"; - cmCTestLog( - this->CTest, HANDLER_OUTPUT, " Old revision of external repository '" - << svninfo.LocalPath << "' is: " << svninfo.OldRevision << "\n"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + " Old revision of external repository '" + << svninfo.LocalPath << "' is: " << svninfo.OldRevision + << "\n"); } // Set the global old revision to the one of the root @@ -128,9 +129,10 @@ bool cmCTestSVN::NoteNewRevision() svninfo.NewRevision = this->LoadInfo(svninfo); this->Log << "Revision for repository '" << svninfo.LocalPath << "' after update: " << svninfo.NewRevision << "\n"; - cmCTestLog( - this->CTest, HANDLER_OUTPUT, " New revision of external repository '" - << svninfo.LocalPath << "' is: " << svninfo.NewRevision << "\n"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + " New revision of external repository '" + << svninfo.LocalPath << "' is: " << svninfo.NewRevision + << "\n"); // svninfo.Root = ""; // uncomment to test GuessBase this->Log << "Repository '" << svninfo.LocalPath @@ -290,8 +292,9 @@ bool cmCTestSVN::RunSVNCommand(std::vector const& parameters, return RunChild(&args[0], out, err); } -class cmCTestSVN::LogParser : public cmCTestVC::OutputLogger, - private cmXMLParser +class cmCTestSVN::LogParser + : public cmCTestVC::OutputLogger + , private cmXMLParser { public: LogParser(cmCTestSVN* svn, const char* prefix, SVNInfo& svninfo) @@ -302,6 +305,7 @@ public: this->InitializeParser(); } ~LogParser() override { this->CleanupParser(); } + private: cmCTestSVN* SVN; cmCTestSVN::SVNInfo& SVNRepo; diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 5fff730..333c899 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -39,9 +39,9 @@ #include "cmake.h" #ifdef _WIN32 -#include +# include #else -#include +# include #endif class cmExecutionStatus; @@ -184,8 +184,9 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg) argv.push_back("-SR"); argv.push_back(total_script_arg.c_str()); - cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Executable for CTest is: " - << cmSystemTools::GetCTestCommand() << "\n"); + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Executable for CTest is: " << cmSystemTools::GetCTestCommand() + << "\n"); // now pass through all the other arguments std::vector& initArgs = @@ -210,8 +211,8 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg) int pipe = cmSystemTools::WaitForLine(cp, line, std::chrono::seconds(100), out, err); while (pipe != cmsysProcess_Pipe_None) { - cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Output: " << line - << "\n"); + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Output: " << line << "\n"); if (pipe == cmsysProcess_Pipe_STDERR) { cmCTestLog(this->CTest, ERROR_MESSAGE, line << "\n"); } else if (pipe == cmsysProcess_Pipe_STDOUT) { @@ -230,17 +231,19 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg) retVal = cmsysProcess_GetExitValue(cp); } else if (result == cmsysProcess_State_Exception) { retVal = cmsysProcess_GetExitException(cp); - cmCTestLog(this->CTest, ERROR_MESSAGE, "\tThere was an exception: " + cmCTestLog(this->CTest, ERROR_MESSAGE, + "\tThere was an exception: " << cmsysProcess_GetExceptionString(cp) << " " << retVal << std::endl); failed = true; } else if (result == cmsysProcess_State_Expired) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "\tThere was a timeout" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "\tThere was a timeout" << std::endl); failed = true; } else if (result == cmsysProcess_State_Error) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "\tError executing ctest: " - << cmsysProcess_GetErrorString(cp) << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "\tError executing ctest: " << cmsysProcess_GetErrorString(cp) + << std::endl); failed = true; } cmsysProcess_Delete(cp); @@ -253,8 +256,8 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg) message << arg << " "; } } - cmCTestLog(this->CTest, ERROR_MESSAGE, message.str() << argv[0] - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + message.str() << argv[0] << std::endl); return -1; } return retVal; @@ -372,8 +375,8 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg) this->Makefile->GetModulesFile("CTestScriptMode.cmake"); if (!this->Makefile->ReadListFile(systemFile.c_str()) || cmSystemTools::GetErrorOccuredFlag()) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Error in read:" << systemFile - << "\n"); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Error in read:" << systemFile << "\n"); return 2; } diff --git a/Source/CTest/cmCTestStartCommand.cxx b/Source/CTest/cmCTestStartCommand.cxx index 367616c..3911540 100644 --- a/Source/CTest/cmCTestStartCommand.cxx +++ b/Source/CTest/cmCTestStartCommand.cxx @@ -98,14 +98,16 @@ bool cmCTestStartCommand::InitialPass(std::vector const& args, this->Quiet); if (smodel) { - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "Run dashboard with model " + cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, + "Run dashboard with model " << smodel << std::endl << " Source directory: " << src_dir << std::endl << " Build directory: " << bld_dir << std::endl, this->Quiet); } else { - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "Run dashboard with " - "to-be-determined model" + cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, + "Run dashboard with " + "to-be-determined model" << std::endl << " Source directory: " << src_dir << std::endl << " Build directory: " << bld_dir << std::endl, diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 3bab81e..cae3d4c 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -28,9 +28,9 @@ #include "cmake.h" #if defined(CTEST_USE_XMLRPC) -#include "cmVersion.h" -#include "cm_sys_stat.h" -#include "cm_xmlrpc.h" +# include "cmVersion.h" +# include "cm_sys_stat.h" +# include "cm_xmlrpc.h" #endif #define SUBMIT_TIMEOUT_IN_SECONDS_DEFAULT 120 @@ -248,14 +248,16 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix, res = ::curl_easy_perform(curl); if (!chunk.empty()) { - cmCTestOptionalLog(this->CTest, DEBUG, "CURL output: [" + cmCTestOptionalLog(this->CTest, DEBUG, + "CURL output: [" << cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]" << std::endl, this->Quiet); } if (!chunkDebug.empty()) { cmCTestOptionalLog( - this->CTest, DEBUG, "CURL debug output: [" + this->CTest, DEBUG, + "CURL debug output: [" << cmCTestLogWrite(&*chunkDebug.begin(), chunkDebug.size()) << "]" << std::endl, this->Quiet); @@ -263,8 +265,9 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix, fclose(ftpfile); if (res) { - cmCTestLog(this->CTest, ERROR_MESSAGE, " Error when uploading file: " - << local_file << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + " Error when uploading file: " << local_file + << std::endl); cmCTestLog(this->CTest, ERROR_MESSAGE, " Error message was: " << error_buffer << std::endl); *this->LogFile << " Error when uploading file: " << local_file @@ -274,7 +277,8 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix, // avoid dereference of empty vector if (!chunk.empty()) { *this->LogFile << cmCTestLogWrite(&*chunk.begin(), chunk.size()); - cmCTestLog(this->CTest, ERROR_MESSAGE, "CURL output: [" + cmCTestLog(this->CTest, ERROR_MESSAGE, + "CURL output: [" << cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]" << std::endl); } @@ -418,8 +422,8 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix, } } std::string upload_as = url + - ((url.find('?') == std::string::npos) ? '?' : '&') + "FileName=" + - ofile; + ((url.find('?') == std::string::npos) ? '?' : '&') + + "FileName=" + ofile; upload_as += "&MD5="; @@ -475,7 +479,8 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix, res = ::curl_easy_perform(curl); if (!chunk.empty()) { - cmCTestOptionalLog(this->CTest, DEBUG, "CURL output: [" + cmCTestOptionalLog(this->CTest, DEBUG, + "CURL output: [" << cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]" << std::endl, this->Quiet); @@ -483,7 +488,8 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix, } if (!chunkDebug.empty()) { cmCTestOptionalLog( - this->CTest, DEBUG, "CURL debug output: [" + this->CTest, DEBUG, + "CURL debug output: [" << cmCTestLogWrite(&*chunkDebug.begin(), chunkDebug.size()) << "]" << std::endl, this->Quiet); @@ -537,7 +543,8 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix, if (!chunk.empty()) { cmCTestOptionalLog( - this->CTest, DEBUG, "CURL output: [" + this->CTest, DEBUG, + "CURL output: [" << cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]" << std::endl, this->Quiet); @@ -552,8 +559,9 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix, fclose(ftpfile); if (res) { - cmCTestLog(this->CTest, ERROR_MESSAGE, " Error when uploading file: " - << local_file << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + " Error when uploading file: " << local_file + << std::endl); cmCTestLog(this->CTest, ERROR_MESSAGE, " Error message was: " << error_buffer << std::endl); *this->LogFile << " Error when uploading file: " << local_file @@ -565,7 +573,8 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix, *this->LogFile << " Curl output was: " << cmCTestLogWrite(&*chunk.begin(), chunk.size()) << std::endl; - cmCTestLog(this->CTest, ERROR_MESSAGE, "CURL output: [" + cmCTestLog(this->CTest, ERROR_MESSAGE, + "CURL output: [" << cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]" << std::endl); } @@ -612,7 +621,8 @@ void cmCTestSubmitHandler::ParseResponse( } if (this->HasWarnings || this->HasErrors) { - cmCTestLog(this->CTest, HANDLER_OUTPUT, " Server Response:\n" + cmCTestLog(this->CTest, HANDLER_OUTPUT, + " Server Response:\n" << cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "\n"); } } @@ -689,8 +699,8 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(const std::set& files, } } std::string turl = url + - ((url.find('?') == std::string::npos) ? '?' : '&') + "xmlfile=" + - ofile; + ((url.find('?') == std::string::npos) ? '?' : '&') + + "xmlfile=" + ofile; *this->LogFile << "Trigger url: " << turl << std::endl; cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Trigger url: " << turl << std::endl, this->Quiet); @@ -709,7 +719,8 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(const std::set& files, *this->LogFile << " Curl output was: " << cmCTestLogWrite(&*chunk.begin(), chunk.size()) << std::endl; - cmCTestLog(this->CTest, ERROR_MESSAGE, "CURL output: [" + cmCTestLog(this->CTest, ERROR_MESSAGE, + "CURL output: [" << cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]" << std::endl); } @@ -719,14 +730,16 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(const std::set& files, } if (!chunk.empty()) { - cmCTestOptionalLog(this->CTest, DEBUG, "CURL output: [" + cmCTestOptionalLog(this->CTest, DEBUG, + "CURL output: [" << cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]" << std::endl, this->Quiet); } if (!chunkDebug.empty()) { cmCTestOptionalLog( - this->CTest, DEBUG, "CURL debug output: [" + this->CTest, DEBUG, + "CURL debug output: [" << cmCTestLogWrite(&*chunkDebug.begin(), chunkDebug.size()) << "]" << std::endl, this->Quiet); @@ -777,9 +790,9 @@ bool cmCTestSubmitHandler::SubmitUsingSCP(const std::string& scp_command, argv[1] = lfname.c_str(); std::string rfname = url + "/" + remoteprefix + file; argv[2] = rfname.c_str(); - cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Execute \"" - << argv[0] << "\" \"" << argv[1] << "\" \"" << argv[2] - << "\"" << std::endl, + cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Execute \"" << argv[0] << "\" \"" << argv[1] << "\" \"" + << argv[2] << "\"" << std::endl, this->Quiet); *this->LogFile << "Execute \"" << argv[0] << "\" \"" << argv[1] << "\" \"" << argv[2] << "\"" << std::endl; @@ -824,13 +837,14 @@ bool cmCTestSubmitHandler::SubmitUsingSCP(const std::string& scp_command, *this->LogFile << "\tThere was an exception: " << retVal << std::endl; problems++; } else if (result == cmsysProcess_State_Expired) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "\tThere was a timeout" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "\tThere was a timeout" << std::endl); *this->LogFile << "\tThere was a timeout" << std::endl; problems++; } else if (result == cmsysProcess_State_Error) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "\tError executing SCP: " - << cmsysProcess_GetErrorString(cp) << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "\tError executing SCP: " << cmsysProcess_GetErrorString(cp) + << std::endl); *this->LogFile << "\tError executing SCP: " << cmsysProcess_GetErrorString(cp) << std::endl; problems++; @@ -864,8 +878,9 @@ bool cmCTestSubmitHandler::SubmitUsingCP(const std::string& localprefix, lfname += "/" + file; std::string rfname = destination + "/" + remoteprefix + file; cmSystemTools::CopyFileAlways(lfname, rfname); - cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Copy file: " - << lfname << " to " << rfname << std::endl, + cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + " Copy file: " << lfname << " to " << rfname + << std::endl, this->Quiet); } std::string tagDoneFile = destination + "/" + remoteprefix + "DONE"; @@ -892,8 +907,9 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC( xmlrpc_env_init(&env); /* Call the famous server at UserLand. */ - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " Submitting to: " - << realURL << " (" << remoteprefix << ")" << std::endl, + cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, + " Submitting to: " << realURL << " (" << remoteprefix + << ")" << std::endl, this->Quiet); for (std::string const& file : files) { xmlrpc_value* result; @@ -916,8 +932,8 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC( // make sure the file is not too big. if (static_cast(static_cast(st.st_size)) != static_cast(st.st_size)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, " File too big: " << local_file - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + " File too big: " << local_file << std::endl); return false; } size_t fileSize = static_cast(st.st_size); @@ -947,9 +963,10 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC( delete[] fileBuffer; if (env.fault_occurred) { - cmCTestLog(this->CTest, ERROR_MESSAGE, " Submission problem: " - << env.fault_string << " (" << env.fault_code << ")" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + " Submission problem: " << env.fault_string << " (" + << env.fault_code << ")" + << std::endl); xmlrpc_env_clean(&env); xmlrpc_client_cleanup(); return false; @@ -1004,8 +1021,8 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, return -1; } if (!cmSystemTools::FileExists(file)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Upload file not found: '" - << file << "'\n"); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Upload file not found: '" << file << "'\n"); return -1; } cmCTestCurl curl(this->CTest); @@ -1040,8 +1057,9 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, unsigned long retryDelayValue = 0; if (!cmSystemTools::StringToULong(retryDelayString.c_str(), &retryDelayValue)) { - cmCTestLog(this->CTest, WARNING, "Invalid value for 'RETRY_DELAY' : " - << retryDelayString << std::endl); + cmCTestLog(this->CTest, WARNING, + "Invalid value for 'RETRY_DELAY' : " << retryDelayString + << std::endl); } else { retryDelay = std::chrono::seconds(retryDelayValue); } @@ -1049,8 +1067,9 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, unsigned long retryCount = 0; if (!retryCountString.empty()) { if (!cmSystemTools::StringToULong(retryCountString.c_str(), &retryCount)) { - cmCTestLog(this->CTest, WARNING, "Invalid value for 'RETRY_DELAY' : " - << retryCountString << std::endl); + cmCTestLog(this->CTest, WARNING, + "Invalid value for 'RETRY_DELAY' : " << retryCountString + << std::endl); } } @@ -1118,7 +1137,8 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, } } if (!internalTest && !requestSucceeded) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Error in HttpRequest\n" + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Error in HttpRequest\n" << response); return -1; } @@ -1128,7 +1148,8 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, Json::Value json; Json::Reader reader; if (!internalTest && !reader.parse(response, json)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "error parsing json string [" + cmCTestLog(this->CTest, ERROR_MESSAGE, + "error parsing json string [" << response << "]\n" << reader.getFormattedErrorMessages() << "\n"); return -1; @@ -1195,12 +1216,14 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, } if (!uploadSucceeded) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "error uploading to CDash. " - << file << " " << url << " " << fstr.str()); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "error uploading to CDash. " << file << " " << url << " " + << fstr.str()); return -1; } if (!reader.parse(response, json)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "error parsing json string [" + cmCTestLog(this->CTest, ERROR_MESSAGE, + "error parsing json string [" << response << "]\n" << reader.getFormattedErrorMessages() << "\n"); return -1; @@ -1357,7 +1380,8 @@ int cmCTestSubmitHandler::ProcessHandler() cnt++; } } - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "Submit files (using " + cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, + "Submit files (using " << this->CTest->GetCTestConfiguration("DropMethod") << ")" << std::endl, this->Quiet); @@ -1380,8 +1404,9 @@ int cmCTestSubmitHandler::ProcessHandler() std::string url = "ftp://"; url += cmCTest::MakeURLSafe( this->CTest->GetCTestConfiguration("DropSiteUser")) + - ":" + cmCTest::MakeURLSafe( - this->CTest->GetCTestConfiguration("DropSitePassword")) + + ":" + + cmCTest::MakeURLSafe( + this->CTest->GetCTestConfiguration("DropSitePassword")) + "@" + this->CTest->GetCTestConfiguration("DropSite") + cmCTest::MakeURLSafe(this->CTest->GetCTestConfiguration("DropLocation")); if (!this->CTest->GetCTestConfiguration("DropSiteUser").empty()) { @@ -1409,12 +1434,13 @@ int cmCTestSubmitHandler::ProcessHandler() return -1; } if (!this->CDash) { - cmCTestOptionalLog( - this->CTest, HANDLER_OUTPUT, " Using HTTP trigger method" - << std::endl - << " Trigger site: " - << this->CTest->GetCTestConfiguration("TriggerSite") << std::endl, - this->Quiet); + cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, + " Using HTTP trigger method" + << std::endl + << " Trigger site: " + << this->CTest->GetCTestConfiguration("TriggerSite") + << std::endl, + this->Quiet); if (!this->TriggerUsingHTTP( files, prefix, this->CTest->GetCTestConfiguration("TriggerSite"))) { @@ -1466,12 +1492,13 @@ int cmCTestSubmitHandler::ProcessHandler() return -1; } if (!this->CDash) { - cmCTestOptionalLog( - this->CTest, HANDLER_OUTPUT, " Using HTTP trigger method" - << std::endl - << " Trigger site: " - << this->CTest->GetCTestConfiguration("TriggerSite") << std::endl, - this->Quiet); + cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, + " Using HTTP trigger method" + << std::endl + << " Trigger site: " + << this->CTest->GetCTestConfiguration("TriggerSite") + << std::endl, + this->Quiet); if (!this->TriggerUsingHTTP( files, prefix, this->CTest->GetCTestConfiguration("TriggerSite"))) { @@ -1482,15 +1509,17 @@ int cmCTestSubmitHandler::ProcessHandler() } } if (this->HasErrors) { - cmCTestLog(this->CTest, HANDLER_OUTPUT, " Errors occurred during " - "submission." + cmCTestLog(this->CTest, HANDLER_OUTPUT, + " Errors occurred during " + "submission." << std::endl); ofs << " Errors occurred during submission. " << std::endl; } else { - cmCTestOptionalLog( - this->CTest, HANDLER_OUTPUT, " Submission successful" - << (this->HasWarnings ? ", with warnings." : "") << std::endl, - this->Quiet); + cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, + " Submission successful" + << (this->HasWarnings ? ", with warnings." : "") + << std::endl, + this->Quiet); ofs << " Submission successful" << (this->HasWarnings ? ", with warnings." : "") << std::endl; } @@ -1587,8 +1616,9 @@ int cmCTestSubmitHandler::ProcessHandler() return 0; } - cmCTestLog(this->CTest, ERROR_MESSAGE, " Unknown submission method: \"" - << dropMethod << "\"" << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + " Unknown submission method: \"" << dropMethod << "\"" + << std::endl); return -1; } diff --git a/Source/CTest/cmCTestTestCommand.cxx b/Source/CTest/cmCTestTestCommand.cxx index daedf62..895ca12 100644 --- a/Source/CTest/cmCTestTestCommand.cxx +++ b/Source/CTest/cmCTestTestCommand.cxx @@ -112,14 +112,16 @@ cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler() if (!cmSystemTools::StringToULong(this->Values[ctt_TEST_LOAD], &testLoad)) { testLoad = 0; - cmCTestLog(this->CTest, WARNING, "Invalid value for 'TEST_LOAD' : " + cmCTestLog(this->CTest, WARNING, + "Invalid value for 'TEST_LOAD' : " << this->Values[ctt_TEST_LOAD] << std::endl); } } else if (ctestTestLoad && *ctestTestLoad) { if (!cmSystemTools::StringToULong(ctestTestLoad, &testLoad)) { testLoad = 0; - cmCTestLog(this->CTest, WARNING, "Invalid value for 'CTEST_TEST_LOAD' : " - << ctestTestLoad << std::endl); + cmCTestLog(this->CTest, WARNING, + "Invalid value for 'CTEST_TEST_LOAD' : " << ctestTestLoad + << std::endl); } } else { testLoad = this->CTest->GetTestLoad(); diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index cbaf984..91b92a3 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -259,7 +259,7 @@ public: /** * This is called when the command is first encountered in * the CMakeLists.txt file. - */ + */ bool InitialPass(std::vector const& /*unused*/, cmExecutionStatus& /*unused*/) override; @@ -472,11 +472,12 @@ int cmCTestTestHandler::ProcessHandler() this->TestResults.clear(); - cmCTestOptionalLog( - this->CTest, HANDLER_OUTPUT, (this->MemCheck ? "Memory check" : "Test") - << " project " << cmSystemTools::GetCurrentWorkingDirectory() - << std::endl, - this->Quiet); + cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, + (this->MemCheck ? "Memory check" : "Test") + << " project " + << cmSystemTools::GetCurrentWorkingDirectory() + << std::endl, + this->Quiet); if (!this->PreProcessHandler()) { return -1; } @@ -500,13 +501,14 @@ int cmCTestTestHandler::ProcessHandler() if (total == 0) { if (!this->CTest->GetShowOnly() && !this->CTest->ShouldPrintLabels()) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "No tests were found!!!" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "No tests were found!!!" << std::endl); } } else { if (this->HandlerVerbose && !passed.empty() && (this->UseIncludeRegExpFlag || this->UseExcludeRegExpFlag)) { - cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl + cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + std::endl << "The following tests passed:" << std::endl, this->Quiet); for (std::string const& j : passed) { @@ -533,7 +535,8 @@ int cmCTestTestHandler::ProcessHandler() percent = 99; } - cmCTestLog(this->CTest, HANDLER_OUTPUT, std::endl + cmCTestLog(this->CTest, HANDLER_OUTPUT, + std::endl << static_cast(percent + .5f) << "% tests passed, " << failed.size() << " tests failed out of " << total << std::endl); @@ -553,7 +556,8 @@ int cmCTestTestHandler::ProcessHandler() if (!disabledTests.empty()) { cmGeneratedFileStream ofs; - cmCTestLog(this->CTest, HANDLER_OUTPUT, std::endl + cmCTestLog(this->CTest, HANDLER_OUTPUT, + std::endl << "The following tests did not run:" << std::endl); this->StartLogFile("TestsDisabled", ofs); @@ -565,15 +569,16 @@ int cmCTestTestHandler::ProcessHandler() } else { disabled_reason = "Skipped"; } - cmCTestLog(this->CTest, HANDLER_OUTPUT, "\t" - << std::setw(3) << dt.TestCount << " - " << dt.Name - << " (" << disabled_reason << ")" << std::endl); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + "\t" << std::setw(3) << dt.TestCount << " - " << dt.Name + << " (" << disabled_reason << ")" << std::endl); } } if (!failed.empty()) { cmGeneratedFileStream ofs; - cmCTestLog(this->CTest, HANDLER_OUTPUT, std::endl + cmCTestLog(this->CTest, HANDLER_OUTPUT, + std::endl << "The following tests FAILED:" << std::endl); this->StartLogFile("TestsFailed", ofs); @@ -582,9 +587,10 @@ int cmCTestTestHandler::ProcessHandler() !cmHasLiteralPrefix(ft.CompletionStatus, "SKIP_RETURN_CODE=") && ft.CompletionStatus != "Disabled") { ofs << ft.TestCount << ":" << ft.Name << std::endl; - cmCTestLog(this->CTest, HANDLER_OUTPUT, "\t" - << std::setw(3) << ft.TestCount << " - " << ft.Name - << " (" << this->GetTestStatus(ft) << ")" << std::endl); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + "\t" << std::setw(3) << ft.TestCount << " - " << ft.Name + << " (" << this->GetTestStatus(ft) << ")" + << std::endl); } } } @@ -595,7 +601,8 @@ int cmCTestTestHandler::ProcessHandler() if (!this->StartResultingXML( (this->MemCheck ? cmCTest::PartMemCheck : cmCTest::PartTest), (this->MemCheck ? "DynamicAnalysis" : "Test"), xmlfile)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot create " + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Cannot create " << (this->MemCheck ? "memory check" : "testing") << " XML file" << std::endl); this->LogFile = nullptr; @@ -671,8 +678,8 @@ void cmCTestTestHandler::PrintLabelOrSubprojectSummary(bool doSubProject) cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "\nSubproject Time Summary:", this->Quiet); } else { - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "\nLabel Time Summary:", - this->Quiet); + cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, + "\nLabel Time Summary:", this->Quiet); } for (std::string const& i : labels) { std::string label = i; @@ -687,7 +694,8 @@ void cmCTestTestHandler::PrintLabelOrSubprojectSummary(bool doSubProject) labelCountStr << "s"; } labelCountStr << ")"; - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "\n" + cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, + "\n" << label << " = " << buf << " " << labelCountStr.str(), this->Quiet); @@ -1089,9 +1097,10 @@ void cmCTestTestHandler::UpdateForFixtures(ListOfTests& tests) const } } - cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Added " - << fixtureTestsAdded - << " tests to meet fixture requirements" << std::endl, + cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Added " << fixtureTestsAdded + << " tests to meet fixture requirements" + << std::endl, this->Quiet); } @@ -1119,8 +1128,9 @@ bool cmCTestTestHandler::GetValue(const char* tag, int& value, fin >> value; ret = cmSystemTools::GetLineFromStream(fin, line); // read blank line } else { - cmCTestLog(this->CTest, ERROR_MESSAGE, "parse error: missing tag: " - << tag << " found [" << line << "]" << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "parse error: missing tag: " << tag << " found [" << line << "]" + << std::endl); ret = false; } return ret; @@ -1136,8 +1146,9 @@ bool cmCTestTestHandler::GetValue(const char* tag, double& value, fin >> value; ret = cmSystemTools::GetLineFromStream(fin, line); // read blank line } else { - cmCTestLog(this->CTest, ERROR_MESSAGE, "parse error: missing tag: " - << tag << " found [" << line << "]" << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "parse error: missing tag: " << tag << " found [" << line << "]" + << std::endl); ret = false; } return ret; @@ -1162,8 +1173,9 @@ bool cmCTestTestHandler::GetValue(const char* tag, bool& value, #endif ret = cmSystemTools::GetLineFromStream(fin, line); // read blank line } else { - cmCTestLog(this->CTest, ERROR_MESSAGE, "parse error: missing tag: " - << tag << " found [" << line << "]" << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "parse error: missing tag: " << tag << " found [" << line << "]" + << std::endl); ret = false; } return ret; @@ -1179,8 +1191,9 @@ bool cmCTestTestHandler::GetValue(const char* tag, size_t& value, fin >> value; ret = cmSystemTools::GetLineFromStream(fin, line); // read blank line } else { - cmCTestLog(this->CTest, ERROR_MESSAGE, "parse error: missing tag: " - << tag << " found [" << line << "]" << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "parse error: missing tag: " << tag << " found [" << line << "]" + << std::endl); ret = false; } return ret; @@ -1195,8 +1208,9 @@ bool cmCTestTestHandler::GetValue(const char* tag, std::string& value, if (line == tag) { ret = cmSystemTools::GetLineFromStream(fin, value); } else { - cmCTestLog(this->CTest, ERROR_MESSAGE, "parse error: missing tag: " - << tag << " found [" << line << "]" << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "parse error: missing tag: " << tag << " found [" << line << "]" + << std::endl); ret = false; } return ret; @@ -1611,7 +1625,8 @@ std::string cmCTestTestHandler::FindExecutable( } } if (fullPath.empty()) { - cmCTestLog(ctest, HANDLER_OUTPUT, "Could not find executable " + cmCTestLog(ctest, HANDLER_OUTPUT, + "Could not find executable " << testCommand << "\n" << "Looked in the following places:\n"); for (std::string const& f : failed) { @@ -1793,8 +1808,8 @@ void cmCTestTestHandler::ExpandTestsToRunInformationForRerunFailed() cmsys::Directory directory; if (directory.Load(dirName) == 0) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Unable to read the contents of " - << dirName << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Unable to read the contents of " << dirName << std::endl); return; } @@ -1829,8 +1844,8 @@ void cmCTestTestHandler::ExpandTestsToRunInformationForRerunFailed() if (!cmSystemTools::FileExists(lastTestsFailedLog)) { if (!this->CTest->GetShowOnly() && !this->CTest->ShouldPrintLabels()) { - cmCTestLog(this->CTest, ERROR_MESSAGE, lastTestsFailedLog - << " does not exist!" << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + lastTestsFailedLog << " does not exist!" << std::endl); } return; } @@ -1852,7 +1867,8 @@ void cmCTestTestHandler::ExpandTestsToRunInformationForRerunFailed() ifs.close(); } else if (!this->CTest->GetShowOnly() && !this->CTest->ShouldPrintLabels()) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Problem reading file: " + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Problem reading file: " << lastTestsFailedLog << " while generating list of previously failed tests." << std::endl); @@ -1961,11 +1977,12 @@ void cmCTestTestHandler::GenerateRegressionImages(cmXMLWriter& xml, xml.Element("Value", "Image " + filename + " is empty"); xml.EndElement(); } else { - cmsys::ifstream ifs(filename.c_str(), std::ios::in + cmsys::ifstream ifs(filename.c_str(), + std::ios::in #ifdef _WIN32 | std::ios::binary #endif - ); + ); unsigned char* file_buffer = new unsigned char[len + 1]; ifs.read(reinterpret_cast(file_buffer), len); unsigned char* encoded_buffer = new unsigned char[static_cast( @@ -2002,9 +2019,9 @@ void cmCTestTestHandler::GenerateRegressionImages(cmXMLWriter& xml, xml.Attribute("text", "text/string"); xml.Element("Value", "File " + filename + " not found"); xml.EndElement(); - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "File \"" - << filename << "\" not found." << std::endl, - this->Quiet); + cmCTestOptionalLog( + this->CTest, HANDLER_OUTPUT, + "File \"" << filename << "\" not found." << std::endl, this->Quiet); } cxml.erase(measurementfile.start(), measurementfile.end() - measurementfile.start()); diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx index 504b210..57e40ce 100644 --- a/Source/CTest/cmCTestUpdateHandler.cxx +++ b/Source/CTest/cmCTestUpdateHandler.cxx @@ -47,7 +47,8 @@ void cmCTestUpdateHandler::Initialize() int cmCTestUpdateHandler::DetermineType(const char* cmd, const char* type) { - cmCTestOptionalLog(this->CTest, DEBUG, "Determine update type from command: " + cmCTestOptionalLog(this->CTest, DEBUG, + "Determine update type from command: " << cmd << " and type: " << type << std::endl, this->Quiet); if (type && *type) { @@ -130,7 +131,8 @@ int cmCTestUpdateHandler::ProcessHandler() return -1; } - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " Use " + cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, + " Use " << cmCTestUpdateHandlerUpdateToString(this->UpdateType) << " repository type" << std::endl; , this->Quiet); @@ -171,8 +173,8 @@ int cmCTestUpdateHandler::ProcessHandler() // cmGeneratedFileStream os; if (!this->StartResultingXML(cmCTest::PartUpdate, "Update", os)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot open log file" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Cannot open log file" << std::endl); return -1; } std::string start_time = this->CTest->CurrentTime(); @@ -191,7 +193,8 @@ int cmCTestUpdateHandler::ProcessHandler() std::string("ctest-") + cmVersion::GetCMakeVersion()); xml.Element("Site", this->CTest->GetCTestConfiguration("Site")); xml.Element("BuildName", buildname); - xml.Element("BuildStamp", this->CTest->GetCurrentTag() + "-" + + xml.Element("BuildStamp", + this->CTest->GetCurrentTag() + "-" + this->CTest->GetTestModelString()); xml.Element("StartDateTime", start_time); xml.Element("StartTime", start_time_time); @@ -209,9 +212,9 @@ int cmCTestUpdateHandler::ProcessHandler() this->Quiet); } if (int numModified = vc->GetPathCount(cmCTestVC::PathModified)) { - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " Found " - << numModified << " locally modified files\n", - this->Quiet); + cmCTestOptionalLog( + this->CTest, HANDLER_OUTPUT, + " Found " << numModified << " locally modified files\n", this->Quiet); localModifications += numModified; } if (int numConflicting = vc->GetPathCount(cmCTestVC::PathConflicting)) { @@ -241,8 +244,9 @@ int cmCTestUpdateHandler::ProcessHandler() if (!updated) { xml.Content("Update command failed:\n"); xml.Content(vc->GetUpdateCommandLine()); - cmCTestLog(this->CTest, HANDLER_OUTPUT, " Update command failed: " - << vc->GetUpdateCommandLine() << "\n"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + " Update command failed: " << vc->GetUpdateCommandLine() + << "\n"); } xml.EndElement(); // UpdateReturnStatus xml.EndElement(); // Update diff --git a/Source/CTest/cmCTestUploadHandler.cxx b/Source/CTest/cmCTestUploadHandler.cxx index 59a5de4..261ecab 100644 --- a/Source/CTest/cmCTestUploadHandler.cxx +++ b/Source/CTest/cmCTestUploadHandler.cxx @@ -30,8 +30,8 @@ int cmCTestUploadHandler::ProcessHandler() cmGeneratedFileStream ofs; if (!this->CTest->OpenOutputFile(this->CTest->GetCurrentTag(), "Upload.xml", ofs)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot open Upload.xml file" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Cannot open Upload.xml file" << std::endl); return -1; } std::string buildname = @@ -45,7 +45,8 @@ int cmCTestUploadHandler::ProcessHandler() " \""); xml.StartElement("Site"); xml.Attribute("BuildName", buildname); - xml.Attribute("BuildStamp", this->CTest->GetCurrentTag() + "-" + + xml.Attribute("BuildStamp", + this->CTest->GetCurrentTag() + "-" + this->CTest->GetTestModelString()); xml.Attribute("Name", this->CTest->GetCTestConfiguration("Site")); xml.Attribute("Generator", diff --git a/Source/CTest/cmCTestVC.cxx b/Source/CTest/cmCTestVC.cxx index 13fa6e1..a59d671 100644 --- a/Source/CTest/cmCTestVC.cxx +++ b/Source/CTest/cmCTestVC.cxx @@ -69,8 +69,8 @@ bool cmCTestVC::InitialCheckout(const char* command) bool result = this->RunChild(&vc_co[0], &out, &err, parent.c_str()); this->Log << "--- End Initial Checkout ---\n"; if (!result) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Initial checkout failed!" - << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Initial checkout failed!" << std::endl); } return result; } diff --git a/Source/CTest/cmParseCacheCoverage.cxx b/Source/CTest/cmParseCacheCoverage.cxx index 4cd6588..ca1fe70 100644 --- a/Source/CTest/cmParseCacheCoverage.cxx +++ b/Source/CTest/cmParseCacheCoverage.cxx @@ -100,10 +100,11 @@ bool cmParseCacheCoverage::ReadCMCovFile(const char* file) std::string line; std::vector separateLine; if (!cmSystemTools::GetLineFromStream(in, line)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Empty file : " - << file << " referenced in this line of cmcov data:\n" - "[" - << line << "]\n"); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Empty file : " << file + << " referenced in this line of cmcov data:\n" + "[" + << line << "]\n"); return false; } separateLine.clear(); @@ -112,8 +113,9 @@ bool cmParseCacheCoverage::ReadCMCovFile(const char* file) separateLine[1] != "Line" || separateLine[2] != "RtnLine" || separateLine[3] != "Code") { cmCTestLog(this->CTest, ERROR_MESSAGE, - "Bad first line of cmcov file : " << file << " line:\n" - "[" + "Bad first line of cmcov file : " << file + << " line:\n" + "[" << line << "]\n"); } std::string routine; @@ -128,8 +130,9 @@ bool cmParseCacheCoverage::ReadCMCovFile(const char* file) if (separateLine.size() < 4) { cmCTestLog(this->CTest, ERROR_MESSAGE, "Bad line of cmcov file expected at least 4 found: " - << separateLine.size() << " " << file << " line:\n" - "[" + << separateLine.size() << " " << file + << " line:\n" + "[" << line << "]\n"); for (std::string::size_type i = 0; i < separateLine.size(); ++i) { cmCTestLog(this->CTest, ERROR_MESSAGE, "" << separateLine[1] << " "); diff --git a/Source/CTest/cmParseDelphiCoverage.cxx b/Source/CTest/cmParseDelphiCoverage.cxx index 6d82cb2..cc81979 100644 --- a/Source/CTest/cmParseDelphiCoverage.cxx +++ b/Source/CTest/cmParseDelphiCoverage.cxx @@ -108,8 +108,9 @@ public: while (true) { lastoffset = line.find('(', pos); if (lastoffset == std::string::npos) { - cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, endnamepos - << "File not found " << lastoffset << std::endl, + cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + endnamepos << "File not found " << lastoffset + << std::endl, this->Coverage.Quiet); return false; } diff --git a/Source/CTest/cmParseGTMCoverage.cxx b/Source/CTest/cmParseGTMCoverage.cxx index f965048..822363d 100644 --- a/Source/CTest/cmParseGTMCoverage.cxx +++ b/Source/CTest/cmParseGTMCoverage.cxx @@ -75,7 +75,8 @@ bool cmParseGTMCoverage::ReadMCovFile(const char* file) this->Coverage.TotalCoverage[lastpath][lastoffset + linenumber] += count; } else { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Can not find mumps file : " + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Can not find mumps file : " << lastroutine << " referenced in this line of mcov data:\n" "[" @@ -102,9 +103,11 @@ bool cmParseGTMCoverage::ReadMCovFile(const char* file) lastoffset = lineoffset; } } else { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Can not find mumps file : " - << routine << " referenced in this line of mcov data:\n" - "[" + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Can not find mumps file : " + << routine + << " referenced in this line of mcov data:\n" + "[" << line << "]\n"); } lastfunction = function; @@ -144,8 +147,9 @@ bool cmParseGTMCoverage::FindFunctionInMumpsFile(std::string const& filepath, linenum++; // move to next line count } lineoffset = 0; - cmCTestLog(this->CTest, ERROR_MESSAGE, "Could not find entry point : " - << function << " in " << filepath << "\n"); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Could not find entry point : " << function << " in " << filepath + << "\n"); return false; } @@ -221,8 +225,8 @@ bool cmParseGTMCoverage::ParseMCOVLine(std::string const& line, } // less then two arguments is an error if (args.size() < 2) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Error parsing mcov line: [" - << line << "]\n"); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Error parsing mcov line: [" << line << "]\n"); return false; } routine = args[0]; // the routine is the first argument diff --git a/Source/CTest/cmParseJacocoCoverage.cxx b/Source/CTest/cmParseJacocoCoverage.cxx index 7acb5ca..31e7cd4 100644 --- a/Source/CTest/cmParseJacocoCoverage.cxx +++ b/Source/CTest/cmParseJacocoCoverage.cxx @@ -38,8 +38,9 @@ protected: if (this->PackagePath.empty()) { if (!this->FindPackagePath(fileName)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot find file: " - << this->PackageName << "/" << fileName << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Cannot find file: " << this->PackageName << "/" + << fileName << std::endl); this->Coverage.Error++; return; } diff --git a/Source/CTest/cmParsePHPCoverage.cxx b/Source/CTest/cmParsePHPCoverage.cxx index 761ebec..a6e65c9 100644 --- a/Source/CTest/cmParsePHPCoverage.cxx +++ b/Source/CTest/cmParsePHPCoverage.cxx @@ -153,7 +153,8 @@ bool cmParsePHPCoverage::ReadFileInformation(std::istream& in) delete[] s; // read close quote if (in.get(c) && c != '"') { - cmCTestLog(this->CTest, ERROR_MESSAGE, "failed to read close quote\n" + cmCTestLog(this->CTest, ERROR_MESSAGE, + "failed to read close quote\n" << "read [" << c << "]\n"); return false; } @@ -184,8 +185,8 @@ bool cmParsePHPCoverage::ReadPHPData(const char* file) } for (int i = 0; i < size; i++) { if (!this->ReadFileInformation(in)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, "Failed to read file #" << i - << "\n"); + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Failed to read file #" << i << "\n"); return false; } in.get(c); diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx index 5c9b169..39cea87 100644 --- a/Source/CTest/cmProcess.cxx +++ b/Source/CTest/cmProcess.cxx @@ -13,13 +13,13 @@ #include #include #if !defined(_WIN32) -#include +# include #endif #define CM_PROCESS_BUF_SIZE 65536 #if defined(_WIN32) && !defined(__CYGWIN__) -#include +# include static int cmProcessGetPipes(int* fds) { @@ -40,7 +40,7 @@ static int cmProcessGetPipes(int* fds) return 0; } #else -#include +# include static int cmProcessGetPipes(int* fds) { @@ -167,8 +167,9 @@ bool cmProcess::StartProcess(uv_loop_t& loop, std::vector* affinity) status = this->Process.spawn(loop, options, this); if (status != 0) { - cmCTestLog(this->Runner.GetCTest(), ERROR_MESSAGE, "Process not started\n " - << this->Command << "\n[" << uv_strerror(status) << "]\n"); + cmCTestLog(this->Runner.GetCTest(), ERROR_MESSAGE, + "Process not started\n " << this->Command << "\n[" + << uv_strerror(status) << "]\n"); return false; } @@ -345,7 +346,7 @@ void cmProcess::OnExit(int64_t exit_status, int term_signal) #else term_signal != 0 #endif - ) { + ) { this->ProcessState = cmProcess::State::Exception; } else { this->ProcessState = cmProcess::State::Exited; @@ -391,7 +392,7 @@ cmProcess::Exception cmProcess::GetExitException() { auto exception = Exception::None; #if defined(_WIN32) && !defined(__CYGWIN__) - auto exit_code = (DWORD) this->ExitValue; + auto exit_code = (DWORD)this->ExitValue; if ((exit_code & 0xF0000000) != 0xC0000000) { return exception; } @@ -415,12 +416,12 @@ cmProcess::Exception cmProcess::GetExitException() case STATUS_FLOAT_OVERFLOW: case STATUS_FLOAT_STACK_CHECK: case STATUS_FLOAT_UNDERFLOW: -#ifdef STATUS_FLOAT_MULTIPLE_FAULTS +# ifdef STATUS_FLOAT_MULTIPLE_FAULTS case STATUS_FLOAT_MULTIPLE_FAULTS: -#endif -#ifdef STATUS_FLOAT_MULTIPLE_TRAPS +# endif +# ifdef STATUS_FLOAT_MULTIPLE_TRAPS case STATUS_FLOAT_MULTIPLE_TRAPS: -#endif +# endif case STATUS_INTEGER_DIVIDE_BY_ZERO: case STATUS_INTEGER_OVERFLOW: exception = Exception::Numerical; @@ -488,16 +489,16 @@ std::string cmProcess::GetExitExceptionString() case STATUS_FLOAT_UNDERFLOW: exception_str = "Floating-point underflow"; break; -#ifdef STATUS_FLOAT_MULTIPLE_FAULTS +# ifdef STATUS_FLOAT_MULTIPLE_FAULTS case STATUS_FLOAT_MULTIPLE_FAULTS: exception_str = "Floating-point exception (multiple faults)"; break; -#endif -#ifdef STATUS_FLOAT_MULTIPLE_TRAPS +# endif +# ifdef STATUS_FLOAT_MULTIPLE_TRAPS case STATUS_FLOAT_MULTIPLE_TRAPS: exception_str = "Floating-point exception (multiple traps)"; break; -#endif +# endif case STATUS_INTEGER_DIVIDE_BY_ZERO: exception_str = "Integer divide-by-zero"; break; @@ -544,188 +545,188 @@ std::string cmProcess::GetExitExceptionString() } #else switch (this->Signal) { -#ifdef SIGSEGV +# ifdef SIGSEGV case SIGSEGV: exception_str = "Segmentation fault"; break; -#endif -#ifdef SIGBUS -#if !defined(SIGSEGV) || SIGBUS != SIGSEGV +# endif +# ifdef SIGBUS +# if !defined(SIGSEGV) || SIGBUS != SIGSEGV case SIGBUS: exception_str = "Bus error"; break; -#endif -#endif -#ifdef SIGFPE +# endif +# endif +# ifdef SIGFPE case SIGFPE: exception_str = "Floating-point exception"; break; -#endif -#ifdef SIGILL +# endif +# ifdef SIGILL case SIGILL: exception_str = "Illegal instruction"; break; -#endif -#ifdef SIGINT +# endif +# ifdef SIGINT case SIGINT: exception_str = "User interrupt"; break; -#endif -#ifdef SIGABRT +# endif +# ifdef SIGABRT case SIGABRT: exception_str = "Child aborted"; break; -#endif -#ifdef SIGKILL +# endif +# ifdef SIGKILL case SIGKILL: exception_str = "Child killed"; break; -#endif -#ifdef SIGTERM +# endif +# ifdef SIGTERM case SIGTERM: exception_str = "Child terminated"; break; -#endif -#ifdef SIGHUP +# endif +# ifdef SIGHUP case SIGHUP: exception_str = "SIGHUP"; break; -#endif -#ifdef SIGQUIT +# endif +# ifdef SIGQUIT case SIGQUIT: exception_str = "SIGQUIT"; break; -#endif -#ifdef SIGTRAP +# endif +# ifdef SIGTRAP case SIGTRAP: exception_str = "SIGTRAP"; break; -#endif -#ifdef SIGIOT -#if !defined(SIGABRT) || SIGIOT != SIGABRT +# endif +# ifdef SIGIOT +# if !defined(SIGABRT) || SIGIOT != SIGABRT case SIGIOT: exception_str = "SIGIOT"; break; -#endif -#endif -#ifdef SIGUSR1 +# endif +# endif +# ifdef SIGUSR1 case SIGUSR1: exception_str = "SIGUSR1"; break; -#endif -#ifdef SIGUSR2 +# endif +# ifdef SIGUSR2 case SIGUSR2: exception_str = "SIGUSR2"; break; -#endif -#ifdef SIGPIPE +# endif +# ifdef SIGPIPE case SIGPIPE: exception_str = "SIGPIPE"; break; -#endif -#ifdef SIGALRM +# endif +# ifdef SIGALRM case SIGALRM: exception_str = "SIGALRM"; break; -#endif -#ifdef SIGSTKFLT +# endif +# ifdef SIGSTKFLT case SIGSTKFLT: exception_str = "SIGSTKFLT"; break; -#endif -#ifdef SIGCHLD +# endif +# ifdef SIGCHLD case SIGCHLD: exception_str = "SIGCHLD"; break; -#elif defined(SIGCLD) +# elif defined(SIGCLD) case SIGCLD: exception_str = "SIGCLD"; break; -#endif -#ifdef SIGCONT +# endif +# ifdef SIGCONT case SIGCONT: exception_str = "SIGCONT"; break; -#endif -#ifdef SIGSTOP +# endif +# ifdef SIGSTOP case SIGSTOP: exception_str = "SIGSTOP"; break; -#endif -#ifdef SIGTSTP +# endif +# ifdef SIGTSTP case SIGTSTP: exception_str = "SIGTSTP"; break; -#endif -#ifdef SIGTTIN +# endif +# ifdef SIGTTIN case SIGTTIN: exception_str = "SIGTTIN"; break; -#endif -#ifdef SIGTTOU +# endif +# ifdef SIGTTOU case SIGTTOU: exception_str = "SIGTTOU"; break; -#endif -#ifdef SIGURG +# endif +# ifdef SIGURG case SIGURG: exception_str = "SIGURG"; break; -#endif -#ifdef SIGXCPU +# endif +# ifdef SIGXCPU case SIGXCPU: exception_str = "SIGXCPU"; break; -#endif -#ifdef SIGXFSZ +# endif +# ifdef SIGXFSZ case SIGXFSZ: exception_str = "SIGXFSZ"; break; -#endif -#ifdef SIGVTALRM +# endif +# ifdef SIGVTALRM case SIGVTALRM: exception_str = "SIGVTALRM"; break; -#endif -#ifdef SIGPROF +# endif +# ifdef SIGPROF case SIGPROF: exception_str = "SIGPROF"; break; -#endif -#ifdef SIGWINCH +# endif +# ifdef SIGWINCH case SIGWINCH: exception_str = "SIGWINCH"; break; -#endif -#ifdef SIGPOLL +# endif +# ifdef SIGPOLL case SIGPOLL: exception_str = "SIGPOLL"; break; -#endif -#ifdef SIGIO -#if !defined(SIGPOLL) || SIGIO != SIGPOLL +# endif +# ifdef SIGIO +# if !defined(SIGPOLL) || SIGIO != SIGPOLL case SIGIO: exception_str = "SIGIO"; break; -#endif -#endif -#ifdef SIGPWR +# endif +# endif +# ifdef SIGPWR case SIGPWR: exception_str = "SIGPWR"; break; -#endif -#ifdef SIGSYS +# endif +# ifdef SIGSYS case SIGSYS: exception_str = "SIGSYS"; break; -#endif -#ifdef SIGUNUSED -#if !defined(SIGSYS) || SIGUNUSED != SIGSYS +# endif +# ifdef SIGUNUSED +# if !defined(SIGSYS) || SIGUNUSED != SIGSYS case SIGUNUSED: exception_str = "SIGUNUSED"; break; -#endif -#endif +# endif +# endif default: exception_str = "Signal "; exception_str += std::to_string(this->Signal); diff --git a/Source/Checks/Curses/CheckCurses.c b/Source/Checks/Curses/CheckCurses.c index 857ae28..7d827e6 100644 --- a/Source/Checks/Curses/CheckCurses.c +++ b/Source/Checks/Curses/CheckCurses.c @@ -1,11 +1,11 @@ #if defined(CURSES_HAVE_NCURSES_H) -#include +# include #elif defined(CURSES_HAVE_NCURSES_NCURSES_H) -#include +# include #elif defined(CURSES_HAVE_NCURSES_CURSES_H) -#include +# include #else -#include +# include #endif int main() diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx index 17cf628..a3e0717 100644 --- a/Source/CursesDialog/ccmake.cxx +++ b/Source/CursesDialog/ccmake.cxx @@ -22,11 +22,13 @@ static const char* cmDocumentationName[][2] = { }; static const char* cmDocumentationUsage[][2] = { - { nullptr, " ccmake \n" - " ccmake " }, - { nullptr, "Specify a source directory to (re-)generate a build system for " - "it in the current working directory. Specify an existing build " - "directory to re-generate its build system." }, + { nullptr, + " ccmake \n" + " ccmake " }, + { nullptr, + "Specify a source directory to (re-)generate a build system for " + "it in the current working directory. Specify an existing build " + "directory to re-generate its build system." }, { nullptr, nullptr } }; @@ -35,9 +37,10 @@ static const char* cmDocumentationUsageNote[][2] = { { nullptr, nullptr } }; -static const char* cmDocumentationOptions[] - [2] = { CMAKE_STANDARD_OPTIONS_TABLE, - { nullptr, nullptr } }; +static const char* cmDocumentationOptions[][2] = { + CMAKE_STANDARD_OPTIONS_TABLE, + { nullptr, nullptr } +}; cmCursesForm* cmCursesForm::CurrentForm = nullptr; diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 4a9dc47..4a379c3 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -371,8 +371,9 @@ void cmCursesMainForm::PrintKeys(int process /* = 0 */) sprintf(thirdLine, toggleKeyInstruction, this->AdvancedMode ? "On" : "Off"); } - sprintf(secondLine, "Press [h] for help " - "Press [q] to quit without generating"); + sprintf(secondLine, + "Press [h] for help " + "Press [q] to quit without generating"); } curses_move(y - 4, 0); @@ -412,9 +413,10 @@ void cmCursesMainForm::UpdateStatusBar(const char* message) curses_clear(); curses_move(0, 0); char fmt[] = "Window is too small. A size of at least %dx%d is required."; - printw(fmt, (cmCursesMainForm::MIN_WIDTH < this->InitialWidth - ? this->InitialWidth - : cmCursesMainForm::MIN_WIDTH), + printw(fmt, + (cmCursesMainForm::MIN_WIDTH < this->InitialWidth + ? this->InitialWidth + : cmCursesMainForm::MIN_WIDTH), cmCursesMainForm::MIN_HEIGHT); touchwin(stdscr); wrefresh(stdscr); @@ -568,10 +570,11 @@ int cmCursesMainForm::Configure(int noconfigure) } int xx, yy; getmaxyx(stdscr, yy, xx); - cmCursesLongMessageForm* msgs = new cmCursesLongMessageForm( - this->Errors, cmSystemTools::GetErrorOccuredFlag() - ? "Errors occurred during the last pass." - : "CMake produced the following output."); + cmCursesLongMessageForm* msgs = + new cmCursesLongMessageForm(this->Errors, + cmSystemTools::GetErrorOccuredFlag() + ? "Errors occurred during the last pass." + : "CMake produced the following output."); // reset error condition cmSystemTools::ResetErrorOccuredFlag(); CurrentForm = msgs; diff --git a/Source/CursesDialog/cmCursesStandardIncludes.h b/Source/CursesDialog/cmCursesStandardIncludes.h index 60bad94..5b0ad58 100644 --- a/Source/CursesDialog/cmCursesStandardIncludes.h +++ b/Source/CursesDialog/cmCursesStandardIncludes.h @@ -7,12 +7,12 @@ // Record whether __attribute__ is currently defined. See purpose below. #ifndef __attribute__ -#define cm_no__attribute__ +# define cm_no__attribute__ #endif #if defined(__hpux) -#define _BOOL_DEFINED -#include +# define _BOOL_DEFINED +# include #endif #include @@ -38,7 +38,7 @@ inline void curses_clear() // define __attribute__ as a macro. This breaks C++ headers // in some cases, so undefine it now. #if defined(cm_no__attribute__) && defined(__attribute__) -#undef __attribute__ +# undef __attribute__ #endif #undef cm_no__attribute__ diff --git a/Source/QtDialog/AddCacheEntry.h b/Source/QtDialog/AddCacheEntry.h index cc710f5..65e11c0 100644 --- a/Source/QtDialog/AddCacheEntry.h +++ b/Source/QtDialog/AddCacheEntry.h @@ -11,7 +11,9 @@ #include "ui_AddCacheEntry.h" -class AddCacheEntry : public QWidget, public Ui::AddCacheEntry +class AddCacheEntry + : public QWidget + , public Ui::AddCacheEntry { Q_OBJECT public: diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx index 193f4d3..2646c9a 100644 --- a/Source/QtDialog/CMakeSetup.cxx +++ b/Source/QtDialog/CMakeSetup.cxx @@ -27,9 +27,10 @@ static const char* cmDocumentationName[][2] = { { nullptr, { nullptr, nullptr } }; static const char* cmDocumentationUsage[][2] = { - { nullptr, " cmake-gui [options]\n" - " cmake-gui [options] \n" - " cmake-gui [options] " }, + { nullptr, + " cmake-gui [options]\n" + " cmake-gui [options] \n" + " cmake-gui [options] " }, { nullptr, nullptr } }; @@ -192,10 +193,10 @@ int main(int argc, char** argv) } #if defined(Q_OS_MAC) -#include "cm_sys_stat.h" -#include -#include -#include +# include "cm_sys_stat.h" +# include +# include +# include static bool cmOSXInstall(std::string const& dir, std::string const& tool) { if (tool.empty()) { diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx index 5be9ec3..5d589cc 100644 --- a/Source/QtDialog/CMakeSetupDialog.cxx +++ b/Source/QtDialog/CMakeSetupDialog.cxx @@ -842,7 +842,7 @@ void CMakeSetupDialog::doAbout() "Qt is licensed under terms of the GNU LGPLv" USE_LGPL ", available at:\n" " \"%3\"" #endif - ); + ); msg = msg.arg(cmVersion::GetCMakeVersion()); msg = msg.arg(qVersion()); #ifdef USE_LGPL @@ -989,8 +989,9 @@ void CMakeSetupDialog::removeSelectedCacheEntries() void CMakeSetupDialog::selectionChanged() { QModelIndexList idxs = this->CacheValues->selectionModel()->selectedRows(); - if (idxs.count() && (this->CurrentState == ReadyConfigure || - this->CurrentState == ReadyGenerate)) { + if (idxs.count() && + (this->CurrentState == ReadyConfigure || + this->CurrentState == ReadyGenerate)) { this->RemoveEntry->setEnabled(true); } else { this->RemoveEntry->setEnabled(false); diff --git a/Source/QtDialog/CMakeSetupDialog.h b/Source/QtDialog/CMakeSetupDialog.h index 7b767e5..1cce35c 100644 --- a/Source/QtDialog/CMakeSetupDialog.h +++ b/Source/QtDialog/CMakeSetupDialog.h @@ -16,7 +16,9 @@ class QProgressBar; class QToolButton; /// Qt user interface for CMake -class CMakeSetupDialog : public QMainWindow, public Ui::CMakeSetupDialog +class CMakeSetupDialog + : public QMainWindow + , public Ui::CMakeSetupDialog { Q_OBJECT public: diff --git a/Source/QtDialog/Compilers.h b/Source/QtDialog/Compilers.h index 746266c..96770e3 100644 --- a/Source/QtDialog/Compilers.h +++ b/Source/QtDialog/Compilers.h @@ -9,7 +9,9 @@ #include -class Compilers : public QWidget, public Ui::Compilers +class Compilers + : public QWidget + , public Ui::Compilers { Q_OBJECT public: diff --git a/Source/QtDialog/FirstConfigure.h b/Source/QtDialog/FirstConfigure.h index c467ddb..abfa03f 100644 --- a/Source/QtDialog/FirstConfigure.h +++ b/Source/QtDialog/FirstConfigure.h @@ -63,7 +63,9 @@ private: }; //! the page that gives basic options for native compilers -class NativeCompilerSetup : public QWizardPage, protected Ui::Compilers +class NativeCompilerSetup + : public QWizardPage + , protected Ui::Compilers { Q_OBJECT public: @@ -83,7 +85,9 @@ public: }; //! the page that gives options for cross compilers -class CrossCompilerSetup : public QWizardPage, protected Ui::CrossCompiler +class CrossCompilerSetup + : public QWizardPage + , protected Ui::CrossCompiler { Q_OBJECT public: diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index a84429b..0e14a3f 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -10,7 +10,7 @@ #include "cmSystemTools.h" #ifdef Q_OS_WIN -#include "qt_windows.h" // For SetErrorMode +# include "qt_windows.h" // For SetErrorMode #endif QCMake::QCMake(QObject* p) diff --git a/Source/QtDialog/QCMake.h b/Source/QtDialog/QCMake.h index 6fae7e3..4b3920a 100644 --- a/Source/QtDialog/QCMake.h +++ b/Source/QtDialog/QCMake.h @@ -8,8 +8,8 @@ #include "cmake.h" #ifdef _MSC_VER -#pragma warning(disable : 4127) -#pragma warning(disable : 4512) +# pragma warning(disable : 4127) +# pragma warning(disable : 4512) #endif #include diff --git a/Source/QtDialog/RegexExplorer.h b/Source/QtDialog/RegexExplorer.h index 8679892..c7dbb76 100644 --- a/Source/QtDialog/RegexExplorer.h +++ b/Source/QtDialog/RegexExplorer.h @@ -12,7 +12,9 @@ class QString; class QWidget; -class RegexExplorer : public QDialog, public Ui::RegexExplorer +class RegexExplorer + : public QDialog + , public Ui::RegexExplorer { Q_OBJECT public: diff --git a/Source/QtDialog/WarningMessagesDialog.h b/Source/QtDialog/WarningMessagesDialog.h index acb830d..9b29ad6 100644 --- a/Source/QtDialog/WarningMessagesDialog.h +++ b/Source/QtDialog/WarningMessagesDialog.h @@ -12,7 +12,9 @@ /** * Dialog window for setting the warning message related options. */ -class WarningMessagesDialog : public QDialog, public Ui_MessagesDialog +class WarningMessagesDialog + : public QDialog + , public Ui_MessagesDialog { Q_OBJECT diff --git a/Source/bindexplib.cxx b/Source/bindexplib.cxx index 9ec9624..5bcaa45 100644 --- a/Source/bindexplib.cxx +++ b/Source/bindexplib.cxx @@ -8,26 +8,26 @@ -------------------------------------------------------------------------*/ /* -*---------------------------------------------------------------------- -* Program: dumpexts.exe -* Author: Gordon Chaffee -* -* History: The real functionality of this file was written by -* Matt Pietrek in 1993 in his pedump utility. I've -* modified it to dump the externals in a bunch of object -* files to create a .def file. -* -* Notes: Visual C++ puts an underscore before each exported symbol. -* This file removes them. I don't know if this is a problem -* this other compilers. If _MSC_VER is defined, -* the underscore is removed. If not, it isn't. To get a -* full dump of an object file, use the -f option. This can -* help determine the something that may be different with a -* compiler other than Visual C++. -* ====================================== -* Corrections (Axel 2006-04-04): -* Conversion to C++. Mostly. -* + *---------------------------------------------------------------------- + * Program: dumpexts.exe + * Author: Gordon Chaffee + * + * History: The real functionality of this file was written by + * Matt Pietrek in 1993 in his pedump utility. I've + * modified it to dump the externals in a bunch of object + * files to create a .def file. + * + * Notes: Visual C++ puts an underscore before each exported symbol. + * This file removes them. I don't know if this is a problem + * this other compilers. If _MSC_VER is defined, + * the underscore is removed. If not, it isn't. To get a + * full dump of an object file, use the -f option. This can + * help determine the something that may be different with a + * compiler other than Visual C++. + * ====================================== + * Corrections (Axel 2006-04-04): + * Conversion to C++. Mostly. + * * Extension (Axel 2006-03-15) * As soon as an object file contains an /EXPORT directive (which * is generated by the compiler when a symbol is declared as @@ -37,30 +37,31 @@ * programmer). * * ====================================== -* ====================================== -* Corrections (Valery Fine 23/02/98): -* -* The "(vector) deleting destructor" MUST not be exported -* To recognize it the following test are introduced: -* "@@UAEPAXI at Z" scalar deleting dtor -* "@@QAEPAXI at Z" vector deleting dtor -* "AEPAXI at Z" vector deleting dtor with thunk adjustor -* ====================================== -* Corrections (Valery Fine 12/02/97): -* -* It created a wrong EXPORTS for the global pointers and constants. -* The Section Header has been involved to discover the missing information -* Now the pointers are correctly supplied with "DATA" descriptor -* the constants with no extra descriptor. -* -* Corrections (Valery Fine 16/09/96): -* -* It didn't work for C++ code with global variables and class definitions -* The DumpExternalObject function has been introduced to generate .DEF file -* -* Author: Valery Fine 16/09/96 (E-mail: fine at vxcern.cern.ch) -*---------------------------------------------------------------------- -*/ + * ====================================== + * Corrections (Valery Fine 23/02/98): + * + * The "(vector) deleting destructor" MUST not be exported + * To recognize it the following test are introduced: + * "@@UAEPAXI at Z" scalar deleting dtor + * "@@QAEPAXI at Z" vector deleting dtor + * "AEPAXI at Z" vector deleting dtor with thunk adjustor + * ====================================== + * Corrections (Valery Fine 12/02/97): + * + * It created a wrong EXPORTS for the global pointers and constants. + * The Section Header has been involved to discover the missing information + * Now the pointers are correctly supplied with "DATA" descriptor + * the constants with no extra descriptor. + * + * Corrections (Valery Fine 16/09/96): + * + * It didn't work for C++ code with global variables and class definitions + * The DumpExternalObject function has been introduced to generate .DEF + *file + * + * Author: Valery Fine 16/09/96 (E-mail: fine at vxcern.cern.ch) + *---------------------------------------------------------------------- + */ #include "bindexplib.h" #include "cmsys/Encoding.hxx" @@ -69,19 +70,19 @@ #include #ifndef IMAGE_FILE_MACHINE_ARM -#define IMAGE_FILE_MACHINE_ARM 0x01c0 // ARM Little-Endian +# define IMAGE_FILE_MACHINE_ARM 0x01c0 // ARM Little-Endian #endif #ifndef IMAGE_FILE_MACHINE_THUMB -#define IMAGE_FILE_MACHINE_THUMB 0x01c2 // ARM Thumb/Thumb-2 Little-Endian +# define IMAGE_FILE_MACHINE_THUMB 0x01c2 // ARM Thumb/Thumb-2 Little-Endian #endif #ifndef IMAGE_FILE_MACHINE_ARMNT -#define IMAGE_FILE_MACHINE_ARMNT 0x01c4 // ARM Thumb-2 Little-Endian +# define IMAGE_FILE_MACHINE_ARMNT 0x01c4 // ARM Thumb-2 Little-Endian #endif #ifndef IMAGE_FILE_MACHINE_ARM64 -#define IMAGE_FILE_MACHINE_ARM64 0xaa64 // ARM64 Little-Endian +# define IMAGE_FILE_MACHINE_ARM64 0xaa64 // ARM64 Little-Endian #endif typedef struct cmANON_OBJECT_HEADER_BIGOBJ @@ -188,7 +189,7 @@ public: { this->ObjectImageHeader = ih; this->SymbolTable = - (SymbolTableType*)((DWORD_PTR) this->ObjectImageHeader + + (SymbolTableType*)((DWORD_PTR)this->ObjectImageHeader + this->ObjectImageHeader->PointerToSymbolTable); this->SectionHeaders = GetSectionHeaderOffset(this->ObjectImageHeader); this->SymbolCount = this->ObjectImageHeader->NumberOfSymbols; @@ -227,8 +228,8 @@ public: (pSymbolTable->Type == 0x20 || pSymbolTable->Type == 0x0)) { if (pSymbolTable->StorageClass == IMAGE_SYM_CLASS_EXTERNAL) { /* - * The name of the Function entry points - */ + * The name of the Function entry points + */ if (pSymbolTable->N.Name.Short != 0) { symbol.clear(); symbol.insert(0, (const char*)pSymbolTable->N.ShortName, 8); @@ -282,8 +283,8 @@ public: } /* - * Take into account any aux symbols - */ + * Take into account any aux symbols + */ i += pSymbolTable->NumberOfAuxSymbols; pSymbolTable += pSymbolTable->NumberOfAuxSymbols; pSymbolTable++; @@ -345,11 +346,11 @@ bool DumpFile(const char* filename, std::set& symbols, (imageHeader->Machine == IMAGE_FILE_MACHINE_ARM64)) && (imageHeader->Characteristics == 0)) { /* - * The tests above are checking for IMAGE_FILE_HEADER.Machine - * if it contains supported machine formats (currently ARM and x86) - * and IMAGE_FILE_HEADER.Characteristics == 0 indicating that - * this is not linked COFF OBJ file; - */ + * The tests above are checking for IMAGE_FILE_HEADER.Machine + * if it contains supported machine formats (currently ARM and x86) + * and IMAGE_FILE_HEADER.Characteristics == 0 indicating that + * this is not linked COFF OBJ file; + */ DumpSymbols symbolDumper( (PIMAGE_FILE_HEADER)lpFileBase, symbols, dataSymbols, (imageHeader->Machine == IMAGE_FILE_MACHINE_I386)); @@ -360,8 +361,8 @@ bool DumpFile(const char* filename, std::set& symbols, (cmANON_OBJECT_HEADER_BIGOBJ*)lpFileBase; if (h->Sig1 == 0x0 && h->Sig2 == 0xffff) { DumpSymbols - symbolDumper((cmANON_OBJECT_HEADER_BIGOBJ*)lpFileBase, symbols, - dataSymbols, (h->Machine == IMAGE_FILE_MACHINE_I386)); + symbolDumper((cmANON_OBJECT_HEADER_BIGOBJ*)lpFileBase, symbols, + dataSymbols, (h->Machine == IMAGE_FILE_MACHINE_I386)); symbolDumper.DumpObjFile(); } else { printf("unrecognized file format in '%s'\n", filename); diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx index 7792235..fae8063 100644 --- a/Source/cmAddLibraryCommand.cxx +++ b/Source/cmAddLibraryCommand.cxx @@ -211,8 +211,9 @@ bool cmAddLibraryCommand::InitialPass(std::vector const& args, if (!aliasedTarget) { std::ostringstream e; e << "cannot create ALIAS target \"" << libName << "\" because target \"" - << aliasedName << "\" does not already " - "exist."; + << aliasedName + << "\" does not already " + "exist."; this->SetError(e.str()); return false; } diff --git a/Source/cmAffinity.cxx b/Source/cmAffinity.cxx index bdf1f42..588b2f2 100644 --- a/Source/cmAffinity.cxx +++ b/Source/cmAffinity.cxx @@ -5,24 +5,24 @@ #include "cm_uv.h" #ifndef CMAKE_USE_SYSTEM_LIBUV -#ifdef _WIN32 -#define CM_HAVE_CPU_AFFINITY -#include -#elif defined(__linux__) || defined(__FreeBSD__) -#define CM_HAVE_CPU_AFFINITY -#include -#include -#if defined(__FreeBSD__) -#include -#include -#include -#endif -#if defined(__linux__) +# ifdef _WIN32 +# define CM_HAVE_CPU_AFFINITY +# include +# elif defined(__linux__) || defined(__FreeBSD__) +# define CM_HAVE_CPU_AFFINITY +# include +# include +# if defined(__FreeBSD__) +# include +# include +# include +# endif +# if defined(__linux__) typedef cpu_set_t cm_cpuset_t; -#else +# else typedef cpuset_t cm_cpuset_t; -#endif -#endif +# endif +# endif #endif namespace cmAffinity { @@ -33,7 +33,7 @@ std::set GetProcessorsAvailable() #ifdef CM_HAVE_CPU_AFFINITY int cpumask_size = uv_cpumask_size(); if (cpumask_size > 0) { -#ifdef _WIN32 +# ifdef _WIN32 DWORD_PTR procmask; DWORD_PTR sysmask; if (GetProcessAffinityMask(GetCurrentProcess(), &procmask, &sysmask) != @@ -44,7 +44,7 @@ std::set GetProcessorsAvailable() } } } -#else +# else cm_cpuset_t cpuset; CPU_ZERO(&cpuset); // NOLINT(clang-tidy) if (pthread_getaffinity_np(pthread_self(), sizeof(cpuset), &cpuset) == 0) { @@ -54,7 +54,7 @@ std::set GetProcessorsAvailable() } } } -#endif +# endif } #endif return processorsAvailable; diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h index c4eb62b..bbd3e8e 100644 --- a/Source/cmAlgorithms.h +++ b/Source/cmAlgorithms.h @@ -375,9 +375,9 @@ using std::size; // std::size backport from C++17. template -#if !defined(_MSC_VER) || _MSC_VER >= 1900 +# if !defined(_MSC_VER) || _MSC_VER >= 1900 constexpr -#endif +# endif auto size(C const& c) -> decltype(c.size()) { @@ -385,9 +385,9 @@ constexpr } template -#if !defined(_MSC_VER) || _MSC_VER >= 1900 +# if !defined(_MSC_VER) || _MSC_VER >= 1900 constexpr -#endif +# endif std::size_t size(const T (&)[N]) throw() { @@ -405,22 +405,22 @@ using std::cend; // std::c{begin,end} backport from C++14 template -#if defined(_MSC_VER) && _MSC_VER < 1900 +# if defined(_MSC_VER) && _MSC_VER < 1900 auto cbegin(C const& c) -#else +# else constexpr auto cbegin(C const& c) noexcept(noexcept(std::begin(c))) -#endif +# endif -> decltype(std::begin(c)) { return std::begin(c); } template -#if defined(_MSC_VER) && _MSC_VER < 1900 +# if defined(_MSC_VER) && _MSC_VER < 1900 auto cend(C const& c) -#else +# else constexpr auto cend(C const& c) noexcept(noexcept(std::end(c))) -#endif +# endif -> decltype(std::end(c)) { return std::end(c); diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index 02408a1..1dd7734 100644 --- a/Source/cmArchiveWrite.cxx +++ b/Source/cmArchiveWrite.cxx @@ -14,7 +14,7 @@ #include #ifndef __LA_SSIZE_T -#define __LA_SSIZE_T la_ssize_t +# define __LA_SSIZE_T la_ssize_t #endif static std::string cm_archive_error_string(struct archive* a) diff --git a/Source/cmArchiveWrite.h b/Source/cmArchiveWrite.h index 56dce2a..6c678ac 100644 --- a/Source/cmArchiveWrite.h +++ b/Source/cmArchiveWrite.h @@ -10,7 +10,7 @@ #include #if !defined(CMAKE_BUILD_WITH_CMAKE) -#error "cmArchiveWrite not allowed during bootstrap build!" +# error "cmArchiveWrite not allowed during bootstrap build!" #endif template @@ -28,6 +28,7 @@ public: void Clear() { this->IsValueSet = false; } bool IsSet() const { return this->IsValueSet; } T Get() const { return Value; } + private: T Value; bool IsValueSet; @@ -41,6 +42,7 @@ class cmArchiveWrite { typedef void (cmArchiveWrite::*safe_bool)(); void safe_bool_true() {} + public: /** Compression type. */ enum Compress diff --git a/Source/cmCMakeHostSystemInformationCommand.cxx b/Source/cmCMakeHostSystemInformationCommand.cxx index 662dd74..8822942 100644 --- a/Source/cmCMakeHostSystemInformationCommand.cxx +++ b/Source/cmCMakeHostSystemInformationCommand.cxx @@ -8,12 +8,12 @@ #include "cmsys/SystemInformation.hxx" #if defined(_WIN32) -#include "cmAlgorithms.h" -#include "cmGlobalGenerator.h" -#include "cmGlobalVisualStudio15Generator.h" -#include "cmSystemTools.h" -#include "cmVSSetupHelper.h" -#define HAVE_VS_SETUP_HELPER +# include "cmAlgorithms.h" +# include "cmGlobalGenerator.h" +# include "cmGlobalVisualStudio15Generator.h" +# include "cmSystemTools.h" +# include "cmVSSetupHelper.h" +# define HAVE_VS_SETUP_HELPER #endif class cmExecutionStatus; diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index 8e7e3ad..be3d2f4 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -17,7 +17,7 @@ #include #ifdef __QNX__ -#include /* for malloc/free on QNX */ +# include /* for malloc/free on QNX */ #endif extern "C" { @@ -395,9 +395,10 @@ void CCONV cmAddLibrary(void* arg, const char* libname, int shared, for (i = 0; i < numSrcs; ++i) { srcs2.push_back(srcs[i]); } - mf->AddLibrary(libname, (shared ? cmStateEnums::SHARED_LIBRARY - : cmStateEnums::STATIC_LIBRARY), - srcs2); + mf->AddLibrary( + libname, + (shared ? cmStateEnums::SHARED_LIBRARY : cmStateEnums::STATIC_LIBRARY), + srcs2); } char CCONV* cmExpandVariablesInString(void* arg, const char* source, diff --git a/Source/cmCPluginAPI.h b/Source/cmCPluginAPI.h index 88b81c6..adc57a2 100644 --- a/Source/cmCPluginAPI.h +++ b/Source/cmCPluginAPI.h @@ -19,9 +19,9 @@ extern "C" { #endif #ifdef __WATCOMC__ -#define CCONV __cdecl +# define CCONV __cdecl #else -#define CCONV +# define CCONV #endif /*========================================================================= this is the structure of function entry points that a plugin may call. This @@ -161,9 +161,9 @@ typedef struct CM_PLUGIN_EXPORT should be used by plugins =========================================================================*/ #ifdef _WIN32 -#define CM_PLUGIN_EXPORT __declspec(dllexport) +# define CM_PLUGIN_EXPORT __declspec(dllexport) #else -#define CM_PLUGIN_EXPORT +# define CM_PLUGIN_EXPORT #endif /*========================================================================= diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 2c32dea..d0e668d 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -55,7 +55,7 @@ #include "cmake.h" #if defined(__BEOS__) || defined(__HAIKU__) -#include /* disable_debugger() API. */ +# include /* disable_debugger() API. */ #endif #define DEBUGOUT \ @@ -75,9 +75,10 @@ struct tm* cmCTest::GetNightlyTime(std::string const& str, bool tomorrowtag) // curl_getdate no longer assumes the day is today sprintf(buf, "%d%02d%02d %s", lctime->tm_year + 1900, lctime->tm_mon + 1, lctime->tm_mday, str.c_str()); - cmCTestLog(this, OUTPUT, "Determine Nightly Start Time" - << std::endl - << " Specified time: " << str << std::endl); + cmCTestLog(this, OUTPUT, + "Determine Nightly Start Time" << std::endl + << " Specified time: " << str + << std::endl); // Convert the nightly start time to seconds. Since we are // providing only a time and a timezone, the current date of // the local machine is assumed. Consequently, nightlySeconds @@ -99,16 +100,17 @@ struct tm* cmCTest::GetNightlyTime(std::string const& str, bool tomorrowtag) // time of the current open dashboard ntime -= dayLength; cmCTestLog(this, DEBUG, "Pick yesterday" << std::endl); - cmCTestLog(this, DEBUG, " Future time, subtract day: " << ntime - << std::endl); + cmCTestLog(this, DEBUG, + " Future time, subtract day: " << ntime << std::endl); } while (tctime > (ntime + dayLength)) { ntime += dayLength; cmCTestLog(this, DEBUG, " Past time, add day: " << ntime << std::endl); } cmCTestLog(this, DEBUG, "nightlySeconds: " << ntime << std::endl); - cmCTestLog(this, DEBUG, " Current time: " << tctime << " Nightly time: " - << ntime << std::endl); + cmCTestLog(this, DEBUG, + " Current time: " << tctime << " Nightly time: " << ntime + << std::endl); if (tomorrowtag) { cmCTestLog(this, OUTPUT, " Use future tag, Add a day" << std::endl); ntime += dayLength; @@ -390,13 +392,14 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command) cmCTestOptionalLog(this, DEBUG, "Here: " << __LINE__ << std::endl, quiet); if (this->ProduceXML) { cmCTestOptionalLog(this, DEBUG, "Here: " << __LINE__ << std::endl, quiet); - cmCTestOptionalLog( - this, OUTPUT, " Site: " - << this->GetCTestConfiguration("Site") << std::endl - << " Build name: " - << cmCTest::SafeBuildIdField(this->GetCTestConfiguration("BuildName")) - << std::endl, - quiet); + cmCTestOptionalLog(this, OUTPUT, + " Site: " + << this->GetCTestConfiguration("Site") << std::endl + << " Build name: " + << cmCTest::SafeBuildIdField( + this->GetCTestConfiguration("BuildName")) + << std::endl, + quiet); cmCTestOptionalLog(this, DEBUG, "Produce XML is on" << std::endl, quiet); if (this->TestModel == cmCTest::NIGHTLY && this->GetCTestConfiguration("NightlyStartTime").empty()) { @@ -431,16 +434,16 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command) std::string testingDir = this->BinaryDir + "/Testing"; if (cmSystemTools::FileExists(testingDir)) { if (!cmSystemTools::FileIsDirectory(testingDir)) { - cmCTestLog(this, ERROR_MESSAGE, "File " - << testingDir - << " is in the place of the testing directory" - << std::endl); + cmCTestLog(this, ERROR_MESSAGE, + "File " << testingDir + << " is in the place of the testing directory" + << std::endl); return 0; } } else { if (!cmSystemTools::MakeDirectory(testingDir)) { - cmCTestLog(this, ERROR_MESSAGE, "Cannot create directory " - << testingDir << std::endl); + cmCTestLog(this, ERROR_MESSAGE, + "Cannot create directory " << testingDir << std::endl); return 0; } } @@ -518,9 +521,10 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command) } ofs.close(); if (nullptr == command) { - cmCTestOptionalLog(this, OUTPUT, "Create new tag: " - << tag << " - " << this->GetTestModelString() - << std::endl, + cmCTestOptionalLog(this, OUTPUT, + "Create new tag: " << tag << " - " + << this->GetTestModelString() + << std::endl, quiet); } } @@ -539,8 +543,9 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command) } if (tag.empty()) { - cmCTestLog(this, ERROR_MESSAGE, "Cannot read existing TAG file in " - << testingDir << std::endl); + cmCTestLog(this, ERROR_MESSAGE, + "Cannot read existing TAG file in " << testingDir + << std::endl); return 0; } @@ -558,24 +563,27 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command) if (model != this->TestModel && model != cmCTest::UNKNOWN && this->TestModel != cmCTest::UNKNOWN) { - cmCTestOptionalLog(this, WARNING, "Model given in TAG does not match " - "model given in ctest_start()" + cmCTestOptionalLog(this, WARNING, + "Model given in TAG does not match " + "model given in ctest_start()" << std::endl, quiet); } if (!this->SpecificTrack.empty() && track != this->SpecificTrack) { - cmCTestOptionalLog(this, WARNING, "Track given in TAG does not match " - "track given in ctest_start()" + cmCTestOptionalLog(this, WARNING, + "Track given in TAG does not match " + "track given in ctest_start()" << std::endl, quiet); } else { this->SpecificTrack = track; } - cmCTestOptionalLog(this, OUTPUT, " Use existing tag: " - << tag << " - " << this->GetTestModelString() - << std::endl, + cmCTestOptionalLog(this, OUTPUT, + " Use existing tag: " << tag << " - " + << this->GetTestModelString() + << std::endl, quiet); } @@ -613,8 +621,9 @@ bool cmCTest::InitializeFromCommand(cmCTestStartCommand* command) } if (!fname.empty()) { - cmCTestOptionalLog(this, OUTPUT, " Reading ctest configuration file: " - << fname << std::endl, + cmCTestOptionalLog(this, OUTPUT, + " Reading ctest configuration file: " << fname + << std::endl, command->ShouldBeQuiet()); bool readit = mf->ReadDependentFile(fname.c_str()); if (!readit) { @@ -629,7 +638,8 @@ bool cmCTest::InitializeFromCommand(cmCTestStartCommand* command) << bld_dir_fname << std::endl, command->ShouldBeQuiet()); cmCTestOptionalLog( - this, WARNING, "Cannot locate CTest configuration: in SourceDirectory: " + this, WARNING, + "Cannot locate CTest configuration: in SourceDirectory: " << src_dir_fname << std::endl, command->ShouldBeQuiet()); } @@ -645,7 +655,8 @@ bool cmCTest::InitializeFromCommand(cmCTestStartCommand* command) if (dartVersion) { this->DartVersion = atoi(dartVersion); if (this->DartVersion < 0) { - cmCTestLog(this, ERROR_MESSAGE, "Invalid Dart server version: " + cmCTestLog(this, ERROR_MESSAGE, + "Invalid Dart server version: " << dartVersion << ". Please specify the version number." << std::endl); return false; @@ -656,9 +667,9 @@ bool cmCTest::InitializeFromCommand(cmCTestStartCommand* command) if (!this->Initialize(bld_dir.c_str(), command)) { return false; } - cmCTestOptionalLog(this, OUTPUT, " Use " - << this->GetTestModelString() - << " tag: " << this->GetCurrentTag() << std::endl, + cmCTestOptionalLog(this, OUTPUT, + " Use " << this->GetTestModelString() << " tag: " + << this->GetCurrentTag() << std::endl, command->ShouldBeQuiet()); return true; } @@ -677,13 +688,13 @@ bool cmCTest::UpdateCTestConfiguration() if (!cmSystemTools::FileExists(fileName)) { // No need to exit if we are not producing XML if (this->ProduceXML) { - cmCTestLog(this, ERROR_MESSAGE, "Cannot find file: " << fileName - << std::endl); + cmCTestLog(this, ERROR_MESSAGE, + "Cannot find file: " << fileName << std::endl); return false; } } else { - cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "Parse Config file:" << fileName - << "\n"); + cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, + "Parse Config file:" << fileName << "\n"); // parse the dart test file cmsys::ifstream fin(fileName.c_str()); @@ -774,8 +785,9 @@ bool cmCTest::SetTest(const char* ttype, bool report) return true; } if (report) { - cmCTestLog(this, ERROR_MESSAGE, "Don't know about test \"" - << ttype << "\" yet..." << std::endl); + cmCTestLog(this, ERROR_MESSAGE, + "Don't know about test \"" << ttype << "\" yet..." + << std::endl); } return false; } @@ -793,23 +805,24 @@ bool cmCTest::OpenOutputFile(const std::string& path, const std::string& name, } if (cmSystemTools::FileExists(testingDir)) { if (!cmSystemTools::FileIsDirectory(testingDir)) { - cmCTestLog(this, ERROR_MESSAGE, "File " - << testingDir << " is in the place of the testing directory" - << std::endl); + cmCTestLog(this, ERROR_MESSAGE, + "File " << testingDir + << " is in the place of the testing directory" + << std::endl); return false; } } else { if (!cmSystemTools::MakeDirectory(testingDir)) { - cmCTestLog(this, ERROR_MESSAGE, "Cannot create directory " << testingDir - << std::endl); + cmCTestLog(this, ERROR_MESSAGE, + "Cannot create directory " << testingDir << std::endl); return false; } } std::string filename = testingDir + "/" + name; stream.Open(filename.c_str()); if (!stream) { - cmCTestLog(this, ERROR_MESSAGE, "Problem opening file: " << filename - << std::endl); + cmCTestLog(this, ERROR_MESSAGE, + "Problem opening file: " << filename << std::endl); return false; } if (compress) { @@ -1048,9 +1061,10 @@ int cmCTest::RunMakeCommand(const char* command, std::string& output, int length; cmProcessOutput processOutput(encoding); std::string strdata; - cmCTestLog(this, HANDLER_PROGRESS_OUTPUT, " Each . represents " - << tick_len << " bytes of output" << std::endl - << " " << std::flush); + cmCTestLog(this, HANDLER_PROGRESS_OUTPUT, + " Each . represents " << tick_len << " bytes of output" + << std::endl + << " " << std::flush); while (cmsysProcess_WaitForData(cp, &data, &length, nullptr)) { processOutput.DecodeText(data, length, strdata); for (char& cc : strdata) { @@ -1084,8 +1098,9 @@ int cmCTest::RunMakeCommand(const char* command, std::string& output, ofs << cmCTestLogWrite(strdata.c_str(), strdata.size()); } } - cmCTestLog(this, HANDLER_PROGRESS_OUTPUT, " Size of output: " - << int(double(output.size()) / 1024.0) << "K" << std::endl); + cmCTestLog(this, HANDLER_PROGRESS_OUTPUT, + " Size of output: " << int(double(output.size()) / 1024.0) << "K" + << std::endl); cmsysProcess_WaitForExit(cp, nullptr); @@ -1097,16 +1112,17 @@ int cmCTest::RunMakeCommand(const char* command, std::string& output, "Command exited with the value: " << *retVal << std::endl); } else if (result == cmsysProcess_State_Exception) { *retVal = cmsysProcess_GetExitException(cp); - cmCTestLog(this, WARNING, "There was an exception: " << *retVal - << std::endl); + cmCTestLog(this, WARNING, + "There was an exception: " << *retVal << std::endl); } else if (result == cmsysProcess_State_Expired) { cmCTestLog(this, WARNING, "There was a timeout" << std::endl); } else if (result == cmsysProcess_State_Error) { output += "\n*** ERROR executing: "; output += cmsysProcess_GetErrorString(cp); output += "\n***The build process failed."; - cmCTestLog(this, ERROR_MESSAGE, "There was an error: " - << cmsysProcess_GetErrorString(cp) << std::endl); + cmCTestLog(this, ERROR_MESSAGE, + "There was an error: " << cmsysProcess_GetErrorString(cp) + << std::endl); } cmsysProcess_Delete(cp); @@ -1142,7 +1158,8 @@ int cmCTest::RunTest(std::vector argv, std::string* output, if (timeout <= cmDuration::zero()) { timeout = std::chrono::seconds(1); } - cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "Test timeout computed to be: " + cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, + "Test timeout computed to be: " << (timeout == cmCTest::MaxDuration() ? std::string("infinite") : std::to_string(cmDurationTo(timeout))) @@ -1250,8 +1267,8 @@ int cmCTest::RunTest(std::vector argv, std::string* output, if (output && tempOutput.begin() != tempOutput.end()) { output->append(&*tempOutput.begin(), tempOutput.size()); } - cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "-- Process completed" - << std::endl); + cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, + "-- Process completed" << std::endl); int result = cmsysProcess_GetState(cp); @@ -1270,16 +1287,18 @@ int cmCTest::RunTest(std::vector argv, std::string* output, if (output) { *output += outerr; } - cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, outerr << std::endl - << std::flush); + cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, + outerr << std::endl + << std::flush); } else if (result == cmsysProcess_State_Error) { std::string outerr = "\n*** ERROR executing: "; outerr += cmsysProcess_GetErrorString(cp); if (output) { *output += outerr; } - cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, outerr << std::endl - << std::flush); + cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, + outerr << std::endl + << std::flush); } cmsysProcess_Delete(cp); @@ -1319,8 +1338,9 @@ std::string cmCTest::SafeBuildIdField(const std::string& value) void cmCTest::StartXML(cmXMLWriter& xml, bool append) { if (this->CurrentTag.empty()) { - cmCTestLog(this, ERROR_MESSAGE, "Current Tag empty, this may mean" - " NightlStartTime was not set correctly." + cmCTestLog(this, ERROR_MESSAGE, + "Current Tag empty, this may mean" + " NightlStartTime was not set correctly." << std::endl); cmSystemTools::SetFatalErrorOccured(); } @@ -1489,8 +1509,9 @@ int cmCTest::GenerateCTestNotesOutput(cmXMLWriter& xml, ifs.close(); } else { xml.Content("Problem reading file: " + file + "\n"); - cmCTestLog(this, ERROR_MESSAGE, "Problem reading file: " - << file << " while creating notes" << std::endl); + cmCTestLog(this, ERROR_MESSAGE, + "Problem reading file: " << file << " while creating notes" + << std::endl); } xml.EndElement(); // Text xml.EndElement(); // Note @@ -1539,8 +1560,9 @@ std::string cmCTest::Base64GzipEncodeFile(std::string const& file) if (!cmSystemTools::CreateTar(tarFile.c_str(), files, cmSystemTools::TarCompressGZip, false)) { - cmCTestLog(this, ERROR_MESSAGE, "Error creating tar while " - "encoding file: " + cmCTestLog(this, ERROR_MESSAGE, + "Error creating tar while " + "encoding file: " << file << std::endl); return ""; } @@ -1552,11 +1574,12 @@ std::string cmCTest::Base64GzipEncodeFile(std::string const& file) std::string cmCTest::Base64EncodeFile(std::string const& file) { size_t const len = cmSystemTools::FileLength(file); - cmsys::ifstream ifs(file.c_str(), std::ios::in + cmsys::ifstream ifs(file.c_str(), + std::ios::in #ifdef _WIN32 | std::ios::binary #endif - ); + ); std::vector file_buffer(len + 1); ifs.read(&file_buffer[0], len); ifs.close(); @@ -1574,8 +1597,9 @@ bool cmCTest::SubmitExtraFiles(const VectorOfStrings& files) { for (cmsys::String const& file : files) { if (!cmSystemTools::FileExists(file)) { - cmCTestLog(this, ERROR_MESSAGE, "Cannot find extra file: " - << file << " to submit." << std::endl;); + cmCTestLog(this, ERROR_MESSAGE, + "Cannot find extra file: " << file << " to submit." + << std::endl;); return false; } this->AddSubmitFile(PartExtraFiles, file.c_str()); @@ -1732,7 +1756,8 @@ void cmCTest::ErrorMessageUnknownDashDValue(std::string& val) "CTest -D called with incorrect option: " << val << std::endl); cmCTestLog( - this, ERROR_MESSAGE, "Available options are:" + this, ERROR_MESSAGE, + "Available options are:" << std::endl << " ctest -D Continuous" << std::endl << " ctest -D Continuous(Start|Update|Configure|Build)" << std::endl @@ -2191,9 +2216,11 @@ bool cmCTest::HandleTestActionArgument(const char* ctestExec, size_t& i, i++; if (!this->SetTest(args[i].c_str(), false)) { success = false; - cmCTestLog(this, ERROR_MESSAGE, "CTest -T called with incorrect option: " - << args[i] << std::endl); - cmCTestLog(this, ERROR_MESSAGE, "Available options are:" + cmCTestLog(this, ERROR_MESSAGE, + "CTest -T called with incorrect option: " << args[i] + << std::endl); + cmCTestLog(this, ERROR_MESSAGE, + "Available options are:" << std::endl << " " << ctestExec << " -T all" << std::endl << " " << ctestExec << " -T start" << std::endl @@ -2227,9 +2254,11 @@ bool cmCTest::HandleTestModelArgument(const char* ctestExec, size_t& i, this->SetTestModel(cmCTest::EXPERIMENTAL); } else { success = false; - cmCTestLog(this, ERROR_MESSAGE, "CTest -M called with incorrect option: " - << str << std::endl); - cmCTestLog(this, ERROR_MESSAGE, "Available options are:" + cmCTestLog(this, ERROR_MESSAGE, + "CTest -M called with incorrect option: " << str + << std::endl); + cmCTestLog(this, ERROR_MESSAGE, + "Available options are:" << std::endl << " " << ctestExec << " -M Continuous" << std::endl << " " << ctestExec << " -M Experimental" << std::endl @@ -2270,8 +2299,8 @@ int cmCTest::ExecuteTests() std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); if (!this->Initialize(cwd.c_str(), nullptr)) { res = 12; - cmCTestLog(this, ERROR_MESSAGE, "Problem initializing the dashboard." - << std::endl); + cmCTestLog(this, ERROR_MESSAGE, + "Problem initializing the dashboard." << std::endl); } else { res = this->ProcessSteps(); } @@ -2295,8 +2324,8 @@ int cmCTest::RunCMakeAndTest(std::string* output) cmDynamicLoader::FlushCache(); #endif if (retv != 0) { - cmCTestLog(this, DEBUG, "build and test failing returning: " << retv - << std::endl); + cmCTestLog(this, DEBUG, + "build and test failing returning: " << retv << std::endl); } return retv; } @@ -2351,22 +2380,25 @@ int cmCTest::ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf) bool found = false; VectorOfStrings dirs; VectorOfStrings ndirs; - cmCTestLog(this, DEBUG, "* Read custom CTest configuration directory: " - << dir << std::endl); + cmCTestLog(this, DEBUG, + "* Read custom CTest configuration directory: " << dir + << std::endl); std::string fname = dir; fname += "/CTestCustom.cmake"; cmCTestLog(this, DEBUG, "* Check for file: " << fname << std::endl); if (cmSystemTools::FileExists(fname)) { - cmCTestLog(this, DEBUG, "* Read custom CTest configuration file: " - << fname << std::endl); + cmCTestLog(this, DEBUG, + "* Read custom CTest configuration file: " << fname + << std::endl); bool erroroc = cmSystemTools::GetErrorOccuredFlag(); cmSystemTools::ResetErrorOccuredFlag(); if (!mf->ReadListFile(fname.c_str()) || cmSystemTools::GetErrorOccuredFlag()) { - cmCTestLog(this, ERROR_MESSAGE, "Problem reading custom configuration: " - << fname << std::endl); + cmCTestLog(this, ERROR_MESSAGE, + "Problem reading custom configuration: " << fname + << std::endl); } found = true; if (erroroc) { @@ -2384,8 +2416,9 @@ int cmCTest::ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf) std::vector& files = gl.GetFiles(); std::vector::iterator fileIt; for (fileIt = files.begin(); fileIt != files.end(); ++fileIt) { - cmCTestLog(this, DEBUG, "* Read custom CTest configuration file: " - << *fileIt << std::endl); + cmCTestLog(this, DEBUG, + "* Read custom CTest configuration file: " << *fileIt + << std::endl); if (!mf->ReadListFile(fileIt->c_str()) || cmSystemTools::GetErrorOccuredFlag()) { cmCTestLog(this, ERROR_MESSAGE, @@ -2398,9 +2431,10 @@ int cmCTest::ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf) if (found) { for (auto& handler : this->TestingHandlers) { - cmCTestLog( - this, DEBUG, "* Read custom CTest configuration vectors for handler: " - << handler.first << " (" << handler.second << ")" << std::endl); + cmCTestLog(this, DEBUG, + "* Read custom CTest configuration vectors for handler: " + << handler.first << " (" << handler.second << ")" + << std::endl); handler.second->PopulateCustomVectors(mf); } } @@ -2502,7 +2536,8 @@ void cmCTest::EmptyCTestConfiguration() void cmCTest::SetCTestConfiguration(const char* name, const char* value, bool suppress) { - cmCTestOptionalLog(this, HANDLER_VERBOSE_OUTPUT, "SetCTestConfiguration:" + cmCTestOptionalLog(this, HANDLER_VERBOSE_OUTPUT, + "SetCTestConfiguration:" << name << ":" << (value ? value : "(null)") << "\n", suppress); @@ -2889,8 +2924,8 @@ bool cmCTest::CompressString(std::string& str) ret = deflate(&strm, Z_FINISH); if (ret != Z_STREAM_END) { - cmCTestLog(this, ERROR_MESSAGE, "Error during gzip compression." - << std::endl); + cmCTestLog(this, ERROR_MESSAGE, + "Error during gzip compression." << std::endl); return false; } diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index 13407e5..c6a1cff 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -566,7 +566,8 @@ void cmCacheManager::AddCacheEntry(const std::string& key, const char* value, cmSystemTools::ConvertToUnixSlashes(e.Value); } } - e.SetProperty("HELPSTRING", helpString + e.SetProperty("HELPSTRING", + helpString ? helpString : "(This variable does not exist and should not be used)"); } diff --git a/Source/cmCallVisualStudioMacro.cxx b/Source/cmCallVisualStudioMacro.cxx index 99fe587..ecfcfb9 100644 --- a/Source/cmCallVisualStudioMacro.cxx +++ b/Source/cmCallVisualStudioMacro.cxx @@ -7,7 +7,7 @@ #include "cmSystemTools.h" #if defined(_MSC_VER) -#define HAVE_COMDEF_H +# define HAVE_COMDEF_H #endif // Just for this file: @@ -16,39 +16,39 @@ static bool LogErrorsAsMessages; #if defined(HAVE_COMDEF_H) -#include +# include // Copied from a correct comdef.h to avoid problems with deficient versions // of comdef.h that exist in the wild... Fixes issue #7533. // -#ifdef _NATIVE_WCHAR_T_DEFINED -#ifdef _DEBUG -#pragma comment(lib, "comsuppwd.lib") -#else -#pragma comment(lib, "comsuppw.lib") -#endif -#else -#ifdef _DEBUG -#pragma comment(lib, "comsuppd.lib") -#else -#pragma comment(lib, "comsupp.lib") -#endif -#endif +# ifdef _NATIVE_WCHAR_T_DEFINED +# ifdef _DEBUG +# pragma comment(lib, "comsuppwd.lib") +# else +# pragma comment(lib, "comsuppw.lib") +# endif +# else +# ifdef _DEBUG +# pragma comment(lib, "comsuppd.lib") +# else +# pragma comment(lib, "comsupp.lib") +# endif +# endif ///! Use ReportHRESULT to make a cmSystemTools::Message after calling ///! a COM method that may have failed. -#define ReportHRESULT(hr, context) \ - if (FAILED(hr)) { \ - if (LogErrorsAsMessages) { \ - std::ostringstream _hresult_oss; \ - _hresult_oss.flags(std::ios::hex); \ - _hresult_oss << context << " failed HRESULT, hr = 0x" << hr \ - << std::endl; \ - _hresult_oss.flags(std::ios::dec); \ - _hresult_oss << __FILE__ << "(" << __LINE__ << ")"; \ - cmSystemTools::Message(_hresult_oss.str().c_str()); \ - } \ - } +# define ReportHRESULT(hr, context) \ + if (FAILED(hr)) { \ + if (LogErrorsAsMessages) { \ + std::ostringstream _hresult_oss; \ + _hresult_oss.flags(std::ios::hex); \ + _hresult_oss << context << " failed HRESULT, hr = 0x" << hr \ + << std::endl; \ + _hresult_oss.flags(std::ios::dec); \ + _hresult_oss << __FILE__ << "(" << __LINE__ << ")"; \ + cmSystemTools::Message(_hresult_oss.str().c_str()); \ + } \ + } ///! Using the given instance of Visual Studio, call the named macro HRESULT InstanceCallMacro(IDispatch* vsIDE, const std::string& macro, diff --git a/Source/cmCommandArgumentsHelper.h b/Source/cmCommandArgumentsHelper.h index d3f102c..c68e64c 100644 --- a/Source/cmCommandArgumentsHelper.h +++ b/Source/cmCommandArgumentsHelper.h @@ -98,6 +98,7 @@ public: /** Is there a keyword which should be skipped in the arguments (e.g. ARGS for ADD_CUSTOM_COMMAND) ? */ void SetIgnore(const char* ignore) { this->Ignore = ignore; } + private: std::vector Vector; unsigned int DataStart; @@ -118,6 +119,7 @@ public: /// Return the string const std::string& GetString() const { return this->String; } const char* GetCString() const { return this->String.c_str(); } + private: std::string String; unsigned int DataStart; @@ -136,6 +138,7 @@ public: /// Has it been enabled ? bool IsEnabled() const { return this->Enabled; } + private: bool Enabled; bool DoConsume(const std::string& arg, unsigned int index) override; @@ -153,6 +156,7 @@ public: /// Is it still enabled ? bool IsEnabled() const { return this->Enabled; } + private: bool Enabled; bool DoConsume(const std::string& arg, unsigned int index) override; diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx index a87b450..dc9318e 100644 --- a/Source/cmCommands.cxx +++ b/Source/cmCommands.cxx @@ -81,30 +81,30 @@ #include "cmWhileCommand.h" #if defined(CMAKE_BUILD_WITH_CMAKE) -#include "cmAddCompileOptionsCommand.h" -#include "cmAuxSourceDirectoryCommand.h" -#include "cmBuildNameCommand.h" -#include "cmCMakeHostSystemInformationCommand.h" -#include "cmExportCommand.h" -#include "cmExportLibraryDependenciesCommand.h" -#include "cmFLTKWrapUICommand.h" -#include "cmIncludeExternalMSProjectCommand.h" -#include "cmInstallProgramsCommand.h" -#include "cmLinkLibrariesCommand.h" -#include "cmLoadCacheCommand.h" -#include "cmLoadCommandCommand.h" -#include "cmOutputRequiredFilesCommand.h" -#include "cmQTWrapCPPCommand.h" -#include "cmQTWrapUICommand.h" -#include "cmRemoveCommand.h" -#include "cmRemoveDefinitionsCommand.h" -#include "cmSourceGroupCommand.h" -#include "cmSubdirDependsCommand.h" -#include "cmUseMangledMesaCommand.h" -#include "cmUtilitySourceCommand.h" -#include "cmVariableRequiresCommand.h" -#include "cmVariableWatchCommand.h" -#include "cmWriteFileCommand.h" +# include "cmAddCompileOptionsCommand.h" +# include "cmAuxSourceDirectoryCommand.h" +# include "cmBuildNameCommand.h" +# include "cmCMakeHostSystemInformationCommand.h" +# include "cmExportCommand.h" +# include "cmExportLibraryDependenciesCommand.h" +# include "cmFLTKWrapUICommand.h" +# include "cmIncludeExternalMSProjectCommand.h" +# include "cmInstallProgramsCommand.h" +# include "cmLinkLibrariesCommand.h" +# include "cmLoadCacheCommand.h" +# include "cmLoadCommandCommand.h" +# include "cmOutputRequiredFilesCommand.h" +# include "cmQTWrapCPPCommand.h" +# include "cmQTWrapUICommand.h" +# include "cmRemoveCommand.h" +# include "cmRemoveDefinitionsCommand.h" +# include "cmSourceGroupCommand.h" +# include "cmSubdirDependsCommand.h" +# include "cmUseMangledMesaCommand.h" +# include "cmUtilitySourceCommand.h" +# include "cmVariableRequiresCommand.h" +# include "cmVariableWatchCommand.h" +# include "cmWriteFileCommand.h" #endif void GetScriptingCommands(cmState* state) @@ -155,32 +155,39 @@ void GetScriptingCommands(cmState* state) state->AddBuiltinCommand("while", new cmWhileCommand); state->AddUnexpectedCommand( - "else", "An ELSE command was found outside of a proper " - "IF ENDIF structure. Or its arguments did not match " - "the opening IF command."); + "else", + "An ELSE command was found outside of a proper " + "IF ENDIF structure. Or its arguments did not match " + "the opening IF command."); state->AddUnexpectedCommand( - "elseif", "An ELSEIF command was found outside of a proper " - "IF ENDIF structure."); + "elseif", + "An ELSEIF command was found outside of a proper " + "IF ENDIF structure."); state->AddUnexpectedCommand( - "endforeach", "An ENDFOREACH command was found outside of a proper " - "FOREACH ENDFOREACH structure. Or its arguments did " - "not match the opening FOREACH command."); + "endforeach", + "An ENDFOREACH command was found outside of a proper " + "FOREACH ENDFOREACH structure. Or its arguments did " + "not match the opening FOREACH command."); state->AddUnexpectedCommand( - "endfunction", "An ENDFUNCTION command was found outside of a proper " - "FUNCTION ENDFUNCTION structure. Or its arguments did not " - "match the opening FUNCTION command."); + "endfunction", + "An ENDFUNCTION command was found outside of a proper " + "FUNCTION ENDFUNCTION structure. Or its arguments did not " + "match the opening FUNCTION command."); state->AddUnexpectedCommand( - "endif", "An ENDIF command was found outside of a proper " - "IF ENDIF structure. Or its arguments did not match " - "the opening IF command."); + "endif", + "An ENDIF command was found outside of a proper " + "IF ENDIF structure. Or its arguments did not match " + "the opening IF command."); state->AddUnexpectedCommand( - "endmacro", "An ENDMACRO command was found outside of a proper " - "MACRO ENDMACRO structure. Or its arguments did not " - "match the opening MACRO command."); + "endmacro", + "An ENDMACRO command was found outside of a proper " + "MACRO ENDMACRO structure. Or its arguments did not " + "match the opening MACRO command."); state->AddUnexpectedCommand( - "endwhile", "An ENDWHILE command was found outside of a proper " - "WHILE ENDWHILE structure. Or its arguments did not " - "match the opening WHILE command."); + "endwhile", + "An ENDWHILE command was found outside of a proper " + "WHILE ENDWHILE structure. Or its arguments did not " + "match the opening WHILE command."); #if defined(CMAKE_BUILD_WITH_CMAKE) state->AddBuiltinCommand("cmake_host_system_information", diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx index d6d8eb0..a1df271 100644 --- a/Source/cmCommonTargetGenerator.cxx +++ b/Source/cmCommonTargetGenerator.cxx @@ -149,7 +149,8 @@ std::vector cmCommonTargetGenerator::GetLinkedTargetDirectories() cmComputeLinkInformation::ItemVector const& items = cli->GetItems(); for (auto const& item : items) { cmGeneratorTarget const* linkee = item.Target; - if (linkee && !linkee->IsImported() + if (linkee && + !linkee->IsImported() // We can ignore the INTERFACE_LIBRARY items because // Target->GetLinkInformation already processed their // link interface and they don't have any output themselves. diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index 354de36..b1f3860 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -239,8 +239,9 @@ cmComputeLinkDepends::Compute() // Display the constraint graph. if (this->DebugMode) { - fprintf(stderr, "---------------------------------------" - "---------------------------------------\n"); + fprintf(stderr, + "---------------------------------------" + "---------------------------------------\n"); fprintf(stderr, "Link dependency analysis for target %s, config %s\n", this->Target->GetName().c_str(), this->HasConfig ? this->Config.c_str() : "noconfig"); diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index 6e6e0be..8d6efde 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -241,13 +241,12 @@ because this need be done only for shared libraries without soname-s. cmComputeLinkInformation::cmComputeLinkInformation( const cmGeneratorTarget* target, const std::string& config) // Store context information. - : Target(target), - Makefile(target->Target->GetMakefile()), - GlobalGenerator(target->GetLocalGenerator()->GetGlobalGenerator()), - CMakeInstance(this->GlobalGenerator->GetCMakeInstance()) - // The configuration being linked. - , - Config(config) + : Target(target) + , Makefile(target->Target->GetMakefile()) + , GlobalGenerator(target->GetLocalGenerator()->GetGlobalGenerator()) + , CMakeInstance(this->GlobalGenerator->GetCMakeInstance()) + // The configuration being linked. + , Config(config) { // Check whether to recognize OpenBSD-style library versioned names. this->OpenBSD = this->Makefile->GetState()->GetGlobalPropertyAsBool( diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h index 65c12da..e00d230 100644 --- a/Source/cmComputeLinkInformation.h +++ b/Source/cmComputeLinkInformation.h @@ -65,6 +65,7 @@ public: std::string GetRPathLinkString() const; std::string GetConfig() const { return this->Config; } + private: void AddItem(std::string const& item, const cmGeneratorTarget* tgt); void AddSharedDepItem(std::string const& item, cmGeneratorTarget const* tgt); diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index a9b7adf..0b50121 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -82,17 +82,20 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv, if (strcmp(tt, cmState::GetTargetTypeName(cmStateEnums::EXECUTABLE)) == 0) { targetType = cmStateEnums::EXECUTABLE; - } else if (strcmp(tt, cmState::GetTargetTypeName( - cmStateEnums::STATIC_LIBRARY)) == 0) { + } else if (strcmp(tt, + cmState::GetTargetTypeName( + cmStateEnums::STATIC_LIBRARY)) == 0) { targetType = cmStateEnums::STATIC_LIBRARY; } else { this->Makefile->IssueMessage( - cmake::FATAL_ERROR, std::string("Invalid value '") + tt + + cmake::FATAL_ERROR, + std::string("Invalid value '") + tt + "' for " "CMAKE_TRY_COMPILE_TARGET_TYPE. Only " "'" + - cmState::GetTargetTypeName(cmStateEnums::EXECUTABLE) + "' and " - "'" + + cmState::GetTargetTypeName(cmStateEnums::EXECUTABLE) + + "' and " + "'" + cmState::GetTargetTypeName(cmStateEnums::STATIC_LIBRARY) + "' " "are allowed."); @@ -224,8 +227,9 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv, cmake::FATAL_ERROR, "Only libraries may be used as try_compile or try_run IMPORTED " "LINK_LIBRARIES. Got " + - std::string(tgt->GetName()) + " of " - "type " + + std::string(tgt->GetName()) + + " of " + "type " + cmState::GetTargetTypeName(tgt->GetType()) + "."); return -1; } @@ -487,8 +491,9 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv, const char* flags = this->Makefile->GetDefinition(langFlags); fprintf(fout, "set(CMAKE_%s_FLAGS %s)\n", li.c_str(), cmOutputConverter::EscapeForCMake(flags ? flags : "").c_str()); - fprintf(fout, "set(CMAKE_%s_FLAGS \"${CMAKE_%s_FLAGS}" - " ${COMPILE_DEFINITIONS}\")\n", + fprintf(fout, + "set(CMAKE_%s_FLAGS \"${CMAKE_%s_FLAGS}" + " ${COMPILE_DEFINITIONS}\")\n", li.c_str(), li.c_str()); } switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0066)) { @@ -563,8 +568,9 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv, } break; } - fprintf(fout, "set(CMAKE_EXE_LINKER_FLAGS \"${CMAKE_EXE_LINKER_FLAGS}" - " ${EXE_LINKER_FLAGS}\")\n"); + fprintf(fout, + "set(CMAKE_EXE_LINKER_FLAGS \"${CMAKE_EXE_LINKER_FLAGS}" + " ${EXE_LINKER_FLAGS}\")\n"); fprintf(fout, "include_directories(${INCLUDE_DIRECTORIES})\n"); fprintf(fout, "set(CMAKE_SUPPRESS_REGENERATION 1)\n"); fprintf(fout, "link_directories(${LINK_DIRECTORIES})\n"); diff --git a/Source/cmCurl.cxx b/Source/cmCurl.cxx index 8ef8bff..3360323 100644 --- a/Source/cmCurl.cxx +++ b/Source/cmCurl.cxx @@ -6,13 +6,13 @@ #if !defined(CMAKE_USE_SYSTEM_CURL) && !defined(_WIN32) && \ !defined(__APPLE__) && !defined(CURL_CA_BUNDLE) && !defined(CURL_CA_PATH) -#define CMAKE_FIND_CAFILE -#include "cmSystemTools.h" +# define CMAKE_FIND_CAFILE +# include "cmSystemTools.h" #endif // curl versions before 7.21.5 did not provide this error code #if defined(LIBCURL_VERSION_NUM) && LIBCURL_VERSION_NUM < 0x071505 -#define CURLE_NOT_BUILT_IN 4 +# define CURLE_NOT_BUILT_IN 4 #endif #define check_curl_result(result, errstr) \ @@ -30,28 +30,28 @@ std::string cmCurlSetCAInfo(::CURL* curl, const char* cafile) check_curl_result(res, "Unable to set TLS/SSL Verify CAINFO: "); } #ifdef CMAKE_FIND_CAFILE -#define CMAKE_CAFILE_FEDORA "/etc/pki/tls/certs/ca-bundle.crt" +# define CMAKE_CAFILE_FEDORA "/etc/pki/tls/certs/ca-bundle.crt" else if (cmSystemTools::FileExists(CMAKE_CAFILE_FEDORA, true)) { ::CURLcode res = ::curl_easy_setopt(curl, CURLOPT_CAINFO, CMAKE_CAFILE_FEDORA); check_curl_result(res, "Unable to set TLS/SSL Verify CAINFO: "); } -#undef CMAKE_CAFILE_FEDORA +# undef CMAKE_CAFILE_FEDORA else { -#define CMAKE_CAFILE_COMMON "/etc/ssl/certs/ca-certificates.crt" +# define CMAKE_CAFILE_COMMON "/etc/ssl/certs/ca-certificates.crt" if (cmSystemTools::FileExists(CMAKE_CAFILE_COMMON, true)) { ::CURLcode res = ::curl_easy_setopt(curl, CURLOPT_CAINFO, CMAKE_CAFILE_COMMON); check_curl_result(res, "Unable to set TLS/SSL Verify CAINFO: "); } -#undef CMAKE_CAFILE_COMMON -#define CMAKE_CAPATH_COMMON "/etc/ssl/certs" +# undef CMAKE_CAFILE_COMMON +# define CMAKE_CAPATH_COMMON "/etc/ssl/certs" if (cmSystemTools::FileIsDirectory(CMAKE_CAPATH_COMMON)) { ::CURLcode res = ::curl_easy_setopt(curl, CURLOPT_CAPATH, CMAKE_CAPATH_COMMON); check_curl_result(res, "Unable to set TLS/SSL Verify CAPATH: "); } -#undef CMAKE_CAPATH_COMMON +# undef CMAKE_CAPATH_COMMON } #endif return e; diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx index 77ccd30..0ccd68a 100644 --- a/Source/cmELF.cxx +++ b/Source/cmELF.cxx @@ -13,39 +13,39 @@ // Include the ELF format information system header. #if defined(__OpenBSD__) -#include -#include +# include +# include #elif defined(__HAIKU__) -#include -#include +# include +# include typedef struct Elf32_Ehdr Elf32_Ehdr; typedef struct Elf32_Shdr Elf32_Shdr; typedef struct Elf32_Sym Elf32_Sym; typedef struct Elf32_Rel Elf32_Rel; typedef struct Elf32_Rela Elf32_Rela; -#define ELFMAG0 0x7F -#define ELFMAG1 'E' -#define ELFMAG2 'L' -#define ELFMAG3 'F' -#define ET_NONE 0 -#define ET_REL 1 -#define ET_EXEC 2 -#define ET_DYN 3 -#define ET_CORE 4 -#define EM_386 3 -#define EM_SPARC 2 -#define EM_PPC 20 +# define ELFMAG0 0x7F +# define ELFMAG1 'E' +# define ELFMAG2 'L' +# define ELFMAG3 'F' +# define ET_NONE 0 +# define ET_REL 1 +# define ET_EXEC 2 +# define ET_DYN 3 +# define ET_CORE 4 +# define EM_386 3 +# define EM_SPARC 2 +# define EM_PPC 20 #else -#include +# include #endif #if defined(__sun) -#include // For dynamic section information +# include // For dynamic section information #endif #ifdef _SCO_DS -#include // For DT_SONAME etc. +# include // For DT_SONAME etc. #endif #ifndef DT_RUNPATH -#define DT_RUNPATH 29 +# define DT_RUNPATH 29 #endif // Low-level byte swapping implementation. @@ -162,6 +162,7 @@ public: // Return the recorded ELF type. cmELF::FileType GetFileType() const { return this->ELFType; } + protected: // Data common to all ELF class implementations. diff --git a/Source/cmELF.h b/Source/cmELF.h index 8c17348..9172f38 100644 --- a/Source/cmELF.h +++ b/Source/cmELF.h @@ -11,7 +11,7 @@ #include #if !defined(CMAKE_USE_ELF_PARSER) -#error "This file may be included only if CMAKE_USE_ELF_PARSER is enabled." +# error "This file may be included only if CMAKE_USE_ELF_PARSER is enabled." #endif class cmELFInternal; diff --git a/Source/cmExecProgramCommand.cxx b/Source/cmExecProgramCommand.cxx index 49f880c..ea4cd40 100644 --- a/Source/cmExecProgramCommand.cxx +++ b/Source/cmExecProgramCommand.cxx @@ -194,9 +194,9 @@ bool cmExecProgramCommand::RunCommand(const char* command, std::string& output, } else { commandInDir = command; } -#ifndef __VMS +# ifndef __VMS commandInDir += " 2>&1"; -#endif +# endif command = commandInDir.c_str(); if (verbose) { cmSystemTools::Stdout("running "); diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx index 655ebe8..4e1d771 100644 --- a/Source/cmExportCommand.cxx +++ b/Source/cmExportCommand.cxx @@ -20,8 +20,8 @@ class cmExecutionStatus; #if defined(__HAIKU__) -#include -#include +# include +# include #endif cmExportCommand::cmExportCommand() @@ -266,7 +266,7 @@ bool cmExportCommand::HandlePackage(std::vector const& args) } #if defined(_WIN32) && !defined(__CYGWIN__) -#include +# include void cmExportCommand::ReportRegistryError(std::string const& msg, std::string const& key, long err) @@ -317,7 +317,7 @@ void cmExportCommand::StorePackageRegistryDir(std::string const& package, const char* content, const char* hash) { -#if defined(__HAIKU__) +# if defined(__HAIKU__) char dir[B_PATH_NAME_LENGTH]; if (find_directory(B_USER_SETTINGS_DIRECTORY, -1, false, dir, sizeof(dir)) != B_OK) { @@ -326,7 +326,7 @@ void cmExportCommand::StorePackageRegistryDir(std::string const& package, std::string fname = dir; fname += "/cmake/packages/"; fname += package; -#else +# else std::string fname; if (!cmSystemTools::GetEnv("HOME", fname)) { return; @@ -334,7 +334,7 @@ void cmExportCommand::StorePackageRegistryDir(std::string const& package, cmSystemTools::ConvertToUnixSlashes(fname); fname += "/.cmake/packages/"; fname += package; -#endif +# endif cmSystemTools::MakeDirectory(fname); fname += "/"; fname += hash; diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index bf9d341..5f61571 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -266,10 +266,12 @@ static bool checkInterfaceDirs(const std::string& prepro, s << "Directory:\n \"" << li << "\"\nin " "INTERFACE_INCLUDE_DIRECTORIES of target \"" - << target->GetName() << "\" is a subdirectory of the install " - "directory:\n \"" - << installDir << "\"\nhowever it is also " - "a subdirectory of the " + << target->GetName() + << "\" is a subdirectory of the install " + "directory:\n \"" + << installDir + << "\"\nhowever it is also " + "a subdirectory of the " << (inBinary ? "build" : "source") << " tree:\n \"" << (inBinary ? topBinaryDir : topSourceDir) << "\"" << std::endl; diff --git a/Source/cmExportTryCompileFileGenerator.h b/Source/cmExportTryCompileFileGenerator.h index ca2987c..2a2ba7e 100644 --- a/Source/cmExportTryCompileFileGenerator.h +++ b/Source/cmExportTryCompileFileGenerator.h @@ -26,6 +26,7 @@ public: /** Set the list of targets to export. */ void SetConfig(const std::string& config) { this->Config = config; } + protected: // Implement virtual methods from the superclass. bool GenerateMainFile(std::ostream& os) override; diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index 4b95140..759094b 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -614,23 +614,27 @@ void cmExtraCodeBlocksGenerator::AppendTarget( xml.StartElement("MakeCommands"); xml.StartElement("Build"); - xml.Attribute("command", this->BuildMakeCommand(make, makefileName.c_str(), - targetName, makeFlags)); + xml.Attribute( + "command", + this->BuildMakeCommand(make, makefileName.c_str(), targetName, makeFlags)); xml.EndElement(); xml.StartElement("CompileFile"); - xml.Attribute("command", this->BuildMakeCommand(make, makefileName.c_str(), - "\"$file\"", makeFlags)); + xml.Attribute("command", + this->BuildMakeCommand(make, makefileName.c_str(), "\"$file\"", + makeFlags)); xml.EndElement(); xml.StartElement("Clean"); - xml.Attribute("command", this->BuildMakeCommand(make, makefileName.c_str(), - "clean", makeFlags)); + xml.Attribute( + "command", + this->BuildMakeCommand(make, makefileName.c_str(), "clean", makeFlags)); xml.EndElement(); xml.StartElement("DistClean"); - xml.Attribute("command", this->BuildMakeCommand(make, makefileName.c_str(), - "clean", makeFlags)); + xml.Attribute( + "command", + this->BuildMakeCommand(make, makefileName.c_str(), "clean", makeFlags)); xml.EndElement(); xml.EndElement(); // MakeCommands diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index e7279d9..14448f5 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -277,10 +277,11 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile() xml.StartDocument("UTF-8"); xml.StartElement("projectDescription"); - xml.Element("name", this->GenerateProjectName( - lg->GetProjectName(), - mf->GetSafeDefinition("CMAKE_BUILD_TYPE"), - this->GetPathBasename(this->HomeOutputDirectory))); + xml.Element("name", + this->GenerateProjectName( + lg->GetProjectName(), + mf->GetSafeDefinition("CMAKE_BUILD_TYPE"), + this->GetPathBasename(this->HomeOutputDirectory))); xml.Element("comment", ""); xml.Element("projects", ""); @@ -641,7 +642,8 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const xml.EndElement(); // extension } else if (systemName == "Darwin") { xml.StartElement("extension"); - xml.Attribute("id", this->SupportsMachO64Parser + xml.Attribute("id", + this->SupportsMachO64Parser ? "org.eclipse.cdt.core.MachO64" : "org.eclipse.cdt.core.MachO"); xml.Attribute("point", "org.eclipse.cdt.core.BinaryParser"); diff --git a/Source/cmExtraKateGenerator.cxx b/Source/cmExtraKateGenerator.cxx index 7a83e41..df18715 100644 --- a/Source/cmExtraKateGenerator.cxx +++ b/Source/cmExtraKateGenerator.cxx @@ -199,8 +199,9 @@ void cmExtraKateGenerator::AppendTarget(cmGeneratedFileStream& fout, { static char JsonSep = ' '; - fout << "\t\t\t" << JsonSep << "{\"name\":\"" << target << "\", " - "\"build_cmd\":\"" + fout << "\t\t\t" << JsonSep << "{\"name\":\"" << target + << "\", " + "\"build_cmd\":\"" << make << " -C \\\"" << (this->UseNinja ? homeOutputDir : path) << "\\\" " << makeArgs << " " << target << "\"}\n"; diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx index 46dcaf6..fb85a68 100644 --- a/Source/cmExtraSublimeTextGenerator.cxx +++ b/Source/cmExtraSublimeTextGenerator.cxx @@ -400,8 +400,9 @@ std::string cmExtraSublimeTextGenerator::ComputeDefines( std::string defPropName = "COMPILE_DEFINITIONS_"; defPropName += cmSystemTools::UpperCase(config); if (const char* config_compile_defs = source->GetProperty(defPropName)) { - lg->AppendDefines(defines, genexInterpreter.Evaluate(config_compile_defs, - COMPILE_DEFINITIONS)); + lg->AppendDefines( + defines, + genexInterpreter.Evaluate(config_compile_defs, COMPILE_DEFINITIONS)); } std::string definesString; diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 1e47687..aae70b1 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -36,17 +36,17 @@ #include "cmake.h" #if defined(CMAKE_BUILD_WITH_CMAKE) -#include "cmCurl.h" -#include "cmFileLockResult.h" -#include "cm_curl.h" +# include "cmCurl.h" +# include "cmFileLockResult.h" +# include "cm_curl.h" #endif #if defined(CMAKE_USE_ELF_PARSER) -#include "cmELF.h" +# include "cmELF.h" #endif #if defined(_WIN32) -#include +# include #endif class cmSystemToolsFileTime; @@ -216,7 +216,7 @@ bool cmFileCommand::HandleWriteCommand(std::vector const& args, #else mode | S_IWUSR | S_IWGRP #endif - ); + ); } // If GetPermissions fails, pretend like it is ok. File open will fail if // the file is not writable @@ -282,7 +282,8 @@ bool cmFileCommand::HandleReadCommand(std::vector const& args) // Open the specified file. #if defined(_WIN32) || defined(__CYGWIN__) cmsys::ifstream file( - fileName.c_str(), std::ios::in | + fileName.c_str(), + std::ios::in | (hexOutputArg.IsEnabled() ? std::ios::binary : std::ios::in)); #else cmsys::ifstream file(fileName.c_str()); @@ -327,8 +328,9 @@ bool cmFileCommand::HandleReadCommand(std::vector const& args) } else { std::string line; bool has_newline = false; - while (sizeLimit != 0 && cmSystemTools::GetLineFromStream( - file, line, &has_newline, sizeLimit)) { + while ( + sizeLimit != 0 && + cmSystemTools::GetLineFromStream(file, line, &has_newline, sizeLimit)) { if (sizeLimit > 0) { sizeLimit = sizeLimit - static_cast(line.size()); if (has_newline) { @@ -616,7 +618,9 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) } else if (encoding == encoding_utf8) { // Check for UTF-8 encoded string (up to 4 octets) static const unsigned char utf8_check_table[3][2] = { - { 0xE0, 0xC0 }, { 0xF0, 0xE0 }, { 0xF8, 0xF0 }, + { 0xE0, 0xC0 }, + { 0xF0, 0xE0 }, + { 0xF8, 0xF0 }, }; // how many octets are there? @@ -865,8 +869,9 @@ bool cmFileCommand::HandleGlobCommand(std::vector const& args, globMessage.content); } else { this->Makefile->IssueMessage( - cmake::FATAL_ERROR, "Error has occurred while globbing for '" + - *i + "' - " + globMessage.content); + cmake::FATAL_ERROR, + "Error has occurred while globbing for '" + *i + "' - " + + globMessage.content); shouldExit = true; } } @@ -2866,9 +2871,9 @@ bool cmFileCommand::HandleDownloadCommand(std::vector const& args) return false; } -#if defined(_WIN32) +# if defined(_WIN32) url = fix_file_url_windows(url); -#endif +# endif ::CURL* curl; ::curl_global_init(CURL_GLOBAL_DEFAULT); @@ -3155,9 +3160,9 @@ bool cmFileCommand::HandleUploadCommand(std::vector const& args) unsigned long file_size = cmsys::SystemTools::FileLength(filename); -#if defined(_WIN32) +# if defined(_WIN32) url = fix_file_url_windows(url); -#endif +# endif ::CURL* curl; ::curl_global_init(CURL_GLOBAL_DEFAULT); diff --git a/Source/cmFileLock.cxx b/Source/cmFileLock.cxx index f309241..1e472da 100644 --- a/Source/cmFileLock.cxx +++ b/Source/cmFileLock.cxx @@ -54,7 +54,7 @@ bool cmFileLock::IsLocked(const std::string& filename) const } #if defined(_WIN32) -#include "cmFileLockWin32.cxx" +# include "cmFileLockWin32.cxx" #else -#include "cmFileLockUnix.cxx" +# include "cmFileLockUnix.cxx" #endif diff --git a/Source/cmFileLock.h b/Source/cmFileLock.h index c9ab0db..6c9a7b8 100644 --- a/Source/cmFileLock.h +++ b/Source/cmFileLock.h @@ -8,17 +8,17 @@ #include #if defined(_WIN32) -#include // HANDLE +# include // HANDLE #endif class cmFileLockResult; /** - * @brief Cross-platform file locking. - * @details Under the hood this class use 'fcntl' for Unix-like platforms and - * 'LockFileEx'/'UnlockFileEx' for Win32 platform. Locks are exclusive and - * advisory. - */ + * @brief Cross-platform file locking. + * @details Under the hood this class use 'fcntl' for Unix-like platforms and + * 'LockFileEx'/'UnlockFileEx' for Win32 platform. Locks are exclusive and + * advisory. + */ class cmFileLock { CM_DISABLE_COPY(cmFileLock) @@ -28,21 +28,21 @@ public: ~cmFileLock(); /** - * @brief Lock the file. - * @param timeoutSec Lock timeout. If -1 try until success or fatal error. - */ + * @brief Lock the file. + * @param timeoutSec Lock timeout. If -1 try until success or fatal error. + */ cmFileLockResult Lock(const std::string& filename, unsigned long timeoutSec); /** - * @brief Unlock the file. - */ + * @brief Unlock the file. + */ cmFileLockResult Release(); /** - * @brief Check file is locked by this class. - * @details This function helps to find double locks (deadlocks) and to do - * explicit unlocks. - */ + * @brief Check file is locked by this class. + * @details This function helps to find double locks (deadlocks) and to do + * explicit unlocks. + */ bool IsLocked(const std::string& filename) const; private: diff --git a/Source/cmFileLockPool.h b/Source/cmFileLockPool.h index af98270..0197354 100644 --- a/Source/cmFileLockPool.h +++ b/Source/cmFileLockPool.h @@ -21,25 +21,25 @@ public: //@{ /** - * @brief Function scope control. - */ + * @brief Function scope control. + */ void PushFunctionScope(); void PopFunctionScope(); //@} //@{ /** - * @brief File scope control. - */ + * @brief File scope control. + */ void PushFileScope(); void PopFileScope(); //@} //@{ /** - * @brief Lock the file in given scope. - * @param timeoutSec Lock timeout. If -1 try until success or fatal error. - */ + * @brief Lock the file in given scope. + * @param timeoutSec Lock timeout. If -1 try until success or fatal error. + */ cmFileLockResult LockFunctionScope(const std::string& filename, unsigned long timeoutSec); cmFileLockResult LockFileScope(const std::string& filename, @@ -49,8 +49,8 @@ public: //@} /** - * @brief Unlock the file explicitly. - */ + * @brief Unlock the file explicitly. + */ cmFileLockResult Release(const std::string& filename); private: diff --git a/Source/cmFileLockResult.h b/Source/cmFileLockResult.h index 4cedc0a..8b4929a 100644 --- a/Source/cmFileLockResult.h +++ b/Source/cmFileLockResult.h @@ -8,13 +8,13 @@ #include #if defined(_WIN32) -#include // DWORD +# include // DWORD #endif /** - * @brief Result of the locking/unlocking file. - * @note See @c cmFileLock - */ + * @brief Result of the locking/unlocking file. + * @note See @c cmFileLock + */ class cmFileLockResult { public: @@ -25,33 +25,33 @@ public: #endif /** - * @brief Successful lock/unlock. - */ + * @brief Successful lock/unlock. + */ static cmFileLockResult MakeOk(); /** - * @brief Lock/Unlock failed. Read error/GetLastError. - */ + * @brief Lock/Unlock failed. Read error/GetLastError. + */ static cmFileLockResult MakeSystem(); /** - * @brief Lock/Unlock failed. Timeout reached. - */ + * @brief Lock/Unlock failed. Timeout reached. + */ static cmFileLockResult MakeTimeout(); /** - * @brief File already locked. - */ + * @brief File already locked. + */ static cmFileLockResult MakeAlreadyLocked(); /** - * @brief Internal error. - */ + * @brief Internal error. + */ static cmFileLockResult MakeInternal(); /** - * @brief Try to lock with function guard outside of the function - */ + * @brief Try to lock with function guard outside of the function + */ static cmFileLockResult MakeNoFunction(); bool IsOk() const; diff --git a/Source/cmFileTimeComparison.cxx b/Source/cmFileTimeComparison.cxx index 622c15e..8f6993d 100644 --- a/Source/cmFileTimeComparison.cxx +++ b/Source/cmFileTimeComparison.cxx @@ -9,12 +9,12 @@ // Use a platform-specific API to get file times efficiently. #if !defined(_WIN32) || defined(__CYGWIN__) -#include "cm_sys_stat.h" -#define cmFileTimeComparison_Type struct stat +# include "cm_sys_stat.h" +# define cmFileTimeComparison_Type struct stat #else -#include "cmsys/Encoding.hxx" -#include -#define cmFileTimeComparison_Type FILETIME +# include "cmsys/Encoding.hxx" +# include +# define cmFileTimeComparison_Type FILETIME #endif class cmFileTimeComparisonInternal @@ -98,7 +98,7 @@ int cmFileTimeComparisonInternal::Compare(cmFileTimeComparison_Type* s1, cmFileTimeComparison_Type* s2) { #if !defined(_WIN32) || defined(__CYGWIN__) -#if CMake_STAT_HAS_ST_MTIM +# if CMake_STAT_HAS_ST_MTIM // Compare using nanosecond resolution. if (s1->st_mtim.tv_sec < s2->st_mtim.tv_sec) { return -1; @@ -112,7 +112,7 @@ int cmFileTimeComparisonInternal::Compare(cmFileTimeComparison_Type* s1, if (s1->st_mtim.tv_nsec > s2->st_mtim.tv_nsec) { return 1; } -#elif CMake_STAT_HAS_ST_MTIMESPEC +# elif CMake_STAT_HAS_ST_MTIMESPEC // Compare using nanosecond resolution. if (s1->st_mtimespec.tv_sec < s2->st_mtimespec.tv_sec) { return -1; @@ -126,7 +126,7 @@ int cmFileTimeComparisonInternal::Compare(cmFileTimeComparison_Type* s1, if (s1->st_mtimespec.tv_nsec > s2->st_mtimespec.tv_nsec) { return 1; } -#else +# else // Compare using 1 second resolution. if (s1->st_mtime < s2->st_mtime) { return -1; @@ -134,7 +134,7 @@ int cmFileTimeComparisonInternal::Compare(cmFileTimeComparison_Type* s1, if (s1->st_mtime > s2->st_mtime) { return 1; } -#endif +# endif // Files have the same time. return 0; #else @@ -147,7 +147,7 @@ bool cmFileTimeComparisonInternal::TimesDiffer(cmFileTimeComparison_Type* s1, cmFileTimeComparison_Type* s2) { #if !defined(_WIN32) || defined(__CYGWIN__) -#if CMake_STAT_HAS_ST_MTIM +# if CMake_STAT_HAS_ST_MTIM // Times are integers in units of 1ns. long long bil = 1000000000; long long t1 = s1->st_mtim.tv_sec * bil + s1->st_mtim.tv_nsec; @@ -159,7 +159,7 @@ bool cmFileTimeComparisonInternal::TimesDiffer(cmFileTimeComparison_Type* s1, return (t1 - t2) >= bil; } return false; -#elif CMake_STAT_HAS_ST_MTIMESPEC +# elif CMake_STAT_HAS_ST_MTIMESPEC // Times are integers in units of 1ns. long long bil = 1000000000; long long t1 = s1->st_mtimespec.tv_sec * bil + s1->st_mtimespec.tv_nsec; @@ -171,7 +171,7 @@ bool cmFileTimeComparisonInternal::TimesDiffer(cmFileTimeComparison_Type* s1, return (t1 - t2) >= bil; } return false; -#else +# else // Times are integers in units of 1s. if (s1->st_mtime < s2->st_mtime) { return (s2->st_mtime - s1->st_mtime) >= 1; @@ -180,7 +180,7 @@ bool cmFileTimeComparisonInternal::TimesDiffer(cmFileTimeComparison_Type* s1, return (s1->st_mtime - s2->st_mtime) >= 1; } return false; -#endif +# endif #else // Times are integers in units of 100ns. LARGE_INTEGER t1; diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 46854f7..7ac0cdf 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -29,8 +29,8 @@ #include "cmake.h" #if defined(__HAIKU__) -#include -#include +# include +# include #endif class cmExecutionStatus; @@ -525,10 +525,12 @@ bool cmFindPackageCommand::InitialPass(std::vector const& args, "Add NO_MODULE to exclusively request Config mode and search for a " "package configuration file provided by " << this->Name << " (" << this->Name << "Config.cmake or " - << cmSystemTools::LowerCase(this->Name) << "-config.cmake). " - "Otherwise make Find" - << this->Name << ".cmake available in " - "CMAKE_MODULE_PATH."; + << cmSystemTools::LowerCase(this->Name) + << "-config.cmake). " + "Otherwise make Find" + << this->Name + << ".cmake available in " + "CMAKE_MODULE_PATH."; } aw << "\n" "(Variable CMAKE_FIND_PACKAGE_WARN_NO_MODULE enabled this warning.)"; @@ -764,8 +766,9 @@ bool cmFindPackageCommand::HandlePackageMode() if (result && !found) { // warn if package required or neither quiet nor in config mode if (this->Required || - !(this->Quiet || (this->UseConfigFiles && !this->UseFindModules && - this->ConsideredConfigs.empty()))) { + !(this->Quiet || + (this->UseConfigFiles && !this->UseFindModules && + this->ConsideredConfigs.empty()))) { // The variable is not set. std::ostringstream e; std::ostringstream aw; @@ -810,8 +813,9 @@ bool cmFindPackageCommand::HandlePackageMode() << ".cmake\" in " "CMAKE_MODULE_PATH this project has asked CMake to find a " "package configuration file provided by \"" - << this->Name << "\", " - "but CMake did not find one.\n"; + << this->Name + << "\", " + "but CMake did not find one.\n"; } if (this->Configs.size() == 1) { @@ -832,8 +836,9 @@ bool cmFindPackageCommand::HandlePackageMode() << "\" to a " "directory containing one of the above files. " "If \"" - << this->Name << "\" provides a separate development " - "package or SDK, be sure it has been installed."; + << this->Name + << "\" provides a separate development " + "package or SDK, be sure it has been installed."; } else // if(!this->UseFindModules && !this->UseConfigFiles) { e << "No \"Find" << this->Name << ".cmake\" found in " @@ -1234,14 +1239,14 @@ void cmFindPackageCommand::FillPrefixesSystemRegistry() } #if defined(_WIN32) && !defined(__CYGWIN__) -#include +# include // http://msdn.microsoft.com/en-us/library/aa384253%28v=vs.85%29.aspx -#if !defined(KEY_WOW64_32KEY) -#define KEY_WOW64_32KEY 0x0200 -#endif -#if !defined(KEY_WOW64_64KEY) -#define KEY_WOW64_64KEY 0x0100 -#endif +# if !defined(KEY_WOW64_32KEY) +# define KEY_WOW64_32KEY 0x0200 +# endif +# if !defined(KEY_WOW64_64KEY) +# define KEY_WOW64_64KEY 0x0100 +# endif void cmFindPackageCommand::LoadPackageRegistryWinUser() { // HKEY_CURRENT_USER\\Software shares 32-bit and 64-bit views. diff --git a/Source/cmFindPackageCommand.h b/Source/cmFindPackageCommand.h index 68b5ec0..d8c7ab3 100644 --- a/Source/cmFindPackageCommand.h +++ b/Source/cmFindPackageCommand.h @@ -22,7 +22,7 @@ namespace std { } /* clang-format on */ #else -#include +# include #endif #include "cmFindCommon.h" diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx index 1c63428..13a18e2 100644 --- a/Source/cmFindProgramCommand.cxx +++ b/Source/cmFindProgramCommand.cxx @@ -9,7 +9,7 @@ class cmExecutionStatus; #if defined(__APPLE__) -#include +# include #endif struct cmFindProgramHelper diff --git a/Source/cmFortranParser.h b/Source/cmFortranParser.h index efcd100..132b3e6 100644 --- a/Source/cmFortranParser.h +++ b/Source/cmFortranParser.h @@ -4,11 +4,11 @@ #define cmFortranParser_h #if !defined(cmFortranLexer_cxx) && !defined(cmFortranParser_cxx) -#include "cmConfigure.h" // IWYU pragma: keep +# include "cmConfigure.h" // IWYU pragma: keep -#include -#include -#include +# include +# include +# include #endif #include /* size_t */ @@ -73,20 +73,20 @@ struct cmFortran_yystype #define YYSTYPE cmFortran_yystype #define YYSTYPE_IS_DECLARED 1 #if !defined(cmFortranLexer_cxx) -#define YY_NO_UNISTD_H -#include "cmFortranLexer.h" +# define YY_NO_UNISTD_H +# include "cmFortranLexer.h" #endif #if !defined(cmFortranLexer_cxx) -#if !defined(cmFortranParser_cxx) -#undef YY_EXTRA_TYPE -#undef YY_DECL -#undef YYSTYPE -#undef YYSTYPE_IS_DECLARED -#endif +# if !defined(cmFortranParser_cxx) +# undef YY_EXTRA_TYPE +# undef YY_DECL +# undef YYSTYPE +# undef YYSTYPE_IS_DECLARED +# endif #endif #if !defined(cmFortranLexer_cxx) && !defined(cmFortranParser_cxx) -#include +# include // Information about a single source file. class cmFortranSourceInfo diff --git a/Source/cmGeneratedFileStream.cxx b/Source/cmGeneratedFileStream.cxx index c0a74a5..6bdf3a4 100644 --- a/Source/cmGeneratedFileStream.cxx +++ b/Source/cmGeneratedFileStream.cxx @@ -7,8 +7,8 @@ #include "cmSystemTools.h" #if defined(CMAKE_BUILD_WITH_CMAKE) -#include "cm_codecvt.hxx" -#include "cm_zlib.h" +# include "cm_codecvt.hxx" +# include "cm_zlib.h" #endif cmGeneratedFileStream::cmGeneratedFileStream(Encoding encoding) diff --git a/Source/cmGeneratedFileStream.h b/Source/cmGeneratedFileStream.h index a96f38f..2b8056f 100644 --- a/Source/cmGeneratedFileStream.h +++ b/Source/cmGeneratedFileStream.h @@ -67,8 +67,9 @@ protected: * contents have changed to prevent the file modification time from * being updated. */ -class cmGeneratedFileStream : private cmGeneratedFileStreamBase, - public cmsys::ofstream +class cmGeneratedFileStream + : private cmGeneratedFileStreamBase + , public cmsys::ofstream { public: typedef cmsys::ofstream Stream; diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index dbc6840..f9a6d64 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -41,8 +41,9 @@ std::string GeneratorExpressionContent::ProcessArbitraryContent( for (; it != end; ++it) { if (node->RequiresLiteralInput()) { if ((*it)->GetType() != cmGeneratorExpressionEvaluator::Text) { - reportError(context, this->GetOriginalExpression(), "$<" + - identifier + "> expression requires literal input."); + reportError(context, this->GetOriginalExpression(), + "$<" + identifier + + "> expression requires literal input."); return std::string(); } } @@ -157,7 +158,8 @@ std::string GeneratorExpressionContent::EvaluateParameters( reportError(context, this->GetOriginalExpression(), "$<" + identifier + "> expression requires no parameters."); } else if (numExpected == 1) { - reportError(context, this->GetOriginalExpression(), "$<" + identifier + + reportError(context, this->GetOriginalExpression(), + "$<" + identifier + "> expression requires " "exactly one parameter."); } else { @@ -172,12 +174,14 @@ std::string GeneratorExpressionContent::EvaluateParameters( if (numExpected == cmGeneratorExpressionNode::OneOrMoreParameters && parameters.empty()) { - reportError(context, this->GetOriginalExpression(), "$<" + identifier + + reportError(context, this->GetOriginalExpression(), + "$<" + identifier + "> expression requires at least one parameter."); } if (numExpected == cmGeneratorExpressionNode::OneOrZeroParameters && parameters.size() > 1) { - reportError(context, this->GetOriginalExpression(), "$<" + identifier + + reportError(context, this->GetOriginalExpression(), + "$<" + identifier + "> expression requires one or zero parameters."); } return std::string(); diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index 7b35bce..1594904 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -1421,8 +1421,9 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode std::ostringstream e; e << "The evaluation of the TARGET_OBJECTS generator expression " "is only suitable for consumption by CMake (limited" - << reason << "). " - "It is not suitable for writing out elsewhere."; + << reason + << "). " + "It is not suitable for writing out elsewhere."; reportError(context, content->GetOriginalExpression(), e.str()); return std::string(); } @@ -1649,7 +1650,7 @@ static const struct TargetPolicyNode : public cmGeneratorExpressionNode CM_FOR_EACH_TARGET_POLICY(TARGET_POLICY_LIST_ITEM) #undef TARGET_POLICY_LIST_ITEM - ); + ); return std::string(); } @@ -1904,13 +1905,15 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode } if (target->GetType() >= cmStateEnums::OBJECT_LIBRARY && target->GetType() != cmStateEnums::UNKNOWN_LIBRARY) { - ::reportError(context, content->GetOriginalExpression(), "Target \"" + - name + "\" is not an executable or library."); + ::reportError(context, content->GetOriginalExpression(), + "Target \"" + name + + "\" is not an executable or library."); return std::string(); } - if (dagChecker && (dagChecker->EvaluatingLinkLibraries(name.c_str()) || - (dagChecker->EvaluatingSources() && - name == dagChecker->TopTarget()))) { + if (dagChecker && + (dagChecker->EvaluatingLinkLibraries(name.c_str()) || + (dagChecker->EvaluatingSources() && + name == dagChecker->TopTarget()))) { ::reportError(context, content->GetOriginalExpression(), "Expressions which require the linker language may not " "be used while evaluating link libraries"); diff --git a/Source/cmGeneratorExpressionParser.cxx b/Source/cmGeneratorExpressionParser.cxx index 7b4dc7b..489970c 100644 --- a/Source/cmGeneratorExpressionParser.cxx +++ b/Source/cmGeneratorExpressionParser.cxx @@ -87,9 +87,9 @@ void cmGeneratorExpressionParser::ParseGeneratorExpression( if (this->it != this->Tokens.end() && this->it->TokenType == cmGeneratorExpressionToken::EndExpression) { - GeneratorExpressionContent* content = - new GeneratorExpressionContent(startToken->Content, this->it->Content - - startToken->Content + this->it->Length); + GeneratorExpressionContent* content = new GeneratorExpressionContent( + startToken->Content, + this->it->Content - startToken->Content + this->it->Length); assert(this->it != this->Tokens.end()); ++this->it; --this->NestingLevel; diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 0c99ed4..b223c5e 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -46,8 +46,9 @@ const char* cmTargetPropertyComputer::GetSources( } template <> -const char* cmTargetPropertyComputer::ComputeLocationForBuild< - cmGeneratorTarget>(cmGeneratorTarget const* tgt) +const char* +cmTargetPropertyComputer::ComputeLocationForBuild( + cmGeneratorTarget const* tgt) { return tgt->GetLocation(""); } @@ -893,8 +894,9 @@ static bool processSources( } if (!usedSources.empty()) { tgt->GetLocalGenerator()->GetCMakeInstance()->IssueMessage( - cmake::LOG, std::string("Used sources for target ") + tgt->GetName() + - ":\n" + usedSources, + cmake::LOG, + std::string("Used sources for target ") + tgt->GetName() + ":\n" + + usedSources, entry->ge->GetBacktrace()); } } @@ -2553,8 +2555,9 @@ static void processIncludeDirectories( } if (!usedIncludes.empty()) { tgt->GetLocalGenerator()->GetCMakeInstance()->IssueMessage( - cmake::LOG, std::string("Used includes for target ") + tgt->GetName() + - ":\n" + usedIncludes, + cmake::LOG, + std::string("Used includes for target ") + tgt->GetName() + ":\n" + + usedIncludes, entry->ge->GetBacktrace()); } } @@ -2661,8 +2664,9 @@ static void processCompileOptionsInternal( } if (!usedOptions.empty()) { tgt->GetLocalGenerator()->GetCMakeInstance()->IssueMessage( - cmake::LOG, std::string("Used compile ") + logName + - std::string(" for target ") + tgt->GetName() + ":\n" + usedOptions, + cmake::LOG, + std::string("Used compile ") + logName + std::string(" for target ") + + tgt->GetName() + ":\n" + usedOptions, entry->ge->GetBacktrace()); } } @@ -3958,8 +3962,9 @@ PropertyType checkInterfacePropertyCompatibility(cmGeneratorTarget const* tgt, e << "Property " << p << " on target \"" << tgt->GetName() << "\" does\nnot match the " "INTERFACE_" - << p << " property requirement\nof " - "dependency \"" + << p + << " property requirement\nof " + "dependency \"" << theTarget->GetName() << "\".\n"; cmSystemTools::Error(e.str().c_str()); break; diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index d4a553a..2132b15 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -260,12 +260,12 @@ public: BundleDirectoryLevel level) const; /** Return the install name directory for the target in the - * build tree. For example: "\@rpath/", "\@loader_path/", - * or "/full/path/to/library". */ + * build tree. For example: "\@rpath/", "\@loader_path/", + * or "/full/path/to/library". */ std::string GetInstallNameDirForBuildTree(const std::string& config) const; /** Return the install name directory for the target in the - * install tree. For example: "\@rpath/" or "\@loader_path/". */ + * install tree. For example: "\@rpath/" or "\@loader_path/". */ std::string GetInstallNameDirForInstallTree() const; cmListFileBacktrace GetBacktrace() const; @@ -499,8 +499,8 @@ public: cmStateEnums::ArtifactType artifact) const; /** Clears cached meta data for local and external source files. - * The meta data will be recomputed on demand. - */ + * The meta data will be recomputed on demand. + */ void ClearSourcesCache(); void AddSource(const std::string& src); diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx index 270413c..847230a 100644 --- a/Source/cmGhsMultiTargetGenerator.cxx +++ b/Source/cmGhsMultiTargetGenerator.cxx @@ -118,8 +118,8 @@ void cmGhsMultiTargetGenerator::Generate() config = cmSystemTools::UpperCase(config); this->DynamicDownload = this->DetermineIfDynamicDownload(config, language); if (this->DynamicDownload) { - *this->GetFolderBuildStreams() << "#component integrity_dynamic_download" - << std::endl; + *this->GetFolderBuildStreams() + << "#component integrity_dynamic_download" << std::endl; } GhsMultiGpj::WriteGpjTag(this->GetGpjTag(), this->GetFolderBuildStreams()); cmGlobalGhsMultiGenerator::WriteDisclaimer(this->GetFolderBuildStreams()); @@ -198,9 +198,9 @@ void cmGhsMultiTargetGenerator::WriteTypeSpecifics(const std::string& config, if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY) { std::string const static_library_suffix = this->Makefile->GetSafeDefinition("CMAKE_STATIC_LIBRARY_SUFFIX"); - *this->GetFolderBuildStreams() << " -o \"" << outputDir - << outputFilename << static_library_suffix - << "\"" << std::endl; + *this->GetFolderBuildStreams() + << " -o \"" << outputDir << outputFilename << static_library_suffix + << "\"" << std::endl; } else if (this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE) { if (notKernel && !this->IsTargetGroup()) { *this->GetFolderBuildStreams() << " -relprog" << std::endl; @@ -208,15 +208,15 @@ void cmGhsMultiTargetGenerator::WriteTypeSpecifics(const std::string& config, if (this->IsTargetGroup()) { *this->GetFolderBuildStreams() << " -o \"" << outputDir << outputFilename << ".elf\"" << std::endl; - *this->GetFolderBuildStreams() << " :extraOutputFile=\"" << outputDir - << outputFilename << ".elf.ael\"" - << std::endl; + *this->GetFolderBuildStreams() + << " :extraOutputFile=\"" << outputDir << outputFilename + << ".elf.ael\"" << std::endl; } else { std::string const executable_suffix = this->Makefile->GetSafeDefinition("CMAKE_EXECUTABLE_SUFFIX"); - *this->GetFolderBuildStreams() << " -o \"" << outputDir - << outputFilename << executable_suffix - << "\"" << std::endl; + *this->GetFolderBuildStreams() + << " -o \"" << outputDir << outputFilename << executable_suffix + << "\"" << std::endl; } } } @@ -293,8 +293,8 @@ void cmGhsMultiTargetGenerator::WriteCompilerFlags(std::string const&, this->FlagsByLanguage.find(language); if (flagsByLangI != this->FlagsByLanguage.end()) { if (!flagsByLangI->second.empty()) { - *this->GetFolderBuildStreams() << " " << flagsByLangI->second - << std::endl; + *this->GetFolderBuildStreams() + << " " << flagsByLangI->second << std::endl; } } } @@ -321,8 +321,8 @@ void cmGhsMultiTargetGenerator::WriteIncludes(const std::string& config, for (std::vector::const_iterator includes_i = includes.begin(); includes_i != includes.end(); ++includes_i) { - *this->GetFolderBuildStreams() << " -I\"" << *includes_i << "\"" - << std::endl; + *this->GetFolderBuildStreams() + << " -I\"" << *includes_i << "\"" << std::endl; } } @@ -335,8 +335,8 @@ void cmGhsMultiTargetGenerator::WriteTargetLinkLibraries( for (cmTargetDependSet::iterator tdsI = tds.begin(); tdsI != tds.end(); ++tdsI) { const cmGeneratorTarget* tg = *tdsI; - *this->GetFolderBuildStreams() << " -L\"" << GetAbsBuildFilePath(tg) - << "\"" << std::endl; + *this->GetFolderBuildStreams() + << " -L\"" << GetAbsBuildFilePath(tg) << "\"" << std::endl; } // library targets cmTarget::LinkLibraryVectorType llv = @@ -349,8 +349,8 @@ void cmGhsMultiTargetGenerator::WriteTargetLinkLibraries( if (NULL != tg) { libName = tg->GetName() + ".a"; } - *this->GetFolderBuildStreams() << " -l\"" << libName << "\"" - << std::endl; + *this->GetFolderBuildStreams() + << " -l\"" << libName << "\"" << std::endl; } if (!this->TargetGroup) { diff --git a/Source/cmGlobalBorlandMakefileGenerator.h b/Source/cmGlobalBorlandMakefileGenerator.h index 85fee74..27de6cc 100644 --- a/Source/cmGlobalBorlandMakefileGenerator.h +++ b/Source/cmGlobalBorlandMakefileGenerator.h @@ -46,11 +46,14 @@ public: bool AllowDeleteOnError() const override { return false; } protected: - void GenerateBuildCommand( - std::vector& makeCommand, const std::string& makeProgram, - const std::string& projectName, const std::string& projectDir, - const std::string& targetName, const std::string& config, bool fast, - int jobs, bool verbose, std::vector const& makeOptions = + void GenerateBuildCommand(std::vector& makeCommand, + const std::string& makeProgram, + const std::string& projectName, + const std::string& projectDir, + const std::string& targetName, + const std::string& config, bool fast, int jobs, + bool verbose, + std::vector const& makeOptions = std::vector()) override; void PrintBuildCommandAdvice(std::ostream& os, int jobs) const override; diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 8a89f36..2872831 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -13,7 +13,7 @@ #include #if defined(_WIN32) && !defined(__CYGWIN__) -#include +# include #endif #include "cmAlgorithms.h" @@ -44,13 +44,13 @@ #include "cmake.h" #if defined(CMAKE_BUILD_WITH_CMAKE) -#include "cmCryptoHash.h" -#include "cm_jsoncpp_value.h" -#include "cm_jsoncpp_writer.h" +# include "cmCryptoHash.h" +# include "cm_jsoncpp_value.h" +# include "cm_jsoncpp_writer.h" #endif #if defined(_MSC_VER) && _MSC_VER >= 1800 -#define KWSYS_WINDOWS_DEPRECATED_GetVersionEx +# define KWSYS_WINDOWS_DEPRECATED_GetVersionEx #endif const std::string kCMAKE_PLATFORM_INFO_INITIALIZED = @@ -442,8 +442,9 @@ void cmGlobalGenerator::EnableLanguage( for (std::string const& li : cur_languages) { if (!this->LanguagesInProgress.insert(li).second) { std::ostringstream e; - e << "Language '" << li << "' is currently being enabled. " - "Recursive call not allowed."; + e << "Language '" << li + << "' is currently being enabled. " + "Recursive call not allowed."; mf->IssueMessage(cmake::FATAL_ERROR, e.str()); cmSystemTools::SetFatalErrorOccured(); return; @@ -523,14 +524,14 @@ void cmGlobalGenerator::EnableLanguage( ZeroMemory(&osviex, sizeof(osviex)); osviex.dwOSVersionInfoSize = sizeof(osviex); -#ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx -#pragma warning(push) -#pragma warning(disable : 4996) -#endif +# ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx +# pragma warning(push) +# pragma warning(disable : 4996) +# endif GetVersionExW((OSVERSIONINFOW*)&osviex); -#ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx -#pragma warning(pop) -#endif +# ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx +# pragma warning(pop) +# endif std::ostringstream windowsVersionString; windowsVersionString << osviex.dwMajorVersion << "." << osviex.dwMinorVersion << "." @@ -1403,7 +1404,8 @@ void cmGlobalGenerator::Generate() } this->LocalGenerators[i]->GenerateTestFiles(); this->CMakeInstance->UpdateProgress( - "Generating", (static_cast(i) + 1.0f) / + "Generating", + (static_cast(i) + 1.0f) / static_cast(this->LocalGenerators.size())); } this->SetCurrentMakefile(nullptr); @@ -1560,8 +1562,8 @@ void cmGlobalGenerator::FinalizeTargetCompileInfo() cmBacktraceRange::const_iterator btIt = noconfig_compile_definitions_bts.begin(); - for (cmStringRange::const_iterator - it = noconfig_compile_definitions.begin(); + for (cmStringRange::const_iterator it = + noconfig_compile_definitions.begin(); it != noconfig_compile_definitions.end(); ++it, ++btIt) { t->InsertCompileDefinition(*it, *btIt); } @@ -1721,7 +1723,8 @@ void cmGlobalGenerator::CheckTargetProperties() } } this->CMakeInstance->UpdateProgress( - "Configuring", 0.9f + + "Configuring", + 0.9f + 0.1f * (static_cast(i) + 1.0f) / static_cast(this->Makefiles.size())); } @@ -1769,7 +1772,7 @@ int cmGlobalGenerator::TryCompile(int jobs, const std::string& srcdir, if (!target.empty()) { newTarget += target; #if 0 -#if defined(_WIN32) || defined(__CYGWIN__) +# if defined(_WIN32) || defined(__CYGWIN__) std::string tmp = target; // if the target does not already end in . something // then assume .exe @@ -1777,7 +1780,7 @@ int cmGlobalGenerator::TryCompile(int jobs, const std::string& srcdir, { newTarget += ".exe"; } -#endif // WIN32 +# endif // WIN32 #endif } std::string config = @@ -2466,8 +2469,9 @@ void cmGlobalGenerator::AddGlobalTarget_Install( bool skipInstallRules = mf->IsOn("CMAKE_SKIP_INSTALL_RULES"); if (this->InstallTargetEnabled && skipInstallRules) { this->CMakeInstance->IssueMessage( - cmake::WARNING, "CMAKE_SKIP_INSTALL_RULES was enabled even though " - "installation rules have been specified", + cmake::WARNING, + "CMAKE_SKIP_INSTALL_RULES was enabled even though " + "installation rules have been specified", mf->GetBacktrace()); } else if (this->InstallTargetEnabled && !skipInstallRules) { if (!cmakeCfgIntDir || !*cmakeCfgIntDir || cmakeCfgIntDir[0] == '.') { diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 62c5441..a50cc3b 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -23,7 +23,7 @@ #include "cm_codecvt.hxx" #if defined(CMAKE_BUILD_WITH_CMAKE) -#include "cmFileLockPool.h" +# include "cmFileLockPool.h" #endif class cmExportBuildFileGenerator; @@ -158,14 +158,15 @@ public: * empty then all is assumed. clean indicates if a "make clean" should be * done first. */ - int Build(int jobs, const std::string& srcdir, const std::string& bindir, - const std::string& projectName, const std::string& targetName, - std::string& output, const std::string& makeProgram, - const std::string& config, bool clean, bool fast, bool verbose, - cmDuration timeout, cmSystemTools::OutputOption outputflag = - cmSystemTools::OUTPUT_NONE, - std::vector const& nativeOptions = - std::vector()); + int Build( + int jobs, const std::string& srcdir, const std::string& bindir, + const std::string& projectName, const std::string& targetName, + std::string& output, const std::string& makeProgram, + const std::string& config, bool clean, bool fast, bool verbose, + cmDuration timeout, + cmSystemTools::OutputOption outputflag = cmSystemTools::OUTPUT_NONE, + std::vector const& nativeOptions = + std::vector()); /** * Open a generated IDE project given the following information. diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx index f4ecff2..0328991 100644 --- a/Source/cmGlobalGhsMultiGenerator.cxx +++ b/Source/cmGlobalGhsMultiGenerator.cxx @@ -313,8 +313,8 @@ void cmGlobalGhsMultiGenerator::WriteMacros() void cmGlobalGhsMultiGenerator::WriteHighLevelDirectives() { - *this->GetBuildFileStream() << "primaryTarget=arm_integrity.tgt" - << std::endl; + *this->GetBuildFileStream() + << "primaryTarget=arm_integrity.tgt" << std::endl; char const* const customization = this->GetCMakeInstance()->GetCacheDefinition("GHS_CUSTOMIZATION"); if (NULL != customization && strlen(customization) > 0) { @@ -326,8 +326,8 @@ void cmGlobalGhsMultiGenerator::WriteHighLevelDirectives() void cmGlobalGhsMultiGenerator::WriteCompilerOptions(std::string const& fOSDir) { - *this->GetBuildFileStream() << " -os_dir=\"" << fOSDir << "\"" - << std::endl; + *this->GetBuildFileStream() + << " -os_dir=\"" << fOSDir << "\"" << std::endl; } void cmGlobalGhsMultiGenerator::WriteDisclaimer(std::ostream* os) diff --git a/Source/cmGlobalGhsMultiGenerator.h b/Source/cmGlobalGhsMultiGenerator.h index c5388ad..30d4d3b 100644 --- a/Source/cmGlobalGhsMultiGenerator.h +++ b/Source/cmGlobalGhsMultiGenerator.h @@ -49,14 +49,14 @@ public: static bool SupportsPlatform() { return false; } /** - * Try to determine system information such as shared library - * extension, pthreads, byte order etc. - */ + * Try to determine system information such as shared library + * extension, pthreads, byte order etc. + */ virtual void EnableLanguage(std::vector const& languages, cmMakefile*, bool optional); /* - * Determine what program to use for building the project. - */ + * Determine what program to use for building the project. + */ bool FindMakeProgram(cmMakefile* mf) override; cmGeneratedFileStream* GetBuildFileStream() diff --git a/Source/cmGlobalJOMMakefileGenerator.h b/Source/cmGlobalJOMMakefileGenerator.h index 65f340c..bcf46d0 100644 --- a/Source/cmGlobalJOMMakefileGenerator.h +++ b/Source/cmGlobalJOMMakefileGenerator.h @@ -40,11 +40,14 @@ public: bool optional) override; protected: - void GenerateBuildCommand( - std::vector& makeCommand, const std::string& makeProgram, - const std::string& projectName, const std::string& projectDir, - const std::string& targetName, const std::string& config, bool fast, - int jobs, bool verbose, std::vector const& makeOptions = + void GenerateBuildCommand(std::vector& makeCommand, + const std::string& makeProgram, + const std::string& projectName, + const std::string& projectDir, + const std::string& targetName, + const std::string& config, bool fast, int jobs, + bool verbose, + std::vector const& makeOptions = std::vector()) override; private: diff --git a/Source/cmGlobalNMakeMakefileGenerator.h b/Source/cmGlobalNMakeMakefileGenerator.h index 4b6382e..62dea6e 100644 --- a/Source/cmGlobalNMakeMakefileGenerator.h +++ b/Source/cmGlobalNMakeMakefileGenerator.h @@ -45,11 +45,14 @@ public: bool optional) override; protected: - void GenerateBuildCommand( - std::vector& makeCommand, const std::string& makeProgram, - const std::string& projectName, const std::string& projectDir, - const std::string& targetName, const std::string& config, bool fast, - int jobs, bool verbose, std::vector const& makeOptions = + void GenerateBuildCommand(std::vector& makeCommand, + const std::string& makeProgram, + const std::string& projectName, + const std::string& projectDir, + const std::string& targetName, + const std::string& config, bool fast, int jobs, + bool verbose, + std::vector const& makeOptions = std::vector()) override; void PrintBuildCommandAdvice(std::ostream& os, int jobs) const override; diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 69bc3be..6f7e82a 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -555,9 +555,10 @@ bool cmGlobalNinjaGenerator::FindMakeProgram(cmMakefile* mf) if (!cmSystemTools::RunSingleCommand(command, &version, &error, nullptr, nullptr, cmSystemTools::OUTPUT_NONE)) { - mf->IssueMessage(cmake::FATAL_ERROR, "Running\n '" + - cmJoin(command, "' '") + "'\n" - "failed with:\n " + + mf->IssueMessage(cmake::FATAL_ERROR, + "Running\n '" + cmJoin(command, "' '") + + "'\n" + "failed with:\n " + error); cmSystemTools::SetFatalErrorOccured(); return false; diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index 17b9a7d..00fa348 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -202,11 +202,14 @@ public: void EnableLanguage(std::vector const& languages, cmMakefile* mf, bool optional) override; - void GenerateBuildCommand( - std::vector& makeCommand, const std::string& makeProgram, - const std::string& projectName, const std::string& projectDir, - const std::string& targetName, const std::string& config, bool fast, - int jobs, bool verbose, std::vector const& makeOptions = + void GenerateBuildCommand(std::vector& makeCommand, + const std::string& makeProgram, + const std::string& projectName, + const std::string& projectDir, + const std::string& targetName, + const std::string& config, bool fast, int jobs, + bool verbose, + std::vector const& makeOptions = std::vector()) override; // Setup target names diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 641b760..61c42be 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -640,12 +640,13 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2( for (cmGeneratorTarget* gtarget : targets) { int type = gtarget->GetType(); std::string name = gtarget->GetName(); - if (!name.empty() && ((type == cmStateEnums::EXECUTABLE) || - (type == cmStateEnums::STATIC_LIBRARY) || - (type == cmStateEnums::SHARED_LIBRARY) || - (type == cmStateEnums::MODULE_LIBRARY) || - (type == cmStateEnums::OBJECT_LIBRARY) || - (type == cmStateEnums::UTILITY))) { + if (!name.empty() && + ((type == cmStateEnums::EXECUTABLE) || + (type == cmStateEnums::STATIC_LIBRARY) || + (type == cmStateEnums::SHARED_LIBRARY) || + (type == cmStateEnums::MODULE_LIBRARY) || + (type == cmStateEnums::OBJECT_LIBRARY) || + (type == cmStateEnums::UTILITY))) { std::string makefileName; // Add a rule to build the target by name. localName = lg->GetRelativeTargetDirectory(gtarget); @@ -920,8 +921,9 @@ void cmGlobalUnixMakefileGenerator3::WriteHelpRule( std::string path; std::vector no_depends; std::vector commands; - lg->AppendEcho(commands, "The following are some of the valid targets " - "for this Makefile:"); + lg->AppendEcho(commands, + "The following are some of the valid targets " + "for this Makefile:"); lg->AppendEcho(commands, "... all (the default if no target is provided)"); lg->AppendEcho(commands, "... clean"); if (!this->GlobalSettingIsOn("CMAKE_SUPPRESS_REGENERATION")) { diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h index 097678f..a2ad095 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.h +++ b/Source/cmGlobalUnixMakefileGenerator3.h @@ -127,11 +127,14 @@ public: std::string GetEmptyRuleHackDepends() { return this->EmptyRuleHackDepends; } // change the build command for speed - void GenerateBuildCommand( - std::vector& makeCommand, const std::string& makeProgram, - const std::string& projectName, const std::string& projectDir, - const std::string& targetName, const std::string& config, bool fast, - int jobs, bool verbose, std::vector const& makeOptions = + void GenerateBuildCommand(std::vector& makeCommand, + const std::string& makeProgram, + const std::string& projectName, + const std::string& projectDir, + const std::string& targetName, + const std::string& config, bool fast, int jobs, + bool verbose, + std::vector const& makeOptions = std::vector()) override; /** Record per-target progress information. */ diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index 148f85f..f85b773 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -24,11 +24,14 @@ public: bool SetGeneratorPlatform(std::string const& p, cmMakefile* mf) override; bool SetGeneratorToolset(std::string const& ts, cmMakefile* mf) override; - void GenerateBuildCommand( - std::vector& makeCommand, const std::string& makeProgram, - const std::string& projectName, const std::string& projectDir, - const std::string& targetName, const std::string& config, bool fast, - int jobs, bool verbose, std::vector const& makeOptions = + void GenerateBuildCommand(std::vector& makeCommand, + const std::string& makeProgram, + const std::string& projectName, + const std::string& projectDir, + const std::string& targetName, + const std::string& config, bool fast, int jobs, + bool verbose, + std::vector const& makeOptions = std::vector()) override; ///! create the correct local generator diff --git a/Source/cmGlobalVisualStudio12Generator.cxx b/Source/cmGlobalVisualStudio12Generator.cxx index a9c605c..e05ae70 100644 --- a/Source/cmGlobalVisualStudio12Generator.cxx +++ b/Source/cmGlobalVisualStudio12Generator.cxx @@ -125,8 +125,9 @@ bool cmGlobalVisualStudio12Generator::InitializeWindowsPhone(cmMakefile* mf) if (!this->SelectWindowsPhoneToolset(this->DefaultPlatformToolset)) { std::ostringstream e; if (this->DefaultPlatformToolset.empty()) { - e << this->GetName() << " supports Windows Phone '8.0' and '8.1', but " - "not '" + e << this->GetName() + << " supports Windows Phone '8.0' and '8.1', but " + "not '" << this->SystemVersion << "'. Check CMAKE_SYSTEM_VERSION."; } else { e << "A Windows Phone component with CMake requires both the Windows " @@ -144,8 +145,9 @@ bool cmGlobalVisualStudio12Generator::InitializeWindowsStore(cmMakefile* mf) if (!this->SelectWindowsStoreToolset(this->DefaultPlatformToolset)) { std::ostringstream e; if (this->DefaultPlatformToolset.empty()) { - e << this->GetName() << " supports Windows Store '8.0' and '8.1', but " - "not '" + e << this->GetName() + << " supports Windows Store '8.0' and '8.1', but " + "not '" << this->SystemVersion << "'. Check CMAKE_SYSTEM_VERSION."; } else { e << "A Windows Store component with CMake requires both the Windows " diff --git a/Source/cmGlobalVisualStudio12Generator.h b/Source/cmGlobalVisualStudio12Generator.h index c941809..9d6554a 100644 --- a/Source/cmGlobalVisualStudio12Generator.h +++ b/Source/cmGlobalVisualStudio12Generator.h @@ -30,6 +30,7 @@ public: // from the .Net Framework version and instead made it have it's own // version number const char* GetToolsVersion() override { return "12.0"; } + protected: bool ProcessGeneratorToolsetField(std::string const& key, std::string const& value) override; @@ -48,6 +49,7 @@ protected: bool IsWindowsPhoneToolsetInstalled() const; bool IsWindowsStoreToolsetInstalled() const; const char* GetIDEVersion() override { return "12.0"; } + private: class Factory; }; diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx index c440e0d..b0db146 100644 --- a/Source/cmGlobalVisualStudio14Generator.cxx +++ b/Source/cmGlobalVisualStudio14Generator.cxx @@ -122,8 +122,9 @@ bool cmGlobalVisualStudio14Generator::InitializeWindowsStore(cmMakefile* mf) std::ostringstream e; if (!this->SelectWindowsStoreToolset(this->DefaultPlatformToolset)) { if (this->DefaultPlatformToolset.empty()) { - e << this->GetName() << " supports Windows Store '8.0', '8.1' and " - "'10.0', but not '" + e << this->GetName() + << " supports Windows Store '8.0', '8.1' and " + "'10.0', but not '" << this->SystemVersion << "'. Check CMAKE_SYSTEM_VERSION."; } else { e << "A Windows Store component with CMake requires both the Windows " diff --git a/Source/cmGlobalVisualStudio14Generator.h b/Source/cmGlobalVisualStudio14Generator.h index d92a11a..4868df0 100644 --- a/Source/cmGlobalVisualStudio14Generator.h +++ b/Source/cmGlobalVisualStudio14Generator.h @@ -27,6 +27,7 @@ public: void WriteSLNHeader(std::ostream& fout) override; const char* GetToolsVersion() override { return "14.0"; } + protected: bool InitializeWindows(cmMakefile* mf) override; bool InitializeWindowsStore(cmMakefile* mf) override; diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h index 77d4a96..0c9dd88 100644 --- a/Source/cmGlobalVisualStudio7Generator.h +++ b/Source/cmGlobalVisualStudio7Generator.h @@ -55,11 +55,14 @@ public: * Try running cmake and building a file. This is used for dynamically * loaded commands, not as part of the usual build process. */ - void GenerateBuildCommand( - std::vector& makeCommand, const std::string& makeProgram, - const std::string& projectName, const std::string& projectDir, - const std::string& targetName, const std::string& config, bool fast, - int jobs, bool verbose, std::vector const& makeOptions = + void GenerateBuildCommand(std::vector& makeCommand, + const std::string& makeProgram, + const std::string& projectName, + const std::string& projectDir, + const std::string& targetName, + const std::string& config, bool fast, int jobs, + bool verbose, + std::vector const& makeOptions = std::vector()) override; /** diff --git a/Source/cmGlobalVisualStudio9Generator.h b/Source/cmGlobalVisualStudio9Generator.h index 37efb9c..2aa6a91 100644 --- a/Source/cmGlobalVisualStudio9Generator.h +++ b/Source/cmGlobalVisualStudio9Generator.h @@ -38,6 +38,7 @@ public: protected: const char* GetIDEVersion() override { return "9.0"; } + private: class Factory; friend class Factory; diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index 1175acf..4aa52c3 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -458,9 +458,9 @@ bool IsVisualStudioMacrosFileRegistered(const std::string& macrosFile, lastWriteTime.dwHighDateTime = 0; lastWriteTime.dwLowDateTime = 0; - while (ERROR_SUCCESS == RegEnumKeyExW(hkey, index, subkeyname, - &cch_subkeyname, 0, keyclass, - &cch_keyclass, &lastWriteTime)) { + while (ERROR_SUCCESS == + RegEnumKeyExW(hkey, index, subkeyname, &cch_subkeyname, 0, keyclass, + &cch_keyclass, &lastWriteTime)) { // Open the subkey and query the values of interest: HKEY hsubkey = NULL; result = RegOpenKeyExW(hkey, subkeyname, 0, KEY_READ, &hsubkey); diff --git a/Source/cmGlobalWatcomWMakeGenerator.h b/Source/cmGlobalWatcomWMakeGenerator.h index 1729bf1..0d10d58 100644 --- a/Source/cmGlobalWatcomWMakeGenerator.h +++ b/Source/cmGlobalWatcomWMakeGenerator.h @@ -50,11 +50,14 @@ public: bool AllowDeleteOnError() const override { return false; } protected: - void GenerateBuildCommand( - std::vector& makeCommand, const std::string& makeProgram, - const std::string& projectName, const std::string& projectDir, - const std::string& targetName, const std::string& config, bool fast, - int jobs, bool verbose, std::vector const& makeOptions = + void GenerateBuildCommand(std::vector& makeCommand, + const std::string& makeProgram, + const std::string& projectName, + const std::string& projectDir, + const std::string& targetName, + const std::string& config, bool fast, int jobs, + bool verbose, + std::vector const& makeOptions = std::vector()) override; void PrintBuildCommandAdvice(std::ostream& os, int jobs) const override; diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index f69f23e..47741f9 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -36,12 +36,12 @@ struct cmLinkImplementation; #if defined(CMAKE_BUILD_WITH_CMAKE) && defined(__APPLE__) -#define HAVE_APPLICATION_SERVICES -#include +# define HAVE_APPLICATION_SERVICES +# include #endif #if defined(CMAKE_BUILD_WITH_CMAKE) -#include "cmXMLParser.h" +# include "cmXMLParser.h" // parse the xml file storing the installed version of Xcode on // the machine diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index f7f4428..0051c4a 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -66,11 +66,14 @@ public: * Try running cmake and building a file. This is used for dynalically * loaded commands, not as part of the usual build process. */ - void GenerateBuildCommand( - std::vector& makeCommand, const std::string& makeProgram, - const std::string& projectName, const std::string& projectDir, - const std::string& targetName, const std::string& config, bool fast, - int jobs, bool verbose, std::vector const& makeOptions = + void GenerateBuildCommand(std::vector& makeCommand, + const std::string& makeProgram, + const std::string& projectName, + const std::string& projectDir, + const std::string& targetName, + const std::string& config, bool fast, int jobs, + bool verbose, + std::vector const& makeOptions = std::vector()) override; /** Append the subdirectory for the given configuration. */ diff --git a/Source/cmGraphAdjacencyList.h b/Source/cmGraphAdjacencyList.h index 46cf878..6a0a799 100644 --- a/Source/cmGraphAdjacencyList.h +++ b/Source/cmGraphAdjacencyList.h @@ -23,6 +23,7 @@ public: operator int() const { return this->Dest; } bool IsStrong() const { return this->Strong; } + private: int Dest; bool Strong; diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx index b42d75e..f862578 100644 --- a/Source/cmIncludeCommand.cxx +++ b/Source/cmIncludeCommand.cxx @@ -95,8 +95,9 @@ bool cmIncludeCommand::InitialPass(std::vector const& args, messageType = cmake::FATAL_ERROR; } if (modal) { - e << "The file\n " << fname_abs << "\nwas generated by the export() " - "command. It " + e << "The file\n " << fname_abs + << "\nwas generated by the export() " + "command. It " << modal << " not be used as the argument to the " "include() command. Use ALIAS targets instead to refer to targets " diff --git a/Source/cmIncludeExternalMSProjectCommand.cxx b/Source/cmIncludeExternalMSProjectCommand.cxx index 85e8cd3..c9217d3 100644 --- a/Source/cmIncludeExternalMSProjectCommand.cxx +++ b/Source/cmIncludeExternalMSProjectCommand.cxx @@ -3,11 +3,11 @@ #include "cmIncludeExternalMSProjectCommand.h" #ifdef _WIN32 -#include "cmGlobalGenerator.h" -#include "cmMakefile.h" -#include "cmStateTypes.h" -#include "cmSystemTools.h" -#include "cmTarget.h" +# include "cmGlobalGenerator.h" +# include "cmMakefile.h" +# include "cmStateTypes.h" +# include "cmSystemTools.h" +# include "cmTarget.h" #endif class cmExecutionStatus; diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index b325b0c..87dcb18 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -861,11 +861,13 @@ bool cmInstallCommand::HandleFilesMode(std::vector const& args) messageType = cmake::FATAL_ERROR; } if (modal) { - e << "The file\n " << file << "\nwas generated by the export() " - "command. It " - << modal << " not be installed with the " - "install() command. Use the install(EXPORT) mechanism " - "instead. See the cmake-packages(7) manual for more.\n"; + e << "The file\n " << file + << "\nwas generated by the export() " + "command. It " + << modal + << " not be installed with the " + "install() command. Use the install(EXPORT) mechanism " + "instead. See the cmake-packages(7) manual for more.\n"; this->Makefile->IssueMessage(messageType, e.str()); if (messageType == cmake::FATAL_ERROR) { return false; diff --git a/Source/cmInstallExportGenerator.cxx b/Source/cmInstallExportGenerator.cxx index 5990f30..d441e41 100644 --- a/Source/cmInstallExportGenerator.cxx +++ b/Source/cmInstallExportGenerator.cxx @@ -7,7 +7,7 @@ #include #ifdef CMAKE_BUILD_WITH_CMAKE -#include "cmExportInstallAndroidMKGenerator.h" +# include "cmExportInstallAndroidMKGenerator.h" #endif #include "cmExportInstallFileGenerator.h" #include "cmExportSet.h" diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index 31bc1c0..1ac2cc2 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -686,8 +686,8 @@ bool cmListCommand::HandleTransformCommand( // Build a set of supported actions. std::set> - descriptors( - [](const std::string& x, const std::string& y) { return x < y; }); + descriptors( + [](const std::string& x, const std::string& y) { return x < y; }); descriptors = { { "APPEND", 1, [&command](const std::string& s) -> std::string { if (command.Selector->InSelection(s)) { diff --git a/Source/cmListFileLexer.h b/Source/cmListFileLexer.h index f243010a..8962396 100644 --- a/Source/cmListFileLexer.h +++ b/Source/cmListFileLexer.h @@ -3,7 +3,8 @@ #ifndef cmListFileLexer_h #define cmListFileLexer_h -typedef enum cmListFileLexer_Type_e { +typedef enum cmListFileLexer_Type_e +{ cmListFileLexer_Token_None, cmListFileLexer_Token_Space, cmListFileLexer_Token_Newline, diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx index 6bfac17..cd71518 100644 --- a/Source/cmLoadCommandCommand.cxx +++ b/Source/cmLoadCommandCommand.cxx @@ -18,7 +18,7 @@ class cmExecutionStatus; #ifdef __QNX__ -#include /* for malloc/free on QNX */ +# include /* for malloc/free on QNX */ #endif extern "C" void TrapsForSignalsCFunction(int sig); diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index c5370e4..a3f4a8f 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -27,8 +27,8 @@ #include "cmake.h" #if defined(CMAKE_BUILD_WITH_CMAKE) -#define CM_LG_ENCODE_OBJECT_NAMES -#include "cmCryptoHash.h" +# define CM_LG_ENCODE_OBJECT_NAMES +# include "cmCryptoHash.h" #endif #include "cmsys/RegularExpression.hxx" @@ -42,8 +42,8 @@ #include #if defined(__HAIKU__) -#include -#include +# include +# include #endif // List of variables that are replaced when @@ -1562,8 +1562,9 @@ void cmLocalGenerator::AddCompilerRequirementFlag( target->Target->GetMakefile()->GetDefinition(option_flag); if (!opt) { std::ostringstream e; - e << "Target \"" << target->GetName() << "\" requires the language " - "dialect \"" + e << "Target \"" << target->GetName() + << "\" requires the language " + "dialect \"" << lang << standardProp << "\" " << (ext ? "(with compiler extensions)" : "") << ", but CMake " diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index b5ae939..360f73d 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -76,8 +76,8 @@ void cmLocalNinjaGenerator::Generate() if (!showIncludesPrefix.empty()) { cmGlobalNinjaGenerator::WriteComment(this->GetRulesFileStream(), "localized /showIncludes string"); - this->GetRulesFileStream() << "msvc_deps_prefix = " << showIncludesPrefix - << "\n\n"; + this->GetRulesFileStream() + << "msvc_deps_prefix = " << showIncludesPrefix << "\n\n"; } } @@ -465,7 +465,7 @@ void cmLocalNinjaGenerator::WriteCustomCommandBuildStatement( } #if 0 -#error TODO: Once CC in an ExternalProject target must provide the \ +# error TODO: Once CC in an ExternalProject target must provide the \ file of each imported target that has an add_dependencies pointing \ at us. How to know which ExternalProject step actually provides it? #endif diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index cf2a7b9..9fd2ddb 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -35,8 +35,8 @@ // C/C++ scanner is needed for bootstrapping CMake. #include "cmDependsC.h" #ifdef CMAKE_BUILD_WITH_CMAKE -#include "cmDependsFortran.h" -#include "cmDependsJava.h" +# include "cmDependsFortran.h" +# include "cmDependsJava.h" #endif // Escape special characters in Makefile dependency lines @@ -786,13 +786,14 @@ void cmLocalUnixMakefileGenerator3::WriteSpecialTargetsBottom( this->CreateCDCommand(commands, this->GetBinaryDirectory(), this->GetCurrentBinaryDirectory()); } - this->WriteMakeRule( - makefileStream, "Special rule to run CMake to check the build system " - "integrity.\n" - "No rule that depends on this can have " - "commands that come from listfiles\n" - "because they might be regenerated.", - "cmake_check_build_system", no_depends, commands, true); + this->WriteMakeRule(makefileStream, + "Special rule to run CMake to check the build system " + "integrity.\n" + "No rule that depends on this can have " + "commands that come from listfiles\n" + "because they might be regenerated.", + "cmake_check_build_system", no_depends, commands, + true); } } @@ -1521,9 +1522,10 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules( static_cast(this->GlobalGenerator); if (gg->AllowNotParallel()) { std::vector no_depends; - this->WriteMakeRule(ruleFileStream, "Allow only one \"make -f " - "Makefile2\" at a time, but pass " - "parallelism.", + this->WriteMakeRule(ruleFileStream, + "Allow only one \"make -f " + "Makefile2\" at a time, but pass " + "parallelism.", ".NOTPARALLEL", no_depends, no_commands, false); } } diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx index 5b6e781..0c2c64e 100644 --- a/Source/cmLocalVisualStudio10Generator.cxx +++ b/Source/cmLocalVisualStudio10Generator.cxx @@ -91,8 +91,9 @@ void cmLocalVisualStudio10Generator::GenerateTargetsDepthFirst( this->CreateSingleVCProj(target->GetName(), target); } else { cmVisualStudio10TargetGenerator tg( - target, static_cast( - this->GetGlobalGenerator())); + target, + static_cast( + this->GetGlobalGenerator())); tg.Generate(); } } diff --git a/Source/cmMSVC60LinkLineComputer.cxx b/Source/cmMSVC60LinkLineComputer.cxx index 5298d1a..74c9435 100644 --- a/Source/cmMSVC60LinkLineComputer.cxx +++ b/Source/cmMSVC60LinkLineComputer.cxx @@ -4,7 +4,7 @@ #include "cmMSVC60LinkLineComputer.h" #if defined(_WIN32) && !defined(__CYGWIN__) -#include "cmSystemTools.h" +# include "cmSystemTools.h" #endif class cmOutputConverter; diff --git a/Source/cmMachO.h b/Source/cmMachO.h index aa17c6a..5886d76 100644 --- a/Source/cmMachO.h +++ b/Source/cmMachO.h @@ -9,7 +9,7 @@ #include #if !defined(CMAKE_USE_MACH_PARSER) -#error "This file may be included only if CMAKE_USE_MACH_PARSER is enabled." +# error "This file may be included only if CMAKE_USE_MACH_PARSER is enabled." #endif class cmMachOInternal; diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index d67d280..3c7a4cf 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -43,7 +43,7 @@ #include "cmake.h" #ifdef CMAKE_BUILD_WITH_CMAKE -#include "cmVariableWatch.h" +# include "cmVariableWatch.h" #endif class cmMessenger; @@ -1705,8 +1705,9 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, // must be outside the following if() to keep it alive long enough std::string nvalue; - if (existingValue && (this->GetState()->GetCacheEntryType(name) == - cmStateEnums::UNINITIALIZED)) { + if (existingValue && + (this->GetState()->GetCacheEntryType(name) == + cmStateEnums::UNINITIALIZED)) { // if this is not a force, then use the value from the cache // if it is a force, then use the value being passed in if (!force) { @@ -2374,10 +2375,11 @@ const char* cmMakefile::GetDefinition(const std::string& name) const #ifdef CMAKE_BUILD_WITH_CMAKE cmVariableWatch* vv = this->GetVariableWatch(); if (vv && !this->SuppressWatches) { - bool const watch_function_executed = vv->VariableAccessed( - name, def ? cmVariableWatch::VARIABLE_READ_ACCESS - : cmVariableWatch::UNKNOWN_VARIABLE_READ_ACCESS, - def, this); + bool const watch_function_executed = + vv->VariableAccessed(name, + def ? cmVariableWatch::VARIABLE_READ_ACCESS + : cmVariableWatch::UNKNOWN_VARIABLE_READ_ACCESS, + def, this); if (watch_function_executed) { // A callback was executed and may have caused re-allocation of the @@ -2630,7 +2632,12 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringOld( return mtype; } -typedef enum { NORMAL, ENVIRONMENT, CACHE } t_domain; +typedef enum +{ + NORMAL, + ENVIRONMENT, + CACHE +} t_domain; struct t_lookup { t_lookup() @@ -2819,9 +2826,11 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew( const char* nextAt = strchr(in + 1, '@'); if (nextAt && nextAt != in + 1 && nextAt == - in + 1 + strspn(in + 1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "abcdefghijklmnopqrstuvwxyz" - "0123456789/_.+-")) { + in + 1 + + strspn(in + 1, + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz" + "0123456789/_.+-")) { std::string variable(in + 1, nextAt - in - 1); std::string varresult = this->GetSafeDefinition(variable); if (escapeQuotes) { @@ -3298,7 +3307,8 @@ int cmMakefile::TryCompile(const std::string& srcdir, cmGlobalGenerator* gg = cm.CreateGlobalGenerator(this->GetGlobalGenerator()->GetName()); if (!gg) { - this->IssueMessage(cmake::INTERNAL_ERROR, "Global generator '" + + this->IssueMessage(cmake::INTERNAL_ERROR, + "Global generator '" + this->GetGlobalGenerator()->GetName() + "' could not be created."); cmSystemTools::SetFatalErrorOccured(); @@ -3863,8 +3873,9 @@ cmTarget* cmMakefile::AddImportedTarget(const std::string& name, { // Create the target. std::unique_ptr target( - new cmTarget(name, type, global ? cmTarget::VisibilityImportedGlobally - : cmTarget::VisibilityImported, + new cmTarget(name, type, + global ? cmTarget::VisibilityImportedGlobally + : cmTarget::VisibilityImported, this)); // Add to the set of available imported targets. @@ -4311,8 +4322,9 @@ bool cmMakefile::CompileFeatureKnown(cmTarget const* target, } else { e << "Specified"; } - e << " unknown feature \"" << feature << "\" for " - "target \"" + e << " unknown feature \"" << feature + << "\" for " + "target \"" << target->GetName() << "\"."; if (error) { *error = e.str(); diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index ac7baae..a7c8df5 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -27,7 +27,7 @@ #include "cmake.h" #if defined(CMAKE_BUILD_WITH_CMAKE) -#include "cmSourceGroup.h" +# include "cmSourceGroup.h" #endif class cmCommand; @@ -282,8 +282,8 @@ public: //@{ /** - * Set, Push, Pop policy values for CMake. - */ + * Set, Push, Pop policy values for CMake. + */ bool SetPolicy(cmPolicies::PolicyID id, cmPolicies::PolicyStatus status); bool SetPolicy(const char* id, cmPolicies::PolicyStatus status); cmPolicies::PolicyStatus GetPolicyStatus(cmPolicies::PolicyID id, @@ -724,6 +724,7 @@ public: ~FunctionPushPop(); void Quiet() { this->ReportError = false; } + private: cmMakefile* Makefile; bool ReportError; @@ -737,6 +738,7 @@ public: ~MacroPushPop(); void Quiet() { this->ReportError = false; } + private: cmMakefile* Makefile; bool ReportError; @@ -767,6 +769,7 @@ public: this->Makefile->PushScope(); } ~ScopePushPop() { this->Makefile->PopScope(); } + private: cmMakefile* Makefile; }; diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 3998823..1f65f08 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -645,8 +645,9 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( // See if we need to use a compiler launcher like ccache or distcc std::string compilerLauncher; - if (!compileCommands.empty() && (lang == "C" || lang == "CXX" || - lang == "Fortran" || lang == "CUDA")) { + if (!compileCommands.empty() && + (lang == "C" || lang == "CXX" || lang == "Fortran" || + lang == "CUDA")) { std::string const clauncher_prop = lang + "_COMPILER_LAUNCHER"; const char* clauncher = this->GeneratorTarget->GetProperty(clauncher_prop); @@ -1027,10 +1028,11 @@ void cmMakefileTargetGenerator::WriteTargetDependRules() // paths. Make sure PWD is set to the original name of the home // output directory to help cmSystemTools to create the same // translation table for the dependency scanning process. - depCmd << "cd " << (this->LocalGenerator->ConvertToOutputFormat( - cmSystemTools::CollapseFullPath( - this->LocalGenerator->GetBinaryDirectory()), - cmOutputConverter::SHELL)) + depCmd << "cd " + << (this->LocalGenerator->ConvertToOutputFormat( + cmSystemTools::CollapseFullPath( + this->LocalGenerator->GetBinaryDirectory()), + cmOutputConverter::SHELL)) << " && "; #endif // Generate a call this signature: diff --git a/Source/cmMessenger.cxx b/Source/cmMessenger.cxx index 3ae5bc5..a81428a 100644 --- a/Source/cmMessenger.cxx +++ b/Source/cmMessenger.cxx @@ -8,7 +8,7 @@ #include "cmSystemTools.h" #if defined(CMAKE_BUILD_WITH_CMAKE) -#include "cmsys/SystemInformation.hxx" +# include "cmsys/SystemInformation.hxx" #endif #include diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 542bb0a..a4d3e06 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -148,16 +148,18 @@ std::string cmNinjaNormalTargetGenerator::LanguageLinkerRule() const { return this->TargetLinkLanguage + "_" + cmState::GetTargetTypeName(this->GetGeneratorTarget()->GetType()) + - "_LINKER__" + cmGlobalNinjaGenerator::EncodeRuleName( - this->GetGeneratorTarget()->GetName()); + "_LINKER__" + + cmGlobalNinjaGenerator::EncodeRuleName( + this->GetGeneratorTarget()->GetName()); } std::string cmNinjaNormalTargetGenerator::LanguageLinkerDeviceRule() const { return this->TargetLinkLanguage + "_" + cmState::GetTargetTypeName(this->GetGeneratorTarget()->GetType()) + - "_DEVICE_LINKER__" + cmGlobalNinjaGenerator::EncodeRuleName( - this->GetGeneratorTarget()->GetName()); + "_DEVICE_LINKER__" + + cmGlobalNinjaGenerator::EncodeRuleName( + this->GetGeneratorTarget()->GetName()); } struct cmNinjaRemoveNoOpCommands @@ -413,8 +415,9 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile) this->GetGlobalGenerator()->AddRule( "CMAKE_SYMLINK_EXECUTABLE", this->GetLocalGenerator()->BuildCommandLine(commandLines), - "Creating executable symlink $out", "Rule for creating " - "executable symlink.", + "Creating executable symlink $out", + "Rule for creating " + "executable symlink.", /*depfile*/ "", /*deptype*/ "", /*rspfile*/ "", @@ -430,8 +433,9 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile) this->GetGlobalGenerator()->AddRule( "CMAKE_SYMLINK_LIBRARY", this->GetLocalGenerator()->BuildCommandLine(commandLines), - "Creating library symlink $out", "Rule for creating " - "library symlink.", + "Creating library symlink $out", + "Rule for creating " + "library symlink.", /*depfile*/ "", /*deptype*/ "", /*rspfile*/ "", @@ -772,9 +776,9 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() // Write comments. cmGlobalNinjaGenerator::WriteDivider(this->GetBuildFileStream()); const cmStateEnums::TargetType targetType = gt.GetType(); - this->GetBuildFileStream() << "# Link build statements for " - << cmState::GetTargetTypeName(targetType) - << " target " << this->GetTargetName() << "\n\n"; + this->GetBuildFileStream() + << "# Link build statements for " << cmState::GetTargetTypeName(targetType) + << " target " << this->GetTargetName() << "\n\n"; cmNinjaDeps emptyDeps; cmNinjaVars vars; diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 7dfce57..9d41948 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -534,10 +534,12 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang) std::string const cmake = this->GetLocalGenerator()->ConvertToOutputFormat( cmSystemTools::GetCMakeCommand(), cmLocalGenerator::SHELL); ppCmds.push_back( - cmake + " -E cmake_ninja_depends" - " --tdi=" + - tdi + " --pp=$out" - " --dep=$DEP_FILE" + + cmake + + " -E cmake_ninja_depends" + " --tdi=" + + tdi + + " --pp=$out" + " --dep=$DEP_FILE" + (needDyndep ? " --obj=$OBJ_FILE --ddi=$DYNDEP_INTERMEDIATE_FILE" : "")); std::string const ppCmdLine = @@ -568,10 +570,12 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang) // Run CMake dependency scanner on preprocessed output. std::string const cmake = this->GetLocalGenerator()->ConvertToOutputFormat( cmSystemTools::GetCMakeCommand(), cmLocalGenerator::SHELL); - ddCmds.push_back(cmake + " -E cmake_ninja_dyndep" - " --tdi=" + - tdi + " --dd=$out" - " " + + ddCmds.push_back(cmake + + " -E cmake_ninja_dyndep" + " --tdi=" + + tdi + + " --dd=$out" + " " + ddInput); std::string const ddCmdLine = @@ -1150,10 +1154,11 @@ void cmNinjaTargetGenerator::ExportObjectCompileCommand( std::string escapedSourceFileName = sourceFileName; if (!cmSystemTools::FileIsFullPath(sourceFileName)) { - escapedSourceFileName = cmSystemTools::CollapseFullPath( - escapedSourceFileName, this->GetGlobalGenerator() - ->GetCMakeInstance() - ->GetHomeOutputDirectory()); + escapedSourceFileName = + cmSystemTools::CollapseFullPath(escapedSourceFileName, + this->GetGlobalGenerator() + ->GetCMakeInstance() + ->GetHomeOutputDirectory()); } escapedSourceFileName = this->LocalGenerator->ConvertToOutputFormat( diff --git a/Source/cmParseArgumentsCommand.cxx b/Source/cmParseArgumentsCommand.cxx index 9a5b097..2d61cc3 100644 --- a/Source/cmParseArgumentsCommand.cxx +++ b/Source/cmParseArgumentsCommand.cxx @@ -54,8 +54,8 @@ bool cmParseArgumentsCommand::InitialPass(std::vector const& args, parseFromArgV = true; argIter++; // move past PARSE_ARGV if (!cmSystemTools::StringToULong(argIter->c_str(), &argvStart)) { - this->Makefile->IssueMessage(cmake::FATAL_ERROR, "PARSE_ARGV index '" + - *argIter + + this->Makefile->IssueMessage(cmake::FATAL_ERROR, + "PARSE_ARGV index '" + *argIter + "' is not an unsigned integer"); cmSystemTools::SetFatalErrorOccured(); return true; diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index dba22b3..ba50fb8 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -303,14 +303,17 @@ bool cmPolicies::GetPolicyID(const char* id, cmPolicies::PolicyID& pid) std::string cmPolicies::GetPolicyWarning(cmPolicies::PolicyID id) { std::ostringstream msg; - msg << "Policy " << idToString(id) << " is not set: " - "" - << idToShortDescription(id) << " " - "Run \"cmake --help-policy " - << idToString(id) << "\" for " - "policy details. " - "Use the cmake_policy command to set the policy " - "and suppress this warning."; + msg << "Policy " << idToString(id) + << " is not set: " + "" + << idToShortDescription(id) + << " " + "Run \"cmake --help-policy " + << idToString(id) + << "\" for " + "policy details. " + "Use the cmake_policy command to set the policy " + "and suppress this warning."; return msg.str(); } @@ -334,19 +337,22 @@ std::string cmPolicies::GetPolicyDeprecatedWarning(cmPolicies::PolicyID id) std::string cmPolicies::GetRequiredPolicyError(cmPolicies::PolicyID id) { std::ostringstream error; - error << "Policy " << idToString(id) << " is not set to NEW: " - "" - << idToShortDescription(id) << " " - "Run \"cmake --help-policy " + error << "Policy " << idToString(id) + << " is not set to NEW: " + "" + << idToShortDescription(id) + << " " + "Run \"cmake --help-policy " << idToString(id) << "\" for " "policy details. " "CMake now requires this policy to be set to NEW by the project. " "The policy may be set explicitly using the code\n" " cmake_policy(SET " - << idToString(id) << " NEW)\n" - "or by upgrading all policies with the code\n" - " cmake_policy(VERSION " + << idToString(id) + << " NEW)\n" + "or by upgrading all policies with the code\n" + " cmake_policy(VERSION " << idToVersion(id) << ") # or later\n" "Run \"cmake --help-command cmake_policy\" for more information."; diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index 7190c36..3fe0c84 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -155,8 +155,9 @@ class cmMakefile; 3, 0, 0, cmPolicies::WARN) \ SELECT(POLICY, CMP0051, "List TARGET_OBJECTS in SOURCES target property.", \ 3, 1, 0, cmPolicies::WARN) \ - SELECT(POLICY, CMP0052, "Reject source and build dirs in installed " \ - "INTERFACE_INCLUDE_DIRECTORIES.", \ + SELECT(POLICY, CMP0052, \ + "Reject source and build dirs in installed " \ + "INTERFACE_INCLUDE_DIRECTORIES.", \ 3, 1, 0, cmPolicies::WARN) \ SELECT(POLICY, CMP0053, \ "Simplify variable reference and escape sequence evaluation.", 3, 1, \ diff --git a/Source/cmProcessOutput.cxx b/Source/cmProcessOutput.cxx index 8371706..e4ca426 100644 --- a/Source/cmProcessOutput.cxx +++ b/Source/cmProcessOutput.cxx @@ -4,7 +4,7 @@ #include "cmProcessOutput.h" #if defined(_WIN32) -#include +# include unsigned int cmProcessOutput::defaultCodepage = KWSYS_ENCODING_DEFAULT_CODEPAGE; #endif diff --git a/Source/cmProcessOutput.h b/Source/cmProcessOutput.h index b5ec4a8..400354c 100644 --- a/Source/cmProcessOutput.h +++ b/Source/cmProcessOutput.h @@ -28,10 +28,10 @@ public: }; /** - * Find encoding enum value for given encoding \a name. - * \param name a encoding name. - * \return encoding enum value or Auto if \a name was not found. - */ + * Find encoding enum value for given encoding \a name. + * \param name a encoding name. + * \return encoding enum value or Auto if \a name was not found. + */ static Encoding FindEncoding(std::string const& name); /// The code page that is used as internal encoding to which we will encode. diff --git a/Source/cmProcessTools.h b/Source/cmProcessTools.h index 23fa74e..f1c2a22 100644 --- a/Source/cmProcessTools.h +++ b/Source/cmProcessTools.h @@ -35,6 +35,7 @@ public: } virtual ~OutputParser() {} + protected: /** Implement in a subclass to process a chunk of data. It should return true only if it is interested in more data. */ diff --git a/Source/cmQtAutoGen.cxx b/Source/cmQtAutoGen.cxx index 6e9ca44..000529d 100644 --- a/Source/cmQtAutoGen.cxx +++ b/Source/cmQtAutoGen.cxx @@ -55,8 +55,9 @@ void MergeOptions(std::vector& baseOpts, } } // Test if this is a value option and change the existing value - if (!optName.empty() && (std::find(valueOpts.begin(), valueOpts.end(), - optName) != valueOpts.end())) { + if (!optName.empty() && + (std::find(valueOpts.begin(), valueOpts.end(), optName) != + valueOpts.end())) { const Iter existItNext(existIt + 1); const CIter fitNext(fit + 1); if ((existItNext != baseOpts.end()) && (fitNext != fitEnd)) { diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index d59f3a7..34196d9 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -1,7 +1,7 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#include "cmQtAutoGen.h" #include "cmQtAutoGenInitializer.h" +#include "cmQtAutoGen.h" #include "cmAlgorithms.h" #include "cmCustomCommand.h" @@ -913,17 +913,18 @@ void cmQtAutoGenInitializer::SetupCustomTargets() std::vector const& list) { CWrite(key, cmJoin(list, ";")); }; - auto CWriteNestedLists = [&CWrite]( - const char* key, std::vector> const& lists) { - std::vector seplist; - for (const std::vector& list : lists) { - std::string blist = "{"; - blist += cmJoin(list, ";"); - blist += "}"; - seplist.push_back(std::move(blist)); - } - CWrite(key, cmJoin(seplist, cmQtAutoGen::ListSep)); - }; + auto CWriteNestedLists = + [&CWrite](const char* key, + std::vector> const& lists) { + std::vector seplist; + for (const std::vector& list : lists) { + std::string blist = "{"; + blist += cmJoin(list, ";"); + blist += "}"; + seplist.push_back(std::move(blist)); + } + CWrite(key, cmJoin(seplist, cmQtAutoGen::ListSep)); + }; auto CWriteSet = [&CWrite](const char* key, std::set const& list) { CWrite(key, cmJoin(list, ";")); @@ -1023,13 +1024,14 @@ void cmQtAutoGenInitializer::SetupCustomTargets() ofs << "set(" << key << " " << cmOutputConverter::EscapeForCMake(value) << ")\n"; }; - auto CWriteMap = [&ofs]( - const char* key, std::map const& map) { - for (auto const& item : map) { - ofs << "set(" << key << "_" << item.first << " " - << cmOutputConverter::EscapeForCMake(item.second) << ")\n"; - } - }; + auto CWriteMap = + [&ofs](const char* key, + std::map const& map) { + for (auto const& item : map) { + ofs << "set(" << key << "_" << item.first << " " + << cmOutputConverter::EscapeForCMake(item.second) << ")\n"; + } + }; // Write ofs << "# Configurations\n"; diff --git a/Source/cmQtAutoGenerator.cxx b/Source/cmQtAutoGenerator.cxx index 750e1ed..7aa792f 100644 --- a/Source/cmQtAutoGenerator.cxx +++ b/Source/cmQtAutoGenerator.cxx @@ -1,7 +1,7 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#include "cmQtAutoGen.h" #include "cmQtAutoGenerator.h" +#include "cmQtAutoGen.h" #include "cmsys/FStream.hxx" diff --git a/Source/cmQtAutoGeneratorMocUic.cxx b/Source/cmQtAutoGeneratorMocUic.cxx index 80db6ac..f196b97 100644 --- a/Source/cmQtAutoGeneratorMocUic.cxx +++ b/Source/cmQtAutoGeneratorMocUic.cxx @@ -1,7 +1,7 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#include "cmQtAutoGen.h" #include "cmQtAutoGeneratorMocUic.h" +#include "cmQtAutoGen.h" #include #include @@ -18,7 +18,7 @@ #include "cmake.h" #if defined(__APPLE__) -#include +# include #endif // -- Class methods @@ -1330,8 +1330,9 @@ bool cmQtAutoGeneratorMocUic::Init(cmMakefile* makefile) std::string error; // Insert default filter for Q_PLUGIN_METADATA if (Base().QtVersionMajor != 4) { - pushFilter("Q_PLUGIN_METADATA", "[\n][ \t]*Q_PLUGIN_METADATA[ \t]*\\(" - "[^\\)]*FILE[ \t]*\"([^\"]+)\"", + pushFilter("Q_PLUGIN_METADATA", + "[\n][ \t]*Q_PLUGIN_METADATA[ \t]*\\(" + "[^\\)]*FILE[ \t]*\"([^\"]+)\"", error); } // Insert user defined dependency filters diff --git a/Source/cmQtAutoGeneratorRcc.cxx b/Source/cmQtAutoGeneratorRcc.cxx index fdb556a..3064895 100644 --- a/Source/cmQtAutoGeneratorRcc.cxx +++ b/Source/cmQtAutoGeneratorRcc.cxx @@ -1,7 +1,7 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#include "cmQtAutoGen.h" #include "cmQtAutoGeneratorRcc.h" +#include "cmQtAutoGen.h" #include "cmAlgorithms.h" #include "cmCryptoHash.h" diff --git a/Source/cmRST.cxx b/Source/cmRST.cxx index d9e5bcb..12817ae 100644 --- a/Source/cmRST.cxx +++ b/Source/cmRST.cxx @@ -154,8 +154,9 @@ void cmRST::ProcessLine(std::string const& line) this->LastLineEndedInColonColon = false; // A line starting in .. is an explicit markup start. - if (line == ".." || (line.size() >= 3 && line[0] == '.' && line[1] == '.' && - isspace(line[2]))) { + if (line == ".." || + (line.size() >= 3 && line[0] == '.' && line[1] == '.' && + isspace(line[2]))) { this->Reset(); this->Markup = (line.find_first_not_of(" \t", 2) == std::string::npos ? MarkupEmpty diff --git a/Source/cmServerConnection.cxx b/Source/cmServerConnection.cxx index 78c8f06..1fc8cf8 100644 --- a/Source/cmServerConnection.cxx +++ b/Source/cmServerConnection.cxx @@ -9,9 +9,9 @@ #include #ifdef _WIN32 -#include "io.h" +# include "io.h" #else -#include +# include #endif #include diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx index 7c10110..c267160 100644 --- a/Source/cmServerProtocol.cxx +++ b/Source/cmServerProtocol.cxx @@ -300,7 +300,8 @@ static bool getOrTestValue(cmState* state, const std::string& key, value = cachedValue; } if (!cachedValue.empty() && cachedValue != value) { - setErrorMessage(errorMessage, std::string("\"") + key + + setErrorMessage(errorMessage, + std::string("\"") + key + "\" is set but incompatible with configured " + keyDescription + " value."); return false; @@ -320,7 +321,8 @@ bool cmServerProtocol1::DoActivate(const cmServerRequest& request, std::string platform = request.Data[kPLATFORM_KEY].asString(); if (buildDirectory.empty()) { - setErrorMessage(errorMessage, std::string("\"") + kBUILD_DIRECTORY_KEY + + setErrorMessage(errorMessage, + std::string("\"") + kBUILD_DIRECTORY_KEY + "\" is missing."); return false; } @@ -328,7 +330,8 @@ bool cmServerProtocol1::DoActivate(const cmServerRequest& request, cmake* cm = CMakeInstance(); if (cmSystemTools::PathExists(buildDirectory)) { if (!cmSystemTools::FileIsDirectory(buildDirectory)) { - setErrorMessage(errorMessage, std::string("\"") + kBUILD_DIRECTORY_KEY + + setErrorMessage(errorMessage, + std::string("\"") + kBUILD_DIRECTORY_KEY + "\" exists but is not a directory."); return false; } @@ -369,17 +372,20 @@ bool cmServerProtocol1::DoActivate(const cmServerRequest& request, } if (sourceDirectory.empty()) { - setErrorMessage(errorMessage, std::string("\"") + kSOURCE_DIRECTORY_KEY + + setErrorMessage(errorMessage, + std::string("\"") + kSOURCE_DIRECTORY_KEY + "\" is unset but required."); return false; } if (!cmSystemTools::FileIsDirectory(sourceDirectory)) { - setErrorMessage(errorMessage, std::string("\"") + kSOURCE_DIRECTORY_KEY + + setErrorMessage(errorMessage, + std::string("\"") + kSOURCE_DIRECTORY_KEY + "\" is not a directory."); return false; } if (generator.empty()) { - setErrorMessage(errorMessage, std::string("\"") + kGENERATOR_KEY + + setErrorMessage(errorMessage, + std::string("\"") + kGENERATOR_KEY + "\" is unset but required."); return false; } @@ -391,7 +397,8 @@ bool cmServerProtocol1::DoActivate(const cmServerRequest& request, return info.name == generator; }); if (baseIt == generators.end()) { - setErrorMessage(errorMessage, std::string("Generator \"") + generator + + setErrorMessage(errorMessage, + std::string("Generator \"") + generator + "\" not supported."); return false; } @@ -629,8 +636,9 @@ struct hash size_t result = hash()(in.Language) ^ hash()(in.Flags); for (auto const& i : in.IncludePathList) { - result = result ^ (hash()(i.first) ^ - (i.second ? std::numeric_limits::max() : 0)); + result = result ^ + (hash()(i.first) ^ + (i.second ? std::numeric_limits::max() : 0)); } for (auto const& i : in.Defines) { result = result ^ hash()(i); @@ -726,8 +734,9 @@ static Json::Value DumpSourceFilesList( for (const auto& include : includes) { fileData.IncludePathList.push_back( - std::make_pair(include, target->IsSystemIncludeDirectory( - include, config, fileData.Language))); + std::make_pair(include, + target->IsSystemIncludeDirectory( + include, config, fileData.Language))); } } @@ -745,8 +754,9 @@ static Json::Value DumpSourceFilesList( const std::string defPropName = "COMPILE_DEFINITIONS_" + cmSystemTools::UpperCase(config); if (const char* config_defs = file->GetProperty(defPropName)) { - lg->AppendDefines(defines, genexInterpreter.Evaluate( - config_defs, COMPILE_DEFINITIONS)); + lg->AppendDefines( + defines, + genexInterpreter.Evaluate(config_defs, COMPILE_DEFINITIONS)); } defines.insert(ld.Defines.begin(), ld.Defines.end()); diff --git a/Source/cmSourceFileLocation.h b/Source/cmSourceFileLocation.h index f325e54..886a184 100644 --- a/Source/cmSourceFileLocation.h +++ b/Source/cmSourceFileLocation.h @@ -81,6 +81,7 @@ public: * Get the cmMakefile instance for which the source file was created. */ cmMakefile const* GetMakefile() const { return this->Makefile; } + private: cmMakefile const* const Makefile; bool AmbiguousDirectory; diff --git a/Source/cmStandardLexer.h b/Source/cmStandardLexer.h index b212c7e..13f7622 100644 --- a/Source/cmStandardLexer.h +++ b/Source/cmStandardLexer.h @@ -7,41 +7,41 @@ /* Disable some warnings. */ #if defined(_MSC_VER) -#pragma warning(disable : 4018) -#pragma warning(disable : 4127) -#pragma warning(disable : 4131) -#pragma warning(disable : 4244) -#pragma warning(disable : 4251) -#pragma warning(disable : 4267) -#pragma warning(disable : 4305) -#pragma warning(disable : 4309) -#pragma warning(disable : 4706) -#pragma warning(disable : 4786) +# pragma warning(disable : 4018) +# pragma warning(disable : 4127) +# pragma warning(disable : 4131) +# pragma warning(disable : 4244) +# pragma warning(disable : 4251) +# pragma warning(disable : 4267) +# pragma warning(disable : 4305) +# pragma warning(disable : 4309) +# pragma warning(disable : 4706) +# pragma warning(disable : 4786) #endif #if defined(__GNUC__) && !defined(__INTEL_COMPILER) -#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 402 -#pragma GCC diagnostic ignored "-Wconversion" -#pragma GCC diagnostic ignored "-Wsign-compare" -#endif -#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 403 -#pragma GCC diagnostic ignored "-Wsign-conversion" -#endif +# if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 402 +# pragma GCC diagnostic ignored "-Wconversion" +# pragma GCC diagnostic ignored "-Wsign-compare" +# endif +# if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 403 +# pragma GCC diagnostic ignored "-Wsign-conversion" +# endif #endif /* Make sure isatty is available. */ #if defined(_WIN32) && !defined(__CYGWIN__) -#include -#if defined(_MSC_VER) -#define isatty _isatty -#endif +# include +# if defined(_MSC_VER) +# define isatty _isatty +# endif #else -#include // IWYU pragma: export +# include // IWYU pragma: export #endif /* Make sure malloc and free are available on QNX. */ #ifdef __QNX__ -#include +# include #endif /* Disable features we do not need. */ diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx index 0229a77..8f5f58c 100644 --- a/Source/cmStateSnapshot.cxx +++ b/Source/cmStateSnapshot.cxx @@ -19,11 +19,11 @@ #include "cmake.h" #if !defined(_WIN32) -#include +# include #endif #if defined(__CYGWIN__) -#include "cmSystemTools.h" +# include "cmSystemTools.h" #endif cmStateSnapshot::cmStateSnapshot(cmState* state) diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index dabec47..ed88a1e 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -348,8 +348,8 @@ bool cmStringCommand::RegexReplace(std::vector const& args) cmStringReplaceHelper replaceHelper(regex, replace, this->Makefile); if (!replaceHelper.IsReplaceExpressionValid()) { - this->SetError("sub-command REGEX, mode REPLACE: " + - replaceHelper.GetError() + "."); + this->SetError( + "sub-command REGEX, mode REPLACE: " + replaceHelper.GetError() + "."); return false; } @@ -369,8 +369,8 @@ bool cmStringCommand::RegexReplace(std::vector const& args) std::string output; if (!replaceHelper.Replace(input, output)) { - this->SetError("sub-command REGEX, mode REPLACE: " + - replaceHelper.GetError() + "."); + this->SetError( + "sub-command REGEX, mode REPLACE: " + replaceHelper.GetError() + "."); return false; } diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index cf1068f..d641a4e 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -8,24 +8,24 @@ #include "cm_sys_stat.h" #if defined(CMAKE_BUILD_WITH_CMAKE) -#include "cmArchiveWrite.h" -#include "cmLocale.h" -#include "cm_libarchive.h" -#ifndef __LA_INT64_T -#define __LA_INT64_T la_int64_t -#endif +# include "cmArchiveWrite.h" +# include "cmLocale.h" +# include "cm_libarchive.h" +# ifndef __LA_INT64_T +# define __LA_INT64_T la_int64_t +# endif #endif #if defined(CMAKE_BUILD_WITH_CMAKE) -#include "cmCryptoHash.h" +# include "cmCryptoHash.h" #endif #if defined(CMAKE_USE_ELF_PARSER) -#include "cmELF.h" +# include "cmELF.h" #endif #if defined(CMAKE_USE_MACH_PARSER) -#include "cmMachO.h" +# include "cmMachO.h" #endif #include "cmsys/Directory.hxx" @@ -48,30 +48,30 @@ #include #if defined(_WIN32) -#include +# include // include wincrypt.h after windows.h -#include +# include -#include /* _O_TEXT */ +# include /* _O_TEXT */ -#include "cm_uv.h" +# include "cm_uv.h" #else -#include -#include -#include +# include +# include +# include #endif #if defined(_WIN32) && \ (defined(_MSC_VER) || defined(__WATCOMC__) || defined(__MINGW32__)) -#include +# include #endif #if defined(__APPLE__) -#include +# include #endif #ifdef __QNX__ -#include /* for malloc/free on QNX */ +# include /* for malloc/free on QNX */ #endif static bool cm_isspace(char c) @@ -93,32 +93,32 @@ public: #if !defined(HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE) // For GetEnvironmentVariables -#if defined(_WIN32) +# if defined(_WIN32) extern __declspec(dllimport) char** environ; -#else +# else extern char** environ; -#endif +# endif #endif #if defined(CMAKE_BUILD_WITH_CMAKE) static std::string cm_archive_entry_pathname(struct archive_entry* entry) { -#if cmsys_STL_HAS_WSTRING +# if cmsys_STL_HAS_WSTRING return cmsys::Encoding::ToNarrow(archive_entry_pathname_w(entry)); -#else +# else return archive_entry_pathname(entry); -#endif +# endif } static int cm_archive_read_open_file(struct archive* a, const char* file, int block_size) { -#if cmsys_STL_HAS_WSTRING +# if cmsys_STL_HAS_WSTRING std::wstring wfile = cmsys::Encoding::ToWide(file); return archive_read_open_filename_w(a, wfile.c_str(), block_size); -#else +# else return archive_read_open_filename(a, file, block_size); -#endif +# endif } #endif @@ -144,9 +144,9 @@ private: HANDLE handle_; }; #elif defined(__APPLE__) -#include +# include -#define environ (*_NSGetEnviron()) +# define environ (*_NSGetEnviron()) #endif bool cmSystemTools::s_RunCommandHideConsole = false; @@ -689,11 +689,11 @@ size_t cmSystemTools::CalculateCommandLineLengthLimit() // We estimate the size of the environment block to be 1000. // This isn't accurate at all, but leaves some headroom. szArgMax = szArgMax < 1000 ? 0 : szArgMax - 1000; -#if defined(_WIN32) || defined(__linux) +# if defined(_WIN32) || defined(__linux) sz = std::min(sz, static_cast(szArgMax)); -#else +# else sz = static_cast(szArgMax); -#endif +# endif } #endif return sz; @@ -995,20 +995,20 @@ void cmSystemTools::InitializeLibUV() // global _fmode setting so that using libuv does not change the // default file text/binary mode. See libuv issue 840. uv_loop_close(uv_default_loop()); -#ifdef _MSC_VER +# ifdef _MSC_VER _set_fmode(_O_TEXT); -#else +# else _fmode = _O_TEXT; -#endif +# endif #endif } bool cmSystemTools::RenameFile(const char* oldname, const char* newname) { #ifdef _WIN32 -#ifndef INVALID_FILE_ATTRIBUTES -#define INVALID_FILE_ATTRIBUTES ((DWORD)-1) -#endif +# ifndef INVALID_FILE_ATTRIBUTES +# define INVALID_FILE_ATTRIBUTES ((DWORD)-1) +# endif /* Windows MoveFileEx may not replace read-only or in-use files. If it fails then remove the read-only attribute from any existing destination. Try multiple times since we may be racing against another process @@ -1460,14 +1460,14 @@ std::string cmSystemTools::CollapseCombinedPath(std::string const& dir, #ifdef CMAKE_BUILD_WITH_CMAKE bool cmSystemTools::UnsetEnv(const char* value) { -#if !defined(HAVE_UNSETENV) +# if !defined(HAVE_UNSETENV) std::string var = value; var += "="; return cmSystemTools::PutEnv(var.c_str()); -#else +# else unsetenv(value); return true; -#endif +# endif } std::vector cmSystemTools::GetEnvironmentVariables() @@ -1522,13 +1522,13 @@ void cmSystemTools::EnableVSConsoleOutput() // output and allow it to be captured on the fly. cmSystemTools::PutEnv("vsconsoleoutput=1"); -#ifdef CMAKE_BUILD_WITH_CMAKE +# ifdef CMAKE_BUILD_WITH_CMAKE // VS sets an environment variable to tell MS tools like "cl" to report // output through a backdoor pipe instead of stdout/stderr. Unset the // environment variable to close this backdoor for any path of process // invocations that passes through CMake so we can capture the output. cmSystemTools::UnsetEnv("VS_UNICODE_OUTPUT"); -#endif +# endif #endif } @@ -1599,8 +1599,8 @@ bool cmSystemTools::CreateTar(const char* outFileName, #if defined(CMAKE_BUILD_WITH_CMAKE) namespace { -#define BSDTAR_FILESIZE_PRINTF "%lu" -#define BSDTAR_FILESIZE_TYPE unsigned long +# define BSDTAR_FILESIZE_PRINTF "%lu" +# define BSDTAR_FILESIZE_TYPE unsigned long void list_item_verbose(FILE* out, struct archive_entry* entry) { char tmp[100]; @@ -1673,13 +1673,13 @@ void list_item_verbose(FILE* out, struct archive_entry* entry) /* Format the time using 'ls -l' conventions. */ tim = archive_entry_mtime(entry); -#define HALF_YEAR ((time_t)365 * 86400 / 2) -#if defined(_WIN32) && !defined(__CYGWIN__) +# define HALF_YEAR ((time_t)365 * 86400 / 2) +# if defined(_WIN32) && !defined(__CYGWIN__) /* Windows' strftime function does not support %e format. */ -#define DAY_FMT "%d" -#else -#define DAY_FMT "%e" /* Day number without leading zeros */ -#endif +# define DAY_FMT "%d" +# else +# define DAY_FMT "%e" /* Day number without leading zeros */ +# endif if (tim < now - HALF_YEAR || tim > now + HALF_YEAR) { fmt = DAY_FMT " %b %Y"; } else { @@ -1706,11 +1706,11 @@ bool copy_data(struct archive* ar, struct archive* aw) long r; const void* buff; size_t size; -#if defined(ARCHIVE_VERSION_NUMBER) && ARCHIVE_VERSION_NUMBER >= 3000000 +# if defined(ARCHIVE_VERSION_NUMBER) && ARCHIVE_VERSION_NUMBER >= 3000000 __LA_INT64_T offset; -#else +# else off_t offset; -#endif +# endif for (;;) { // Return value: @@ -1733,9 +1733,9 @@ bool copy_data(struct archive* ar, struct archive* aw) return false; } } -#if !defined(__clang__) && !defined(__HP_aCC) +# if !defined(__clang__) && !defined(__HP_aCC) return false; /* this should not happen but it quiets some compilers */ -#endif +# endif } bool extract_tar(const char* outFileName, bool verbose, bool extract) @@ -1798,13 +1798,13 @@ bool extract_tar(const char* outFileName, bool verbose, bool extract) break; } } -#ifdef _WIN32 +# ifdef _WIN32 else if (const char* linktext = archive_entry_symlink(entry)) { std::cerr << "cmake -E tar: warning: skipping symbolic link \"" << cm_archive_entry_pathname(entry) << "\" -> \"" << linktext << "\"." << std::endl; } -#endif +# endif else { cmSystemTools::Error("Problem with archive_write_header(): ", archive_error_string(ext)); @@ -2051,9 +2051,9 @@ bool cmSystemTools::FileTimeSet(const char* fname, cmSystemToolsFileTime* t) } #ifdef _WIN32 -#ifndef CRYPT_SILENT -#define CRYPT_SILENT 0x40 /* Not defined by VS 6 version of header. */ -#endif +# ifndef CRYPT_SILENT +# define CRYPT_SILENT 0x40 /* Not defined by VS 6 version of header. */ +# endif static int WinCryptRandom(void* data, size_t size) { int result = 0; @@ -2134,14 +2134,14 @@ void cmSystemTools::FindCMakeResources(const char* argv0) exe_dir = cmSystemTools::GetFilenamePath(realPath); #elif defined(__APPLE__) (void)argv0; // ignore this on OS X -#define CM_EXE_PATH_LOCAL_SIZE 16384 +# define CM_EXE_PATH_LOCAL_SIZE 16384 char exe_path_local[CM_EXE_PATH_LOCAL_SIZE]; -#if defined(MAC_OS_X_VERSION_10_3) && !defined(MAC_OS_X_VERSION_10_4) +# if defined(MAC_OS_X_VERSION_10_3) && !defined(MAC_OS_X_VERSION_10_4) unsigned long exe_path_size = CM_EXE_PATH_LOCAL_SIZE; -#else +# else uint32_t exe_path_size = CM_EXE_PATH_LOCAL_SIZE; -#endif -#undef CM_EXE_PATH_LOCAL_SIZE +# endif +# undef CM_EXE_PATH_LOCAL_SIZE char* exe_path = exe_path_local; if (_NSGetExecutablePath(exe_path, &exe_path_size) < 0) { exe_path = static_cast(malloc(exe_path_size)); diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 7dcba74..1868816 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -720,8 +720,9 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf, const std::string& lib, } if (cmGeneratorExpression::Find(lib) != std::string::npos || - (tgt && (tgt->GetType() == cmStateEnums::INTERFACE_LIBRARY || - tgt->GetType() == cmStateEnums::OBJECT_LIBRARY)) || + (tgt && + (tgt->GetType() == cmStateEnums::INTERFACE_LIBRARY || + tgt->GetType() == cmStateEnums::OBJECT_LIBRARY)) || (this->Name == lib)) { return; } @@ -1512,22 +1513,24 @@ bool cmTarget::CheckImportedLibName(std::string const& prop, if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY || !this->IsImported()) { this->Makefile->IssueMessage( - cmake::FATAL_ERROR, prop + + cmake::FATAL_ERROR, + prop + " property may be set only on imported INTERFACE library targets."); return false; } if (!value.empty()) { if (value[0] == '-') { - this->Makefile->IssueMessage(cmake::FATAL_ERROR, prop + - " property value\n " + value + + this->Makefile->IssueMessage(cmake::FATAL_ERROR, + prop + " property value\n " + value + "\nmay not start with '-'."); return false; } std::string::size_type bad = value.find_first_of(":/\\;"); if (bad != std::string::npos) { - this->Makefile->IssueMessage( - cmake::FATAL_ERROR, prop + " property value\n " + value + - "\nmay not contain '" + value.substr(bad, 1) + "'."); + this->Makefile->IssueMessage(cmake::FATAL_ERROR, + prop + " property value\n " + value + + "\nmay not contain '" + + value.substr(bad, 1) + "'."); return false; } } diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 62c4e22..3abb47e 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -36,6 +36,7 @@ public: cmTargetInternalPointer& operator=(cmTargetInternalPointer const& r); cmTargetInternals* operator->() const { return this->Pointer; } cmTargetInternals* Get() const { return this->Pointer; } + private: cmTargetInternals* Pointer; }; @@ -181,8 +182,8 @@ public: void SetHaveInstallRule(bool h) { this->HaveInstallRule = h; } /** - * Get/Set whether this target was auto-created by a generator. - */ + * Get/Set whether this target was auto-created by a generator. + */ bool GetIsGeneratorProvided() const { return this->IsGeneratorProvided; } void SetIsGeneratorProvided(bool igp) { this->IsGeneratorProvided = igp; } diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index 53f1213..73f9a2e 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -342,8 +342,9 @@ bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib, // form must be the plain form. const char* existingSig = (sig == cmTarget::KeywordTLLSignature ? "plain" : "keyword"); - e << "The " << existingSig << " signature for target_link_libraries has " - "already been used with the target \"" + e << "The " << existingSig + << " signature for target_link_libraries has " + "already been used with the target \"" << this->Target->GetName() << "\". All uses of target_link_libraries with a target " << modal << " be either all-keyword or all-plain.\n"; diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx index b548359..c532efb 100644 --- a/Source/cmTestGenerator.cxx +++ b/Source/cmTestGenerator.cxx @@ -111,8 +111,9 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os, os << cmOutputConverter::EscapeForCMake(exe); for (std::vector::const_iterator ci = command.begin() + 1; ci != command.end(); ++ci) { - os << " " << cmOutputConverter::EscapeForCMake( - ge.Parse(*ci)->Evaluate(this->LG, config)); + os << " " + << cmOutputConverter::EscapeForCMake( + ge.Parse(*ci)->Evaluate(this->LG, config)); } // Finish the test command. diff --git a/Source/cmUVHandlePtr.cxx b/Source/cmUVHandlePtr.cxx index eb70416..fd07d2d 100644 --- a/Source/cmUVHandlePtr.cxx +++ b/Source/cmUVHandlePtr.cxx @@ -87,16 +87,16 @@ template <> struct uv_handle_deleter { /*** - * Wile uv_async_send is itself thread-safe, there are - * no strong guarantees that close hasn't already been - * called on the handle; and that it might be deleted - * as the send call goes through. This mutex guards - * against that. - * - * The shared_ptr here is to allow for copy construction - * which is mandated by the standard for Deleter on - * shared_ptrs. - */ + * Wile uv_async_send is itself thread-safe, there are + * no strong guarantees that close hasn't already been + * called on the handle; and that it might be deleted + * as the send call goes through. This mutex guards + * against that. + * + * The shared_ptr here is to allow for copy construction + * which is mandated by the standard for Deleter on + * shared_ptrs. + */ std::shared_ptr handleMutex; uv_handle_deleter() diff --git a/Source/cmUVHandlePtr.h b/Source/cmUVHandlePtr.h index a6ce565..2937e0d 100644 --- a/Source/cmUVHandlePtr.h +++ b/Source/cmUVHandlePtr.h @@ -21,12 +21,12 @@ namespace cm { /*** -* RAII class to simplify and insure the safe usage of uv_*_t types. This -* includes making sure resources are properly freed and contains casting -* operators which allow for passing into relevant uv_* functions. -* -*@tparam T actual uv_*_t type represented. -*/ + * RAII class to simplify and insure the safe usage of uv_*_t types. This + * includes making sure resources are properly freed and contains casting + * operators which allow for passing into relevant uv_* functions. + * + *@tparam T actual uv_*_t type represented. + */ template class uv_handle_ptr_base_ { @@ -65,8 +65,9 @@ public: * that initializes something like uv_pipe_ptr or uv_tcp_ptr and interact * and clean up after it without caring about the exact type. */ - template ::value>::type> + template ::value>::type> uv_handle_ptr_base_(S&& rhs) { // This will force a compiler error if rhs doesn't have a casting @@ -198,9 +199,9 @@ typedef uv_handle_ptr_ uv_handle_ptr; extern template class uv_handle_ptr_base_; -#define UV_HANDLE_PTR_INSTANTIATE_EXTERN(NAME) \ - extern template class uv_handle_ptr_base_; \ - extern template class uv_handle_ptr_; +# define UV_HANDLE_PTR_INSTANTIATE_EXTERN(NAME) \ + extern template class uv_handle_ptr_base_; \ + extern template class uv_handle_ptr_; UV_HANDLE_PTR_INSTANTIATE_EXTERN(async) @@ -216,7 +217,7 @@ UV_HANDLE_PTR_INSTANTIATE_EXTERN(timer) UV_HANDLE_PTR_INSTANTIATE_EXTERN(tty) -#undef UV_HANDLE_PTR_INSTANTIATE_EXTERN +# undef UV_HANDLE_PTR_INSTANTIATE_EXTERN #endif } diff --git a/Source/cmUVSignalHackRAII.h b/Source/cmUVSignalHackRAII.h index c019aea..63599db 100644 --- a/Source/cmUVSignalHackRAII.h +++ b/Source/cmUVSignalHackRAII.h @@ -7,8 +7,8 @@ #if defined(CMAKE_USE_SYSTEM_LIBUV) && !defined(_WIN32) && \ UV_VERSION_MAJOR == 1 && UV_VERSION_MINOR < 19 -#define CMAKE_UV_SIGNAL_HACK -#include "cmUVHandlePtr.h" +# define CMAKE_UV_SIGNAL_HACK +# include "cmUVHandlePtr.h" /* libuv does not use SA_RESTART on its signal handler, but C++ streams depend on it for reliable i/o operations. This RAII helper convinces @@ -22,6 +22,7 @@ class cmUVSignalHackRAII uv_loop_t HackLoop; cm::uv_signal_ptr HackSignal; static void HackCB(uv_signal_t*, int) {} + public: cmUVSignalHackRAII() { diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx index 1140800..a601637 100644 --- a/Source/cmUtilitySourceCommand.cxx +++ b/Source/cmUtilitySourceCommand.cxx @@ -44,11 +44,11 @@ bool cmUtilitySourceCommand::InitialPass(std::vector const& args, } } else { cmState* state = this->Makefile->GetState(); - haveCacheValue = - (cacheValue && (strstr(cacheValue, "(IntDir)") == nullptr || - (intDir && strcmp(intDir, "$(IntDir)") == 0)) && - (state->GetCacheMajorVersion() != 0 && - state->GetCacheMinorVersion() != 0)); + haveCacheValue = (cacheValue && + (strstr(cacheValue, "(IntDir)") == nullptr || + (intDir && strcmp(intDir, "$(IntDir)") == 0)) && + (state->GetCacheMajorVersion() != 0 && + state->GetCacheMinorVersion() != 0)); } if (haveCacheValue) { diff --git a/Source/cmVS10LibFlagTable.h b/Source/cmVS10LibFlagTable.h index 65f28ef..be4f475 100644 --- a/Source/cmVS10LibFlagTable.h +++ b/Source/cmVS10LibFlagTable.h @@ -49,11 +49,11 @@ static cmVS7FlagTable cmVS10LibFlagTable[] = { // String List Properties // Skip [AdditionalDependencies] - no command line Switch. - { "AdditionalLibraryDirectories", "LIBPATH:", - "Additional Library Directories", "", + { "AdditionalLibraryDirectories", + "LIBPATH:", "Additional Library Directories", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "IgnoreSpecificDefaultLibraries", "NODEFAULTLIB:", - "Ignore Specific Default Libraries", "", + { "IgnoreSpecificDefaultLibraries", + "NODEFAULTLIB:", "Ignore Specific Default Libraries", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, { "ExportNamedFunctions", "EXPORT:", "Export Named Functions", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, diff --git a/Source/cmVS10LinkFlagTable.h b/Source/cmVS10LinkFlagTable.h index 6a0313a..8f5b59b 100644 --- a/Source/cmVS10LinkFlagTable.h +++ b/Source/cmVS10LinkFlagTable.h @@ -176,17 +176,17 @@ static cmVS7FlagTable cmVS10LinkFlagTable[] = { cmVS7FlagTable::UserValueRequired }, // String List Properties - { "AdditionalLibraryDirectories", "LIBPATH:", - "Additional Library Directories", "", + { "AdditionalLibraryDirectories", + "LIBPATH:", "Additional Library Directories", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, // Skip [AdditionalDependencies] - no command line Switch. - { "IgnoreSpecificDefaultLibraries", "NODEFAULTLIB:", - "Ignore Specific Default Libraries", "", + { "IgnoreSpecificDefaultLibraries", + "NODEFAULTLIB:", "Ignore Specific Default Libraries", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, { "AddModuleNamesToAssembly", "ASSEMBLYMODULE:", "Add Module to Assembly", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "EmbedManagedResourceFile", "ASSEMBLYRESOURCE:", - "Embed Managed Resource File", "", + { "EmbedManagedResourceFile", + "ASSEMBLYRESOURCE:", "Embed Managed Resource File", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, { "ForceSymbolReferences", "INCLUDE:", "Force Symbol References", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, @@ -194,8 +194,8 @@ static cmVS7FlagTable cmVS10LinkFlagTable[] = { cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, { "AssemblyLinkResource", "ASSEMBLYLINKRESOURCE:", "Assembly Link Resource", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "AdditionalManifestDependencies", "MANIFESTDEPENDENCY:", - "Additional Manifest Dependencies", "", + { "AdditionalManifestDependencies", + "MANIFESTDEPENDENCY:", "Additional Manifest Dependencies", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, // String Properties diff --git a/Source/cmVS11LibFlagTable.h b/Source/cmVS11LibFlagTable.h index 8aacaac..15c8ddd 100644 --- a/Source/cmVS11LibFlagTable.h +++ b/Source/cmVS11LibFlagTable.h @@ -49,11 +49,11 @@ static cmVS7FlagTable cmVS11LibFlagTable[] = { // String List Properties // Skip [AdditionalDependencies] - no command line Switch. - { "AdditionalLibraryDirectories", "LIBPATH:", - "Additional Library Directories", "", + { "AdditionalLibraryDirectories", + "LIBPATH:", "Additional Library Directories", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "IgnoreSpecificDefaultLibraries", "NODEFAULTLIB:", - "Ignore Specific Default Libraries", "", + { "IgnoreSpecificDefaultLibraries", + "NODEFAULTLIB:", "Ignore Specific Default Libraries", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, { "ExportNamedFunctions", "EXPORT:", "Export Named Functions", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, diff --git a/Source/cmVS11LinkFlagTable.h b/Source/cmVS11LinkFlagTable.h index 24ba8fd..53f1139 100644 --- a/Source/cmVS11LinkFlagTable.h +++ b/Source/cmVS11LinkFlagTable.h @@ -193,17 +193,17 @@ static cmVS7FlagTable cmVS11LinkFlagTable[] = { cmVS7FlagTable::UserValueRequired }, // String List Properties - { "AdditionalLibraryDirectories", "LIBPATH:", - "Additional Library Directories", "", + { "AdditionalLibraryDirectories", + "LIBPATH:", "Additional Library Directories", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, // Skip [AdditionalDependencies] - no command line Switch. - { "IgnoreSpecificDefaultLibraries", "NODEFAULTLIB:", - "Ignore Specific Default Libraries", "", + { "IgnoreSpecificDefaultLibraries", + "NODEFAULTLIB:", "Ignore Specific Default Libraries", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, { "AddModuleNamesToAssembly", "ASSEMBLYMODULE:", "Add Module to Assembly", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "EmbedManagedResourceFile", "ASSEMBLYRESOURCE:", - "Embed Managed Resource File", "", + { "EmbedManagedResourceFile", + "ASSEMBLYRESOURCE:", "Embed Managed Resource File", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, { "ForceSymbolReferences", "INCLUDE:", "Force Symbol References", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, @@ -211,8 +211,8 @@ static cmVS7FlagTable cmVS11LinkFlagTable[] = { cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, { "AssemblyLinkResource", "ASSEMBLYLINKRESOURCE:", "Assembly Link Resource", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "AdditionalManifestDependencies", "MANIFESTDEPENDENCY:", - "Additional Manifest Dependencies", "", + { "AdditionalManifestDependencies", + "MANIFESTDEPENDENCY:", "Additional Manifest Dependencies", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, { "ManifestInput", "manifestinput:", "Manifest Input", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, diff --git a/Source/cmVS12LibFlagTable.h b/Source/cmVS12LibFlagTable.h index 0f7a259..2229b97 100644 --- a/Source/cmVS12LibFlagTable.h +++ b/Source/cmVS12LibFlagTable.h @@ -49,11 +49,11 @@ static cmVS7FlagTable cmVS12LibFlagTable[] = { // String List Properties // Skip [AdditionalDependencies] - no command line Switch. - { "AdditionalLibraryDirectories", "LIBPATH:", - "Additional Library Directories", "", + { "AdditionalLibraryDirectories", + "LIBPATH:", "Additional Library Directories", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "IgnoreSpecificDefaultLibraries", "NODEFAULTLIB:", - "Ignore Specific Default Libraries", "", + { "IgnoreSpecificDefaultLibraries", + "NODEFAULTLIB:", "Ignore Specific Default Libraries", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, { "ExportNamedFunctions", "EXPORT:", "Export Named Functions", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, diff --git a/Source/cmVS12LinkFlagTable.h b/Source/cmVS12LinkFlagTable.h index fc667c3..ddc3ea1 100644 --- a/Source/cmVS12LinkFlagTable.h +++ b/Source/cmVS12LinkFlagTable.h @@ -193,17 +193,17 @@ static cmVS7FlagTable cmVS12LinkFlagTable[] = { cmVS7FlagTable::UserValueRequired }, // String List Properties - { "AdditionalLibraryDirectories", "LIBPATH:", - "Additional Library Directories", "", + { "AdditionalLibraryDirectories", + "LIBPATH:", "Additional Library Directories", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, // Skip [AdditionalDependencies] - no command line Switch. - { "IgnoreSpecificDefaultLibraries", "NODEFAULTLIB:", - "Ignore Specific Default Libraries", "", + { "IgnoreSpecificDefaultLibraries", + "NODEFAULTLIB:", "Ignore Specific Default Libraries", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, { "AddModuleNamesToAssembly", "ASSEMBLYMODULE:", "Add Module to Assembly", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "EmbedManagedResourceFile", "ASSEMBLYRESOURCE:", - "Embed Managed Resource File", "", + { "EmbedManagedResourceFile", + "ASSEMBLYRESOURCE:", "Embed Managed Resource File", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, { "ForceSymbolReferences", "INCLUDE:", "Force Symbol References", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, @@ -211,8 +211,8 @@ static cmVS7FlagTable cmVS12LinkFlagTable[] = { cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, { "AssemblyLinkResource", "ASSEMBLYLINKRESOURCE:", "Assembly Link Resource", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "AdditionalManifestDependencies", "MANIFESTDEPENDENCY:", - "Additional Manifest Dependencies", "", + { "AdditionalManifestDependencies", + "MANIFESTDEPENDENCY:", "Additional Manifest Dependencies", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, { "ManifestInput", "manifestinput:", "Manifest Input", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, diff --git a/Source/cmVS140LinkFlagTable.h b/Source/cmVS140LinkFlagTable.h index 7c9452a..fe03153 100644 --- a/Source/cmVS140LinkFlagTable.h +++ b/Source/cmVS140LinkFlagTable.h @@ -204,19 +204,19 @@ static cmVS7FlagTable cmVS140LinkFlagTable[] = { cmVS7FlagTable::UserValueRequired }, // String List Properties - { "AdditionalLibraryDirectories", "LIBPATH:", - "Additional Library Directories", "", + { "AdditionalLibraryDirectories", + "LIBPATH:", "Additional Library Directories", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, { "Natvis", "NATVIS:", "Natvis files", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, // Skip [AdditionalDependencies] - no command line Switch. - { "IgnoreSpecificDefaultLibraries", "NODEFAULTLIB:", - "Ignore Specific Default Libraries", "", + { "IgnoreSpecificDefaultLibraries", + "NODEFAULTLIB:", "Ignore Specific Default Libraries", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, { "AddModuleNamesToAssembly", "ASSEMBLYMODULE:", "Add Module to Assembly", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "EmbedManagedResourceFile", "ASSEMBLYRESOURCE:", - "Embed Managed Resource File", "", + { "EmbedManagedResourceFile", + "ASSEMBLYRESOURCE:", "Embed Managed Resource File", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, { "ForceSymbolReferences", "INCLUDE:", "Force Symbol References", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, @@ -224,8 +224,8 @@ static cmVS7FlagTable cmVS140LinkFlagTable[] = { cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, { "AssemblyLinkResource", "ASSEMBLYLINKRESOURCE:", "Assembly Link Resource", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "AdditionalManifestDependencies", "MANIFESTDEPENDENCY:", - "Additional Manifest Dependencies", "", + { "AdditionalManifestDependencies", + "MANIFESTDEPENDENCY:", "Additional Manifest Dependencies", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, { "ManifestInput", "manifestinput:", "Manifest Input", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, diff --git a/Source/cmVS141LinkFlagTable.h b/Source/cmVS141LinkFlagTable.h index f159f70..7e56c8e 100644 --- a/Source/cmVS141LinkFlagTable.h +++ b/Source/cmVS141LinkFlagTable.h @@ -206,19 +206,19 @@ static cmVS7FlagTable cmVS141LinkFlagTable[] = { cmVS7FlagTable::UserValueRequired }, // String List Properties - { "AdditionalLibraryDirectories", "LIBPATH:", - "Additional Library Directories", "", + { "AdditionalLibraryDirectories", + "LIBPATH:", "Additional Library Directories", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, { "Natvis", "NATVIS:", "Natvis files", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, // Skip [AdditionalDependencies] - no command line Switch. - { "IgnoreSpecificDefaultLibraries", "NODEFAULTLIB:", - "Ignore Specific Default Libraries", "", + { "IgnoreSpecificDefaultLibraries", + "NODEFAULTLIB:", "Ignore Specific Default Libraries", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, { "AddModuleNamesToAssembly", "ASSEMBLYMODULE:", "Add Module to Assembly", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "EmbedManagedResourceFile", "ASSEMBLYRESOURCE:", - "Embed Managed Resource File", "", + { "EmbedManagedResourceFile", + "ASSEMBLYRESOURCE:", "Embed Managed Resource File", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, { "ForceSymbolReferences", "INCLUDE:", "Force Symbol References", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, @@ -226,8 +226,8 @@ static cmVS7FlagTable cmVS141LinkFlagTable[] = { cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, { "AssemblyLinkResource", "ASSEMBLYLINKRESOURCE:", "Assembly Link Resource", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "AdditionalManifestDependencies", "MANIFESTDEPENDENCY:", - "Additional Manifest Dependencies", "", + { "AdditionalManifestDependencies", + "MANIFESTDEPENDENCY:", "Additional Manifest Dependencies", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, { "ManifestInput", "manifestinput:", "Manifest Input", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, diff --git a/Source/cmVS14LibFlagTable.h b/Source/cmVS14LibFlagTable.h index be4652c..adce075 100644 --- a/Source/cmVS14LibFlagTable.h +++ b/Source/cmVS14LibFlagTable.h @@ -50,11 +50,11 @@ static cmVS7FlagTable cmVS14LibFlagTable[] = { // String List Properties // Skip [AdditionalDependencies] - no command line Switch. - { "AdditionalLibraryDirectories", "LIBPATH:", - "Additional Library Directories", "", + { "AdditionalLibraryDirectories", + "LIBPATH:", "Additional Library Directories", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "IgnoreSpecificDefaultLibraries", "NODEFAULTLIB:", - "Ignore Specific Default Libraries", "", + { "IgnoreSpecificDefaultLibraries", + "NODEFAULTLIB:", "Ignore Specific Default Libraries", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, { "ExportNamedFunctions", "EXPORT:", "Export Named Functions", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, diff --git a/Source/cmVSSetupHelper.cxx b/Source/cmVSSetupHelper.cxx index c2f8deb..4ca847e 100644 --- a/Source/cmVSSetupHelper.cxx +++ b/Source/cmVSSetupHelper.cxx @@ -7,7 +7,7 @@ #include "cmsys/FStream.hxx" #ifndef VSSetupConstants -#define VSSetupConstants +# define VSSetupConstants /* clang-format off */ const IID IID_ISetupConfiguration = { 0x42843719, 0xDB4C, 0x46C2, diff --git a/Source/cmVSSetupHelper.h b/Source/cmVSSetupHelper.h index c07cfaf..368341c 100644 --- a/Source/cmVSSetupHelper.h +++ b/Source/cmVSSetupHelper.h @@ -4,7 +4,7 @@ #define cmVSSetupHelper_h #ifndef NOMINMAX -#define NOMINMAX // Undefine min and max defined by windows.h +# define NOMINMAX // Undefine min and max defined by windows.h #endif // Published by Visual Studio Setup team @@ -97,6 +97,7 @@ public: operator BSTR() const { return str; } BSTR* operator&() throw() { return &str; } ~SmartBSTR() throw() { ::SysFreeString(str); } + private: BSTR str; }; diff --git a/Source/cmVersionMacros.h b/Source/cmVersionMacros.h index 1b617bd..e8ac4f8 100644 --- a/Source/cmVersionMacros.h +++ b/Source/cmVersionMacros.h @@ -7,7 +7,7 @@ #define CMake_VERSION_PATCH_IS_RELEASE(patch) ((patch) < 20000000) #if CMake_VERSION_PATCH_IS_RELEASE(CMake_VERSION_PATCH) -#define CMake_VERSION_IS_RELEASE 1 +# define CMake_VERSION_IS_RELEASE 1 #endif #endif diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index f16db76..1768c57 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -1742,18 +1742,21 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(Elem& e1, e2.Element("Link", deployLocation + "\\%(FileName)%(Extension)"); } for (size_t i = 0; i != this->Configurations.size(); ++i) { - if (0 == strcmp(cge->Evaluate(this->LocalGenerator, - this->Configurations[i]), - "1")) { - e2.WritePlatformConfigTag( - "DeploymentContent", "'$(Configuration)|$(Platform)'=='" + - this->Configurations[i] + "|" + this->Platform + "'", - "true"); + if (0 == + strcmp( + cge->Evaluate(this->LocalGenerator, this->Configurations[i]), + "1")) { + e2.WritePlatformConfigTag("DeploymentContent", + "'$(Configuration)|$(Platform)'=='" + + this->Configurations[i] + "|" + + this->Platform + "'", + "true"); } else { - e2.WritePlatformConfigTag( - "ExcludedFromBuild", "'$(Configuration)|$(Platform)'=='" + - this->Configurations[i] + "|" + this->Platform + "'", - "true"); + e2.WritePlatformConfigTag("ExcludedFromBuild", + "'$(Configuration)|$(Platform)'=='" + + this->Configurations[i] + "|" + + this->Platform + "'", + "true"); } } } @@ -1768,18 +1771,20 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(Elem& e1, } if (!outputHeaderFile.empty()) { for (size_t i = 0; i != this->Configurations.size(); ++i) { - e2.WritePlatformConfigTag( - "HeaderFileOutput", "'$(Configuration)|$(Platform)'=='" + - this->Configurations[i] + "|" + this->Platform + "'", - outputHeaderFile); + e2.WritePlatformConfigTag("HeaderFileOutput", + "'$(Configuration)|$(Platform)'=='" + + this->Configurations[i] + "|" + + this->Platform + "'", + outputHeaderFile); } } if (!variableName.empty()) { for (size_t i = 0; i != this->Configurations.size(); ++i) { - e2.WritePlatformConfigTag( - "VariableName", "'$(Configuration)|$(Platform)'=='" + - this->Configurations[i] + "|" + this->Platform + "'", - variableName); + e2.WritePlatformConfigTag("VariableName", + "'$(Configuration)|$(Platform)'=='" + + this->Configurations[i] + "|" + + this->Platform + "'", + variableName); } } if (!shaderEnableDebug.empty()) { @@ -1792,8 +1797,9 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(Elem& e1, cge->Evaluate(this->LocalGenerator, this->Configurations[i]); if (strlen(enableDebug) > 0) { e2.WritePlatformConfigTag( - "EnableDebuggingInformation", "'$(Configuration)|$(Platform)'=='" + - this->Configurations[i] + "|" + this->Platform + "'", + "EnableDebuggingInformation", + "'$(Configuration)|$(Platform)'=='" + this->Configurations[i] + + "|" + this->Platform + "'", cmSystemTools::IsOn(enableDebug) ? "true" : "false"); } } @@ -1808,8 +1814,9 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(Elem& e1, cge->Evaluate(this->LocalGenerator, this->Configurations[i]); if (strlen(disableOptimizations) > 0) { e2.WritePlatformConfigTag( - "DisableOptimizations", "'$(Configuration)|$(Platform)'=='" + - this->Configurations[i] + "|" + this->Platform + "'", + "DisableOptimizations", + "'$(Configuration)|$(Platform)'=='" + this->Configurations[i] + + "|" + this->Platform + "'", (cmSystemTools::IsOn(disableOptimizations) ? "true" : "false")); } } @@ -2190,10 +2197,11 @@ void cmVisualStudio10TargetGenerator::WriteExcludeFromBuild( Elem& e2, std::vector const& exclude_configs) { for (size_t ci : exclude_configs) { - e2.WritePlatformConfigTag( - "ExcludedFromBuild", "'$(Configuration)|$(Platform)'=='" + - this->Configurations[ci] + "|" + this->Platform + "'", - "true"); + e2.WritePlatformConfigTag("ExcludedFromBuild", + "'$(Configuration)|$(Platform)'=='" + + this->Configurations[ci] + "|" + + this->Platform + "'", + "true"); } } @@ -2968,8 +2976,9 @@ bool cmVisualStudio10TargetGenerator::ComputeNasmOptions( std::string configFlagsVar = std::string("CMAKE_ASM_NASM_FLAGS_") + CONFIG; std::string flags = std::string(this->Makefile->GetSafeDefinition("CMAKE_ASM_NASM_FLAGS")) + - std::string(" -f") + std::string(this->Makefile->GetSafeDefinition( - "CMAKE_ASM_NASM_OBJECT_FORMAT")) + + std::string(" -f") + + std::string( + this->Makefile->GetSafeDefinition("CMAKE_ASM_NASM_OBJECT_FORMAT")) + std::string(" ") + std::string(this->Makefile->GetSafeDefinition(configFlagsVar)); nasmOptions.Parse(flags.c_str()); diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx index 3ec3355..4afef8b 100644 --- a/Source/cmVisualStudioGeneratorOptions.cxx +++ b/Source/cmVisualStudioGeneratorOptions.cxx @@ -393,7 +393,8 @@ void cmVisualStudioGeneratorOptions::StoreUnknownFlag(std::string const& flag) // This option is not known. Store it in the output flags. std::string const opts = cmOutputConverter::EscapeWindowsShellArgument( - flag.c_str(), cmOutputConverter::Shell_Flag_AllowMakeVariables | + flag.c_str(), + cmOutputConverter::Shell_Flag_AllowMakeVariables | cmOutputConverter::Shell_Flag_VSIDE); this->AppendFlagString(this->UnknownFlagField, opts); } diff --git a/Source/cmWriteFileCommand.cxx b/Source/cmWriteFileCommand.cxx index 3464a1b..d3d2db0 100644 --- a/Source/cmWriteFileCommand.cxx +++ b/Source/cmWriteFileCommand.cxx @@ -54,7 +54,7 @@ bool cmWriteFileCommand::InitialPass(std::vector const& args, #else mode | S_IWUSR | S_IWGRP #endif - ); + ); } // If GetPermissions fails, pretend like it is ok. File open will fail if // the file is not writable diff --git a/Source/cmXMLWriter.h b/Source/cmXMLWriter.h index d124907..b080654 100644 --- a/Source/cmXMLWriter.h +++ b/Source/cmXMLWriter.h @@ -145,6 +145,7 @@ public: xmlwr.StartDocument(); } ~cmXMLDocument() { xmlwr.EndDocument(); } + private: friend class cmXMLElement; cmXMLWriter& xmlwr; diff --git a/Source/cm_codecvt.cxx b/Source/cm_codecvt.cxx index 6705851..9519f91 100644 --- a/Source/cm_codecvt.cxx +++ b/Source/cm_codecvt.cxx @@ -3,11 +3,11 @@ #include "cm_codecvt.hxx" #if defined(_WIN32) -#include -#include -#include -#undef max -#include "cmsys/Encoding.hxx" +# include +# include +# include +# undef max +# include "cmsys/Encoding.hxx" #endif #if defined(_WIN32) diff --git a/Source/cm_codecvt.hxx b/Source/cm_codecvt.hxx index 3a5606b..2df3961 100644 --- a/Source/cm_codecvt.hxx +++ b/Source/cm_codecvt.hxx @@ -52,13 +52,13 @@ private: }; bool m_noconv; -#if defined(_WIN32) +# if defined(_WIN32) unsigned int m_codepage; result Decode(mbstate_t& state, int need, const char*& from_next, char*& to_next, char* to_end) const; result DecodePartial(mbstate_t& state, char*& to_next, char* to_end) const; void BufferPartial(mbstate_t& state, int need, const char*& from_next) const; -#endif +# endif #endif }; diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 801d52d..6edaa74 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -28,69 +28,69 @@ #include "cm_sys_stat.h" #if defined(CMAKE_BUILD_WITH_CMAKE) -#include "cm_jsoncpp_writer.h" +# include "cm_jsoncpp_writer.h" -#include "cmGraphVizWriter.h" -#include "cmVariableWatch.h" -#include +# include "cmGraphVizWriter.h" +# include "cmVariableWatch.h" +# include #endif #if defined(CMAKE_BUILD_WITH_CMAKE) -#define CMAKE_USE_ECLIPSE +# define CMAKE_USE_ECLIPSE #endif #if defined(__MINGW32__) && !defined(CMAKE_BUILD_WITH_CMAKE) -#define CMAKE_BOOT_MINGW +# define CMAKE_BOOT_MINGW #endif // include the generator #if defined(_WIN32) && !defined(__CYGWIN__) -#if !defined(CMAKE_BOOT_MINGW) -#include "cmGlobalBorlandMakefileGenerator.h" -#include "cmGlobalGhsMultiGenerator.h" -#include "cmGlobalJOMMakefileGenerator.h" -#include "cmGlobalNMakeMakefileGenerator.h" -#include "cmGlobalVisualStudio10Generator.h" -#include "cmGlobalVisualStudio11Generator.h" -#include "cmGlobalVisualStudio12Generator.h" -#include "cmGlobalVisualStudio14Generator.h" -#include "cmGlobalVisualStudio15Generator.h" -#include "cmGlobalVisualStudio9Generator.h" -#include "cmVSSetupHelper.h" - -#define CMAKE_HAVE_VS_GENERATORS -#endif -#include "cmGlobalMSYSMakefileGenerator.h" -#include "cmGlobalMinGWMakefileGenerator.h" +# if !defined(CMAKE_BOOT_MINGW) +# include "cmGlobalBorlandMakefileGenerator.h" +# include "cmGlobalGhsMultiGenerator.h" +# include "cmGlobalJOMMakefileGenerator.h" +# include "cmGlobalNMakeMakefileGenerator.h" +# include "cmGlobalVisualStudio10Generator.h" +# include "cmGlobalVisualStudio11Generator.h" +# include "cmGlobalVisualStudio12Generator.h" +# include "cmGlobalVisualStudio14Generator.h" +# include "cmGlobalVisualStudio15Generator.h" +# include "cmGlobalVisualStudio9Generator.h" +# include "cmVSSetupHelper.h" + +# define CMAKE_HAVE_VS_GENERATORS +# endif +# include "cmGlobalMSYSMakefileGenerator.h" +# include "cmGlobalMinGWMakefileGenerator.h" #else #endif #if defined(CMAKE_USE_WMAKE) -#include "cmGlobalWatcomWMakeGenerator.h" +# include "cmGlobalWatcomWMakeGenerator.h" #endif #include "cmGlobalUnixMakefileGenerator3.h" #if defined(CMAKE_BUILD_WITH_CMAKE) -#include "cmGlobalNinjaGenerator.h" +# include "cmGlobalNinjaGenerator.h" #endif #include "cmExtraCodeLiteGenerator.h" #if !defined(CMAKE_BOOT_MINGW) -#include "cmExtraCodeBlocksGenerator.h" +# include "cmExtraCodeBlocksGenerator.h" #endif #include "cmExtraKateGenerator.h" #include "cmExtraSublimeTextGenerator.h" #ifdef CMAKE_USE_ECLIPSE -#include "cmExtraEclipseCDT4Generator.h" +# include "cmExtraEclipseCDT4Generator.h" #endif #if defined(__APPLE__) -#if defined(CMAKE_BUILD_WITH_CMAKE) -#include "cmGlobalXCodeGenerator.h" +# if defined(CMAKE_BUILD_WITH_CMAKE) +# include "cmGlobalXCodeGenerator.h" -#define CMAKE_USE_XCODE 1 -#endif -#include -#include +# define CMAKE_USE_XCODE 1 +# endif +# include +# include #endif #include "cmsys/FStream.hxx" @@ -891,9 +891,9 @@ void cmake::AddDefaultExtraGenerators() this->ExtraGenerators.push_back(cmExtraSublimeTextGenerator::GetFactory()); this->ExtraGenerators.push_back(cmExtraKateGenerator::GetFactory()); -#ifdef CMAKE_USE_ECLIPSE +# ifdef CMAKE_USE_ECLIPSE this->ExtraGenerators.push_back(cmExtraEclipseCDT4Generator::GetFactory()); -#endif +# endif #endif } @@ -1708,7 +1708,7 @@ void cmake::AddProjectCommands() void cmake::AddDefaultGenerators() { #if defined(_WIN32) && !defined(__CYGWIN__) -#if !defined(CMAKE_BOOT_MINGW) +# if !defined(CMAKE_BOOT_MINGW) this->Generators.push_back(cmGlobalVisualStudio15Generator::NewFactory()); this->Generators.push_back(cmGlobalVisualStudio14Generator::NewFactory()); this->Generators.push_back(cmGlobalVisualStudio12Generator::NewFactory()); @@ -1719,7 +1719,7 @@ void cmake::AddDefaultGenerators() this->Generators.push_back(cmGlobalNMakeMakefileGenerator::NewFactory()); this->Generators.push_back(cmGlobalJOMMakefileGenerator::NewFactory()); this->Generators.push_back(cmGlobalGhsMultiGenerator::NewFactory()); -#endif +# endif this->Generators.push_back(cmGlobalMSYSMakefileGenerator::NewFactory()); this->Generators.push_back(cmGlobalMinGWMakefileGenerator::NewFactory()); #endif diff --git a/Source/cmake.h b/Source/cmake.h index 53c2f45..86e06df 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -17,7 +17,7 @@ #include "cmStateTypes.h" #if defined(CMAKE_BUILD_WITH_CMAKE) -#include "cm_jsoncpp_value.h" +# include "cm_jsoncpp_value.h" #endif class cmExternalMakefileProjectGeneratorFactory; @@ -566,11 +566,13 @@ private: { "-Wno-error=dev", "Make developer warnings not errors." }, \ { "-Wdeprecated", "Enable deprecation warnings." }, \ { "-Wno-deprecated", "Suppress deprecation warnings." }, \ - { "-Werror=deprecated", "Make deprecated macro and function warnings " \ - "errors." }, \ + { "-Werror=deprecated", \ + "Make deprecated macro and function warnings " \ + "errors." }, \ { \ - "-Wno-error=deprecated", "Make deprecated macro and function warnings " \ - "not errors." \ + "-Wno-error=deprecated", \ + "Make deprecated macro and function warnings " \ + "not errors." \ } #define FOR_EACH_C_FEATURE(F) \ diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 9c9f65c..e3d94f6 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -1,7 +1,6 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#include "cmake.h" #include "cmAlgorithms.h" #include "cmDocumentationEntry.h" #include "cmGlobalGenerator.h" @@ -9,18 +8,19 @@ #include "cmState.h" #include "cmStateTypes.h" #include "cmSystemTools.h" +#include "cmake.h" #include "cmcmd.h" #ifdef CMAKE_BUILD_WITH_CMAKE -#include "cmDocumentation.h" -#include "cmDynamicLoader.h" +# include "cmDocumentation.h" +# include "cmDynamicLoader.h" #endif #include "cm_uv.h" #include "cmsys/Encoding.hxx" #if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE) -#include "cmsys/ConsoleBuf.hxx" +# include "cmsys/ConsoleBuf.hxx" #endif #include @@ -36,11 +36,13 @@ static const char* cmDocumentationName[][2] = { }; static const char* cmDocumentationUsage[][2] = { - { nullptr, " cmake [options] \n" - " cmake [options] " }, - { nullptr, "Specify a source directory to (re-)generate a build system for " - "it in the current working directory. Specify an existing build " - "directory to re-generate its build system." }, + { nullptr, + " cmake [options] \n" + " cmake [options] " }, + { nullptr, + "Specify a source directory to (re-)generate a build system for " + "it in the current working directory. Specify an existing build " + "directory to re-generate its build system." }, { nullptr, nullptr } }; @@ -49,21 +51,23 @@ static const char* cmDocumentationUsageNote[][2] = { { nullptr, nullptr } }; -#define CMAKE_BUILD_OPTIONS \ - " = Project binary directory to be built.\n" \ - " -j [] --parallel [] = Build in parallel using\n" \ - " the given number of jobs. If is omitted\n" \ - " the native build tool's default number is used.\n" \ - " The CMAKE_BUILD_PARALLEL_LEVEL environment variable\n" \ - " specifies a default parallel level when this option\n" \ - " is not given.\n" \ - " --target = Build instead of default targets.\n" \ - " May only be specified once.\n" \ - " --config = For multi-configuration tools, choose .\n" \ - " --clean-first = Build target 'clean' first, then build.\n" \ - " (To clean only, use --target 'clean'.)\n" \ - " --use-stderr = Ignored. Behavior is default in CMake >= 3.0.\n" \ - " -- = Pass remaining options to the native tool.\n" +# define CMAKE_BUILD_OPTIONS \ + " = Project binary directory to be built.\n" \ + " -j [] --parallel [] = Build in parallel using\n" \ + " the given number of jobs. If is omitted\n" \ + " the native build tool's default number is used.\n" \ + " The CMAKE_BUILD_PARALLEL_LEVEL environment " \ + "variable\n" \ + " specifies a default parallel level when this " \ + "option\n" \ + " is not given.\n" \ + " --target = Build instead of default targets.\n" \ + " May only be specified once.\n" \ + " --config = For multi-configuration tools, choose .\n" \ + " --clean-first = Build target 'clean' first, then build.\n" \ + " (To clean only, use --target 'clean'.)\n" \ + " --use-stderr = Ignored. Behavior is default in CMake >= 3.0.\n" \ + " -- = Pass remaining options to the native tool.\n" static const char* cmDocumentationOptions[][2] = { CMAKE_STANDARD_OPTIONS_TABLE, @@ -74,11 +78,13 @@ static const char* cmDocumentationOptions[][2] = { { "-N", "View mode only." }, { "-P ", "Process script mode." }, { "--find-package", "Run in pkg-config like mode." }, - { "--graphviz=[file]", "Generate graphviz of dependencies, see " - "CMakeGraphVizOptions.cmake for more." }, + { "--graphviz=[file]", + "Generate graphviz of dependencies, see " + "CMakeGraphVizOptions.cmake for more." }, { "--system-information [file]", "Dump information about this system." }, - { "--debug-trycompile", "Do not delete the try_compile build tree. Only " - "useful on one try_compile at a time." }, + { "--debug-trycompile", + "Do not delete the try_compile build tree. Only " + "useful on one try_compile at a time." }, { "--debug-output", "Put cmake in a debug mode." }, { "--trace", "Put cmake in trace mode." }, { "--trace-expand", "Put cmake in trace mode with variable expansion." }, @@ -87,8 +93,9 @@ static const char* cmDocumentationOptions[][2] = { { "--warn-uninitialized", "Warn about uninitialized values." }, { "--warn-unused-vars", "Warn about unused variables." }, { "--no-warn-unused-cli", "Don't warn about command line options." }, - { "--check-system-vars", "Find problems with variable usage in system " - "files." }, + { "--check-system-vars", + "Find problems with variable usage in system " + "files." }, { nullptr, nullptr } }; diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 6f3a90f..0a75e77 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -17,17 +17,17 @@ #include "cmake.h" #if defined(CMAKE_BUILD_WITH_CMAKE) -#include "cmDependsFortran.h" // For -E cmake_copy_f90_mod callback. -#include "cmServer.h" -#include "cmServerConnection.h" +# include "cmDependsFortran.h" // For -E cmake_copy_f90_mod callback. +# include "cmServer.h" +# include "cmServerConnection.h" #endif #if defined(CMAKE_BUILD_WITH_CMAKE) && defined(_WIN32) -#include "bindexplib.h" +# include "bindexplib.h" #endif #if defined(CMAKE_BUILD_WITH_CMAKE) && defined(_WIN32) && !defined(__CYGWIN__) -#include "cmVisualStudioWCEPlatformParser.h" +# include "cmVisualStudioWCEPlatformParser.h" #endif #include "cmsys/Directory.hxx" @@ -1775,8 +1775,9 @@ int cmVSLink::LinkIncremental() if (!fout) { return -1; } - fout << this->Type << " /* CREATEPROCESS_MANIFEST_RESOURCE_ID */ " - "24 /* RT_MANIFEST */ \"" + fout << this->Type + << " /* CREATEPROCESS_MANIFEST_RESOURCE_ID */ " + "24 /* RT_MANIFEST */ \"" << absManifestFile << "\""; } diff --git a/Source/ctest.cxx b/Source/ctest.cxx index 0a6d1d2..b338dea 100644 --- a/Source/ctest.cxx +++ b/Source/ctest.cxx @@ -9,7 +9,7 @@ #include "cmsys/Encoding.hxx" #if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE) -#include "cmsys/ConsoleBuf.hxx" +# include "cmsys/ConsoleBuf.hxx" #endif #include #include @@ -30,60 +30,76 @@ static const char* cmDocumentationOptions[][2] = { { "-V,--verbose", "Enable verbose output from tests." }, { "-VV,--extra-verbose", "Enable more verbose output from tests." }, { "--debug", "Displaying more verbose internals of CTest." }, - { "--output-on-failure", "Output anything outputted by the test program " - "if the test should fail." }, - { "--test-output-size-passed ", "Limit the output for passed tests " - "to bytes" }, - { "--test-output-size-failed ", "Limit the output for failed tests " - "to bytes" }, + { "--output-on-failure", + "Output anything outputted by the test program " + "if the test should fail." }, + { "--test-output-size-passed ", + "Limit the output for passed tests " + "to bytes" }, + { "--test-output-size-failed ", + "Limit the output for failed tests " + "to bytes" }, { "-F", "Enable failover." }, - { "-j , --parallel ", "Run the tests in parallel using the " - "given number of jobs." }, + { "-j , --parallel ", + "Run the tests in parallel using the " + "given number of jobs." }, { "-Q,--quiet", "Make ctest quiet." }, { "-O , --output-log ", "Output to log file" }, { "-N,--show-only", "Disable actual execution of tests." }, - { "-L , --label-regex ", "Run tests with labels matching " - "regular expression." }, - { "-R , --tests-regex ", "Run tests matching regular " - "expression." }, - { "-E , --exclude-regex ", "Exclude tests matching regular " - "expression." }, - { "-LE , --label-exclude ", "Exclude tests with labels " - "matching regular expression." }, - { "-FA , --fixture-exclude-any ", "Do not automatically " - "add any tests for " - "fixtures matching " - "regular expression." }, - { "-FS , --fixture-exclude-setup ", "Do not automatically " - "add setup tests for " - "fixtures matching " - "regular expression." }, - { "-FC , --fixture-exclude-cleanup ", "Do not automatically " - "add cleanup tests for " - "fixtures matching " - "regular expression." }, + { "-L , --label-regex ", + "Run tests with labels matching " + "regular expression." }, + { "-R , --tests-regex ", + "Run tests matching regular " + "expression." }, + { "-E , --exclude-regex ", + "Exclude tests matching regular " + "expression." }, + { "-LE , --label-exclude ", + "Exclude tests with labels " + "matching regular expression." }, + { "-FA , --fixture-exclude-any ", + "Do not automatically " + "add any tests for " + "fixtures matching " + "regular expression." }, + { "-FS , --fixture-exclude-setup ", + "Do not automatically " + "add setup tests for " + "fixtures matching " + "regular expression." }, + { "-FC , --fixture-exclude-cleanup ", + "Do not automatically " + "add cleanup tests for " + "fixtures matching " + "regular expression." }, { "-D , --dashboard ", "Execute dashboard test" }, { "-D :=", "Define a variable for script mode" }, { "-M , --test-model ", "Sets the model for a dashboard" }, - { "-T , --test-action ", "Sets the dashboard action to " - "perform" }, + { "-T , --test-action ", + "Sets the dashboard action to " + "perform" }, { "--track ", "Specify the track to submit dashboard to" }, - { "-S