diff options
Diffstat (limited to 'Source')
186 files changed, 372 insertions, 551 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index e9cca30..887d970 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 15) -set(CMake_VERSION_PATCH 20190913) +set(CMake_VERSION_PATCH 20190917) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx index b4bfea7..2393279 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx +++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx @@ -13,8 +13,8 @@ #include "cmXMLParser.h" #include "cmXMLWriter.h" +#include <cstddef> #include <sstream> -#include <stddef.h> #include <utility> cmCPackIFWInstaller::cmCPackIFWInstaller() = default; diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx index 5fa8cce..9f2a443 100644 --- a/Source/CPack/IFW/cmCPackIFWPackage.cxx +++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx @@ -13,9 +13,9 @@ #include "cmTimestamp.h" #include "cmXMLWriter.h" +#include <cstddef> #include <map> #include <sstream> -#include <stddef.h> #include <utility> //---------------------------------------------------------- CompareStruct --- diff --git a/Source/CPack/IFW/cmCPackIFWRepository.cxx b/Source/CPack/IFW/cmCPackIFWRepository.cxx index 8042167..82ddbdb 100644 --- a/Source/CPack/IFW/cmCPackIFWRepository.cxx +++ b/Source/CPack/IFW/cmCPackIFWRepository.cxx @@ -8,7 +8,7 @@ #include "cmXMLParser.h" #include "cmXMLWriter.h" -#include <stddef.h> +#include <cstddef> cmCPackIFWRepository::cmCPackIFWRepository() : Update(cmCPackIFWRepository::None) diff --git a/Source/CPack/OSXScriptLauncher.cxx b/Source/CPack/OSXScriptLauncher.cxx index 00d272c..b8f12fd 100644 --- a/Source/CPack/OSXScriptLauncher.cxx +++ b/Source/CPack/OSXScriptLauncher.cxx @@ -3,8 +3,9 @@ #include "cmsys/FStream.hxx" #include "cmsys/Process.h" #include "cmsys/SystemTools.hxx" + +#include <cstddef> #include <iostream> -#include <stddef.h> #include <string> #include <vector> diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index cefbc90..0e64b5a 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -13,10 +13,10 @@ #include "cm_sys_stat.h" #include "cmsys/Glob.hxx" +#include <cstring> #include <map> #include <ostream> #include <set> -#include <string.h> #include <utility> namespace { diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx index ca06b81..bedbfa8 100644 --- a/Source/CPack/cmCPackDragNDropGenerator.cxx +++ b/Source/CPack/cmCPackDragNDropGenerator.cxx @@ -12,9 +12,9 @@ #include "cmsys/FStream.hxx" #include "cmsys/RegularExpression.hxx" #include <algorithm> +#include <cstdlib> #include <iomanip> #include <map> -#include <stdlib.h> #include <CoreFoundation/CoreFoundation.h> diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index 8098edf..3f53186 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -14,10 +14,10 @@ #include "cmsys/Directory.hxx" #include "cmsys/RegularExpression.hxx" #include <algorithm> +#include <cstdlib> +#include <cstring> #include <map> #include <sstream> -#include <stdlib.h> -#include <string.h> #include <utility> /* NSIS uses different command line syntax on Windows and others */ diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx index 5dc36ab..7be6a7d 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.cxx +++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx @@ -4,11 +4,11 @@ #include "cmsys/FStream.hxx" #include "cmsys/RegularExpression.hxx" -#include <assert.h> +#include <cassert> +#include <cstdio> +#include <cstdlib> #include <map> #include <sstream> -#include <stdio.h> -#include <stdlib.h> #include <string> #include "cmCPackComponentGroup.h" diff --git a/Source/CPack/cmCPackProductBuildGenerator.cxx b/Source/CPack/cmCPackProductBuildGenerator.cxx index 800af28..dae268c 100644 --- a/Source/CPack/cmCPackProductBuildGenerator.cxx +++ b/Source/CPack/cmCPackProductBuildGenerator.cxx @@ -2,9 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackProductBuildGenerator.h" +#include <cstddef> #include <map> #include <sstream> -#include <stddef.h> #include "cmCPackComponentGroup.h" #include "cmCPackLog.h" diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx index e8728a3..0c1cecf 100644 --- a/Source/CPack/cmCPackRPMGenerator.cxx +++ b/Source/CPack/cmCPackRPMGenerator.cxx @@ -3,7 +3,7 @@ #include "cmCPackRPMGenerator.h" #include <algorithm> -#include <ctype.h> +#include <cctype> #include <map> #include <ostream> #include <utility> diff --git a/Source/CPack/cmCPackSTGZGenerator.cxx b/Source/CPack/cmCPackSTGZGenerator.cxx index 3092508..eb48c37 100644 --- a/Source/CPack/cmCPackSTGZGenerator.cxx +++ b/Source/CPack/cmCPackSTGZGenerator.cxx @@ -3,8 +3,8 @@ #include "cmCPackSTGZGenerator.h" #include "cmsys/FStream.hxx" +#include <cstdio> #include <sstream> -#include <stdio.h> #include <string> #include <vector> diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index 08681ec..ab44a42 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -22,10 +22,10 @@ # include "cmsys/ConsoleBuf.hxx" #endif +#include <cstddef> #include <iostream> #include <map> #include <sstream> -#include <stddef.h> #include <string> #include <utility> #include <vector> diff --git a/Source/CTest/cmCTestBZR.cxx b/Source/CTest/cmCTestBZR.cxx index 52dc0ac..4ea0c88 100644 --- a/Source/CTest/cmCTestBZR.cxx +++ b/Source/CTest/cmCTestBZR.cxx @@ -11,10 +11,10 @@ #include "cm_expat.h" #include "cmsys/RegularExpression.hxx" +#include <cstdlib> #include <list> #include <map> #include <ostream> -#include <stdlib.h> #include <vector> extern "C" int cmBZRXMLParserUnknownEncodingHandler(void* /*unused*/, diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index e7fb4c7..0f79670 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -14,9 +14,9 @@ #include "cmsys/Process.h" #include <chrono> +#include <cstdlib> #include <cstring> #include <ratio> -#include <stdlib.h> cmCTestBuildAndTestHandler::cmCTestBuildAndTestHandler() { diff --git a/Source/CTest/cmCTestBuildCommand.cxx b/Source/CTest/cmCTestBuildCommand.cxx index cb22fa6..02b00e3 100644 --- a/Source/CTest/cmCTestBuildCommand.cxx +++ b/Source/CTest/cmCTestBuildCommand.cxx @@ -11,8 +11,8 @@ #include "cmSystemTools.h" #include "cmake.h" +#include <cstring> #include <sstream> -#include <string.h> class cmExecutionStatus; diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index e07d7aa..86abb12 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -17,9 +17,9 @@ #include "cmsys/Directory.hxx" #include "cmsys/FStream.hxx" #include "cmsys/Process.h" +#include <cstdlib> +#include <cstring> #include <set> -#include <stdlib.h> -#include <string.h> #include <utility> static const char* cmCTestErrorMatches[] = { diff --git a/Source/CTest/cmCTestConfigureCommand.cxx b/Source/CTest/cmCTestConfigureCommand.cxx index 320c184..8a56f3d 100644 --- a/Source/CTest/cmCTestConfigureCommand.cxx +++ b/Source/CTest/cmCTestConfigureCommand.cxx @@ -10,8 +10,8 @@ #include "cmSystemTools.h" #include "cmake.h" +#include <cstring> #include <sstream> -#include <string.h> #include <vector> cmCTestConfigureCommand::cmCTestConfigureCommand() diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index d9dd931..4d76387 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -24,12 +24,12 @@ #include "cmsys/RegularExpression.hxx" #include <algorithm> #include <chrono> +#include <cstdio> +#include <cstdlib> #include <cstring> #include <iomanip> #include <iterator> #include <sstream> -#include <stdio.h> -#include <stdlib.h> #include <utility> class cmMakefile; diff --git a/Source/CTest/cmCTestCurl.cxx b/Source/CTest/cmCTestCurl.cxx index 40f5918..8793260 100644 --- a/Source/CTest/cmCTestCurl.cxx +++ b/Source/CTest/cmCTestCurl.cxx @@ -8,8 +8,8 @@ #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +#include <cstdio> #include <ostream> -#include <stdio.h> cmCTestCurl::cmCTestCurl(cmCTest* ctest) { diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx index 3ae464d..9fd3a62 100644 --- a/Source/CTest/cmCTestGIT.cxx +++ b/Source/CTest/cmCTestGIT.cxx @@ -4,10 +4,10 @@ #include "cmsys/FStream.hxx" #include "cmsys/Process.h" -#include <ctype.h> -#include <stdio.h> -#include <stdlib.h> -#include <time.h> +#include <cctype> +#include <cstdio> +#include <cstdlib> +#include <ctime> #include <vector> #include "cmCTest.h" diff --git a/Source/CTest/cmCTestHandlerCommand.cxx b/Source/CTest/cmCTestHandlerCommand.cxx index 6add717..9c5425d 100644 --- a/Source/CTest/cmCTestHandlerCommand.cxx +++ b/Source/CTest/cmCTestHandlerCommand.cxx @@ -10,9 +10,9 @@ #include "cmSystemTools.h" #include "cmWorkingDirectory.h" +#include <cstdlib> #include <cstring> #include <sstream> -#include <stdlib.h> cmCTestHandlerCommand::cmCTestHandlerCommand() { diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx index ac52581..ba49c29 100644 --- a/Source/CTest/cmCTestLaunch.cxx +++ b/Source/CTest/cmCTestLaunch.cxx @@ -5,9 +5,9 @@ #include "cmsys/FStream.hxx" #include "cmsys/Process.h" #include "cmsys/RegularExpression.hxx" +#include <cstdlib> +#include <cstring> #include <iostream> -#include <stdlib.h> -#include <string.h> #include "cmCryptoHash.h" #include "cmGeneratedFileStream.h" diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index 259240f..ba196f0 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -12,9 +12,9 @@ #include "cmsys/Glob.hxx" #include "cmsys/RegularExpression.hxx" #include <chrono> +#include <cstring> #include <iostream> #include <sstream> -#include <string.h> #include <utility> struct CatToErrorType diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index af1980a..f79ba2e 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -25,15 +25,15 @@ #include <algorithm> #include <chrono> +#include <cmath> +#include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <list> -#include <math.h> #include <memory> #include <sstream> #include <stack> -#include <stdlib.h> #include <unordered_map> #include <utility> #include <vector> diff --git a/Source/CTest/cmCTestP4.cxx b/Source/CTest/cmCTestP4.cxx index 08c850d..a6aea85 100644 --- a/Source/CTest/cmCTestP4.cxx +++ b/Source/CTest/cmCTestP4.cxx @@ -12,8 +12,8 @@ #include "cmsys/RegularExpression.hxx" #include <algorithm> +#include <ctime> #include <ostream> -#include <time.h> #include <utility> cmCTestP4::cmCTestP4(cmCTest* ct, std::ostream& log) diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index c5bb826..3629a50 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -13,11 +13,11 @@ #include "cmsys/RegularExpression.hxx" #include <chrono> #include <cstdint> +#include <cstdio> #include <cstring> #include <iomanip> #include <ratio> #include <sstream> -#include <stdio.h> #include <utility> #include "cm_memory.hxx" diff --git a/Source/CTest/cmCTestSVN.cxx b/Source/CTest/cmCTestSVN.cxx index a945111..6e5b5e7 100644 --- a/Source/CTest/cmCTestSVN.cxx +++ b/Source/CTest/cmCTestSVN.cxx @@ -12,10 +12,10 @@ #include "cmXMLWriter.h" #include "cmsys/RegularExpression.hxx" +#include <cstdlib> +#include <cstring> #include <map> #include <ostream> -#include <stdlib.h> -#include <string.h> struct cmCTestSVN::Revision : public cmCTestVC::Revision { diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 81966dd..354e3c4 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -34,13 +34,13 @@ #include "cmSystemTools.h" #include "cmake.h" +#include <cstdio> +#include <cstdlib> +#include <cstring> #include <map> #include <memory> #include <ratio> #include <sstream> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> #include <utility> #ifdef _WIN32 diff --git a/Source/CTest/cmCTestSleepCommand.cxx b/Source/CTest/cmCTestSleepCommand.cxx index 2752cd3..bc4470c 100644 --- a/Source/CTest/cmCTestSleepCommand.cxx +++ b/Source/CTest/cmCTestSleepCommand.cxx @@ -4,7 +4,7 @@ #include "cmCTestScriptHandler.h" -#include <stdlib.h> +#include <cstdlib> class cmExecutionStatus; diff --git a/Source/CTest/cmCTestStartCommand.cxx b/Source/CTest/cmCTestStartCommand.cxx index e4a1844..844f2ca 100644 --- a/Source/CTest/cmCTestStartCommand.cxx +++ b/Source/CTest/cmCTestStartCommand.cxx @@ -8,8 +8,8 @@ #include "cmMakefile.h" #include "cmSystemTools.h" +#include <cstddef> #include <sstream> -#include <stddef.h> class cmExecutionStatus; diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index f215911..ca7fd2c 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -6,9 +6,9 @@ #include "cm_jsoncpp_reader.h" #include "cm_jsoncpp_value.h" #include <chrono> +#include <cstdio> +#include <cstdlib> #include <sstream> -#include <stdio.h> -#include <stdlib.h> #include "cmAlgorithms.h" #include "cmCTest.h" diff --git a/Source/CTest/cmCTestTestCommand.cxx b/Source/CTest/cmCTestTestCommand.cxx index 24de5b4..3a29ad3 100644 --- a/Source/CTest/cmCTestTestCommand.cxx +++ b/Source/CTest/cmCTestTestCommand.cxx @@ -10,8 +10,8 @@ #include "cmStringAlgorithms.h" #include <chrono> +#include <cstdlib> #include <sstream> -#include <stdlib.h> #include <vector> cmCTestTestCommand::cmCTestTestCommand() diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index f0c5939..10f9f9b 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -29,15 +29,15 @@ #include <cmsys/Directory.hxx> #include <cmsys/RegularExpression.hxx> #include <cstddef> +#include <cstdio> +#include <cstdlib> #include <cstring> +#include <ctime> #include <functional> #include <iomanip> #include <iterator> #include <set> #include <sstream> -#include <stdio.h> -#include <stdlib.h> -#include <time.h> #include <utility> namespace { diff --git a/Source/CTest/cmCTestVC.cxx b/Source/CTest/cmCTestVC.cxx index 773886d..00919e5 100644 --- a/Source/CTest/cmCTestVC.cxx +++ b/Source/CTest/cmCTestVC.cxx @@ -8,9 +8,9 @@ #include "cmXMLWriter.h" #include "cmsys/Process.h" +#include <cstdio> +#include <ctime> #include <sstream> -#include <stdio.h> -#include <time.h> #include <vector> cmCTestVC::cmCTestVC(cmCTest* ct, std::ostream& log) diff --git a/Source/CTest/cmParseBlanketJSCoverage.cxx b/Source/CTest/cmParseBlanketJSCoverage.cxx index 191100c..8c87700 100644 --- a/Source/CTest/cmParseBlanketJSCoverage.cxx +++ b/Source/CTest/cmParseBlanketJSCoverage.cxx @@ -7,8 +7,8 @@ #include "cmSystemTools.h" #include "cmsys/FStream.hxx" -#include <stdio.h> -#include <stdlib.h> +#include <cstdio> +#include <cstdlib> class cmParseBlanketJSCoverage::JSONParser { diff --git a/Source/CTest/cmParseCacheCoverage.cxx b/Source/CTest/cmParseCacheCoverage.cxx index b3ef7d3..da48610 100644 --- a/Source/CTest/cmParseCacheCoverage.cxx +++ b/Source/CTest/cmParseCacheCoverage.cxx @@ -7,9 +7,9 @@ #include "cmsys/Directory.hxx" #include "cmsys/FStream.hxx" +#include <cstdio> +#include <cstdlib> #include <map> -#include <stdio.h> -#include <stdlib.h> #include <utility> cmParseCacheCoverage::cmParseCacheCoverage( diff --git a/Source/CTest/cmParseCoberturaCoverage.cxx b/Source/CTest/cmParseCoberturaCoverage.cxx index e4f353b..7c00d00 100644 --- a/Source/CTest/cmParseCoberturaCoverage.cxx +++ b/Source/CTest/cmParseCoberturaCoverage.cxx @@ -7,8 +7,8 @@ #include "cmXMLParser.h" #include "cmsys/FStream.hxx" -#include <stdlib.h> -#include <string.h> +#include <cstdlib> +#include <cstring> class cmParseCoberturaCoverage::XMLParser : public cmXMLParser { diff --git a/Source/CTest/cmParseDelphiCoverage.cxx b/Source/CTest/cmParseDelphiCoverage.cxx index e8a184a..22c756c 100644 --- a/Source/CTest/cmParseDelphiCoverage.cxx +++ b/Source/CTest/cmParseDelphiCoverage.cxx @@ -6,8 +6,8 @@ #include "cmsys/FStream.hxx" #include "cmsys/Glob.hxx" -#include <stdio.h> -#include <stdlib.h> +#include <cstdio> +#include <cstdlib> class cmParseDelphiCoverage::HTMLParser { diff --git a/Source/CTest/cmParseGTMCoverage.cxx b/Source/CTest/cmParseGTMCoverage.cxx index 621ca79..1f2181b 100644 --- a/Source/CTest/cmParseGTMCoverage.cxx +++ b/Source/CTest/cmParseGTMCoverage.cxx @@ -7,9 +7,9 @@ #include "cmsys/Directory.hxx" #include "cmsys/FStream.hxx" +#include <cstdio> +#include <cstdlib> #include <map> -#include <stdio.h> -#include <stdlib.h> #include <vector> cmParseGTMCoverage::cmParseGTMCoverage(cmCTestCoverageHandlerContainer& cont, diff --git a/Source/CTest/cmParseJacocoCoverage.cxx b/Source/CTest/cmParseJacocoCoverage.cxx index 6a2d0cc..be6348a 100644 --- a/Source/CTest/cmParseJacocoCoverage.cxx +++ b/Source/CTest/cmParseJacocoCoverage.cxx @@ -9,8 +9,8 @@ #include "cmsys/Directory.hxx" #include "cmsys/FStream.hxx" #include "cmsys/Glob.hxx" -#include <stdlib.h> -#include <string.h> +#include <cstdlib> +#include <cstring> class cmParseJacocoCoverage::XMLParser : public cmXMLParser { diff --git a/Source/CTest/cmParsePHPCoverage.cxx b/Source/CTest/cmParsePHPCoverage.cxx index 870e222..8f0404d 100644 --- a/Source/CTest/cmParsePHPCoverage.cxx +++ b/Source/CTest/cmParsePHPCoverage.cxx @@ -7,8 +7,8 @@ #include "cmsys/Directory.hxx" #include "cmsys/FStream.hxx" -#include <stdlib.h> -#include <string.h> +#include <cstdlib> +#include <cstring> /* To setup coverage for php. diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx index 61d2ed3..9c63a59 100644 --- a/Source/CTest/cmProcess.cxx +++ b/Source/CTest/cmProcess.cxx @@ -10,8 +10,8 @@ #include "cmStringAlgorithms.h" #include "cmsys/Process.h" +#include <csignal> #include <iostream> -#include <signal.h> #include <string> #if defined(_WIN32) # include "cm_kwiml.h" diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx index ce32898..567b4f4 100644 --- a/Source/CursesDialog/ccmake.cxx +++ b/Source/CursesDialog/ccmake.cxx @@ -11,9 +11,9 @@ #include "cmake.h" #include "cmsys/Encoding.hxx" +#include <csignal> +#include <cstring> #include <iostream> -#include <signal.h> -#include <string.h> #include <string> #include <vector> diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx index f450a1c..47fe84c 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx @@ -15,7 +15,7 @@ #include "cmSystemTools.h" #include "cmake.h" -#include <assert.h> +#include <cassert> #include <vector> cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( diff --git a/Source/CursesDialog/cmCursesLongMessageForm.cxx b/Source/CursesDialog/cmCursesLongMessageForm.cxx index 95026d5..028cc26 100644 --- a/Source/CursesDialog/cmCursesLongMessageForm.cxx +++ b/Source/CursesDialog/cmCursesLongMessageForm.cxx @@ -7,8 +7,8 @@ #include "cmCursesStandardIncludes.h" #include "cmVersion.h" -#include <stdio.h> -#include <string.h> +#include <cstdio> +#include <cstring> inline int ctrl(int z) { diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 1b25716..5f8a19e 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -19,8 +19,8 @@ #include "cmake.h" #include <algorithm> -#include <stdio.h> -#include <string.h> +#include <cstdio> +#include <cstring> #include <utility> inline int ctrl(int z) diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h index d379975..f3194ab 100644 --- a/Source/CursesDialog/cmCursesMainForm.h +++ b/Source/CursesDialog/cmCursesMainForm.h @@ -9,7 +9,7 @@ #include "cmCursesStandardIncludes.h" #include "cmStateTypes.h" -#include <stddef.h> +#include <cstddef> #include <string> #include <vector> diff --git a/Source/CursesDialog/cmCursesStringWidget.cxx b/Source/CursesDialog/cmCursesStringWidget.cxx index 26724e7..3fc1858 100644 --- a/Source/CursesDialog/cmCursesStringWidget.cxx +++ b/Source/CursesDialog/cmCursesStringWidget.cxx @@ -8,8 +8,8 @@ #include "cmCursesWidget.h" #include "cmStateTypes.h" -#include <stdio.h> -#include <string.h> +#include <cstdio> +#include <cstring> inline int ctrl(int z) { diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx index 287a482..ad18cfe 100644 --- a/Source/QtDialog/CMakeSetup.cxx +++ b/Source/QtDialog/CMakeSetup.cxx @@ -229,8 +229,8 @@ int main(int argc, char** argv) #if defined(Q_OS_MAC) # include "cm_sys_stat.h" -# include <errno.h> -# include <string.h> +# include <cerrno> +# include <cstring> # include <unistd.h> static bool cmOSXInstall(std::string const& dir, std::string const& tool) { diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx index d2330e1..c91198c 100644 --- a/Source/cmAddCustomCommandCommand.cxx +++ b/Source/cmAddCustomCommandCommand.cxx @@ -4,7 +4,6 @@ #include <sstream> #include <unordered_set> -#include <utility> #include "cmCustomCommand.h" #include "cmCustomCommandLines.h" @@ -13,7 +12,6 @@ #include "cmMakefile.h" #include "cmMessageType.h" #include "cmPolicies.h" -#include "cmSourceFile.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cmTarget.h" @@ -51,7 +49,7 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args, bool uses_terminal = false; bool command_expand_lists = false; std::string implicit_depends_lang; - cmCustomCommand::ImplicitDependsList implicit_depends; + cmImplicitDependsList implicit_depends; // Accumulate one command line at a time. cmCustomCommandLine currentLine; @@ -248,6 +246,8 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args, // An implicit dependency starting point is also an // explicit dependency. std::string dep = copy; + // Upfront path conversion is correct because Genex + // are not supported. cmSystemTools::ConvertToUnixSlashes(dep); depends.push_back(dep); @@ -264,9 +264,7 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args, target = copy; break; case doing_depends: { - std::string dep = copy; - cmSystemTools::ConvertToUnixSlashes(dep); - depends.push_back(std::move(dep)); + depends.push_back(copy); } break; case doing_outputs: outputs.push_back(filename); @@ -317,14 +315,9 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args, // Check for an append request. if (append) { - // Lookup an existing command. - if (cmSourceFile* sf = mf.GetSourceFileWithOutput(output[0])) { - if (cmCustomCommand* cc = sf->GetCustomCommand()) { - cc->AppendCommands(commandLines); - cc->AppendDepends(depends); - cc->AppendImplicitDepends(implicit_depends); - return true; - } + if (mf.AppendCustomCommandToOutput(output[0], depends, implicit_depends, + commandLines)) { + return true; } // No command for this output exists. @@ -351,28 +344,10 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args, job_pool, command_expand_lists); } else if (target.empty()) { // Target is empty, use the output. - mf.AddCustomCommandToOutput(output, byproducts, depends, main_dependency, - commandLines, comment, working.c_str(), false, - escapeOldStyle, uses_terminal, - command_expand_lists, depfile, job_pool); - - // Add implicit dependency scanning requests if any were given. - if (!implicit_depends.empty()) { - bool okay = false; - if (cmSourceFile* sf = mf.GetSourceFileWithOutput(output[0])) { - if (cmCustomCommand* cc = sf->GetCustomCommand()) { - okay = true; - cc->SetImplicitDepends(implicit_depends); - } - } - if (!okay) { - std::ostringstream e; - e << "could not locate source file with a custom command producing \"" - << output[0] << "\" even though this command tried to create it!"; - status.SetError(e.str()); - return false; - } - } + mf.AddCustomCommandToOutput( + output, byproducts, depends, main_dependency, implicit_depends, + commandLines, comment, working.c_str(), false, escapeOldStyle, + uses_terminal, command_expand_lists, depfile, job_pool); } else if (!byproducts.empty()) { status.SetError("BYPRODUCTS may not be specified with SOURCE signatures"); return false; diff --git a/Source/cmAddSubDirectoryCommand.cxx b/Source/cmAddSubDirectoryCommand.cxx index 17bdc4a..c0be308 100644 --- a/Source/cmAddSubDirectoryCommand.cxx +++ b/Source/cmAddSubDirectoryCommand.cxx @@ -2,8 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmAddSubDirectoryCommand.h" +#include <cstring> #include <sstream> -#include <string.h> #include "cmExecutionStatus.h" #include "cmMakefile.h" diff --git a/Source/cmAffinity.cxx b/Source/cmAffinity.cxx index a6d89aa..33768a9 100644 --- a/Source/cmAffinity.cxx +++ b/Source/cmAffinity.cxx @@ -13,7 +13,7 @@ # include <pthread.h> # include <sched.h> // On some platforms CPU_ZERO needs memset but sched.h forgets string.h -# include <string.h> // IWYU pragma: keep +# include <cstring> // IWYU pragma: keep # if defined(__FreeBSD__) # include <pthread_np.h> # include <sys/cpuset.h> diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index a6c25e1..c45edaf 100644 --- a/Source/cmArchiveWrite.cxx +++ b/Source/cmArchiveWrite.cxx @@ -11,10 +11,10 @@ #include "cmsys/Encoding.hxx" #include "cmsys/FStream.hxx" +#include <cstring> +#include <ctime> #include <iostream> #include <sstream> -#include <string.h> -#include <time.h> #ifndef __LA_SSIZE_T # define __LA_SSIZE_T la_ssize_t diff --git a/Source/cmArchiveWrite.h b/Source/cmArchiveWrite.h index e90a603..e791761 100644 --- a/Source/cmArchiveWrite.h +++ b/Source/cmArchiveWrite.h @@ -5,8 +5,8 @@ #include "cmConfigure.h" // IWYU pragma: keep +#include <cstddef> #include <iosfwd> -#include <stddef.h> #include <string> #if defined(CMAKE_BOOTSTRAP) diff --git a/Source/cmAuxSourceDirectoryCommand.cxx b/Source/cmAuxSourceDirectoryCommand.cxx index 7bf19d0..111bc41 100644 --- a/Source/cmAuxSourceDirectoryCommand.cxx +++ b/Source/cmAuxSourceDirectoryCommand.cxx @@ -4,7 +4,7 @@ #include "cmsys/Directory.hxx" #include <algorithm> -#include <stddef.h> +#include <cstddef> #include <utility> #include "cmExecutionStatus.h" diff --git a/Source/cmBase32.h b/Source/cmBase32.h index c6758d4..d85198d 100644 --- a/Source/cmBase32.h +++ b/Source/cmBase32.h @@ -5,7 +5,7 @@ #include "cmConfigure.h" // IWYU pragma: keep -#include <stddef.h> +#include <cstddef> #include <string> /** \class cmBase32Encoder diff --git a/Source/cmCMakeHostSystemInformationCommand.cxx b/Source/cmCMakeHostSystemInformationCommand.cxx index 974b984..c3f6f40 100644 --- a/Source/cmCMakeHostSystemInformationCommand.cxx +++ b/Source/cmCMakeHostSystemInformationCommand.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCMakeHostSystemInformationCommand.h" -#include <stddef.h> +#include <cstddef> #include "cmExecutionStatus.h" #include "cmMakefile.h" diff --git a/Source/cmCMakeMinimumRequired.cxx b/Source/cmCMakeMinimumRequired.cxx index f93c266..1b03873 100644 --- a/Source/cmCMakeMinimumRequired.cxx +++ b/Source/cmCMakeMinimumRequired.cxx @@ -2,8 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCMakeMinimumRequired.h" +#include <cstdio> #include <sstream> -#include <stdio.h> #include "cmExecutionStatus.h" #include "cmMakefile.h" diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index f19d99b..9c7beca 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -14,7 +14,7 @@ #include "cmState.h" #include "cmVersion.h" -#include <stdlib.h> +#include <cstdlib> #ifdef __QNX__ # include <malloc.h> /* for malloc/free on QNX */ diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index cd54770..5e17ce8 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -11,16 +11,16 @@ #include "cmsys/Process.h" #include "cmsys/SystemInformation.hxx" #include <algorithm> +#include <cctype> #include <chrono> -#include <ctype.h> +#include <cstdio> +#include <cstdlib> +#include <cstring> +#include <ctime> #include <iostream> #include <map> #include <sstream> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> #include <string> -#include <time.h> #include <utility> #include <vector> #if defined(_WIN32) diff --git a/Source/cmCTest.h b/Source/cmCTest.h index 41dac85..9b11653 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -9,11 +9,11 @@ #include "cmProcessOutput.h" #include <chrono> +#include <ctime> #include <map> #include <memory> #include <sstream> #include <string> -#include <time.h> #include <vector> class cmCTestBuildHandler; diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index e28107f..0888a5e 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -5,9 +5,9 @@ #include "cmsys/FStream.hxx" #include "cmsys/Glob.hxx" #include <algorithm> +#include <cstdio> +#include <cstring> #include <sstream> -#include <stdio.h> -#include <string.h> #include <string> #include "cmGeneratedFileStream.h" diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx index b368b3a..e35fba5 100644 --- a/Source/cmCommandArgumentParserHelper.cxx +++ b/Source/cmCommandArgumentParserHelper.cxx @@ -8,9 +8,9 @@ #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +#include <cstring> #include <iostream> #include <sstream> -#include <string.h> int cmCommandArgument_yyparse(yyscan_t yyscanner); // diff --git a/Source/cmComputeComponentGraph.cxx b/Source/cmComputeComponentGraph.cxx index 113463f..655e4ac 100644 --- a/Source/cmComputeComponentGraph.cxx +++ b/Source/cmComputeComponentGraph.cxx @@ -4,7 +4,7 @@ #include <algorithm> -#include <assert.h> +#include <cassert> cmComputeComponentGraph::cmComputeComponentGraph(Graph const& input) : InputGraph(input) diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index 15b0087..2ee4ca2 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -16,11 +16,11 @@ #include "cmake.h" #include <algorithm> -#include <assert.h> +#include <cassert> +#include <cstdio> +#include <cstring> #include <iterator> #include <sstream> -#include <stdio.h> -#include <string.h> #include <utility> #include "cm_memory.hxx" diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index ade0f87..09dbbb1 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -20,9 +20,9 @@ #include "cmake.h" #include <algorithm> -#include <ctype.h> +#include <cctype> +#include <cstring> #include <sstream> -#include <string.h> #include <utility> //#define CM_COMPUTE_LINK_INFO_DEBUG diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx index de82782..239fcdf 100644 --- a/Source/cmComputeTargetDepends.cxx +++ b/Source/cmComputeTargetDepends.cxx @@ -20,9 +20,9 @@ #include "cmTargetDepend.h" #include "cmake.h" -#include <assert.h> +#include <cassert> +#include <cstdio> #include <sstream> -#include <stdio.h> #include <utility> /* diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx index 97469be..3ddd8ca 100644 --- a/Source/cmConditionEvaluator.cxx +++ b/Source/cmConditionEvaluator.cxx @@ -3,11 +3,11 @@ #include "cmConditionEvaluator.h" #include "cmsys/RegularExpression.hxx" +#include <cstdio> +#include <cstdlib> +#include <cstring> #include <functional> #include <sstream> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> #include <utility> #include "cmAlgorithms.h" diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 3687056..12050b3 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -3,10 +3,10 @@ #include "cmCoreTryCompile.h" #include "cmsys/Directory.hxx" +#include <cstdio> +#include <cstring> #include <set> #include <sstream> -#include <stdio.h> -#include <string.h> #include <utility> #include "cmExportTryCompileFileGenerator.h" diff --git a/Source/cmCryptoHash.h b/Source/cmCryptoHash.h index 681f5cc..145ff91 100644 --- a/Source/cmCryptoHash.h +++ b/Source/cmCryptoHash.h @@ -7,8 +7,8 @@ #include "cm_string_view.hxx" +#include <cstddef> #include <memory> -#include <stddef.h> #include <string> #include <vector> diff --git a/Source/cmCustomCommand.cxx b/Source/cmCustomCommand.cxx index 7402eeb..fc6718d 100644 --- a/Source/cmCustomCommand.cxx +++ b/Source/cmCustomCommand.cxx @@ -88,18 +88,17 @@ cmListFileBacktrace const& cmCustomCommand::GetBacktrace() const return this->Backtrace; } -cmCustomCommand::ImplicitDependsList const& -cmCustomCommand::GetImplicitDepends() const +cmImplicitDependsList const& cmCustomCommand::GetImplicitDepends() const { return this->ImplicitDepends; } -void cmCustomCommand::SetImplicitDepends(ImplicitDependsList const& l) +void cmCustomCommand::SetImplicitDepends(cmImplicitDependsList const& l) { this->ImplicitDepends = l; } -void cmCustomCommand::AppendImplicitDepends(ImplicitDependsList const& l) +void cmCustomCommand::AppendImplicitDepends(cmImplicitDependsList const& l) { cmAppend(this->ImplicitDepends, l); } diff --git a/Source/cmCustomCommand.h b/Source/cmCustomCommand.h index 102b178..bb5a0ed 100644 --- a/Source/cmCustomCommand.h +++ b/Source/cmCustomCommand.h @@ -14,6 +14,11 @@ class cmMakefile; +class cmImplicitDependsList + : public std::vector<std::pair<std::string, std::string>> +{ +}; + /** \class cmCustomCommand * \brief A class to encapsulate a custom command * @@ -68,13 +73,9 @@ public: /** Backtrace of the command that created this custom command. */ cmListFileBacktrace const& GetBacktrace() const; - using ImplicitDependsPair = std::pair<std::string, std::string>; - class ImplicitDependsList : public std::vector<ImplicitDependsPair> - { - }; - void SetImplicitDepends(ImplicitDependsList const&); - void AppendImplicitDepends(ImplicitDependsList const&); - ImplicitDependsList const& GetImplicitDepends() const; + void SetImplicitDepends(cmImplicitDependsList const&); + void AppendImplicitDepends(cmImplicitDependsList const&); + cmImplicitDependsList const& GetImplicitDepends() const; /** Set/Get whether this custom command should be given access to the real console (if possible). */ @@ -99,7 +100,7 @@ private: std::vector<std::string> Depends; cmCustomCommandLines CommandLines; cmListFileBacktrace Backtrace; - ImplicitDependsList ImplicitDepends; + cmImplicitDependsList ImplicitDepends; std::string Comment; std::string WorkingDirectory; std::string Depfile; diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx index 82cc037..2c0cbfd 100644 --- a/Source/cmCustomCommandGenerator.cxx +++ b/Source/cmCustomCommandGenerator.cxx @@ -13,8 +13,8 @@ #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +#include <cstddef> #include <memory> -#include <stddef.h> #include <utility> cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc, @@ -58,6 +58,7 @@ cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc, std::vector<std::string> result = cmExpandedList(cge->Evaluate(this->LG, this->Config)); for (std::string& it : result) { + cmSystemTools::ConvertToUnixSlashes(it); if (cmSystemTools::FileIsFullPath(it)) { it = cmSystemTools::CollapseFullPath(it); } diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx index e688890..2a117c1 100644 --- a/Source/cmDefinitions.cxx +++ b/Source/cmDefinitions.cxx @@ -4,7 +4,7 @@ #include "cm_string_view.hxx" -#include <assert.h> +#include <cassert> #include <functional> #include <unordered_set> #include <utility> diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index b657ff7..de919f1 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -3,10 +3,10 @@ #include "cmDependsFortran.h" #include "cmsys/FStream.hxx" -#include <assert.h> +#include <cassert> +#include <cstdlib> #include <iostream> #include <map> -#include <stdlib.h> #include <utility> #include "cmFortranParser.h" /* Interface to parser object. */ diff --git a/Source/cmDependsJavaParserHelper.cxx b/Source/cmDependsJavaParserHelper.cxx index 12d875d..63a96d0 100644 --- a/Source/cmDependsJavaParserHelper.cxx +++ b/Source/cmDependsJavaParserHelper.cxx @@ -7,10 +7,10 @@ #include "cm_string_view.hxx" #include "cmsys/FStream.hxx" +#include <cstdio> +#include <cstdlib> +#include <cstring> #include <iostream> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> #include <utility> int cmDependsJava_yyparse(yyscan_t yyscanner); diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx index d4628fa..d1f3a83 100644 --- a/Source/cmDocumentation.cxx +++ b/Source/cmDocumentation.cxx @@ -11,8 +11,8 @@ #include "cmsys/FStream.hxx" #include "cmsys/Glob.hxx" #include <algorithm> -#include <ctype.h> -#include <string.h> +#include <cctype> +#include <cstring> #include <utility> static const char* cmDocumentationStandardOptions[][2] = { diff --git a/Source/cmDocumentationFormatter.cxx b/Source/cmDocumentationFormatter.cxx index 3e7f989..be6756a 100644 --- a/Source/cmDocumentationFormatter.cxx +++ b/Source/cmDocumentationFormatter.cxx @@ -5,9 +5,9 @@ #include "cmDocumentationEntry.h" #include "cmDocumentationSection.h" +#include <cstring> #include <iomanip> #include <ostream> -#include <string.h> #include <string> #include <vector> diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx index 90250b6..12f996d 100644 --- a/Source/cmELF.cxx +++ b/Source/cmELF.cxx @@ -6,10 +6,10 @@ #include "cm_kwiml.h" #include "cm_memory.hxx" #include "cmsys/FStream.hxx" +#include <cstddef> #include <map> #include <memory> #include <sstream> -#include <stddef.h> #include <utility> #include <vector> diff --git a/Source/cmExecProgramCommand.cxx b/Source/cmExecProgramCommand.cxx index 74e9c55..207b6fd 100644 --- a/Source/cmExecProgramCommand.cxx +++ b/Source/cmExecProgramCommand.cxx @@ -3,7 +3,7 @@ #include "cmExecProgramCommand.h" #include "cmsys/Process.h" -#include <stdio.h> +#include <cstdio> #include "cmExecutionStatus.h" #include "cmMakefile.h" diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx index acf2a83..12364c8 100644 --- a/Source/cmExecuteProcessCommand.cxx +++ b/Source/cmExecuteProcessCommand.cxx @@ -6,10 +6,10 @@ #include "cmsys/Process.h" #include <algorithm> -#include <ctype.h> /* isspace */ +#include <cctype> /* isspace */ +#include <cstdio> #include <iostream> #include <memory> -#include <stdio.h> #include <vector> #include "cmAlgorithms.h" diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 9545814..e588f7b 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -19,9 +19,9 @@ #include "cmTargetExport.h" #include "cmsys/FStream.hxx" -#include <assert.h> +#include <cassert> +#include <cstring> #include <sstream> -#include <string.h> #include <utility> #include "cm_memory.hxx" diff --git a/Source/cmExportInstallAndroidMKGenerator.cxx b/Source/cmExportInstallAndroidMKGenerator.cxx index 1b536c9..207ea41 100644 --- a/Source/cmExportInstallAndroidMKGenerator.cxx +++ b/Source/cmExportInstallAndroidMKGenerator.cxx @@ -2,8 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmExportInstallAndroidMKGenerator.h" +#include <cstddef> #include <ostream> -#include <stddef.h> #include "cmExportBuildAndroidMKGenerator.h" #include "cmExportSet.h" diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx index 5a01eb2..e74ad0c 100644 --- a/Source/cmExtraCodeLiteGenerator.cxx +++ b/Source/cmExtraCodeLiteGenerator.cxx @@ -15,10 +15,10 @@ #include "cmake.h" #include "cmsys/SystemInformation.hxx" +#include <cstring> #include <map> #include <set> #include <sstream> -#include <string.h> #include <utility> cmExtraCodeLiteGenerator::cmExtraCodeLiteGenerator() diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index d398018..ca612b5 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -4,10 +4,10 @@ #include "cmsys/RegularExpression.hxx" #include <algorithm> -#include <assert.h> +#include <cassert> +#include <cstdio> #include <map> #include <sstream> -#include <stdio.h> #include <utility> #include "cmGeneratedFileStream.h" diff --git a/Source/cmExtraKateGenerator.cxx b/Source/cmExtraKateGenerator.cxx index 7ac73cf..b3d869e 100644 --- a/Source/cmExtraKateGenerator.cxx +++ b/Source/cmExtraKateGenerator.cxx @@ -12,9 +12,9 @@ #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +#include <cstring> #include <ostream> #include <set> -#include <string.h> #include <vector> cmExtraKateGenerator::cmExtraKateGenerator() = default; diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx index 6ad8609..f041821 100644 --- a/Source/cmExtraSublimeTextGenerator.cxx +++ b/Source/cmExtraSublimeTextGenerator.cxx @@ -3,9 +3,9 @@ #include "cmExtraSublimeTextGenerator.h" #include "cmsys/RegularExpression.hxx" +#include <cstring> #include <set> #include <sstream> -#include <string.h> #include <utility> #include "cmGeneratedFileStream.h" diff --git a/Source/cmFLTKWrapUICommand.cxx b/Source/cmFLTKWrapUICommand.cxx index 5094c3c..654714e 100644 --- a/Source/cmFLTKWrapUICommand.cxx +++ b/Source/cmFLTKWrapUICommand.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFLTKWrapUICommand.h" -#include <stddef.h> +#include <cstddef> #include "cmCustomCommandLines.h" #include "cmExecutionStatus.h" diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index e8a7810..33acd05 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -9,14 +9,14 @@ #include "cmsys/RegularExpression.hxx" #include <algorithm> -#include <assert.h> +#include <cassert> +#include <cctype> #include <cmath> -#include <ctype.h> +#include <cstdio> +#include <cstdlib> #include <map> #include <set> #include <sstream> -#include <stdio.h> -#include <stdlib.h> #include <utility> #include <vector> diff --git a/Source/cmFileCopier.cxx b/Source/cmFileCopier.cxx index e00e726..5b9c85a 100644 --- a/Source/cmFileCopier.cxx +++ b/Source/cmFileCopier.cxx @@ -16,8 +16,8 @@ # include "cmsys/FStream.hxx" #endif +#include <cstring> #include <sstream> -#include <string.h> using namespace cmFSPermissions; diff --git a/Source/cmFileLock.cxx b/Source/cmFileLock.cxx index 1e472da..d380798 100644 --- a/Source/cmFileLock.cxx +++ b/Source/cmFileLock.cxx @@ -3,7 +3,7 @@ #include "cmFileLock.h" #include "cmFileLockResult.h" -#include <assert.h> +#include <cassert> // Common implementation diff --git a/Source/cmFileLockPool.cxx b/Source/cmFileLockPool.cxx index d700a79..8db2db2 100644 --- a/Source/cmFileLockPool.cxx +++ b/Source/cmFileLockPool.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFileLockPool.h" -#include <assert.h> +#include <cassert> #include "cmAlgorithms.h" #include "cmFileLock.h" diff --git a/Source/cmFileLockResult.cxx b/Source/cmFileLockResult.cxx index c4779f0..9d5a6c6 100644 --- a/Source/cmFileLockResult.cxx +++ b/Source/cmFileLockResult.cxx @@ -2,8 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFileLockResult.h" -#include <errno.h> -#include <string.h> +#include <cerrno> +#include <cstring> #define WINMSG_BUF_LEN (1024) cmFileLockResult cmFileLockResult::MakeOk() diff --git a/Source/cmFileLockUnix.cxx b/Source/cmFileLockUnix.cxx index 1bf5013..7393823 100644 --- a/Source/cmFileLockUnix.cxx +++ b/Source/cmFileLockUnix.cxx @@ -3,9 +3,9 @@ #include "cmFileLock.h" #include "cmSystemTools.h" -#include <errno.h> // errno +#include <cerrno> // errno +#include <cstdio> // SEEK_SET #include <fcntl.h> -#include <stdio.h> // SEEK_SET #include <unistd.h> cmFileLock::cmFileLock() = default; diff --git a/Source/cmFileMonitor.cxx b/Source/cmFileMonitor.cxx index 56ee739..7fcced2 100644 --- a/Source/cmFileMonitor.cxx +++ b/Source/cmFileMonitor.cxx @@ -6,7 +6,7 @@ #include "cmsys/SystemTools.hxx" #include <cassert> -#include <stddef.h> +#include <cstddef> #include <unordered_map> #include <utility> diff --git a/Source/cmFilePathChecksum.h b/Source/cmFilePathChecksum.h index 30881ce..b7d5cd2 100644 --- a/Source/cmFilePathChecksum.h +++ b/Source/cmFilePathChecksum.h @@ -6,7 +6,7 @@ #include "cmConfigure.h" // IWYU pragma: keep #include <array> -#include <stddef.h> +#include <cstddef> #include <string> #include <utility> diff --git a/Source/cmFileTime.cxx b/Source/cmFileTime.cxx index 253457f..f92c0ff 100644 --- a/Source/cmFileTime.cxx +++ b/Source/cmFileTime.cxx @@ -2,8 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFileTime.h" +#include <ctime> #include <string> -#include <time.h> // Use a platform-specific API to get file times efficiently. #if !defined(_WIN32) || defined(__CYGWIN__) diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index e0daa4f..7d74118 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -2,10 +2,10 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFindBase.h" +#include <cstddef> #include <deque> #include <iostream> #include <map> -#include <stddef.h> #include "cmAlgorithms.h" #include "cmMakefile.h" diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx index 5606838..badec55 100644 --- a/Source/cmFindCommon.cxx +++ b/Source/cmFindCommon.cxx @@ -4,7 +4,7 @@ #include <algorithm> #include <array> -#include <string.h> +#include <cstring> #include <utility> #include "cmAlgorithms.h" diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx index 529e5c8..011e8aa 100644 --- a/Source/cmFindLibraryCommand.cxx +++ b/Source/cmFindLibraryCommand.cxx @@ -4,9 +4,9 @@ #include "cmsys/RegularExpression.hxx" #include <algorithm> +#include <cstdio> +#include <cstring> #include <set> -#include <stdio.h> -#include <string.h> #include <utility> #include "cmGlobalGenerator.h" diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 8f76030..8c8cf13 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -9,13 +9,13 @@ #include "cmsys/RegularExpression.hxx" #include "cmsys/String.h" #include <algorithm> -#include <assert.h> +#include <cassert> +#include <cstdio> +#include <cstring> #include <deque> #include <functional> #include <iterator> #include <sstream> -#include <stdio.h> -#include <string.h> #include <utility> #include "cm_memory.hxx" diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx index f0633aa..3c39c46 100644 --- a/Source/cmForEachCommand.cxx +++ b/Source/cmForEachCommand.cxx @@ -2,9 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmForEachCommand.h" +#include <cstdio> +#include <cstdlib> #include <sstream> -#include <stdio.h> -#include <stdlib.h> #include <utility> #include "cm_memory.hxx" diff --git a/Source/cmFortranParser.h b/Source/cmFortranParser.h index 825876c..6f97b42 100644 --- a/Source/cmFortranParser.h +++ b/Source/cmFortranParser.h @@ -12,7 +12,7 @@ # include <vector> #endif -#include <stddef.h> /* size_t */ +#include <cstddef> /* size_t */ /* Forward declare parser object type. */ using cmFortranParser = struct cmFortranParser_s; diff --git a/Source/cmFortranParserImpl.cxx b/Source/cmFortranParserImpl.cxx index ad377de..b983b4d 100644 --- a/Source/cmFortranParserImpl.cxx +++ b/Source/cmFortranParserImpl.cxx @@ -5,10 +5,10 @@ #include "cmStringAlgorithms.h" #include "cmSystemTools.h" -#include <assert.h> +#include <cassert> +#include <cstdio> #include <set> #include <stack> -#include <stdio.h> #include <string> #include <utility> #include <vector> diff --git a/Source/cmGeneratedFileStream.cxx b/Source/cmGeneratedFileStream.cxx index 491d96f..2af04b6 100644 --- a/Source/cmGeneratedFileStream.cxx +++ b/Source/cmGeneratedFileStream.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGeneratedFileStream.h" -#include <stdio.h> +#include <cstdio> #include "cmStringAlgorithms.h" #include "cmSystemTools.h" diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index 7bb6a63..f49ed2c 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -6,7 +6,6 @@ #include <memory> #include <utility> -#include "assert.h" #include "cmAlgorithms.h" #include "cmGeneratorExpressionContext.h" #include "cmGeneratorExpressionDAGChecker.h" @@ -15,6 +14,7 @@ #include "cmGeneratorExpressionParser.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +#include <cassert> cmGeneratorExpression::cmGeneratorExpression(cmListFileBacktrace backtrace) : Backtrace(std::move(backtrace)) diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx index dda0abc..76f2905 100644 --- a/Source/cmGeneratorExpressionDAGChecker.cxx +++ b/Source/cmGeneratorExpressionDAGChecker.cxx @@ -10,8 +10,8 @@ #include "cmStringAlgorithms.h" #include "cmake.h" +#include <cstring> #include <sstream> -#include <string.h> #include <utility> cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker( diff --git a/Source/cmGeneratorExpressionEvaluator.h b/Source/cmGeneratorExpressionEvaluator.h index 4530152..b10bb5b 100644 --- a/Source/cmGeneratorExpressionEvaluator.h +++ b/Source/cmGeneratorExpressionEvaluator.h @@ -5,7 +5,7 @@ #include "cmConfigure.h" // IWYU pragma: keep -#include <stddef.h> +#include <cstddef> #include <string> #include <utility> #include <vector> diff --git a/Source/cmGeneratorExpressionLexer.h b/Source/cmGeneratorExpressionLexer.h index bf24308..9e01948 100644 --- a/Source/cmGeneratorExpressionLexer.h +++ b/Source/cmGeneratorExpressionLexer.h @@ -5,7 +5,7 @@ #include "cmConfigure.h" // IWYU pragma: keep -#include <stddef.h> +#include <cstddef> #include <string> #include <vector> diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index 89b6c1c..6cb7a96 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -30,15 +30,15 @@ #include "cmsys/String.h" #include <algorithm> -#include <assert.h> -#include <errno.h> +#include <cassert> +#include <cerrno> +#include <cstdlib> +#include <cstring> #include <iterator> #include <map> #include <memory> #include <set> #include <sstream> -#include <stdlib.h> -#include <string.h> #include <utility> std::string cmGeneratorExpressionNode::EvaluateDependentExpression( diff --git a/Source/cmGeneratorExpressionParser.cxx b/Source/cmGeneratorExpressionParser.cxx index ba00b94..a0b685e 100644 --- a/Source/cmGeneratorExpressionParser.cxx +++ b/Source/cmGeneratorExpressionParser.cxx @@ -5,8 +5,8 @@ #include "cmAlgorithms.h" #include "cmGeneratorExpressionEvaluator.h" -#include <assert.h> -#include <stddef.h> +#include <cassert> +#include <cstddef> #include <utility> cmGeneratorExpressionParser::cmGeneratorExpressionParser( diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index b019e0b..2ca5706 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -4,16 +4,16 @@ #include "cmsys/RegularExpression.hxx" #include <algorithm> -#include <assert.h> +#include <cassert> +#include <cerrno> #include <cstddef> -#include <errno.h> +#include <cstdio> +#include <cstdlib> +#include <cstring> #include <iterator> #include <memory> #include <queue> #include <sstream> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> #include <unordered_set> #include <utility> diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 9eb2ecf..4207d65 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -10,9 +10,9 @@ #include "cmPolicies.h" #include "cmStateTypes.h" +#include <cstddef> #include <map> #include <set> -#include <stddef.h> #include <string> #include <unordered_map> #include <utility> diff --git a/Source/cmGetPipes.cxx b/Source/cmGetPipes.cxx index ad323f7..79f90fd 100644 --- a/Source/cmGetPipes.cxx +++ b/Source/cmGetPipes.cxx @@ -28,7 +28,7 @@ int cmGetPipes(int* fds) return 0; } #else -# include <errno.h> +# include <cerrno> # include <unistd.h> int cmGetPipes(int* fds) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 9479424..2273c50 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -5,13 +5,13 @@ #include "cmsys/Directory.hxx" #include "cmsys/FStream.hxx" #include <algorithm> -#include <assert.h> +#include <cassert> +#include <cstdio> +#include <cstdlib> #include <cstring> #include <initializer_list> #include <iterator> #include <sstream> -#include <stdio.h> -#include <stdlib.h> #if defined(_WIN32) && !defined(__CYGWIN__) # include <windows.h> diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx index 0b45f4b..236554f 100644 --- a/Source/cmGlobalGhsMultiGenerator.cxx +++ b/Source/cmGlobalGhsMultiGenerator.cxx @@ -18,9 +18,9 @@ #include "cmake.h" #include <algorithm> +#include <cstring> #include <map> #include <ostream> -#include <string.h> #include <utility> const char* cmGlobalGhsMultiGenerator::FILE_EXTENSION = ".gpj"; diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 062eccb..9ce6324 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -7,10 +7,10 @@ #include "cm_jsoncpp_writer.h" #include "cmsys/FStream.hxx" #include <algorithm> -#include <ctype.h> +#include <cctype> +#include <cstdio> #include <iterator> #include <sstream> -#include <stdio.h> #include "cm_memory.hxx" diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h index 264de54..6a39509 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.h +++ b/Source/cmGlobalUnixMakefileGenerator3.h @@ -5,10 +5,10 @@ #include "cmConfigure.h" // IWYU pragma: keep +#include <cstddef> #include <iosfwd> #include <map> #include <set> -#include <stddef.h> #include <string> #include <vector> diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 5e60108..18ff9ac 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGlobalVisualStudio8Generator.h" +#include "cmCustomCommand.h" #include "cmDocumentationEntry.h" #include "cmGeneratedFileStream.h" #include "cmGeneratorExpression.h" @@ -191,11 +192,13 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget() // file as the main dependency because it would get // overwritten by the CreateVCProjBuildRule. // (this could be avoided with per-target source files) - std::string no_main_dependency; std::vector<std::string> no_byproducts; + std::string no_main_dependency; + cmImplicitDependsList no_implicit_depends; if (cmSourceFile* file = mf->AddCustomCommandToOutput( - stamps, no_byproducts, listFiles, no_main_dependency, commandLines, - "Checking Build System", no_working_directory, true, false)) { + stamps, no_byproducts, listFiles, no_main_dependency, + no_implicit_depends, commandLines, "Checking Build System", + no_working_directory, true, false)) { gt->AddSource(file->ResolveFullPath()); } else { cmSystemTools::Error("Error adding rule for " + stamps[0]); diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index af5d279..de04e84 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -3,11 +3,11 @@ #include "cmGlobalXCodeGenerator.h" #include "cmsys/RegularExpression.hxx" -#include <assert.h> +#include <cassert> +#include <cstdio> +#include <cstring> #include <iomanip> #include <sstream> -#include <stdio.h> -#include <string.h> #include "cm_memory.hxx" diff --git a/Source/cmHexFileConverter.cxx b/Source/cmHexFileConverter.cxx index 190f2e3..2fa4b55 100644 --- a/Source/cmHexFileConverter.cxx +++ b/Source/cmHexFileConverter.cxx @@ -2,9 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmHexFileConverter.h" -#include <ctype.h> -#include <stdio.h> -#include <string.h> +#include <cctype> +#include <cstdio> +#include <cstring> #include "cmSystemTools.h" diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index 9a78c49..9b931f7 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -4,9 +4,9 @@ #include "cm_static_string_view.hxx" #include "cmsys/Glob.hxx" +#include <cstddef> #include <set> #include <sstream> -#include <stddef.h> #include <utility> #include "cmArgumentParser.h" diff --git a/Source/cmInstallExportAndroidMKGenerator.cxx b/Source/cmInstallExportAndroidMKGenerator.cxx deleted file mode 100644 index e8de029..0000000 --- a/Source/cmInstallExportAndroidMKGenerator.cxx +++ /dev/null @@ -1,134 +0,0 @@ - -/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying - file Copyright.txt or https://cmake.org/licensing for details. */ -#include "cmInstallExportAndroidMKGenerator.h" - -#include <stdio.h> - -#include "cmExportInstallFileGenerator.h" -#include "cmExportSet.h" -#include "cmGeneratedFileStream.h" -#include "cmGlobalGenerator.h" -#include "cmInstallFilesGenerator.h" -#include "cmInstallTargetGenerator.h" -#include "cmLocalGenerator.h" -#include "cmMakefile.h" -#include "cmMessageType.h" - -cmInstallExportAndroidMKGenerator::cmInstallExportAndroidMKGenerator( - cmExportSet* exportSet, const char* destination, - const char* file_permissions, std::vector<std::string> const& configurations, - const char* component, MessageLevel message, bool exclude_from_all, - const char* filename, const char* name_space, bool exportOld) - : cmInstallExportGenerator(exportSet, destination, file_permissions, - configurations, component, message, - exclude_from_all, filename, name_space, exportOld) -{ -} - -cmInstallExportAndroidMKGenerator::~cmInstallExportAndroidMKGenerator() -{ -} - -bool cmInstallExportAndroidMKGenerator::Compute(cmLocalGenerator* lg) -{ - this->LocalGenerator = lg; - this->ExportSet->Compute(lg); - return true; -} - -void cmInstallExportAndroidMKGenerator::GenerateScript(std::ostream& os) -{ - // Skip empty sets. - if (ExportSet->GetTargetExports()->empty()) { - std::ostringstream e; - e << "INSTALL(EXPORT) given unknown export \"" << ExportSet->GetName() - << "\""; - cmSystemTools::Error(e.str()); - return; - } - - // Create the temporary directory in which to store the files. - this->ComputeTempDir(); - cmSystemTools::MakeDirectory(this->TempDir.c_str()); - - // Construct a temporary location for the file. - this->MainImportFile = cmStrCat(this->TempDir, '/', this->FileName); - - // Generate the import file for this export set. - this->EFGen->SetExportFile(this->MainImportFile.c_str()); - this->EFGen->SetNamespace(this->Namespace); - this->EFGen->SetExportOld(this->ExportOld); - if (this->ConfigurationTypes->empty()) { - if (!this->ConfigurationName.empty()) { - this->EFGen->AddConfiguration(this->ConfigurationName); - } else { - this->EFGen->AddConfiguration(""); - } - } else { - for (std::string const& config : this->ConfigurationTypes) { - this->EFGen->AddConfiguration(config); - } - } - this->EFGen->GenerateImportFile(); - - // Perform the main install script generation. - this->cmInstallGenerator::GenerateScript(os); -} - -void cmInstallExportAndroidMKGenerator::GenerateScriptConfigs( - std::ostream& os, Indent const& indent) -{ - // Create the main install rules first. - this->cmInstallGenerator::GenerateScriptConfigs(os, indent); - - // Now create a configuration-specific install rule for the import - // file of each configuration. - std::vector<std::string> files; - for (auto const& pair : this->EFGen->GetConfigImportFiles()) { - files.push_back(pair.second); - std::string config_test = this->CreateConfigTest(pair.first); - os << indent << "if(" << config_test << ")\n"; - this->AddInstallRule(os, this->Destination, cmInstallType_FILES, files, - false, this->FilePermissions.c_str(), nullptr, - nullptr, nullptr, indent.Next()); - os << indent << "endif()\n"; - files.clear(); - } -} - -void cmInstallExportAndroidMKGenerator::GenerateScriptActions( - std::ostream& os, Indent const& indent) -{ - // Remove old per-configuration export files if the main changes. - std::string installedDir = - cmStrCat("$ENV{DESTDIR}", - this->ConvertToAbsoluteDestination(this->Destination), '/'); - std::string installedFile = cmStrCat(installedDir, this->FileName); - os << indent << "if(EXISTS \"" << installedFile << "\")\n"; - Indent indentN = indent.Next(); - Indent indentNN = indentN.Next(); - Indent indentNNN = indentNN.Next(); - /* clang-format off */ - os << indentN << "file(DIFFERENT EXPORT_FILE_CHANGED FILES\n" - << indentN << " \"" << installedFile << "\"\n" - << indentN << " \"" << this->MainImportFile << "\")\n"; - os << indentN << "if(EXPORT_FILE_CHANGED)\n"; - os << indentNN << "file(GLOB OLD_CONFIG_FILES \"" << installedDir - << this->EFGen->GetConfigImportFileGlob() << "\")\n"; - os << indentNN << "if(OLD_CONFIG_FILES)\n"; - os << indentNNN << "message(STATUS \"Old export file \\\"" << installedFile - << "\\\" will be replaced. Removing files [${OLD_CONFIG_FILES}].\")\n"; - os << indentNNN << "file(REMOVE ${OLD_CONFIG_FILES})\n"; - os << indentNN << "endif()\n"; - os << indentN << "endif()\n"; - os << indent << "endif()\n"; - /* clang-format on */ - - // Install the main export file. - std::vector<std::string> files; - files.push_back(this->MainImportFile); - this->AddInstallRule(os, this->Destination, cmInstallType_FILES, files, - false, this->FilePermissions.c_str(), nullptr, nullptr, - nullptr, indent); -} diff --git a/Source/cmInstallExportAndroidMKGenerator.h b/Source/cmInstallExportAndroidMKGenerator.h deleted file mode 100644 index a92ff27..0000000 --- a/Source/cmInstallExportAndroidMKGenerator.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying - file Copyright.txt or https://cmake.org/licensing for details. */ -#ifndef cmInstallExportAndroidMKGenerator_h -#define cmInstallExportAndroidMKGenerator_h - -#include "cmInstallExportGenerator.h" - -class cmExportInstallFileGenerator; -class cmInstallFilesGenerator; -class cmInstallTargetGenerator; -class cmExportSet; -class cmMakefile; - -/** \class cmInstallExportAndroidMKGenerator - * \brief Generate rules for creating an export files. - */ -class cmInstallExportAndroidMKGenerator : public cmInstallExportGenerator -{ -public: - cmInstallExportAndroidMKGenerator( - cmExportSet* exportSet, const char* dest, const char* file_permissions, - const std::vector<std::string>& configurations, const char* component, - MessageLevel message, bool exclude_from_all, const char* filename, - const char* name_space, bool exportOld); - ~cmInstallExportAndroidMKGenerator(); - - bool Compute(cmLocalGenerator* lg) override; - -protected: - virtual void GenerateScript(std::ostream& os); - virtual void GenerateScriptConfigs(std::ostream& os, Indent const& indent); - virtual void GenerateScriptActions(std::ostream& os, Indent const& indent); - void GenerateImportFile(cmExportSet const* exportSet); - void GenerateImportFile(const char* config, cmExportSet const* exportSet); -}; - -#endif diff --git a/Source/cmInstallExportGenerator.h b/Source/cmInstallExportGenerator.h index e680066..3b9268a 100644 --- a/Source/cmInstallExportGenerator.h +++ b/Source/cmInstallExportGenerator.h @@ -8,8 +8,8 @@ #include "cmInstallGenerator.h" #include "cmScriptGenerator.h" +#include <cstddef> #include <iosfwd> -#include <stddef.h> #include <string> #include <vector> diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index 7bbef35..90b0e1d 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmInstallTargetGenerator.h" -#include <assert.h> +#include <cassert> #include <map> #include <memory> #include <set> diff --git a/Source/cmLinkedTree.h b/Source/cmLinkedTree.h index 8b91162..c7453ea 100644 --- a/Source/cmLinkedTree.h +++ b/Source/cmLinkedTree.h @@ -5,7 +5,7 @@ #include "cmConfigure.h" // IWYU pragma: keep -#include <assert.h> +#include <cassert> #include <vector> /** diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index b35dc6f..9487e3b 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -4,15 +4,15 @@ #include "cmsys/RegularExpression.hxx" #include <algorithm> -#include <assert.h> +#include <cassert> #include <cstddef> +#include <cstdio> +#include <cstdlib> // required for atoi #include <functional> #include <iterator> #include <set> #include <sstream> #include <stdexcept> -#include <stdio.h> -#include <stdlib.h> // required for atoi #include <utility> #include <vector> diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx index 349d5e9..ab53df6 100644 --- a/Source/cmListFileCache.cxx +++ b/Source/cmListFileCache.cxx @@ -10,7 +10,7 @@ #include "cmStringAlgorithms.h" #include "cmSystemTools.h" -#include <assert.h> +#include <cassert> #include <memory> #include <sstream> #include <utility> diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h index 5de1a74..9cae827 100644 --- a/Source/cmListFileCache.h +++ b/Source/cmListFileCache.h @@ -5,9 +5,9 @@ #include "cmConfigure.h" // IWYU pragma: keep +#include <cstddef> #include <iosfwd> #include <memory> -#include <stddef.h> #include <string> #include <utility> #include <vector> diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx index f650eb1..66fdada 100644 --- a/Source/cmLoadCommandCommand.cxx +++ b/Source/cmLoadCommandCommand.cxx @@ -2,12 +2,12 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmLoadCommandCommand.h" -#include <signal.h> +#include <csignal> +#include <cstdio> +#include <cstdlib> +#include <cstring> #include <sstream> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> #include <utility> #include "cm_memory.hxx" diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 51eb78c..5bbb83c 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -38,15 +38,15 @@ #endif #include <algorithm> -#include <assert.h> +#include <cassert> +#include <cstdio> #include <cstdlib> +#include <cstring> #include <functional> #include <initializer_list> #include <iterator> #include <memory> #include <sstream> -#include <stdio.h> -#include <string.h> #include <unordered_set> #include <utility> #include <vector> diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index 1284d4d..0fe385f 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -3,11 +3,11 @@ #include "cmLocalNinjaGenerator.h" #include <algorithm> -#include <assert.h> +#include <cassert> +#include <cstdio> #include <iterator> #include <memory> #include <sstream> -#include <stdio.h> #include <utility> #include "cmCryptoHash.h" diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 8248608..f80695d 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -5,8 +5,8 @@ #include "cmsys/FStream.hxx" #include "cmsys/Terminal.h" #include <algorithm> +#include <cstdio> #include <sstream> -#include <stdio.h> #include <utility> #include "cm_memory.hxx" diff --git a/Source/cmLocale.h b/Source/cmLocale.h index 3580ec8..c44a42d 100644 --- a/Source/cmLocale.h +++ b/Source/cmLocale.h @@ -5,7 +5,7 @@ #include "cmConfigure.h" // IWYU pragma: keep -#include <locale.h> +#include <clocale> #include <string> class cmLocaleRAII diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index ef6a705..af97761 100644 --- a/Source/cmMacroCommand.cxx +++ b/Source/cmMacroCommand.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMacroCommand.h" -#include <stdio.h> +#include <cstdio> #include <utility> #include "cm_memory.hxx" diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 9e64f97..f35b999 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -5,16 +5,18 @@ #include "cmsys/FStream.hxx" #include "cmsys/RegularExpression.hxx" #include <algorithm> -#include <assert.h> +#include <cassert> +#include <cctype> +#include <cstdio> +#include <cstdlib> #include <cstring> -#include <ctype.h> #include <iterator> #include <memory> #include <sstream> -#include <stdio.h> -#include <stdlib.h> #include <utility> +#include "cm_memory.hxx" + #include "cmAlgorithms.h" #include "cmCommandArgumentParserHelper.h" #include "cmCustomCommand.h" @@ -945,6 +947,7 @@ cmSourceFile* cmMakefile::AddCustomCommandToOutput( const std::vector<std::string>& outputs, const std::vector<std::string>& byproducts, const std::vector<std::string>& depends, const std::string& main_dependency, + const cmImplicitDependsList& implicit_depends, const cmCustomCommandLines& commandLines, const char* comment, const char* workingDir, bool replace, bool escapeOldStyle, bool uses_terminal, bool command_expand_lists, const std::string& depfile, @@ -1025,15 +1028,16 @@ cmSourceFile* cmMakefile::AddCustomCommandToOutput( depends2.push_back(main_dependency); } - cmCustomCommand* cc = new cmCustomCommand( + std::unique_ptr<cmCustomCommand> cc = cm::make_unique<cmCustomCommand>( this, outputs, byproducts, depends2, commandLines, comment, workingDir); cc->SetEscapeOldStyle(escapeOldStyle); cc->SetEscapeAllowMakeVars(true); + cc->SetImplicitDepends(implicit_depends); cc->SetUsesTerminal(uses_terminal); cc->SetCommandExpandLists(command_expand_lists); cc->SetDepfile(depfile); cc->SetJobPool(job_pool); - file->SetCustomCommand(cc); + file->SetCustomCommand(std::move(cc)); this->UpdateOutputToSourceMap(outputs, file, false); this->UpdateOutputToSourceMap(byproducts, file, true); } @@ -1087,10 +1091,11 @@ cmSourceFile* cmMakefile::AddCustomCommandToOutput( std::vector<std::string> outputs; outputs.push_back(output); std::vector<std::string> no_byproducts; + cmImplicitDependsList no_implicit_depends; return this->AddCustomCommandToOutput( - outputs, no_byproducts, depends, main_dependency, commandLines, comment, - workingDir, replace, escapeOldStyle, uses_terminal, command_expand_lists, - depfile, job_pool); + outputs, no_byproducts, depends, main_dependency, no_implicit_depends, + commandLines, comment, workingDir, replace, escapeOldStyle, uses_terminal, + command_expand_lists, depfile, job_pool); } void cmMakefile::AddCustomCommandOldStyle( @@ -1151,6 +1156,23 @@ void cmMakefile::AddCustomCommandOldStyle( } } +bool cmMakefile::AppendCustomCommandToOutput( + const std::string& output, const std::vector<std::string>& depends, + const cmImplicitDependsList& implicit_depends, + const cmCustomCommandLines& commandLines) +{ + // Lookup an existing command. + if (cmSourceFile* sf = this->GetSourceFileWithOutput(output)) { + if (cmCustomCommand* cc = sf->GetCustomCommand()) { + cc->AppendCommands(commandLines); + cc->AppendDepends(depends); + cc->AppendImplicitDepends(implicit_depends); + return true; + } + } + return false; +} + cmTarget* cmMakefile::AddUtilityCommand( const std::string& utilityName, TargetOrigin origin, bool excludeFromAll, const std::vector<std::string>& depends, const char* workingDirectory, @@ -1224,11 +1246,12 @@ cmTarget* cmMakefile::AddUtilityCommand( std::vector<std::string> forced; forced.push_back(force); std::string no_main_dependency; + cmImplicitDependsList no_implicit_depends; bool no_replace = false; this->AddCustomCommandToOutput( - forced, byproducts, depends, no_main_dependency, commandLines, comment, - workingDirectory, no_replace, escapeOldStyle, uses_terminal, - command_expand_lists, /*depfile=*/"", job_pool); + forced, byproducts, depends, no_main_dependency, no_implicit_depends, + commandLines, comment, workingDirectory, no_replace, escapeOldStyle, + uses_terminal, command_expand_lists, /*depfile=*/"", job_pool); cmSourceFile* sf = target->AddSourceCMP0049(force); // The output is not actually created so mark it symbolic. diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index dc9318b..1944879 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -6,13 +6,13 @@ #include "cmConfigure.h" // IWYU pragma: keep #include "cmsys/RegularExpression.hxx" +#include <cstddef> #include <deque> #include <functional> #include <map> #include <memory> #include <set> #include <stack> -#include <stddef.h> #include <string> #include <unordered_map> #include <vector> @@ -42,6 +42,7 @@ class cmExportBuildFileGenerator; class cmFunctionBlocker; class cmGeneratorExpressionEvaluationFile; class cmGlobalGenerator; +class cmImplicitDependsList; class cmInstallGenerator; class cmMessenger; class cmSourceFile; @@ -184,6 +185,7 @@ public: const std::vector<std::string>& byproducts, const std::vector<std::string>& depends, const std::string& main_dependency, + const cmImplicitDependsList& implicit_depends, const cmCustomCommandLines& commandLines, const char* comment, const char* workingDir, bool replace = false, bool escapeOldStyle = true, bool uses_terminal = false, bool command_expand_lists = false, @@ -201,6 +203,10 @@ public: const std::string& source, const cmCustomCommandLines& commandLines, const char* comment); + bool AppendCustomCommandToOutput( + const std::string& output, const std::vector<std::string>& depends, + const cmImplicitDependsList& implicit_depends, + const cmCustomCommandLines& commandLines); /** * Add a define flag to the build. diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index 6d71a6d..b37a933 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -2,9 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMakefileLibraryTargetGenerator.h" +#include <cstddef> #include <set> #include <sstream> -#include <stddef.h> #include <utility> #include <vector> diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 1f6986b..477badd 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -2,9 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMakefileTargetGenerator.h" +#include <cstdio> #include <memory> #include <sstream> -#include <stdio.h> #include <utility> #include "cmAlgorithms.h" diff --git a/Source/cmMathCommand.cxx b/Source/cmMathCommand.cxx index 83c22aa..4ea3638 100644 --- a/Source/cmMathCommand.cxx +++ b/Source/cmMathCommand.cxx @@ -8,7 +8,7 @@ #include "cmMessageType.h" #include "cm_kwiml.h" -#include <stdio.h> +#include <cstdio> namespace { bool HandleExprCommand(std::vector<std::string> const& args, diff --git a/Source/cmNewLineStyle.cxx b/Source/cmNewLineStyle.cxx index 1ff741e..a121332 100644 --- a/Source/cmNewLineStyle.cxx +++ b/Source/cmNewLineStyle.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmNewLineStyle.h" -#include <stddef.h> +#include <cstddef> cmNewLineStyle::cmNewLineStyle() = default; diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index bc2506e..97742c1 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -3,7 +3,7 @@ #include "cmNinjaNormalTargetGenerator.h" #include <algorithm> -#include <assert.h> +#include <cassert> #include <iterator> #include <map> #include <set> diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 90b59e7..37e9e0e 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -5,7 +5,7 @@ #include "cm_jsoncpp_value.h" #include "cm_jsoncpp_writer.h" #include <algorithm> -#include <assert.h> +#include <cassert> #include <iterator> #include <map> #include <ostream> diff --git a/Source/cmOrderDirectories.cxx b/Source/cmOrderDirectories.cxx index c8cac3b..e1267ec 100644 --- a/Source/cmOrderDirectories.cxx +++ b/Source/cmOrderDirectories.cxx @@ -11,7 +11,7 @@ #include "cmake.h" #include <algorithm> -#include <assert.h> +#include <cassert> #include <functional> #include <sstream> #include <vector> diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx index bf516e3..e602a6d 100644 --- a/Source/cmOutputConverter.cxx +++ b/Source/cmOutputConverter.cxx @@ -3,8 +3,8 @@ #include "cmOutputConverter.h" #include <algorithm> -#include <assert.h> -#include <ctype.h> +#include <cassert> +#include <cctype> #include <set> #include <vector> diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx index 2f4e003..d9a433d 100644 --- a/Source/cmOutputRequiredFilesCommand.cxx +++ b/Source/cmOutputRequiredFilesCommand.cxx @@ -4,9 +4,9 @@ #include "cmsys/FStream.hxx" #include "cmsys/RegularExpression.hxx" +#include <cstdio> #include <map> #include <set> -#include <stdio.h> #include <utility> #include "cmAlgorithms.h" diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index d33cd32..c8bc56d 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -8,11 +8,11 @@ #include "cmSystemTools.h" #include "cmVersion.h" -#include <assert.h> -#include <ctype.h> +#include <cassert> +#include <cctype> +#include <cstdio> +#include <cstring> #include <sstream> -#include <stdio.h> -#include <string.h> #include <vector> static bool stringToId(const char* input, cmPolicies::PolicyID& pid) diff --git a/Source/cmProcessOutput.h b/Source/cmProcessOutput.h index 400354c..3db47a4 100644 --- a/Source/cmProcessOutput.h +++ b/Source/cmProcessOutput.h @@ -5,7 +5,7 @@ #include "cmConfigure.h" // IWYU pragma: keep -#include <stddef.h> +#include <cstddef> #include <string> #include <vector> diff --git a/Source/cmProcessTools.h b/Source/cmProcessTools.h index c205a8f..7d97e36 100644 --- a/Source/cmProcessTools.h +++ b/Source/cmProcessTools.h @@ -6,8 +6,8 @@ #include "cmConfigure.h" // IWYU pragma: keep #include "cmProcessOutput.h" +#include <cstring> #include <iosfwd> -#include <string.h> #include <string> /** \class cmProcessTools diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index d6916b0..54304c3 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -1166,10 +1166,12 @@ bool cmQtAutoGenInitializer::InitRccTargets() if (!this->Rcc.ExecutableTargetName.empty()) { ccDepends.push_back(this->Rcc.ExecutableTargetName); } - makefile->AddCustomCommandToOutput(ccOutput, ccByproducts, ccDepends, - /*main_dependency*/ std::string(), - commandLines, ccComment.c_str(), - this->Dir.Work.c_str()); + std::string no_main_dependency; + cmImplicitDependsList no_implicit_depends; + makefile->AddCustomCommandToOutput( + ccOutput, ccByproducts, ccDepends, no_main_dependency, + no_implicit_depends, commandLines, ccComment.c_str(), + this->Dir.Work.c_str()); } // Reconfigure when .qrc file changes makefile->AddCMakeDependFile(qrc.QrcFile); diff --git a/Source/cmRST.cxx b/Source/cmRST.cxx index aa394e5..edbb3de 100644 --- a/Source/cmRST.cxx +++ b/Source/cmRST.cxx @@ -10,9 +10,9 @@ #include "cmsys/FStream.hxx" #include <algorithm> -#include <ctype.h> +#include <cctype> +#include <cstddef> #include <iterator> -#include <stddef.h> #include <utility> cmRST::cmRST(std::ostream& os, std::string docroot) diff --git a/Source/cmRulePlaceholderExpander.cxx b/Source/cmRulePlaceholderExpander.cxx index 6c954a6..0a1d109 100644 --- a/Source/cmRulePlaceholderExpander.cxx +++ b/Source/cmRulePlaceholderExpander.cxx @@ -2,8 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmRulePlaceholderExpander.h" -#include <ctype.h> -#include <string.h> +#include <cctype> +#include <cstring> #include <utility> #include "cmOutputConverter.h" diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index 4deb94a..3344217 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -5,7 +5,6 @@ #include <array> #include <utility> -#include "cmCustomCommand.h" #include "cmGlobalGenerator.h" #include "cmMakefile.h" #include "cmMessageType.h" @@ -21,11 +20,6 @@ cmSourceFile::cmSourceFile(cmMakefile* mf, const std::string& name, { } -cmSourceFile::~cmSourceFile() -{ - this->SetCustomCommand(nullptr); -} - std::string const& cmSourceFile::GetExtension() const { return this->Extension; @@ -320,19 +314,12 @@ bool cmSourceFile::GetPropertyAsBool(const std::string& prop) const return cmIsOn(this->GetProperty(prop)); } -cmCustomCommand* cmSourceFile::GetCustomCommand() -{ - return this->CustomCommand; -} - -cmCustomCommand const* cmSourceFile::GetCustomCommand() const +cmCustomCommand* cmSourceFile::GetCustomCommand() const { - return this->CustomCommand; + return this->CustomCommand.get(); } -void cmSourceFile::SetCustomCommand(cmCustomCommand* cc) +void cmSourceFile::SetCustomCommand(std::unique_ptr<cmCustomCommand> cc) { - cmCustomCommand* old = this->CustomCommand; - this->CustomCommand = cc; - delete old; + this->CustomCommand = std::move(cc); } diff --git a/Source/cmSourceFile.h b/Source/cmSourceFile.h index 774cb28..dd36d45 100644 --- a/Source/cmSourceFile.h +++ b/Source/cmSourceFile.h @@ -5,14 +5,15 @@ #include "cmConfigure.h" // IWYU pragma: keep +#include "cmCustomCommand.h" #include "cmPropertyMap.h" #include "cmSourceFileLocation.h" #include "cmSourceFileLocationKind.h" +#include <memory> #include <string> #include <vector> -class cmCustomCommand; class cmMakefile; /** \class cmSourceFile @@ -32,17 +33,11 @@ public: cmMakefile* mf, const std::string& name, cmSourceFileLocationKind kind = cmSourceFileLocationKind::Ambiguous); - ~cmSourceFile(); - - cmSourceFile(const cmSourceFile&) = delete; - cmSourceFile& operator=(const cmSourceFile&) = delete; - /** - * Get the list of the custom commands for this source file + * Get the custom command for this source file */ - cmCustomCommand* GetCustomCommand(); - cmCustomCommand const* GetCustomCommand() const; - void SetCustomCommand(cmCustomCommand* cc); + cmCustomCommand* GetCustomCommand() const; + void SetCustomCommand(std::unique_ptr<cmCustomCommand> cc); //! Set/Get a property of this source file void SetProperty(const std::string& prop, const char* value); @@ -114,7 +109,7 @@ public: private: cmSourceFileLocation Location; cmPropertyMap Properties; - cmCustomCommand* CustomCommand = nullptr; + std::unique_ptr<cmCustomCommand> CustomCommand; std::string Extension; std::string Language; std::string FullPath; diff --git a/Source/cmSourceFileLocation.cxx b/Source/cmSourceFileLocation.cxx index 0e8d09d..bd75c14 100644 --- a/Source/cmSourceFileLocation.cxx +++ b/Source/cmSourceFileLocation.cxx @@ -9,7 +9,7 @@ #include "cmSystemTools.h" #include "cmake.h" -#include <assert.h> +#include <cassert> cmSourceFileLocation::cmSourceFileLocation() = default; diff --git a/Source/cmSourceGroupCommand.cxx b/Source/cmSourceGroupCommand.cxx index c239a1f..3be7fec 100644 --- a/Source/cmSourceGroupCommand.cxx +++ b/Source/cmSourceGroupCommand.cxx @@ -2,8 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmSourceGroupCommand.h" +#include <cstddef> #include <set> -#include <stddef.h> #include <utility> #include "cmAlgorithms.h" diff --git a/Source/cmState.cxx b/Source/cmState.cxx index 751eb77..7463bf8 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -4,9 +4,9 @@ #include "cmsys/RegularExpression.hxx" #include <algorithm> -#include <assert.h> -#include <stdlib.h> -#include <string.h> +#include <cassert> +#include <cstdlib> +#include <cstring> #include <utility> #include "cm_memory.hxx" diff --git a/Source/cmStateDirectory.cxx b/Source/cmStateDirectory.cxx index c14bf4a..ede00a0 100644 --- a/Source/cmStateDirectory.cxx +++ b/Source/cmStateDirectory.cxx @@ -4,7 +4,7 @@ #include "cmStateDirectory.h" #include <algorithm> -#include <assert.h> +#include <cassert> #include <iterator> #include <vector> diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx index b3e33ea..28d5170 100644 --- a/Source/cmStateSnapshot.cxx +++ b/Source/cmStateSnapshot.cxx @@ -4,7 +4,7 @@ #include "cmStateSnapshot.h" #include <algorithm> -#include <assert.h> +#include <cassert> #include <iterator> #include <string> diff --git a/Source/cmStringAlgorithms.cxx b/Source/cmStringAlgorithms.cxx index 131a01e..bb6dcd7 100644 --- a/Source/cmStringAlgorithms.cxx +++ b/Source/cmStringAlgorithms.cxx @@ -3,10 +3,10 @@ #include "cmStringAlgorithms.h" #include <algorithm> +#include <cerrno> #include <cstddef> #include <cstdio> -#include <errno.h> -#include <stdlib.h> +#include <cstdlib> std::string cmTrimWhitespace(cm::string_view str) { diff --git a/Source/cmStringAlgorithms.h b/Source/cmStringAlgorithms.h index 7f442d8..cb6b8ba 100644 --- a/Source/cmStringAlgorithms.h +++ b/Source/cmStringAlgorithms.h @@ -8,9 +8,9 @@ #include "cmRange.h" #include "cm_string_view.hxx" #include <cctype> +#include <cstring> #include <initializer_list> #include <sstream> -#include <string.h> #include <string> #include <utility> #include <vector> diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index 9a2de9d..ab670ca 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -6,12 +6,12 @@ #include "cmsys/RegularExpression.hxx" #include <algorithm> -#include <ctype.h> +#include <cctype> +#include <cstdio> +#include <cstdlib> #include <iterator> #include <memory> #include <sstream> -#include <stdio.h> -#include <stdlib.h> #include "cm_static_string_view.hxx" diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 86af683..62a8d8f 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -40,16 +40,16 @@ #include "cmsys/System.h" #include "cmsys/Terminal.h" #include <algorithm> -#include <assert.h> -#include <ctype.h> -#include <errno.h> +#include <cassert> +#include <cctype> +#include <cerrno> +#include <cstdio> +#include <cstdlib> +#include <cstring> +#include <ctime> #include <fcntl.h> #include <iostream> #include <sstream> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <time.h> #include <utility> #include <vector> diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 8ca4939..e7eef33 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -11,8 +11,8 @@ #include "cm_string_view.hxx" #include "cmsys/Process.h" #include "cmsys/SystemTools.hxx" // IWYU pragma: export +#include <cstddef> #include <functional> -#include <stddef.h> #include <string> #include <vector> diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 2420810..6637e32 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -4,12 +4,12 @@ #include "cmsys/RegularExpression.hxx" #include <algorithm> -#include <assert.h> +#include <cassert> +#include <cstring> #include <initializer_list> #include <iterator> #include <set> #include <sstream> -#include <string.h> #include <unordered_set> #include "cm_memory.hxx" diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index 4fbec90..237d90c 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -2,8 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTargetLinkLibrariesCommand.h" +#include <cstring> #include <sstream> -#include <string.h> #include "cmGeneratorExpression.h" #include "cmGlobalGenerator.h" diff --git a/Source/cmTimestamp.cxx b/Source/cmTimestamp.cxx index a9be729..390fd16 100644 --- a/Source/cmTimestamp.cxx +++ b/Source/cmTimestamp.cxx @@ -2,9 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTimestamp.h" +#include <cstdlib> #include <cstring> #include <sstream> -#include <stdlib.h> #include "cmStringAlgorithms.h" #include "cmSystemTools.h" diff --git a/Source/cmTimestamp.h b/Source/cmTimestamp.h index d5fbdfd..40338f8 100644 --- a/Source/cmTimestamp.h +++ b/Source/cmTimestamp.h @@ -5,8 +5,8 @@ #include "cmConfigure.h" // IWYU pragma: keep +#include <ctime> #include <string> -#include <time.h> /** \class cmTimestamp * \brief Utility class to generate string representation of a timestamp diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index 24d0f0f..73354ec 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -3,7 +3,7 @@ #include "cmTryRunCommand.h" #include "cmsys/FStream.hxx" -#include <stdio.h> +#include <cstdio> #include "cmDuration.h" #include "cmMakefile.h" diff --git a/Source/cmUVHandlePtr.cxx b/Source/cmUVHandlePtr.cxx index 97c27cb..23dabb7 100644 --- a/Source/cmUVHandlePtr.cxx +++ b/Source/cmUVHandlePtr.cxx @@ -3,9 +3,9 @@ #define cmUVHandlePtr_cxx #include "cmUVHandlePtr.h" -#include <assert.h> +#include <cassert> +#include <cstdlib> #include <mutex> -#include <stdlib.h> #include "cm_uv.h" diff --git a/Source/cmUVProcessChain.cxx b/Source/cmUVProcessChain.cxx index 56d6c09..2c37a64 100644 --- a/Source/cmUVProcessChain.cxx +++ b/Source/cmUVProcessChain.cxx @@ -7,7 +7,7 @@ #include "cmUVStreambuf.h" #include "cm_uv.h" -#include <assert.h> +#include <cassert> #include <istream> // IWYU pragma: keep #include <iterator> diff --git a/Source/cmUVProcessChain.h b/Source/cmUVProcessChain.h index 76a9c40..8a19bc3 100644 --- a/Source/cmUVProcessChain.h +++ b/Source/cmUVProcessChain.h @@ -7,13 +7,12 @@ #include <array> #include <cstddef> +#include <cstdint> #include <iosfwd> #include <memory> #include <string> #include <vector> -#include <stdint.h> - class cmUVProcessChain; class cmUVProcessChainBuilder diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx index 6b3590f..a43165c 100644 --- a/Source/cmUtilitySourceCommand.cxx +++ b/Source/cmUtilitySourceCommand.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmUtilitySourceCommand.h" -#include <string.h> +#include <cstring> #include "cmExecutionStatus.h" #include "cmMakefile.h" diff --git a/Source/cmUuid.cxx b/Source/cmUuid.cxx index 91c8af3..f0f2c51 100644 --- a/Source/cmUuid.cxx +++ b/Source/cmUuid.cxx @@ -5,7 +5,7 @@ #include "cmCryptoHash.h" #include <array> -#include <string.h> +#include <cstring> static const std::array<int, 5> kUuidGroups = { { 4, 2, 2, 2, 6 } }; diff --git a/Source/cmWorkerPool.cxx b/Source/cmWorkerPool.cxx index 2e4d00b..5ac81df 100644 --- a/Source/cmWorkerPool.cxx +++ b/Source/cmWorkerPool.cxx @@ -11,10 +11,10 @@ #include <algorithm> #include <array> #include <condition_variable> +#include <cstddef> #include <deque> #include <functional> #include <mutex> -#include <stddef.h> #include <thread> #include "cm_memory.hxx" diff --git a/Source/cmWorkerPool.h b/Source/cmWorkerPool.h index b541ce3..bf07299 100644 --- a/Source/cmWorkerPool.h +++ b/Source/cmWorkerPool.h @@ -5,7 +5,7 @@ #include "cmConfigure.h" // IWYU pragma: keep -#include <stdint.h> +#include <cstdint> #include <string> #include <utility> #include <vector> diff --git a/Source/cmXMLParser.cxx b/Source/cmXMLParser.cxx index 4c6c35a..1f69032 100644 --- a/Source/cmXMLParser.cxx +++ b/Source/cmXMLParser.cxx @@ -4,10 +4,10 @@ #include "cm_expat.h" #include "cmsys/FStream.hxx" -#include <ctype.h> +#include <cctype> +#include <cstring> #include <iostream> #include <sstream> -#include <string.h> cmXMLParser::cmXMLParser() { diff --git a/Source/cmXMLSafe.cxx b/Source/cmXMLSafe.cxx index d9bdc02..7c3b306 100644 --- a/Source/cmXMLSafe.cxx +++ b/Source/cmXMLSafe.cxx @@ -4,9 +4,9 @@ #include "cm_utf8.h" +#include <cstdio> +#include <cstring> #include <sstream> -#include <stdio.h> -#include <string.h> cmXMLSafe::cmXMLSafe(const char* s) : Data(s) diff --git a/Source/cm_codecvt.hxx b/Source/cm_codecvt.hxx index 2060584..b2cb9e6 100644 --- a/Source/cm_codecvt.hxx +++ b/Source/cm_codecvt.hxx @@ -5,8 +5,8 @@ #include "cmConfigure.h" // IWYU pragma: keep +#include <cwchar> #include <locale> -#include <wchar.h> class codecvt : public std::codecvt<char, char, mbstate_t> { diff --git a/Source/cm_get_date.h b/Source/cm_get_date.h index 6acf8de..38a690e 100644 --- a/Source/cm_get_date.h +++ b/Source/cm_get_date.h @@ -3,7 +3,7 @@ #ifndef cm_get_date_h #define cm_get_date_h -#include <time.h> +#include <time.h> /* NOLINT(modernize-deprecated-headers) */ #ifdef __cplusplus extern "C" { diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 170e09b..9a66805 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -105,12 +105,12 @@ #include "cmsys/Glob.hxx" #include "cmsys/RegularExpression.hxx" #include <algorithm> +#include <cstdio> +#include <cstdlib> #include <cstring> #include <initializer_list> #include <iostream> #include <sstream> -#include <stdio.h> -#include <stdlib.h> #include <utility> namespace { diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 2b51a2a..252c6d6 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -25,10 +25,10 @@ #endif #include <cassert> +#include <cctype> #include <climits> -#include <ctype.h> +#include <cstring> #include <iostream> -#include <string.h> #include <string> #include <vector> diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index ba2ba33..211fd4c 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -39,13 +39,13 @@ #include "cmsys/Process.h" #include "cmsys/Terminal.h" #include <array> +#include <cstdio> +#include <cstdlib> +#include <cstring> +#include <ctime> #include <iostream> #include <memory> #include <sstream> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <time.h> #include <utility> class cmConnection; diff --git a/Source/ctest.cxx b/Source/ctest.cxx index a69ba15..7be6746 100644 --- a/Source/ctest.cxx +++ b/Source/ctest.cxx @@ -11,8 +11,8 @@ #if defined(_WIN32) && !defined(CMAKE_BOOTSTRAP) # include "cmsys/ConsoleBuf.hxx" #endif +#include <cstring> #include <iostream> -#include <string.h> #include <string> #include <vector> |