summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Auxiliary/cmake-mode.el10
-rw-r--r--Auxiliary/vim/syntax/cmake.vim7
-rw-r--r--Help/command/FIND_XXX.txt2
-rw-r--r--Help/command/file.rst5
-rw-r--r--Help/command/find_package.rst6
-rw-r--r--Help/command/message.rst12
-rw-r--r--Help/manual/cmake-packages.7.rst9
-rw-r--r--Help/manual/cmake-variables.7.rst5
-rw-r--r--Help/manual/cmake.1.rst10
-rw-r--r--Help/manual/ctest.1.rst3
-rw-r--r--Help/prop_test/SKIP_RETURN_CODE.rst3
-rw-r--r--Help/prop_tgt/ENABLE_EXPORTS.rst23
-rw-r--r--Help/release/3.14.rst8
-rw-r--r--Help/release/dev/add_cmake_find_use_package_registry.rst11
-rw-r--r--Help/release/dev/cmake-e-true-false.rst5
-rw-r--r--Help/release/dev/ctest-build-makeprogram-propagated-configure-pass.rst6
-rw-r--r--Help/release/dev/eclipse-resource-encoding.rst6
-rw-r--r--Help/release/dev/global-controls-over-find-locations.rst20
-rw-r--r--Help/variable/CMAKE_ECLIPSE_RESOURCE_ENCODING.rst6
-rw-r--r--Help/variable/CMAKE_ENABLE_EXPORTS.rst22
-rw-r--r--Help/variable/CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY.rst15
-rw-r--r--Help/variable/CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH.rst17
-rw-r--r--Help/variable/CMAKE_FIND_USE_CMAKE_PATH.rst17
-rw-r--r--Help/variable/CMAKE_FIND_USE_CMAKE_SYSTEM_PATH.rst17
-rw-r--r--Help/variable/CMAKE_FIND_USE_PACAKGE_ROOT_PATH.rst11
-rw-r--r--Help/variable/CMAKE_FIND_USE_PACKAGE_REGISTRY.rst29
-rw-r--r--Help/variable/CMAKE_FIND_USE_PACKAGE_ROOT_PATH.rst18
-rw-r--r--Help/variable/CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH.rst17
-rw-r--r--Help/variable/CMAKE_Swift_NUM_THREADS.rst8
-rw-r--r--Modules/CMakeDetermineASMCompiler.cmake2
-rw-r--r--Modules/CMakeDetermineCSharpCompiler.cmake1
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake12
-rw-r--r--Modules/CMakeParseImplicitIncludeInfo.cmake4
-rw-r--r--Modules/CMakePlatformId.h.in3
-rw-r--r--Modules/CMakeSwiftInformation.cmake19
-rw-r--r--Modules/CheckCXXSymbolExists.cmake28
-rw-r--r--Modules/CheckSymbolExists.cmake11
-rw-r--r--Modules/Compiler/Cray-Fortran.cmake2
-rw-r--r--Modules/Compiler/IAR-ASM.cmake5
-rw-r--r--Modules/Compiler/IAR-C.cmake6
-rw-r--r--Modules/Compiler/IAR-CXX.cmake4
-rw-r--r--Modules/Compiler/IAR-DetermineCompiler.cmake2
-rw-r--r--Modules/Compiler/IAR-FindBinUtils.cmake3
-rw-r--r--Modules/Compiler/XL.cmake2
-rw-r--r--Modules/FindBISON.cmake12
-rw-r--r--Modules/FindBacktrace.cmake2
-rw-r--r--Modules/FindMatlab.cmake162
-rw-r--r--Modules/FindPNG.cmake4
-rw-r--r--Modules/FindProtobuf.cmake5
-rw-r--r--Modules/FindQt4.cmake2
-rw-r--r--Modules/Internal/CPack/CPack.DS_Store.in (renamed from Modules/CPack.DS_Store.in)bin12292 -> 12292 bytes
-rw-r--r--Modules/Internal/CPack/CPack.Description.plist.in (renamed from Modules/CPack.Description.plist.in)0
-rw-r--r--Modules/Internal/CPack/CPack.Info.plist.in (renamed from Modules/CPack.Info.plist.in)0
-rw-r--r--Modules/Internal/CPack/CPack.NuGet.nuspec.in (renamed from Modules/CPack.NuGet.nuspec.in)0
-rw-r--r--[-rwxr-xr-x]Modules/Internal/CPack/CPack.OSXScriptLauncher.in (renamed from Modules/CPack.OSXScriptLauncher.in)bin29592 -> 29592 bytes
-rw-r--r--Modules/Internal/CPack/CPack.OSXScriptLauncher.rsrc.in (renamed from Modules/CPack.OSXScriptLauncher.rsrc.in)bin362 -> 362 bytes
-rw-r--r--Modules/Internal/CPack/CPack.OSXX11.Info.plist.in (renamed from Modules/CPack.OSXX11.Info.plist.in)0
-rw-r--r--Modules/Internal/CPack/CPack.OSXX11.main.scpt.in (renamed from Modules/CPack.OSXX11.main.scpt.in)bin1870 -> 1870 bytes
-rwxr-xr-xModules/Internal/CPack/CPack.RuntimeScript.in (renamed from Modules/CPack.RuntimeScript.in)0
-rwxr-xr-xModules/Internal/CPack/CPack.STGZ_Header.sh.in (renamed from Modules/CPack.STGZ_Header.sh.in)5
-rw-r--r--Modules/Internal/CPack/CPack.VolumeIcon.icns.in (renamed from Modules/CPack.VolumeIcon.icns.in)bin45739 -> 45739 bytes
-rw-r--r--Modules/Internal/CPack/CPack.background.png.in (renamed from Modules/CPack.background.png.in)bin44108 -> 44108 bytes
-rw-r--r--Modules/Internal/CPack/CPack.distribution.dist.in (renamed from Modules/CPack.distribution.dist.in)0
-rw-r--r--Modules/Internal/CPack/CPackNuGet.cmake2
-rw-r--r--Modules/Internal/CPack/NSIS.InstallOptions.ini.in (renamed from Modules/NSIS.InstallOptions.ini.in)0
-rw-r--r--Modules/Internal/CPack/NSIS.template.in (renamed from Modules/NSIS.template.in)0
-rw-r--r--Modules/Internal/CPack/WIX.template.in (renamed from Modules/WIX.template.in)0
-rw-r--r--Modules/Platform/AIX-GNU.cmake15
-rw-r--r--Modules/Platform/AIX-XL.cmake31
-rwxr-xr-xModules/Platform/AIX/ExportImportList48
-rw-r--r--Modules/Platform/Apple-XL-C.cmake1
-rw-r--r--Modules/Platform/Apple-XL-CXX.cmake1
-rw-r--r--Modules/Platform/Linux-XL-C.cmake1
-rw-r--r--Modules/Platform/Linux-XL-CXX.cmake1
-rw-r--r--Modules/Platform/Linux-XL-Fortran.cmake1
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CPack/WiX/cmCPackWIXGenerator.cxx2
-rw-r--r--Source/CPack/cmCPackExternalGenerator.cxx3
-rw-r--r--Source/CPack/cmCPackGenerator.cxx2
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx5
-rw-r--r--Source/CPack/cmCPackOSXX11Generator.cxx2
-rw-r--r--Source/CPack/cmCPackPKGGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackSTGZGenerator.cxx3
-rw-r--r--Source/CPack/cpack.cxx11
-rw-r--r--Source/CTest/cmCTestBuildAndTestHandler.cxx5
-rw-r--r--Source/CTest/cmCTestBuildCommand.h11
-rw-r--r--Source/CTest/cmCTestConfigureCommand.h11
-rw-r--r--Source/CTest/cmCTestCoverageCommand.h11
-rw-r--r--Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h12
-rw-r--r--Source/CTest/cmCTestLaunch.cxx1
-rw-r--r--Source/CTest/cmCTestMemCheckCommand.h12
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx2
-rw-r--r--Source/CTest/cmCTestReadCustomFilesCommand.h11
-rw-r--r--Source/CTest/cmCTestRunScriptCommand.h11
-rw-r--r--Source/CTest/cmCTestRunTest.cxx24
-rw-r--r--Source/CTest/cmCTestRunTest.h3
-rw-r--r--Source/CTest/cmCTestScriptHandler.cxx42
-rw-r--r--Source/CTest/cmCTestScriptHandler.h4
-rw-r--r--Source/CTest/cmCTestSleepCommand.h11
-rw-r--r--Source/CTest/cmCTestStartCommand.h11
-rw-r--r--Source/CTest/cmCTestSubmitCommand.cxx10
-rw-r--r--Source/CTest/cmCTestSubmitCommand.h5
-rw-r--r--Source/CTest/cmCTestTestCommand.h11
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx58
-rw-r--r--Source/CTest/cmCTestUpdateCommand.h11
-rw-r--r--Source/CTest/cmCTestUpdateHandler.cxx4
-rw-r--r--Source/CTest/cmCTestUploadCommand.h11
-rw-r--r--Source/cmAddCompileDefinitionsCommand.h7
-rw-r--r--Source/cmAddCompileOptionsCommand.h7
-rw-r--r--Source/cmAddCustomCommandCommand.h7
-rw-r--r--Source/cmAddCustomTargetCommand.h7
-rw-r--r--Source/cmAddDefinitionsCommand.h7
-rw-r--r--Source/cmAddDependenciesCommand.h7
-rw-r--r--Source/cmAddExecutableCommand.h7
-rw-r--r--Source/cmAddLibraryCommand.h7
-rw-r--r--Source/cmAddLinkOptionsCommand.h7
-rw-r--r--Source/cmAddSubDirectoryCommand.h7
-rw-r--r--Source/cmAddTestCommand.h7
-rw-r--r--Source/cmAlgorithms.h15
-rw-r--r--Source/cmAuxSourceDirectoryCommand.h7
-rw-r--r--Source/cmBinUtilsLinuxELFLinker.cxx5
-rw-r--r--Source/cmBinUtilsLinuxELFLinker.h2
-rw-r--r--Source/cmBinUtilsMacOSMachOLinker.cxx2
-rw-r--r--Source/cmBinUtilsMacOSMachOLinker.h2
-rw-r--r--Source/cmBinUtilsWindowsPELinker.cxx5
-rw-r--r--Source/cmBinUtilsWindowsPELinker.h2
-rw-r--r--Source/cmBreakCommand.h7
-rw-r--r--Source/cmBuildCommand.h7
-rw-r--r--Source/cmBuildNameCommand.h7
-rw-r--r--Source/cmCMakeHostSystemInformationCommand.h6
-rw-r--r--Source/cmCMakeMinimumRequired.h7
-rw-r--r--Source/cmCMakePolicyCommand.h7
-rw-r--r--Source/cmCTest.cxx27
-rw-r--r--Source/cmCTest.h2
-rw-r--r--Source/cmCommand.h3
-rw-r--r--Source/cmCommands.cxx269
-rw-r--r--Source/cmComputeLinkDepends.cxx2
-rw-r--r--Source/cmComputeLinkDepends.h1
-rw-r--r--Source/cmComputeLinkInformation.cxx21
-rw-r--r--Source/cmComputeLinkInformation.h1
-rw-r--r--Source/cmConfigureFileCommand.h7
-rw-r--r--Source/cmContinueCommand.h7
-rw-r--r--Source/cmCreateTestSourceList.h7
-rw-r--r--Source/cmCryptoHash.cxx4
-rw-r--r--Source/cmCryptoHash.h2
-rw-r--r--Source/cmCustomCommandGenerator.cxx2
-rw-r--r--Source/cmDefinePropertyCommand.h7
-rw-r--r--Source/cmDisallowedCommand.h19
-rw-r--r--Source/cmELF.cxx2
-rw-r--r--Source/cmEnableLanguageCommand.h7
-rw-r--r--Source/cmEnableTestingCommand.h7
-rw-r--r--Source/cmExecProgramCommand.h7
-rw-r--r--Source/cmExecuteProcessCommand.cxx2
-rw-r--r--Source/cmExecuteProcessCommand.h7
-rw-r--r--Source/cmExportBuildAndroidMKGenerator.cxx1
-rw-r--r--Source/cmExportBuildFileGenerator.cxx9
-rw-r--r--Source/cmExportCommand.h7
-rw-r--r--Source/cmExportFileGenerator.cxx3
-rw-r--r--Source/cmExportLibraryDependenciesCommand.cxx4
-rw-r--r--Source/cmExportLibraryDependenciesCommand.h6
-rw-r--r--Source/cmExportTryCompileFileGenerator.cxx2
-rw-r--r--Source/cmExtraCodeLiteGenerator.cxx19
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx25
-rw-r--r--Source/cmExtraEclipseCDT4Generator.h3
-rw-r--r--Source/cmFLTKWrapUICommand.h7
-rw-r--r--Source/cmFileAPI.h2
-rw-r--r--Source/cmFileAPICodemodel.cxx18
-rw-r--r--Source/cmFileCommand.cxx3
-rw-r--r--Source/cmFileCommand.h7
-rw-r--r--Source/cmFileTimes.cxx3
-rw-r--r--Source/cmFileTimes.h2
-rw-r--r--Source/cmFindCommon.cxx2
-rw-r--r--Source/cmFindFileCommand.h10
-rw-r--r--Source/cmFindLibraryCommand.h9
-rw-r--r--Source/cmFindPackageCommand.cxx15
-rw-r--r--Source/cmFindPackageCommand.h9
-rw-r--r--Source/cmFindPathCommand.h9
-rw-r--r--Source/cmFindProgramCommand.h9
-rw-r--r--Source/cmForEachCommand.cxx4
-rw-r--r--Source/cmForEachCommand.h7
-rw-r--r--Source/cmFortranParserImpl.cxx8
-rw-r--r--Source/cmFunctionCommand.cxx13
-rw-r--r--Source/cmFunctionCommand.h7
-rw-r--r--Source/cmGeneratorExpression.cxx2
-rw-r--r--Source/cmGeneratorExpression.h2
-rw-r--r--Source/cmGeneratorExpressionEvaluationFile.cxx2
-rw-r--r--Source/cmGeneratorExpressionEvaluationFile.h2
-rw-r--r--Source/cmGeneratorExpressionNode.cxx2
-rw-r--r--Source/cmGeneratorTarget.cxx47
-rw-r--r--Source/cmGeneratorTarget.h9
-rw-r--r--Source/cmGetCMakePropertyCommand.h7
-rw-r--r--Source/cmGetDirectoryPropertyCommand.h7
-rw-r--r--Source/cmGetFilenameComponentCommand.h7
-rw-r--r--Source/cmGetPropertyCommand.h7
-rw-r--r--Source/cmGetSourceFilePropertyCommand.h7
-rw-r--r--Source/cmGetTargetPropertyCommand.h7
-rw-r--r--Source/cmGetTestPropertyCommand.h7
-rw-r--r--Source/cmGhsMultiTargetGenerator.cxx2
-rw-r--r--Source/cmGlobalGenerator.cxx1
-rw-r--r--Source/cmGlobalGenerator.h1
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx3
-rw-r--r--Source/cmGlobalNinjaGenerator.h2
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx2
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx3
-rw-r--r--Source/cmGraphVizWriter.cxx2
-rw-r--r--Source/cmIfCommand.cxx2
-rw-r--r--Source/cmIfCommand.h7
-rw-r--r--Source/cmIncludeCommand.h7
-rw-r--r--Source/cmIncludeDirectoryCommand.h7
-rw-r--r--Source/cmIncludeExternalMSProjectCommand.h7
-rw-r--r--Source/cmIncludeGuardCommand.h7
-rw-r--r--Source/cmIncludeRegularExpressionCommand.h7
-rw-r--r--Source/cmInstallCommand.cxx8
-rw-r--r--Source/cmInstallCommand.h7
-rw-r--r--Source/cmInstallDirectoryGenerator.cxx2
-rw-r--r--Source/cmInstallFilesCommand.h7
-rw-r--r--Source/cmInstallFilesGenerator.cxx2
-rw-r--r--Source/cmInstallProgramsCommand.h7
-rw-r--r--Source/cmInstallScriptGenerator.cxx1
-rw-r--r--Source/cmInstallTargetGenerator.cxx1
-rw-r--r--Source/cmInstallTargetsCommand.h7
-rw-r--r--Source/cmInstalledFile.h2
-rw-r--r--Source/cmJsonObjects.cxx5
-rw-r--r--Source/cmLinkDirectoriesCommand.h7
-rw-r--r--Source/cmLinkLibrariesCommand.h7
-rw-r--r--Source/cmLinkLineComputer.cxx3
-rw-r--r--Source/cmLinkLineDeviceComputer.cxx17
-rw-r--r--Source/cmListCommand.cxx3
-rw-r--r--Source/cmListCommand.h7
-rw-r--r--Source/cmListFileCache.h2
-rw-r--r--Source/cmLoadCacheCommand.h7
-rw-r--r--Source/cmLoadCommandCommand.cxx14
-rw-r--r--Source/cmLoadCommandCommand.h7
-rw-r--r--Source/cmLocalGenerator.cxx16
-rw-r--r--Source/cmLocalNinjaGenerator.cxx2
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx3
-rw-r--r--Source/cmLocalVisualStudioGenerator.h2
-rw-r--r--Source/cmMachO.cxx3
-rw-r--r--Source/cmMacroCommand.cxx12
-rw-r--r--Source/cmMacroCommand.h7
-rw-r--r--Source/cmMakeDirectoryCommand.h7
-rw-r--r--Source/cmMakefile.cxx9
-rw-r--r--Source/cmMakefile.h4
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx8
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx3
-rw-r--r--Source/cmMakefileTargetGenerator.cxx2
-rw-r--r--Source/cmMakefileTargetGenerator.h1
-rw-r--r--Source/cmMakefileUtilityTargetGenerator.cxx3
-rw-r--r--Source/cmMarkAsAdvancedCommand.h7
-rw-r--r--Source/cmMathCommand.h7
-rw-r--r--Source/cmMessageCommand.h7
-rw-r--r--Source/cmMessenger.cxx3
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx3
-rw-r--r--Source/cmNinjaTargetGenerator.cxx3
-rw-r--r--Source/cmNinjaTargetGenerator.h2
-rw-r--r--Source/cmOptionCommand.h7
-rw-r--r--Source/cmOrderDirectories.cxx1
-rw-r--r--Source/cmOutputRequiredFilesCommand.h7
-rw-r--r--Source/cmParseArgumentsCommand.h7
-rw-r--r--Source/cmProjectCommand.h7
-rw-r--r--Source/cmQTWrapCPPCommand.h7
-rw-r--r--Source/cmQTWrapUICommand.h7
-rw-r--r--Source/cmQtAutoGen.h2
-rw-r--r--Source/cmQtAutoGenGlobalInitializer.cxx4
-rw-r--r--Source/cmQtAutoGenGlobalInitializer.h2
-rw-r--r--Source/cmQtAutoGenInitializer.cxx33
-rw-r--r--Source/cmQtAutoGenInitializer.h2
-rw-r--r--Source/cmQtAutoGenerator.cxx3
-rw-r--r--Source/cmQtAutoMocUic.cxx3
-rw-r--r--Source/cmQtAutoMocUic.h2
-rw-r--r--Source/cmRemoveCommand.h7
-rw-r--r--Source/cmRemoveDefinitionsCommand.h7
-rw-r--r--Source/cmReturnCommand.h7
-rw-r--r--Source/cmRuntimeDependencyArchive.cxx3
-rw-r--r--Source/cmRuntimeDependencyArchive.h2
-rw-r--r--Source/cmSeparateArgumentsCommand.h7
-rw-r--r--Source/cmServer.cxx4
-rw-r--r--Source/cmServer.h2
-rw-r--r--Source/cmServerProtocol.cxx4
-rw-r--r--Source/cmSetCommand.h7
-rw-r--r--Source/cmSetDirectoryPropertiesCommand.h7
-rw-r--r--Source/cmSetPropertyCommand.h7
-rw-r--r--Source/cmSetSourceFilesPropertiesCommand.h7
-rw-r--r--Source/cmSetTargetPropertiesCommand.h7
-rw-r--r--Source/cmSetTestsPropertiesCommand.h7
-rw-r--r--Source/cmSiteNameCommand.h7
-rw-r--r--Source/cmSourceGroupCommand.h7
-rw-r--r--Source/cmState.cxx54
-rw-r--r--Source/cmState.h14
-rw-r--r--Source/cmStateDirectory.cxx1
-rw-r--r--Source/cmStringCommand.cxx1
-rw-r--r--Source/cmStringCommand.h7
-rw-r--r--Source/cmSubdirCommand.h7
-rw-r--r--Source/cmSubdirDependsCommand.h7
-rw-r--r--Source/cmSystemTools.cxx59
-rw-r--r--Source/cmSystemTools.h26
-rw-r--r--Source/cmTarget.cxx26
-rw-r--r--Source/cmTarget.h8
-rw-r--r--Source/cmTargetCompileDefinitionsCommand.h9
-rw-r--r--Source/cmTargetCompileFeaturesCommand.h9
-rw-r--r--Source/cmTargetCompileOptionsCommand.h9
-rw-r--r--Source/cmTargetIncludeDirectoriesCommand.h9
-rw-r--r--Source/cmTargetLinkDirectoriesCommand.h9
-rw-r--r--Source/cmTargetLinkLibrariesCommand.h7
-rw-r--r--Source/cmTargetLinkOptionsCommand.h9
-rw-r--r--Source/cmTargetSourcesCommand.h9
-rw-r--r--Source/cmTestGenerator.cxx2
-rw-r--r--Source/cmTryCompileCommand.h9
-rw-r--r--Source/cmTryRunCommand.h9
-rw-r--r--Source/cmUVProcessChain.cxx5
-rw-r--r--Source/cmUVProcessChain.h2
-rw-r--r--Source/cmUnexpectedCommand.h6
-rw-r--r--Source/cmUnsetCommand.h7
-rw-r--r--Source/cmUseMangledMesaCommand.h7
-rw-r--r--Source/cmUtilitySourceCommand.h7
-rw-r--r--Source/cmVariableRequiresCommand.h7
-rw-r--r--Source/cmVariableWatch.h2
-rw-r--r--Source/cmVariableWatchCommand.h7
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx5
-rw-r--r--Source/cmWhileCommand.cxx2
-rw-r--r--Source/cmWhileCommand.h7
-rw-r--r--Source/cmWorkerPool.cxx2
-rw-r--r--Source/cmWorkerPool.h5
-rw-r--r--Source/cmWriteFileCommand.h7
-rw-r--r--Source/cm_memory.hxx31
-rw-r--r--Source/cmake.cxx74
-rw-r--r--Source/cmake.h51
-rw-r--r--Source/cmakemain.cxx183
-rw-r--r--Source/cmcmd.cxx14
-rw-r--r--Tests/Assembler/CMakeLists.txt5
-rw-r--r--Tests/CMakeLib/testUVProcessChain.cxx3
-rw-r--r--Tests/CMakeLists.txt154
-rw-r--r--Tests/CMakeServerLib/testServerBuffering.cpp2
-rw-r--r--Tests/CPackComponentsDEB/CMakeLists.txt8
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake32
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake36
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake14
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake16
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake8
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake12
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake19
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake12
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake6
-rw-r--r--Tests/FindPackageTest/CMakeLists.txt67
-rw-r--r--Tests/FindPackageTest/PreferConfigRecurse/ACMEConfig.cmake1
-rw-r--r--Tests/FindPackageTest/PreferConfigRecurse/FindACME.cmake1
-rw-r--r--Tests/FindProtobuf/Test/CMakeLists.txt4
-rw-r--r--Tests/PDBDirectoryAndName/CMakeLists.txt4
-rw-r--r--Tests/Preprocess/CMakeLists.txt7
-rw-r--r--Tests/QtAutogen/SameName/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/SameName/main.cpp4
-rw-r--r--Tests/QtAutogen/SameName/object.hh13
-rw-r--r--Tests/QtAutogen/SameName/object_upper_ext.H13
-rw-r--r--Tests/RunCMake/CMP0065/RunCMakeTest.cmake7
-rw-r--r--Tests/RunCMake/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailRegexFound-check.cmake13
-rw-r--r--Tests/RunCMake/CTestCommandLine/RequiredRegexFound-check.cmake13
-rw-r--r--Tests/RunCMake/CTestCommandLine/RequiredRegexNotFound-check.cmake16
-rw-r--r--Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake42
-rw-r--r--Tests/RunCMake/CommandLine/E_false-extraargs-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_false-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/ParseImplicitIncludeInfo.cmake1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Cray-9.0-hlist-ad.input54
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Cray-9.0-hlist-ad.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Cray-9.0-hlist-ad.input54
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Cray-9.0-hlist-ad.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-9.0-hlist-ad.input53
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-9.0-hlist-ad.output1
-rw-r--r--Tests/RunCMake/RunCMake.cmake2
-rw-r--r--Tests/RunCMake/VS10Project/VsPackageReferences-check.cmake2
-rw-r--r--Tests/RunCMake/find_program/RelAndAbsPath.cmake2
-rw-r--r--Utilities/IWYU/mapping.imp13
-rw-r--r--Utilities/Release/create-cmake-release.cmake44
-rw-r--r--Utilities/cmcurl/CMake/CurlSymbolHiding.cmake2
375 files changed, 2592 insertions, 1361 deletions
diff --git a/Auxiliary/cmake-mode.el b/Auxiliary/cmake-mode.el
index e4fa6c1..caaf0d5 100644
--- a/Auxiliary/cmake-mode.el
+++ b/Auxiliary/cmake-mode.el
@@ -1,5 +1,7 @@
;;; cmake-mode.el --- major-mode for editing CMake sources
+;; Package-Requires: ((emacs "24.1"))
+
; Distributed under the OSI-approved BSD 3-Clause License. See accompanying
; file Copyright.txt or https://cmake.org/licensing for details.
@@ -224,17 +226,11 @@ the indentation. Otherwise it retains the same position on the line"
;;
(defvar cmake-mode-hook nil)
-;------------------------------------------------------------------------------
-
-;; For compatibility with Emacs < 24
-(defalias 'cmake--parent-mode
- (if (fboundp 'prog-mode) 'prog-mode 'fundamental-mode))
-
;;------------------------------------------------------------------------------
;; Mode definition.
;;
;;;###autoload
-(define-derived-mode cmake-mode cmake--parent-mode "CMake"
+(define-derived-mode cmake-mode prog-mode "CMake"
"Major mode for editing CMake source files."
; Setup font-lock mode.
diff --git a/Auxiliary/vim/syntax/cmake.vim b/Auxiliary/vim/syntax/cmake.vim
index cd8385b..8712fb9 100644
--- a/Auxiliary/vim/syntax/cmake.vim
+++ b/Auxiliary/vim/syntax/cmake.vim
@@ -915,6 +915,7 @@ syn keyword cmakeVariable contained
\ CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES
\ CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT
\ CMAKE_ECLIPSE_MAKE_ARGUMENTS
+ \ CMAKE_ECLIPSE_RESOURCE_ENCODING
\ CMAKE_ECLIPSE_VERSION
\ CMAKE_EDIT_COMMAND
\ CMAKE_ENABLE_EXPORTS
@@ -948,6 +949,12 @@ syn keyword cmakeVariable contained
\ CMAKE_FIND_ROOT_PATH_MODE_LIBRARY
\ CMAKE_FIND_ROOT_PATH_MODE_PACKAGE
\ CMAKE_FIND_ROOT_PATH_MODE_PROGRAM
+ \ CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH
+ \ CMAKE_FIND_USE_CMAKE_PATH
+ \ CMAKE_FIND_USE_CMAKE_SYSTEM_PATH
+ \ CMAKE_FIND_USE_PACKAGE_REGISTRY
+ \ CMAKE_FIND_USE_PACKAGE_ROOT_PATH
+ \ CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH
\ CMAKE_FOLDER
\ CMAKE_FRAMEWORK
\ CMAKE_FRAMEWORK_PATH
diff --git a/Help/command/FIND_XXX.txt b/Help/command/FIND_XXX.txt
index fc8c55e..40f1c1a 100644
--- a/Help/command/FIND_XXX.txt
+++ b/Help/command/FIND_XXX.txt
@@ -90,7 +90,7 @@ If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows:
i.e. ``<CurrentPackage>_ROOT``, ``ENV{<CurrentPackage>_ROOT}``,
``<ParentPackage>_ROOT``, ``ENV{<ParentPackage>_ROOT}``, etc.
This can be skipped if ``NO_PACKAGE_ROOT_PATH`` is passed or by setting
- the :variable:`CMAKE_FIND_USE_PACAKGE_ROOT_PATH` to ``FALSE``.
+ the :variable:`CMAKE_FIND_USE_PACKAGE_ROOT_PATH` to ``FALSE``.
See policy :policy:`CMP0074`.
* |FIND_PACKAGE_ROOT_PREFIX_PATH_XXX|
diff --git a/Help/command/file.rst b/Help/command/file.rst
index 666a532..c06451a 100644
--- a/Help/command/file.rst
+++ b/Help/command/file.rst
@@ -503,6 +503,11 @@ regular expressions, but much simpler. If ``RELATIVE`` flag is
specified, the results will be returned as relative paths to the given
path. The results will be ordered lexicographically.
+On Windows and macOS, globbing is case-insensitive even if the underlying
+filesystem is case-sensitive (both filenames and globbing expressions are
+converted to lowercase before matching). On other platforms, globbing is
+case-sensitive.
+
If the ``CONFIGURE_DEPENDS`` flag is specified, CMake will add logic
to the main build system check target to rerun the flagged ``GLOB`` commands
at build time. If any of the outputs change, CMake will regenerate the build
diff --git a/Help/command/find_package.rst b/Help/command/find_package.rst
index e5e5b2c..6e1d232 100644
--- a/Help/command/find_package.rst
+++ b/Help/command/find_package.rst
@@ -330,8 +330,10 @@ enabled.
6. Search paths stored in the CMake :ref:`User Package Registry`.
This can be skipped if ``NO_CMAKE_PACKAGE_REGISTRY`` is passed or by
- setting the :variable:`CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY`
- to ``TRUE``.
+ setting the variable :variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY`
+ to ``FALSE`` or the deprecated variable
+ :variable:`CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY` to ``TRUE``.
+
See the :manual:`cmake-packages(7)` manual for details on the user
package registry.
diff --git a/Help/command/message.rst b/Help/command/message.rst
index 3f9216a..5dca6b4 100644
--- a/Help/command/message.rst
+++ b/Help/command/message.rst
@@ -53,12 +53,12 @@ The optional ``<mode>`` keyword determines the type of message:
The CMake command-line tool displays ``STATUS`` to ``TRACE`` messages on stdout
with the message preceded by two hyphens and a space. All other message types
-are sent to stderr and are not prefixed with hyphens. The CMake GUI displays
-all messages in its log area. The interactive dialogs (:manual:`ccmake(1)`
-and :manual:`cmake-gui(1)`) show ``STATUS`` to ``TRACE`` messages one at a
-time on a status line and other messages in interactive pop-up boxes.
-The ``--loglevel`` command-line option to each of these tools can be used to
-control which messages will be shown.
+are sent to stderr and are not prefixed with hyphens. The
+:manual:`CMake GUI <cmake-gui(1)>` displays all messages in its log area.
+The :manual:`curses interface <ccmake(1)>` shows ``STATUS`` to ``TRACE``
+messages one at a time on a status line and other messages in an
+interactive pop-up box. The ``--loglevel`` command-line option to each of
+these tools can be used to control which messages will be shown.
CMake Warning and Error message text displays using a simple markup
language. Non-indented text is formatted in line-wrapped paragraphs
diff --git a/Help/manual/cmake-packages.7.rst b/Help/manual/cmake-packages.7.rst
index f5aa42d..4b2934a 100644
--- a/Help/manual/cmake-packages.7.rst
+++ b/Help/manual/cmake-packages.7.rst
@@ -654,8 +654,13 @@ allows one to disable them using the following variables:
:command:`export(PACKAGE)` populates the user package registry unless
the :variable:`CMAKE_EXPORT_NO_PACKAGE_REGISTRY` variable explicitly
disables it.
-* :variable:`CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY` disables the
- User Package Registry in all the :command:`find_package` calls.
+* :variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY` disables the
+ User Package Registry in all the :command:`find_package` calls when
+ set to ``FALSE``.
+* Deprecated :variable:`CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY` disables the
+ User Package Registry in all the :command:`find_package` calls when set
+ to ``TRUE``. This variable is ignored when
+ :variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY` has been set.
* :variable:`CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY` disables
the System Package Registry in all the :command:`find_package` calls.
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index cc6a7d2..e0ce6f7 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -98,6 +98,7 @@ Variables that Provide Information
/variable/CMAKE_STATIC_LIBRARY_PREFIX
/variable/CMAKE_STATIC_LIBRARY_SUFFIX
/variable/CMAKE_Swift_MODULE_DIRECTORY
+ /variable/CMAKE_Swift_NUM_THREADS
/variable/CMAKE_TOOLCHAIN_FILE
/variable/CMAKE_TWEAK_VERSION
/variable/CMAKE_VERBOSE_MAKEFILE
@@ -157,6 +158,7 @@ Variables that Change Behavior
/variable/CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES
/variable/CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT
/variable/CMAKE_ECLIPSE_MAKE_ARGUMENTS
+ /variable/CMAKE_ECLIPSE_RESOURCE_ENCODING
/variable/CMAKE_ECLIPSE_VERSION
/variable/CMAKE_ERROR_DEPRECATED
/variable/CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION
@@ -183,7 +185,8 @@ Variables that Change Behavior
/variable/CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH
/variable/CMAKE_FIND_USE_CMAKE_PATH
/variable/CMAKE_FIND_USE_CMAKE_SYSTEM_PATH
- /variable/CMAKE_FIND_USE_PACAKGE_ROOT_PATH
+ /variable/CMAKE_FIND_USE_PACKAGE_REGISTRY
+ /variable/CMAKE_FIND_USE_PACKAGE_ROOT_PATH
/variable/CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH
/variable/CMAKE_FRAMEWORK_PATH
/variable/CMAKE_IGNORE_PATH
diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst
index ff099dd..68d88e7 100644
--- a/Help/manual/cmake.1.rst
+++ b/Help/manual/cmake.1.rst
@@ -200,11 +200,11 @@ Options
from the top of a binary tree for a CMake project it will dump
additional information such as the cache, log files etc.
-``--loglevel=<error|warning|notice|status|verbose|debug|trace>``
+``--loglevel=<ERROR|WARNING|NOTICE|STATUS|VERBOSE|DEBUG|TRACE>``
Set the log level.
The :command:`message` command will only output messages of the specified
- log level or higher. The default log level is ``status``.
+ log level or higher. The default log level is ``STATUS``.
``--debug-trycompile``
Do not delete the :command:`try_compile` build tree.
@@ -604,6 +604,12 @@ Available commands are:
.. note::
Path to where ``<new>`` symbolic link will be created has to exist beforehand.
+``true``
+ Do nothing, with an exit code of 0.
+
+``false``
+ Do nothing, with an exit code of 1.
+
Windows-specific Command-Line Tools
-----------------------------------
diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst
index 5773176..c6b1425 100644
--- a/Help/manual/ctest.1.rst
+++ b/Help/manual/ctest.1.rst
@@ -443,7 +443,8 @@ this mode include:
Specify the name of the project to build.
``--build-makeprogram``
- Override the make program chosen by CTest with a given one.
+ Specify the explicit make program to be used by CMake when configuring and
+ building the project. Only applicable for Make and Ninja based generators.
``--build-noclean``
Skip the make clean step.
diff --git a/Help/prop_test/SKIP_RETURN_CODE.rst b/Help/prop_test/SKIP_RETURN_CODE.rst
index a05fbf3..3d48c2f 100644
--- a/Help/prop_test/SKIP_RETURN_CODE.rst
+++ b/Help/prop_test/SKIP_RETURN_CODE.rst
@@ -6,4 +6,5 @@ Return code to mark a test as skipped.
Sometimes only a test itself can determine if all requirements for the
test are met. If such a situation should not be considered a hard failure
a return code of the process can be specified that will mark the test as
-``Not Run`` if it is encountered.
+``Not Run`` if it is encountered. Valid values are in the range of
+0 to 255, inclusive.
diff --git a/Help/prop_tgt/ENABLE_EXPORTS.rst b/Help/prop_tgt/ENABLE_EXPORTS.rst
index 581c2b9..daef78b 100644
--- a/Help/prop_tgt/ENABLE_EXPORTS.rst
+++ b/Help/prop_tgt/ENABLE_EXPORTS.rst
@@ -7,16 +7,21 @@ Normally an executable does not export any symbols because it is the
final program. It is possible for an executable to export symbols to
be used by loadable modules. When this property is set to true CMake
will allow other targets to "link" to the executable with the
-:command:`TARGET_LINK_LIBRARIES` command. On all platforms a target-level
+:command:`target_link_libraries` command. On all platforms a target-level
dependency on the executable is created for targets that link to it.
-For DLL platforms an import library will be created for the exported
-symbols and then used for linking. All Windows-based systems
-including Cygwin are DLL platforms. For non-DLL platforms that
-require all symbols to be resolved at link time, such as macOS, the
-module will "link" to the executable using a flag like
-``-bundle_loader``. For other non-DLL platforms the link rule is simply
-ignored since the dynamic loader will automatically bind symbols when
-the module is loaded.
+Handling of the executable on the link lines of the loadable modules
+varies by platform:
+
+* On Windows-based systems (including Cygwin) an "import library" is
+ created along with the executable to list the exported symbols.
+ Loadable modules link to the import library to get the symbols.
+
+* On macOS, loadable modules link to the executable itself using the
+ ``-bundle_loader`` flag.
+
+* On other platforms, loadable modules are simply linked without
+ referencing the executable since the dynamic loader will
+ automatically bind symbols when the module is loaded.
This property is initialized by the value of the variable
:variable:`CMAKE_ENABLE_EXPORTS` if it is set when a target is created.
diff --git a/Help/release/3.14.rst b/Help/release/3.14.rst
index e3a7a62..229d8dc 100644
--- a/Help/release/3.14.rst
+++ b/Help/release/3.14.rst
@@ -420,3 +420,11 @@ Changes made since CMake 3.14.0 include the following.
from explicit use via :command:`include_directories` and
:command:`target_include_directories` as they were in CMake 3.14.0
through 3.14.4.
+
+3.14.6
+------
+
+* In CMake 3.14.0 through 3.14.5, the :module:`FindBISON` module
+ policy :policy:`CMP0088` ``NEW`` behavior accidentally interpreted
+ a relative path to the ``.y`` input as relative to the build tree
+ directory instead of the source tree directory. This has been fixed.
diff --git a/Help/release/dev/add_cmake_find_use_package_registry.rst b/Help/release/dev/add_cmake_find_use_package_registry.rst
new file mode 100644
index 0000000..1b02bad
--- /dev/null
+++ b/Help/release/dev/add_cmake_find_use_package_registry.rst
@@ -0,0 +1,11 @@
+add_cmake_find_use_package_registry
+-----------------------------------
+
+* The :command:`find_package` command has learned to check the following
+ variables to control searching
+
+ * :variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY` - Controls the searching the
+ cmake user registry.
+
+* The :variable:`CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY` has been deprecated.
+ Instead use :variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY`
diff --git a/Help/release/dev/cmake-e-true-false.rst b/Help/release/dev/cmake-e-true-false.rst
new file mode 100644
index 0000000..173fabd
--- /dev/null
+++ b/Help/release/dev/cmake-e-true-false.rst
@@ -0,0 +1,5 @@
+cmake-e-true-false
+------------------
+
+* :manual:`cmake(1)` ``-E`` now supports ``true`` and ``false`` commands, which
+ do nothing while returning exit codes of 0 and 1, respectively.
diff --git a/Help/release/dev/ctest-build-makeprogram-propagated-configure-pass.rst b/Help/release/dev/ctest-build-makeprogram-propagated-configure-pass.rst
new file mode 100644
index 0000000..4465de8
--- /dev/null
+++ b/Help/release/dev/ctest-build-makeprogram-propagated-configure-pass.rst
@@ -0,0 +1,6 @@
+ctest-build-makeprogram-propagated-configure-pass
+-------------------------------------------------
+
+* :manual:`ctest(1)` ``--build-makeprogram`` now specifies the make program
+ used when configuring a project with the Ninja and Makefiles generators
+ in addition to building it.
diff --git a/Help/release/dev/eclipse-resource-encoding.rst b/Help/release/dev/eclipse-resource-encoding.rst
new file mode 100644
index 0000000..6ceca0c
--- /dev/null
+++ b/Help/release/dev/eclipse-resource-encoding.rst
@@ -0,0 +1,6 @@
+eclipse-resource-encoding
+-------------------------
+
+* The :generator:`Eclipse CDT4` extra generator gained a new
+ :variable:`CMAKE_ECLIPSE_RESOURCE_ENCODING` option to specify
+ the resource encoding.
diff --git a/Help/release/dev/global-controls-over-find-locations.rst b/Help/release/dev/global-controls-over-find-locations.rst
index d915fbb..79bc869 100644
--- a/Help/release/dev/global-controls-over-find-locations.rst
+++ b/Help/release/dev/global-controls-over-find-locations.rst
@@ -4,8 +4,18 @@ global-controls-over-find-locations
* The :command:`find_file`, :command:`find_library`, :command:`find_path`,
and :command:`find_program` commands have learned to check the following
variables to control searching
- * :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH` - Controls the searching the cmake-specific environment variables.
- * :variable:`CMAKE_FIND_USE_CMAKE_PATH` - Controls the searching the cmake-specific cache variables.
- * :variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH` - Controls the searching cmake platform specific variables.
- * :variable:`CMAKE_FIND_USE_PACAKGE_ROOT_PATH` - Controls the searching of :variable:`<PackageName>_ROOT` variables.
- * :variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH` - Controls the searching the standard system environment variables.
+
+ * :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH` - Controls the searching
+ the cmake-specific environment variables.
+
+ * :variable:`CMAKE_FIND_USE_CMAKE_PATH` - Controls the searching the
+ cmake-specific cache variables.
+
+ * :variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH` - Controls the searching
+ cmake platform specific variables.
+
+ * :variable:`CMAKE_FIND_USE_PACKAGE_ROOT_PATH` - Controls the searching of
+ :variable:`<PackageName>_ROOT` variables.
+
+ * :variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH` - Controls the searching
+ the standard system environment variables.
diff --git a/Help/variable/CMAKE_ECLIPSE_RESOURCE_ENCODING.rst b/Help/variable/CMAKE_ECLIPSE_RESOURCE_ENCODING.rst
new file mode 100644
index 0000000..314efe5
--- /dev/null
+++ b/Help/variable/CMAKE_ECLIPSE_RESOURCE_ENCODING.rst
@@ -0,0 +1,6 @@
+CMAKE_ECLIPSE_RESOURCE_ENCODING
+-------------------------------
+
+This cache variable tells the :generator:`Eclipse CDT4` project generator
+to set the resource encoding to the given value in generated project files.
+If no value is given, no encoding will be set.
diff --git a/Help/variable/CMAKE_ENABLE_EXPORTS.rst b/Help/variable/CMAKE_ENABLE_EXPORTS.rst
index 7ec4d63..8848da1 100644
--- a/Help/variable/CMAKE_ENABLE_EXPORTS.rst
+++ b/Help/variable/CMAKE_ENABLE_EXPORTS.rst
@@ -1,22 +1,8 @@
CMAKE_ENABLE_EXPORTS
--------------------
-Specify whether an executable exports symbols for loadable modules.
+Specify whether executables export symbols for loadable modules.
-Normally an executable does not export any symbols because it is the
-final program. It is possible for an executable to export symbols to
-be used by loadable modules. When this property is set to true CMake
-will allow other targets to ``link`` to the executable with the
-:command:`TARGET_LINK_LIBRARIES` command. On all platforms a target-level
-dependency on the executable is created for targets that link to it.
-For DLL platforms an import library will be created for the exported
-symbols and then used for linking. All Windows-based systems
-including Cygwin are DLL platforms. For non-DLL platforms that
-require all symbols to be resolved at link time, such as macOS, the
-module will ``link`` to the executable using a flag like
-``-bundle_loader``. For other non-DLL platforms the link rule is simply
-ignored since the dynamic loader will automatically bind symbols when
-the module is loaded.
-
-This variable is used to initialize the target property
-:prop_tgt:`ENABLE_EXPORTS` for executable targets.
+This variable is used to initialize the :prop_tgt:`ENABLE_EXPORTS` target
+property for executable targets when they are created by calls to the
+:command:`add_executable` command. See the property documentation for details.
diff --git a/Help/variable/CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY.rst b/Help/variable/CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY.rst
index 9058471..ffb8a2c 100644
--- a/Help/variable/CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY.rst
+++ b/Help/variable/CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY.rst
@@ -1,12 +1,23 @@
CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY
--------------------------------------
-Skip :ref:`User Package Registry` in :command:`find_package` calls.
+.. deprecated:: 3.16
+
+ Use the :variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY` variable instead.
+
+By default this variable is not set. If neither
+:variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY` nor
+``CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY`` is set, then
+:command:`find_package()` will use the `User Package Registry` unless the
+`NO_CMAKE_PACKAGE_REGISTRY` option is provided.
+
+``CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY`` is ignored if
+:variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY` is set.
In some cases, for example to locate only system wide installations, it
is not desirable to use the :ref:`User Package Registry` when searching
for packages. If the :variable:`CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY`
-variable is enabled, all the :command:`find_package` commands will skip
+variable is ``TRUE``, all the :command:`find_package` commands will skip
the :ref:`User Package Registry` as if they were called with the
``NO_CMAKE_PACKAGE_REGISTRY`` argument.
diff --git a/Help/variable/CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH.rst b/Help/variable/CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH.rst
index 3db510f..33514a0 100644
--- a/Help/variable/CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH.rst
+++ b/Help/variable/CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH.rst
@@ -1,11 +1,18 @@
CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH
-------------------------------------
-Controls the searching the cmake-specific environment variables by the :command:`find_program`,
-:command:`find_library`, :command:`find_file`, :command:`find_package`, and :command:`find_path`.
+Controls the searching the cmake-specific environment variables by the
+:command:`find_program`, :command:`find_library`, :command:`find_file`,
+and :command:`find_path` commands.
This is useful in cross-compiling environments.
-By default this this is set to ``TRUE``.
+By default this variable is not set, which is equivalent to it having
+a value of ``TRUE``. Explicit options given to the :command:`find_program`,
+:command:`find_library`, :command:`find_file`, and :command:`find_path`
+commands take precedence over this variable.
-See also the :variable:`CMAKE_FIND_USE_CMAKE_PATH`, :variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`,
-:variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH`, and :variable:`CMAKE_FIND_USE_PACAKGE_ROOT_PATH` variables.
+See also the :variable:`CMAKE_FIND_USE_CMAKE_PATH`,
+:variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`,
+:variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH`,
+:variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY`,
+and :variable:`CMAKE_FIND_USE_PACKAGE_ROOT_PATH` variables.
diff --git a/Help/variable/CMAKE_FIND_USE_CMAKE_PATH.rst b/Help/variable/CMAKE_FIND_USE_CMAKE_PATH.rst
index 86a6186..cefc645 100644
--- a/Help/variable/CMAKE_FIND_USE_CMAKE_PATH.rst
+++ b/Help/variable/CMAKE_FIND_USE_CMAKE_PATH.rst
@@ -1,11 +1,18 @@
CMAKE_FIND_USE_CMAKE_PATH
-------------------------
-Controls the searching the cmake-specific cache variables by the :command:`find_program`,
-:command:`find_library`, :command:`find_file`, :command:`find_package`, and :command:`find_path`.
+Controls the searching the cmake-specific cache variables by the
+:command:`find_program`, :command:`find_library`, :command:`find_file`,
+and :command:`find_path` commands.
This is useful in cross-compiling environments.
-By default this this is set to ``TRUE``.
+By default this variable is not set, which is equivalent to it having
+a value of ``TRUE``. Explicit options given to the :command:`find_program`,
+:command:`find_library`, :command:`find_file`, and :command:`find_path`
+commands take precedence over this variable.
-See also the :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH`, :variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`,
-:variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH`, and :variable:`CMAKE_FIND_USE_PACAKGE_ROOT_PATH` variables.
+See also the :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH`,
+:variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`,
+:variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH`,
+:variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY`,
+and :variable:`CMAKE_FIND_USE_PACKAGE_ROOT_PATH` variables.
diff --git a/Help/variable/CMAKE_FIND_USE_CMAKE_SYSTEM_PATH.rst b/Help/variable/CMAKE_FIND_USE_CMAKE_SYSTEM_PATH.rst
index b4171c0..2aa544d 100644
--- a/Help/variable/CMAKE_FIND_USE_CMAKE_SYSTEM_PATH.rst
+++ b/Help/variable/CMAKE_FIND_USE_CMAKE_SYSTEM_PATH.rst
@@ -1,11 +1,18 @@
CMAKE_FIND_USE_CMAKE_SYSTEM_PATH
--------------------------------
-Controls the searching cmake platform specific variables by the :command:`find_program`,
-:command:`find_library`, :command:`find_file`, :command:`find_package`, and :command:`find_path`.
+Controls the searching cmake platform specific variables by the
+:command:`find_program`, :command:`find_library`, :command:`find_file`,
+and :command:`find_path` commands.
This is useful in cross-compiling environments.
-By default this this is set to ``TRUE``.
+By default this variable is not set, which is equivalent to it having
+a value of ``TRUE``. Explicit options given to the :command:`find_program`,
+:command:`find_library`, :command:`find_file`, and :command:`find_path`
+commands take precedence over this variable.
-See also the :variable:`CMAKE_FIND_USE_CMAKE_PATH`, :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH`,
-:variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH`, and :variable:`CMAKE_FIND_USE_PACAKGE_ROOT_PATH` variables.
+See also the :variable:`CMAKE_FIND_USE_CMAKE_PATH`,
+:variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH`,
+:variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH`,
+:variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY`,
+and :variable:`CMAKE_FIND_USE_PACKAGE_ROOT_PATH` variables.
diff --git a/Help/variable/CMAKE_FIND_USE_PACAKGE_ROOT_PATH.rst b/Help/variable/CMAKE_FIND_USE_PACAKGE_ROOT_PATH.rst
deleted file mode 100644
index ac25ec9..0000000
--- a/Help/variable/CMAKE_FIND_USE_PACAKGE_ROOT_PATH.rst
+++ /dev/null
@@ -1,11 +0,0 @@
-CMAKE_FIND_USE_PACAKGE_ROOT_PATH
---------------------------------
-
-Controls the searching of :variable:`<PackageName>_ROOT` variables by the :command:`find_program`,
-:command:`find_library`, :command:`find_file`, :command:`find_package`, and :command:`find_path`.
-This is useful in cross-compiling environments.
-
-By default this this is set to ``TRUE``.
-
-See also the :variable:`CMAKE_FIND_USE_CMAKE_PATH`, :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH`,
-:variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`, and :variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH` variables.
diff --git a/Help/variable/CMAKE_FIND_USE_PACKAGE_REGISTRY.rst b/Help/variable/CMAKE_FIND_USE_PACKAGE_REGISTRY.rst
new file mode 100644
index 0000000..75e910f
--- /dev/null
+++ b/Help/variable/CMAKE_FIND_USE_PACKAGE_REGISTRY.rst
@@ -0,0 +1,29 @@
+CMAKE_FIND_USE_PACKAGE_REGISTRY
+-------------------------------
+
+Controls the searching the :ref:`User Package Registry` by the :command:`find_package`
+command.
+
+By default this variable is not set and the behavior will fall back
+to that determined by the deprecated :variable:`CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY`
+variable. If that is also not set, then `find_package()` will use the
+`User Package Registry` unless the `NO_CMAKE_PACKAGE_REGISTRY` option
+is provided.
+
+This variable takes precedence over :variable:`CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY`
+when both are set.
+
+In some cases, for example to locate only system wide installations, it
+is not desirable to use the :ref:`User Package Registry` when searching
+for packages. If the :variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY`
+variable is ``FALSE``, all the :command:`find_package` commands will skip
+the :ref:`User Package Registry` as if they were called with the
+``NO_CMAKE_PACKAGE_REGISTRY`` argument.
+
+See also :ref:`Disabling the Package Registry`.
+
+See also the :variable:`CMAKE_FIND_USE_CMAKE_PATH`,
+:variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH`,
+:variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`,
+:variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH`,
+and :variable:`CMAKE_FIND_USE_PACKAGE_ROOT_PATH` variables.
diff --git a/Help/variable/CMAKE_FIND_USE_PACKAGE_ROOT_PATH.rst b/Help/variable/CMAKE_FIND_USE_PACKAGE_ROOT_PATH.rst
new file mode 100644
index 0000000..899e62e
--- /dev/null
+++ b/Help/variable/CMAKE_FIND_USE_PACKAGE_ROOT_PATH.rst
@@ -0,0 +1,18 @@
+CMAKE_FIND_USE_PACKAGE_ROOT_PATH
+--------------------------------
+
+Controls the searching of :variable:`<PackageName>_ROOT` variables by the
+:command:`find_program`, :command:`find_library`, :command:`find_file`,
+and :command:`find_path` commands.
+This is useful in cross-compiling environments.
+
+By default this variable is not set, which is equivalent to it having
+a value of ``TRUE``. Explicit options given to the :command:`find_program`,
+:command:`find_library`, :command:`find_file`, and :command:`find_path`
+commands take precedence over this variable.
+
+See also the :variable:`CMAKE_FIND_USE_CMAKE_PATH`,
+:variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH`,
+:variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`,
+:variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH`,
+and :variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY` variables.
diff --git a/Help/variable/CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH.rst b/Help/variable/CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH.rst
index fd0582f..604c710 100644
--- a/Help/variable/CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH.rst
+++ b/Help/variable/CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH.rst
@@ -1,11 +1,18 @@
CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH
--------------------------------------
-Controls the searching the standard system environment variables by the :command:`find_program`,
-:command:`find_library`, :command:`find_file`, :command:`find_package`, and :command:`find_path`.
+Controls the searching the standard system environment variables by the
+:command:`find_program`, :command:`find_library`, :command:`find_file`,
+and :command:`find_path` commands.
This is useful in cross-compiling environments.
-By default this this is set to ``TRUE``.
+By default this variable is not set, which is equivalent to it having
+a value of ``TRUE``. Explicit options given to the :command:`find_program`,
+:command:`find_library`, :command:`find_file`, and :command:`find_path`
+commands take precedence over this variable.
-See also the :variable:`CMAKE_FIND_USE_CMAKE_PATH`, :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH`,
-:variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`, and :variable:`CMAKE_FIND_USE_PACAKGE_ROOT_PATH` variables.
+See also the :variable:`CMAKE_FIND_USE_CMAKE_PATH`,
+:variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH`,
+:variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`,
+:variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY`,
+and :variable:`CMAKE_FIND_USE_PACKAGE_ROOT_PATH` variables.
diff --git a/Help/variable/CMAKE_Swift_NUM_THREADS.rst b/Help/variable/CMAKE_Swift_NUM_THREADS.rst
new file mode 100644
index 0000000..cb33678
--- /dev/null
+++ b/Help/variable/CMAKE_Swift_NUM_THREADS.rst
@@ -0,0 +1,8 @@
+CMAKE_Swift_NUM_THREADS
+-----------------------
+
+Number of threads for parallel compilation for Swift targets.
+
+This variable controls the number of parallel jobs that the swift driver creates
+for building targets. If not specified, it will default to the number of
+logical CPUs on the host.
diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake
index a48d33c..e47f3a4 100644
--- a/Modules/CMakeDetermineASMCompiler.cmake
+++ b/Modules/CMakeDetermineASMCompiler.cmake
@@ -129,7 +129,7 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
if("${_compileid}" MATCHES "V([0-9]+\\.[0-9]+\\.[0-9]+)")
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_VERSION ${CMAKE_MATCH_1})
endif()
- string(REGEX MATCHALL "([A-Za-z0-9]+)" _all_compileid_matches "${_compileid}")
+ string(REGEX MATCHALL "([A-Za-z0-9-]+)" _all_compileid_matches "${_compileid}")
if(_all_compileid_matches)
list(GET _all_compileid_matches "-1" CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID)
endif()
diff --git a/Modules/CMakeDetermineCSharpCompiler.cmake b/Modules/CMakeDetermineCSharpCompiler.cmake
index dab9414..da860a8 100644
--- a/Modules/CMakeDetermineCSharpCompiler.cmake
+++ b/Modules/CMakeDetermineCSharpCompiler.cmake
@@ -18,7 +18,6 @@ if(NOT CMAKE_CSharp_COMPILER_ID_RUN)
set(CMAKE_CSharp_COMPILER_ID_RUN 1)
# Try to identify the compiler.
- set(CMAKE_CSharp_COMPILER_ID_STRINGS_PARAMETERS ENCODING UTF-16LE)
set(CMAKE_CSharp_COMPILER_ID)
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
CMAKE_DETERMINE_COMPILER_ID(CSharp CSFLAGS CMakeCSharpCompilerId.cs)
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 6083358..1914f52 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -640,10 +640,14 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
set(ARCHITECTURE_ID)
set(SIMULATE_ID)
set(SIMULATE_VERSION)
- file(STRINGS ${file}
- CMAKE_${lang}_COMPILER_ID_STRINGS LIMIT_COUNT 38
- ${CMAKE_${lang}_COMPILER_ID_STRINGS_PARAMETERS}
- REGEX ".?I.?N.?F.?O.?:.?[A-Za-z0-9_]+\\[[^]]*\\]")
+ foreach(encoding "" "ENCODING;UTF-16LE" "ENCODING;UTF-16BE")
+ file(STRINGS "${file}" CMAKE_${lang}_COMPILER_ID_STRINGS
+ LIMIT_COUNT 38 ${encoding}
+ REGEX ".?I.?N.?F.?O.?:.?[A-Za-z0-9_]+\\[[^]]*\\]")
+ if(NOT CMAKE_${lang}_COMPILER_ID_STRINGS STREQUAL "")
+ break()
+ endif()
+ endforeach()
set(COMPILER_ID_TWICE)
# With the IAR Compiler, some strings are found twice, first time as incomplete
# list like "?<Constant "INFO:compiler[IAR]">". Remove the incomplete copies.
diff --git a/Modules/CMakeParseImplicitIncludeInfo.cmake b/Modules/CMakeParseImplicitIncludeInfo.cmake
index 176b3ff..91d03cd 100644
--- a/Modules/CMakeParseImplicitIncludeInfo.cmake
+++ b/Modules/CMakeParseImplicitIncludeInfo.cmake
@@ -15,9 +15,9 @@ function(cmake_parse_implicit_include_line line lang id_var log_var state_var)
if("${CMAKE_${lang}_COMPILER_ID}" STREQUAL "Cray" AND
"${line}" MATCHES "^/" AND "${line}" MATCHES "/ccfe |/ftnfe " AND
"${line}" MATCHES " -isystem| -I")
- string(REGEX MATCHALL " (-I ?|-isystem )([^ ]*)" incs "${line}")
+ string(REGEX MATCHALL " (-I ?|-isystem )(\"[^\"]+\"|[^ \"]+)" incs "${line}")
foreach(inc IN LISTS incs)
- string(REGEX REPLACE " (-I ?|-isystem )([^ ]*)" "\\2" idir "${inc}")
+ string(REGEX REPLACE " (-I ?|-isystem )(\"[^\"]+\"|[^ \"]+)" "\\2" idir "${inc}")
list(APPEND rv "${idir}")
endforeach()
if(rv)
diff --git a/Modules/CMakePlatformId.h.in b/Modules/CMakePlatformId.h.in
index 8f5747a..542a6fe 100644
--- a/Modules/CMakePlatformId.h.in
+++ b/Modules/CMakePlatformId.h.in
@@ -165,6 +165,9 @@
# elif defined(__ICCRL78__)
# define ARCHITECTURE_ID "RL78"
+# elif defined(__ICCRISCV__)
+# define ARCHITECTURE_ID "RISCV"
+
# elif defined(__ICCAVR__)
# define ARCHITECTURE_ID "AVR"
diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake
index f62f61b..f6510b9 100644
--- a/Modules/CMakeSwiftInformation.cmake
+++ b/Modules/CMakeSwiftInformation.cmake
@@ -18,6 +18,9 @@ if(CMAKE_Swift_COMPILER_ID)
endif()
set(CMAKE_INCLUDE_FLAG_Swift "-I ")
+if(NOT CMAKE_SYSTEM_NAME STREQUAL Windows AND NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
+ set(CMAKE_SHARED_LIBRARY_SONAME_Swift_FLAG "-Xlinker -soname -Xlinker ")
+endif()
set(CMAKE_Swift_COMPILE_OPTIONS_TARGET "-target ")
set(CMAKE_Swift_COMPILER_ARG1 -frontend)
@@ -49,11 +52,15 @@ if(NOT CMAKE_Swift_COMPILE_OBJECT)
set(CMAKE_Swift_COMPILE_OBJECT ":")
endif()
+if(NOT CMAKE_Swift_NUM_THREADS MATCHES "^[0-9]+$")
+ cmake_host_system_information(RESULT CMAKE_Swift_NUM_THREADS QUERY NUMBER_OF_LOGICAL_CORES)
+endif()
+
if(NOT CMAKE_Swift_CREATE_SHARED_LIBRARY)
if(CMAKE_Swift_COMPILER_TARGET)
- set(CMAKE_Swift_CREATE_SHARED_LIBRARY "${CMAKE_Swift_COMPILER} -target <CMAKE_Swift_COMPILER_TARGET> -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -emit-library -o <TARGET> -module-name <SWIFT_MODULE_NAME> -module-link-name <SWIFT_LIBRARY_NAME> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>")
+ set(CMAKE_Swift_CREATE_SHARED_LIBRARY "${CMAKE_Swift_COMPILER} -target <CMAKE_Swift_COMPILER_TARGET> -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -o <TARGET> -module-name <SWIFT_MODULE_NAME> -module-link-name <SWIFT_LIBRARY_NAME> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <SONAME_FLAG> <TARGET_SONAME> <LINK_LIBRARIES>")
else()
- set(CMAKE_Swift_CREATE_SHARED_LIBRARY "${CMAKE_Swift_COMPILER} -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -emit-library -o <TARGET> -module-name <SWIFT_MODULE_NAME> -module-link-name <SWIFT_LIBRARY_NAME> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>")
+ set(CMAKE_Swift_CREATE_SHARED_LIBRARY "${CMAKE_Swift_COMPILER} -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -o <TARGET> -module-name <SWIFT_MODULE_NAME> -module-link-name <SWIFT_LIBRARY_NAME> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <SONAME_FLAG> <TARGET_SONAME> <LINK_LIBRARIES>")
endif()
endif()
@@ -63,17 +70,17 @@ endif()
if(NOT CMAKE_Swift_LINK_EXECUTABLE)
if(CMAKE_Swift_COMPILER_TARGET)
- set(CMAKE_Swift_LINK_EXECUTABLE "${CMAKE_Swift_COMPILER} -target <CMAKE_Swift_COMPILER_TARGET> -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -emit-executable -o <TARGET> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>")
+ set(CMAKE_Swift_LINK_EXECUTABLE "${CMAKE_Swift_COMPILER} -target <CMAKE_Swift_COMPILER_TARGET> -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-executable -o <TARGET> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>")
else()
- set(CMAKE_Swift_LINK_EXECUTABLE "${CMAKE_Swift_COMPILER} -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -emit-executable -o <TARGET> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>")
+ set(CMAKE_Swift_LINK_EXECUTABLE "${CMAKE_Swift_COMPILER} -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-executable -o <TARGET> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>")
endif()
endif()
if(NOT CMAKE_Swift_CREATE_STATIC_LIBRARY)
if(CMAKE_Swift_COMPILER_TARGET)
- set(CMAKE_Swift_CREATE_STATIC_LIBRARY "${CMAKE_Swift_COMPILER} -target <CMAKE_Swift_COMPILER_TARGET> -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -emit-library -static -o <TARGET> -module-name <SWIFT_MODULE_NAME> -module-link-name <SWIFT_LIBRARY_NAME> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>")
+ set(CMAKE_Swift_CREATE_STATIC_LIBRARY "${CMAKE_Swift_COMPILER} -target <CMAKE_Swift_COMPILER_TARGET> -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -static -o <TARGET> -module-name <SWIFT_MODULE_NAME> -module-link-name <SWIFT_LIBRARY_NAME> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>")
else()
- set(CMAKE_Swift_CREATE_STATIC_LIBRARY "${CMAKE_Swift_COMPILER} -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -emit-library -static -o <TARGET> -module-name <SWIFT_MODULE_NAME> -module-link-name <SWIFT_LIBRARY_NAME> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>")
+ set(CMAKE_Swift_CREATE_STATIC_LIBRARY "${CMAKE_Swift_COMPILER} -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -static -o <TARGET> -module-name <SWIFT_MODULE_NAME> -module-link-name <SWIFT_LIBRARY_NAME> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>")
endif()
set(CMAKE_Swift_ARCHIVE_CREATE "<CMAKE_AR> crs <TARGET> <OBJECTS>")
diff --git a/Modules/CheckCXXSymbolExists.cmake b/Modules/CheckCXXSymbolExists.cmake
index 2cccd09..b112094 100644
--- a/Modules/CheckCXXSymbolExists.cmake
+++ b/Modules/CheckCXXSymbolExists.cmake
@@ -5,26 +5,27 @@
CheckCXXSymbolExists
--------------------
-Check if a symbol exists as a function, variable, or macro in C++
+Check if a symbol exists as a function, variable, or macro in ``C++``.
-.. command:: CHECK_CXX_SYMBOL_EXISTS
+.. command:: check_cxx_symbol_exists
.. code-block:: cmake
- CHECK_CXX_SYMBOL_EXISTS(<symbol> <files> <variable>)
+ check_cxx_symbol_exists(<symbol> <files> <variable>)
Check that the ``<symbol>`` is available after including given header
``<files>`` and store the result in a ``<variable>``. Specify the list of
files in one argument as a semicolon-separated list.
- ``CHECK_CXX_SYMBOL_EXISTS()`` can be used to check in C++ files, as
- opposed to ``CHECK_SYMBOL_EXISTS()``, which works only for ``C``.
+ ``check_cxx_symbol_exists()`` can be used to check for symbols as seen by
+ the C++ compiler, as opposed to :command:`check_symbol_exists`, which always
+ uses the ``C`` compiler.
If the header files define the symbol as a macro it is considered
available and assumed to work. If the header files declare the symbol
as a function or variable then the symbol must also be available for
- linking. If the symbol is a type or enum value it will not be
- recognized (consider using :module:`CheckTypeSize`
- or :module:`CheckCXXSourceCompiles`).
+ linking. If the symbol is a type, enum value, or C++ template it will
+ not be recognized: consider using the :module:`CheckTypeSize`
+ or :module:`CheckCXXSourceCompiles` module instead.
The following variables may be set before calling this macro to modify
the way the check is run:
@@ -43,6 +44,17 @@ the way the check is run:
command. See policy :policy:`CMP0075`.
``CMAKE_REQUIRED_QUIET``
execute quietly without messages.
+
+For example:
+
+.. code-block:: cmake
+
+ include(CheckCXXSymbolExists)
+
+ # Check for macro SEEK_SET
+ check_cxx_symbol_exists(SEEK_SET "cstdio" HAVE_SEEK_SET)
+ # Check for function std::fopen
+ check_cxx_symbol_exists(std::fopen "cstdio" HAVE_STD_FOPEN)
#]=======================================================================]
include_guard(GLOBAL)
diff --git a/Modules/CheckSymbolExists.cmake b/Modules/CheckSymbolExists.cmake
index b9ef808..c2f488a 100644
--- a/Modules/CheckSymbolExists.cmake
+++ b/Modules/CheckSymbolExists.cmake
@@ -45,6 +45,17 @@ the way the check is run:
command. See policy :policy:`CMP0075`.
``CMAKE_REQUIRED_QUIET``
execute quietly without messages.
+
+For example:
+
+.. code-block:: cmake
+
+ include(CheckSymbolExists)
+
+ # Check for macro SEEK_SET
+ check_symbol_exists(SEEK_SET "stdio.h" HAVE_SEEK_SET)
+ # Check for function fopen
+ check_symbol_exists(fopen "stdio.h" HAVE_FOPEN)
#]=======================================================================]
include_guard(GLOBAL)
diff --git a/Modules/Compiler/Cray-Fortran.cmake b/Modules/Compiler/Cray-Fortran.cmake
index dbf28e3..ccb7c2e 100644
--- a/Modules/Compiler/Cray-Fortran.cmake
+++ b/Modules/Compiler/Cray-Fortran.cmake
@@ -4,6 +4,8 @@
include(Compiler/Cray)
__compiler_cray(Fortran)
+set(CMAKE_Fortran_SUBMODULE_SEP "")
+set(CMAKE_Fortran_SUBMODULE_EXT ".mod")
set(CMAKE_Fortran_MODOUT_FLAG -em)
set(CMAKE_Fortran_MODDIR_FLAG -J)
set(CMAKE_Fortran_MODDIR_DEFAULT .)
diff --git a/Modules/Compiler/IAR-ASM.cmake b/Modules/Compiler/IAR-ASM.cmake
index 71f2ac6..437678e 100644
--- a/Modules/Compiler/IAR-ASM.cmake
+++ b/Modules/Compiler/IAR-ASM.cmake
@@ -22,6 +22,11 @@ elseif("${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID}" STREQUAL "RL78")
__compiler_iar_ilink(ASM)
set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;asm;msa)
+elseif("${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID}" STREQUAL "RISC-V")
+ set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> --silent <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT>")
+ __compiler_iar_ilink(ASM)
+ set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;asm;msa)
+
elseif("${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID}" STREQUAL "AVR")
set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> -S <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT>")
__compiler_iar_xlink(ASM)
diff --git a/Modules/Compiler/IAR-C.cmake b/Modules/Compiler/IAR-C.cmake
index 4b02a9a..e03ce3f 100644
--- a/Modules/Compiler/IAR-C.cmake
+++ b/Modules/Compiler/IAR-C.cmake
@@ -15,7 +15,7 @@ if(CMAKE_C_COMPILER_VERSION_INTERNAL VERSION_GREATER 7)
set(CMAKE_C90_EXTENSION_COMPILE_OPTION --c89 -e)
set(CMAKE_C99_STANDARD_COMPILE_OPTION "")
set(CMAKE_C99_EXTENSION_COMPILE_OPTION -e)
-elseif()
+else()
set(CMAKE_C90_STANDARD_COMPILE_OPTION "")
set(CMAKE_C90_EXTENSION_COMPILE_OPTION -e)
endif()
@@ -46,6 +46,10 @@ elseif("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "RL78")
__compiler_iar_ilink(C)
__compiler_check_default_language_standard(C 1.10 90 1.10 99 4.10 11)
+elseif("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "RISCV")
+ __compiler_iar_ilink(C)
+ __compiler_check_default_language_standard(C 1.10 90 1.10 99 1.10 11)
+
elseif("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "AVR")
__compiler_iar_xlink(C)
__compiler_check_default_language_standard(C 7.10 99)
diff --git a/Modules/Compiler/IAR-CXX.cmake b/Modules/Compiler/IAR-CXX.cmake
index 22ec118..e8f1142 100644
--- a/Modules/Compiler/IAR-CXX.cmake
+++ b/Modules/Compiler/IAR-CXX.cmake
@@ -55,6 +55,10 @@ elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "RL78")
__compiler_iar_ilink(CXX)
__compiler_check_default_language_standard(CXX 1.10 98 4.10 14)
+elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "RISCV")
+ __compiler_iar_ilink(CXX)
+ __compiler_check_default_language_standard(CXX 1.10 98 1.10 14)
+
elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "AVR")
__compiler_iar_xlink(CXX)
__compiler_check_default_language_standard(CXX 7.10 98)
diff --git a/Modules/Compiler/IAR-DetermineCompiler.cmake b/Modules/Compiler/IAR-DetermineCompiler.cmake
index 6b09c40..57ca1c9 100644
--- a/Modules/Compiler/IAR-DetermineCompiler.cmake
+++ b/Modules/Compiler/IAR-DetermineCompiler.cmake
@@ -31,7 +31,7 @@ set(_compiler_id_version_compute "
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(((__VER__) / 1000) % 1000)
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@((__VER__) % 1000)
# define @PREFIX@COMPILER_VERSION_INTERNAL @MACRO_DEC@(__IAR_SYSTEMS_ICC__)
-# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__))
+# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__))
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@((__VER__) / 100)
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@((__VER__) - (((__VER__) / 100)*100))
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__SUBVERSION__)
diff --git a/Modules/Compiler/IAR-FindBinUtils.cmake b/Modules/Compiler/IAR-FindBinUtils.cmake
index 3f13dce..b7d4664 100644
--- a/Modules/Compiler/IAR-FindBinUtils.cmake
+++ b/Modules/Compiler/IAR-FindBinUtils.cmake
@@ -13,7 +13,8 @@ set(__iar_hints "${__iar_hint_1}" "${__iar_hint_2}")
if("${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM" OR
"${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "RX" OR
"${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "RH850" OR
- "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "RL78")
+ "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "RL78" OR
+ "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "RISCV")
string(TOLOWER "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" _archid_lower)
diff --git a/Modules/Compiler/XL.cmake b/Modules/Compiler/XL.cmake
index a9cec11..fc71ab4 100644
--- a/Modules/Compiler/XL.cmake
+++ b/Modules/Compiler/XL.cmake
@@ -18,6 +18,8 @@ macro(__compiler_xl lang)
set(CMAKE_${lang}_RESPONSE_FILE_FLAG "-qoptfile=")
set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "-qoptfile=")
+ set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-qmkshrobj")
+
set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Wl,")
set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP ",")
diff --git a/Modules/FindBISON.cmake b/Modules/FindBISON.cmake
index e75981c..6b5828e 100644
--- a/Modules/FindBISON.cmake
+++ b/Modules/FindBISON.cmake
@@ -257,15 +257,19 @@ if(BISON_EXECUTABLE)
PARENT_SCOPE # undocumented, do not use outside of CMake
)
set(_BISON_WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+ set(_BisonInput "${BisonInput}")
if("x${_BISON_CMP0088}x" STREQUAL "xNEWx")
set(_BISON_WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
+ if(NOT IS_ABSOLUTE "${_BisonInput}")
+ set(_BisonInput "${CMAKE_CURRENT_SOURCE_DIR}/${_BisonInput}")
+ endif()
endif()
unset(_BISON_CMP0088)
add_custom_command(OUTPUT ${BISON_TARGET_outputs}
- COMMAND ${BISON_EXECUTABLE} ${BISON_TARGET_cmdopt} -o ${BisonOutput} ${BisonInput}
+ COMMAND ${BISON_EXECUTABLE} ${BISON_TARGET_cmdopt} -o ${BisonOutput} ${_BisonInput}
VERBATIM
- DEPENDS ${BisonInput}
+ DEPENDS ${_BisonInput}
COMMENT "[BISON][${Name}] Building parser with bison ${BISON_VERSION}"
WORKING_DIRECTORY ${_BISON_WORKING_DIRECTORY})
@@ -273,12 +277,14 @@ if(BISON_EXECUTABLE)
# define target variables
set(BISON_${Name}_DEFINED TRUE)
- set(BISON_${Name}_INPUT ${BisonInput})
+ set(BISON_${Name}_INPUT ${_BisonInput})
set(BISON_${Name}_OUTPUTS ${BISON_TARGET_outputs} ${BISON_TARGET_extraoutputs})
set(BISON_${Name}_COMPILE_FLAGS ${BISON_TARGET_cmdopt})
set(BISON_${Name}_OUTPUT_SOURCE "${BisonOutput}")
set(BISON_${Name}_OUTPUT_HEADER "${BISON_TARGET_output_header}")
+ unset(_BisonInput)
+
endif()
endmacro()
#
diff --git a/Modules/FindBacktrace.cmake b/Modules/FindBacktrace.cmake
index cf1632a..3d8ce88 100644
--- a/Modules/FindBacktrace.cmake
+++ b/Modules/FindBacktrace.cmake
@@ -74,7 +74,7 @@ else()
if(Backtrace_INCLUDE_DIR)
# OpenBSD has libbacktrace renamed to libexecinfo
find_library(Backtrace_LIBRARY "execinfo")
- elseif() # respect user wishes
+ else() # respect user wishes
set(_Backtrace_HEADER_TRY "backtrace.h")
find_path(Backtrace_INCLUDE_DIR ${_Backtrace_HEADER_TRY})
find_library(Backtrace_LIBRARY "backtrace")
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake
index 03f1500..c8cae2e 100644
--- a/Modules/FindMatlab.cmake
+++ b/Modules/FindMatlab.cmake
@@ -609,14 +609,23 @@ function(matlab_get_mex_suffix matlab_root mex_suffix)
set(devnull INPUT_FILE NUL)
endif()
+ if(WIN32)
+ # this environment variable is used to determine the arch on Windows
+ if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ set(ENV{MATLAB_ARCH} "win64")
+ else()
+ set(ENV{MATLAB_ARCH} "win32")
+ endif()
+ endif()
+
# this is the preferred way. If this does not work properly (eg. MCR on Windows), then we use our own knowledge
execute_process(
COMMAND ${Matlab_MEXEXTENSIONS_PROG}
OUTPUT_VARIABLE _matlab_mex_extension
- #RESULT_VARIABLE _matlab_mex_extension_call
ERROR_VARIABLE _matlab_mex_extension_error
OUTPUT_STRIP_TRAILING_WHITESPACE
${devnull})
+ unset(ENV{MATLAB_ARCH})
if(_matlab_mex_extension_error)
if(WIN32)
@@ -631,7 +640,7 @@ function(matlab_get_mex_suffix matlab_root mex_suffix)
string(STRIP "${_matlab_mex_extension}" _matlab_mex_extension)
if(MATLAB_FIND_DEBUG)
- message(STATUS "[MATLAB] '${Matlab_MEXEXTENSIONS_PROG}' : returned '${_matlab_mex_extension_call}', determined extension '${_matlab_mex_extension}' and error string is '${_matlab_mex_extension_error}'")
+ message(STATUS "[MATLAB] '${Matlab_MEXEXTENSIONS_PROG}' : determined extension '${_matlab_mex_extension}' and error string is '${_matlab_mex_extension_error}'")
endif()
unset(Matlab_MEXEXTENSIONS_PROG CACHE)
@@ -1043,14 +1052,9 @@ function(matlab_add_mex)
set(_link_flags "${_link_flags} /EXPORT:mexfilerequiredapiversion")
endif()
- if(Matlab_HAS_CPP_API)
- set(_link_flags "${_link_flags} /EXPORT:mexCreateMexFunction /EXPORT:mexDestroyMexFunction /EXPORT:mexFunctionAdapter")
- #TODO: Is this necessary?
- endif()
-
set_property(TARGET ${${prefix}_NAME} APPEND PROPERTY LINK_FLAGS ${_link_flags})
- endif() # TODO: what if there's a different compiler on Windows?
+ endif() # No other compiler currently supported on Windows.
set_target_properties(${${prefix}_NAME}
PROPERTIES
@@ -1533,7 +1537,9 @@ if(MATLAB_FIND_DEBUG)
message(STATUS "[MATLAB] Current version is ${Matlab_VERSION_STRING} located ${Matlab_ROOT_DIR}")
endif()
-if(NOT ${Matlab_VERSION_STRING} VERSION_LESS "9.4") # MATLAB 9.4 (R2018a) and newer have a new C++ API
+# MATLAB 9.4 (R2018a) and newer have a new C++ API
+# This API pulls additional required libraries.
+if(NOT ${Matlab_VERSION_STRING} VERSION_LESS "9.4")
set(Matlab_HAS_CPP_API 1)
endif()
@@ -1619,6 +1625,10 @@ endfunction()
set(_matlab_required_variables)
+# Order is as follow:
+# - unconditionally required libraries/headers first
+# - then library components
+# - then program components
# the MEX library/header are required
find_path(
@@ -1644,34 +1654,6 @@ list(APPEND _matlab_required_variables Matlab_MEX_EXTENSION)
# the matlab root is required
list(APPEND _matlab_required_variables Matlab_ROOT_DIR)
-# component Mex Compiler
-if("MEX_COMPILER" IN_LIST Matlab_FIND_COMPONENTS)
- find_program(
- Matlab_MEX_COMPILER
- "mex"
- PATHS ${Matlab_BINARIES_DIR}
- DOC "Matlab MEX compiler"
- NO_DEFAULT_PATH
- )
- if(Matlab_MEX_COMPILER)
- set(Matlab_MEX_COMPILER_FOUND TRUE)
- endif()
-endif()
-
-# component Matlab program
-if("MAIN_PROGRAM" IN_LIST Matlab_FIND_COMPONENTS)
- find_program(
- Matlab_MAIN_PROGRAM
- matlab
- PATHS ${Matlab_ROOT_DIR} ${Matlab_ROOT_DIR}/bin
- DOC "Matlab main program"
- NO_DEFAULT_PATH
- )
- if(Matlab_MAIN_PROGRAM)
- set(Matlab_MAIN_PROGRAM_FOUND TRUE)
- endif()
-endif()
-
# The MX library is required
_Matlab_find_library(
${_matlab_lib_prefix_for_search}
@@ -1685,9 +1667,40 @@ if(Matlab_MX_LIBRARY)
set(Matlab_MX_LIBRARY_FOUND TRUE)
endif()
+if(Matlab_HAS_CPP_API)
+
+ # The MatlabEngine library is required for R2018a+
+ _Matlab_find_library(
+ ${_matlab_lib_prefix_for_search}
+ Matlab_ENGINE_LIBRARY
+ MatlabEngine
+ PATHS ${_matlab_lib_dir_for_search}
+ DOC "MatlabEngine Library"
+ NO_DEFAULT_PATH
+ )
+ list(APPEND _matlab_required_variables Matlab_ENGINE_LIBRARY)
+ if(Matlab_ENGINE_LIBRARY)
+ set(Matlab_ENGINE_LIBRARY_FOUND TRUE)
+ endif()
+
+ # The MatlabDataArray library is required for R2018a+
+ _Matlab_find_library(
+ ${_matlab_lib_prefix_for_search}
+ Matlab_DATAARRAY_LIBRARY
+ MatlabDataArray
+ PATHS ${_matlab_lib_dir_for_search}
+ DOC "MatlabDataArray Library"
+ NO_DEFAULT_PATH
+ )
+ list(APPEND _matlab_required_variables Matlab_DATAARRAY_LIBRARY)
+ if(Matlab_DATAARRAY_LIBRARY)
+ set(Matlab_DATAARRAY_LIBRARY_FOUND TRUE)
+ endif()
+
+endif()
+
# Component ENG library
-list(FIND Matlab_FIND_COMPONENTS ENG_LIBRARY _matlab_find_eng)
-if(_matlab_find_eng GREATER -1)
+if("ENG_LIBRARY" IN_LIST Matlab_FIND_COMPONENTS)
_Matlab_find_library(
${_matlab_lib_prefix_for_search}
Matlab_ENG_LIBRARY
@@ -1699,11 +1712,9 @@ if(_matlab_find_eng GREATER -1)
set(Matlab_ENG_LIBRARY_FOUND TRUE)
endif()
endif()
-unset(_matlab_find_eng)
# Component MAT library
-list(FIND Matlab_FIND_COMPONENTS MAT_LIBRARY _matlab_find_mat)
-if(_matlab_find_mat GREATER -1)
+if("MAT_LIBRARY" IN_LIST Matlab_FIND_COMPONENTS)
_Matlab_find_library(
${_matlab_lib_prefix_for_search}
Matlab_MAT_LIBRARY
@@ -1715,11 +1726,9 @@ if(_matlab_find_mat GREATER -1)
set(Matlab_MAT_LIBRARY_FOUND TRUE)
endif()
endif()
-unset(_matlab_find_mat)
# Component Simulink
-list(FIND Matlab_FIND_COMPONENTS SIMULINK _matlab_find_simulink)
-if(_matlab_find_simulink GREATER -1)
+if("SIMULINK" IN_LIST Matlab_FIND_COMPONENTS)
find_path(
Matlab_SIMULINK_INCLUDE_DIR
simstruc.h
@@ -1731,58 +1740,49 @@ if(_matlab_find_simulink GREATER -1)
list(APPEND Matlab_INCLUDE_DIRS "${Matlab_SIMULINK_INCLUDE_DIR}")
endif()
endif()
-unset(_matlab_find_simulink)
-# component MCC Compiler
-list(FIND Matlab_FIND_COMPONENTS MCC_COMPILER _matlab_find_mcc_compiler)
-if(_matlab_find_mcc_compiler GREATER -1)
+# component Matlab program
+if("MAIN_PROGRAM" IN_LIST Matlab_FIND_COMPONENTS)
find_program(
- Matlab_MCC_COMPILER
- "mcc"
- PATHS ${Matlab_BINARIES_DIR}
- DOC "Matlab MCC compiler"
+ Matlab_MAIN_PROGRAM
+ matlab
+ PATHS ${Matlab_ROOT_DIR} ${Matlab_ROOT_DIR}/bin
+ DOC "Matlab main program"
NO_DEFAULT_PATH
)
- if(Matlab_MCC_COMPILER)
- set(Matlab_MCC_COMPILER_FOUND TRUE)
+ if(Matlab_MAIN_PROGRAM)
+ set(Matlab_MAIN_PROGRAM_FOUND TRUE)
endif()
endif()
-unset(_matlab_find_mcc_compiler)
-if(Matlab_HAS_CPP_API)
-
- # The MatlabEngine library is required for R2018a+
- _Matlab_find_library(
- ${_matlab_lib_prefix_for_search}
- Matlab_ENGINE_LIBRARY
- MatlabEngine
- PATHS ${_matlab_lib_dir_for_search}
- DOC "MatlabEngine Library"
+# component Mex Compiler
+if("MEX_COMPILER" IN_LIST Matlab_FIND_COMPONENTS)
+ find_program(
+ Matlab_MEX_COMPILER
+ "mex"
+ PATHS ${Matlab_BINARIES_DIR}
+ DOC "Matlab MEX compiler"
NO_DEFAULT_PATH
)
- list(APPEND _matlab_required_variables Matlab_ENGINE_LIBRARY)
- if(Matlab_ENGINE_LIBRARY)
- set(Matlab_ENGINE_LIBRARY_FOUND TRUE)
+ if(Matlab_MEX_COMPILER)
+ set(Matlab_MEX_COMPILER_FOUND TRUE)
endif()
+endif()
- # The MatlabDataArray library is required for R2018a+
- _Matlab_find_library(
- ${_matlab_lib_prefix_for_search}
- Matlab_DATAARRAY_LIBRARY
- MatlabDataArray
- PATHS ${_matlab_lib_dir_for_search}
- DOC "MatlabDataArray Library"
+# component MCC Compiler
+if("MCC_COMPILER" IN_LIST Matlab_FIND_COMPONENTS)
+ find_program(
+ Matlab_MCC_COMPILER
+ "mcc"
+ PATHS ${Matlab_BINARIES_DIR}
+ DOC "Matlab MCC compiler"
NO_DEFAULT_PATH
)
- list(APPEND _matlab_required_variables Matlab_DATAARRAY_LIBRARY)
- if(Matlab_DATAARRAY_LIBRARY)
- set(Matlab_DATAARRAY_LIBRARY_FOUND TRUE)
+ if(Matlab_MCC_COMPILER)
+ set(Matlab_MCC_COMPILER_FOUND TRUE)
endif()
-
endif()
-unset(_matlab_lib_dir_for_search)
-
set(Matlab_LIBRARIES
${Matlab_MEX_LIBRARY} ${Matlab_MX_LIBRARY}
${Matlab_ENG_LIBRARY} ${Matlab_MAT_LIBRARY}
diff --git a/Modules/FindPNG.cmake b/Modules/FindPNG.cmake
index a7908c5..bd400c7 100644
--- a/Modules/FindPNG.cmake
+++ b/Modules/FindPNG.cmake
@@ -69,8 +69,8 @@ if(ZLIB_FOUND)
unset(_PNG_VERSION_SUFFIX_MIN)
endif ()
foreach(v IN LISTS _PNG_VERSION_SUFFIXES)
- list(APPEND PNG_NAMES png${v} libpng${v})
- list(APPEND PNG_NAMES_DEBUG png${v}d libpng${v}d)
+ list(APPEND PNG_NAMES png${v} libpng${v} libpng${v}_static)
+ list(APPEND PNG_NAMES_DEBUG png${v}d libpng${v}d libpng${v}_staticd)
endforeach()
unset(_PNG_VERSION_SUFFIXES)
# For compatibility with versions prior to this multi-config search, honor
diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake
index 085e96c..670352c 100644
--- a/Modules/FindProtobuf.cmake
+++ b/Modules/FindProtobuf.cmake
@@ -582,6 +582,11 @@ if(Protobuf_INCLUDE_DIR)
set_target_properties(protobuf::libprotoc PROPERTIES
IMPORTED_LOCATION_DEBUG "${Protobuf_PROTOC_LIBRARY_DEBUG}")
endif()
+ if (Protobuf_VERSION VERSION_GREATER_EQUAL "3.6")
+ set_property(TARGET protobuf::libprotoc APPEND PROPERTY
+ INTERFACE_COMPILE_FEATURES cxx_std_11
+ )
+ endif()
if(UNIX AND TARGET Threads::Threads)
set_property(TARGET protobuf::libprotoc APPEND PROPERTY
INTERFACE_LINK_LIBRARIES Threads::Threads)
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index a145b46..3993968 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -670,7 +670,7 @@ if (QT_QMAKE_EXECUTABLE AND
get_filename_component(qt_headers "${QT_QTCORE_INCLUDE_DIR}/../" ABSOLUTE)
set(QT_HEADERS_DIR "${qt_headers}" CACHE INTERNAL "" FORCE)
endif()
- elseif()
+ else()
message("Warning: QT_QMAKE_EXECUTABLE reported QT_INSTALL_HEADERS as ${qt_headers}")
message("Warning: But QtCore couldn't be found. Qt must NOT be installed correctly.")
endif()
diff --git a/Modules/CPack.DS_Store.in b/Modules/Internal/CPack/CPack.DS_Store.in
index 5be0eeb..5be0eeb 100644
--- a/Modules/CPack.DS_Store.in
+++ b/Modules/Internal/CPack/CPack.DS_Store.in
Binary files differ
diff --git a/Modules/CPack.Description.plist.in b/Modules/Internal/CPack/CPack.Description.plist.in
index 3d11476..3d11476 100644
--- a/Modules/CPack.Description.plist.in
+++ b/Modules/Internal/CPack/CPack.Description.plist.in
diff --git a/Modules/CPack.Info.plist.in b/Modules/Internal/CPack/CPack.Info.plist.in
index 6e32500..6e32500 100644
--- a/Modules/CPack.Info.plist.in
+++ b/Modules/Internal/CPack/CPack.Info.plist.in
diff --git a/Modules/CPack.NuGet.nuspec.in b/Modules/Internal/CPack/CPack.NuGet.nuspec.in
index b7beb5d..b7beb5d 100644
--- a/Modules/CPack.NuGet.nuspec.in
+++ b/Modules/Internal/CPack/CPack.NuGet.nuspec.in
diff --git a/Modules/CPack.OSXScriptLauncher.in b/Modules/Internal/CPack/CPack.OSXScriptLauncher.in
index c715860..c715860 100755..100644
--- a/Modules/CPack.OSXScriptLauncher.in
+++ b/Modules/Internal/CPack/CPack.OSXScriptLauncher.in
Binary files differ
diff --git a/Modules/CPack.OSXScriptLauncher.rsrc.in b/Modules/Internal/CPack/CPack.OSXScriptLauncher.rsrc.in
index 5f5f17a..5f5f17a 100644
--- a/Modules/CPack.OSXScriptLauncher.rsrc.in
+++ b/Modules/Internal/CPack/CPack.OSXScriptLauncher.rsrc.in
Binary files differ
diff --git a/Modules/CPack.OSXX11.Info.plist.in b/Modules/Internal/CPack/CPack.OSXX11.Info.plist.in
index 23a1483..23a1483 100644
--- a/Modules/CPack.OSXX11.Info.plist.in
+++ b/Modules/Internal/CPack/CPack.OSXX11.Info.plist.in
diff --git a/Modules/CPack.OSXX11.main.scpt.in b/Modules/Internal/CPack/CPack.OSXX11.main.scpt.in
index de30ea1..de30ea1 100644
--- a/Modules/CPack.OSXX11.main.scpt.in
+++ b/Modules/Internal/CPack/CPack.OSXX11.main.scpt.in
Binary files differ
diff --git a/Modules/CPack.RuntimeScript.in b/Modules/Internal/CPack/CPack.RuntimeScript.in
index f27444f..f27444f 100755
--- a/Modules/CPack.RuntimeScript.in
+++ b/Modules/Internal/CPack/CPack.RuntimeScript.in
diff --git a/Modules/CPack.STGZ_Header.sh.in b/Modules/Internal/CPack/CPack.STGZ_Header.sh.in
index 70f63d2..003fcfe 100755
--- a/Modules/CPack.STGZ_Header.sh.in
+++ b/Modules/Internal/CPack/CPack.STGZ_Header.sh.in
@@ -43,10 +43,10 @@ for a in "$@CPACK_AT_SIGN@"; do
cpack_prefix_dir=`cpack_fix_slashes "${cpack_prefix_dir}"`
fi
if echo $a | grep "^--help" > /dev/null 2> /dev/null; then
- cpack_usage
+ cpack_usage
fi
if echo $a | grep "^--version" > /dev/null 2> /dev/null; then
- cpack_version
+ cpack_version
exit 2
fi
if echo $a | grep "^--include-subdir" > /dev/null 2> /dev/null; then
@@ -143,4 +143,3 @@ exit 0
#-----------------------------------------------------------
# Start of TAR.GZ file
#-----------------------------------------------------------;
-
diff --git a/Modules/CPack.VolumeIcon.icns.in b/Modules/Internal/CPack/CPack.VolumeIcon.icns.in
index c59217e..c59217e 100644
--- a/Modules/CPack.VolumeIcon.icns.in
+++ b/Modules/Internal/CPack/CPack.VolumeIcon.icns.in
Binary files differ
diff --git a/Modules/CPack.background.png.in b/Modules/Internal/CPack/CPack.background.png.in
index a32ab37..a32ab37 100644
--- a/Modules/CPack.background.png.in
+++ b/Modules/Internal/CPack/CPack.background.png.in
Binary files differ
diff --git a/Modules/CPack.distribution.dist.in b/Modules/Internal/CPack/CPack.distribution.dist.in
index f20e66c..f20e66c 100644
--- a/Modules/CPack.distribution.dist.in
+++ b/Modules/Internal/CPack/CPack.distribution.dist.in
diff --git a/Modules/Internal/CPack/CPackNuGet.cmake b/Modules/Internal/CPack/CPackNuGet.cmake
index 4b2ce92..82053b2 100644
--- a/Modules/Internal/CPack/CPackNuGet.cmake
+++ b/Modules/Internal/CPack/CPackNuGet.cmake
@@ -262,7 +262,7 @@ function(_cpack_nuget_render_spec)
# NuGet will name it properly.
_cpack_nuget_debug("Rendering `${CPACK_TEMPORARY_DIRECTORY}/CPack.NuGet.nuspec` file...")
configure_file(
- "${CMAKE_ROOT}/Modules/CPack.NuGet.nuspec.in"
+ "${CMAKE_ROOT}/Modules/Internal/CPack/CPack.NuGet.nuspec.in"
"${CPACK_TEMPORARY_DIRECTORY}/CPack.NuGet.nuspec"
@ONLY
)
diff --git a/Modules/NSIS.InstallOptions.ini.in b/Modules/Internal/CPack/NSIS.InstallOptions.ini.in
index d92d779..d92d779 100644
--- a/Modules/NSIS.InstallOptions.ini.in
+++ b/Modules/Internal/CPack/NSIS.InstallOptions.ini.in
diff --git a/Modules/NSIS.template.in b/Modules/Internal/CPack/NSIS.template.in
index f75ae78..f75ae78 100644
--- a/Modules/NSIS.template.in
+++ b/Modules/Internal/CPack/NSIS.template.in
diff --git a/Modules/WIX.template.in b/Modules/Internal/CPack/WIX.template.in
index c4fc83a..c4fc83a 100644
--- a/Modules/WIX.template.in
+++ b/Modules/Internal/CPack/WIX.template.in
diff --git a/Modules/Platform/AIX-GNU.cmake b/Modules/Platform/AIX-GNU.cmake
index 0abbb61..cec71a1 100644
--- a/Modules/Platform/AIX-GNU.cmake
+++ b/Modules/Platform/AIX-GNU.cmake
@@ -11,8 +11,6 @@ set(__AIX_COMPILER_GNU 1)
#
# By default, runtime linking is enabled. All shared objects specified on the command line
# will be listed, even if there are no symbols referenced, in the output file.
-string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " -Wl,-brtl")
-string(APPEND CMAKE_MODULE_LINKER_FLAGS_INIT " -Wl,-brtl")
string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " -Wl,-brtl")
@@ -20,11 +18,22 @@ macro(__aix_compiler_gnu lang)
set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-blibpath:")
set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":")
string(APPEND CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS " -Wl,-G,-bnoipath")
- set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-bexpall")
+ set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-bexpall") # CMP0065 old behavior
set(CMAKE_${lang}_USE_IMPLICIT_LINK_DIRECTORIES_IN_RUNTIME_PATH 1)
set(CMAKE_${lang}_LINK_FLAGS "-Wl,-bnoipath")
if(CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 7 OR CMAKE_SYSTEM_VERSION VERSION_LESS 7.1)
unset(CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY)
endif()
+
+ # Construct the export list ourselves to pass only the object files so
+ # that we export only the symbols actually provided by the sources.
+ set(CMAKE_${lang}_CREATE_SHARED_LIBRARY
+ "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o <OBJECT_DIR>/objects.exp <OBJECTS>"
+ "<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> -Wl,-bE:<OBJECT_DIR>/objects.exp <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>"
+ )
+
+ set(CMAKE_${lang}_LINK_EXECUTABLE_WITH_EXPORTS
+ "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o <OBJECT_DIR>/objects.exp <OBJECTS>"
+ "<CMAKE_${lang}_COMPILER> <FLAGS> <CMAKE_${lang}_LINK_FLAGS> -Wl,-bE:<OBJECT_DIR>/objects.exp <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
endmacro()
diff --git a/Modules/Platform/AIX-XL.cmake b/Modules/Platform/AIX-XL.cmake
index 06a806b..52292bd 100644
--- a/Modules/Platform/AIX-XL.cmake
+++ b/Modules/Platform/AIX-XL.cmake
@@ -11,8 +11,6 @@ set(__AIX_COMPILER_XL 1)
#
# By default, runtime linking is enabled. All shared objects specified on the command line
# will be listed, even if there are no symbols referenced, in the output file.
-string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " -Wl,-brtl")
-string(APPEND CMAKE_MODULE_LINKER_FLAGS_INIT " -Wl,-brtl")
string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " -Wl,-brtl")
@@ -20,31 +18,20 @@ macro(__aix_compiler_xl lang)
set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-blibpath:")
set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":")
set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-G -Wl,-bnoipath") # -shared
- set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-bexpall")
+ set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-bexpall") # CMP0065 old behavior
set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS " ")
set(CMAKE_SHARED_MODULE_${lang}_FLAGS " ")
set(CMAKE_${lang}_LINK_FLAGS "-Wl,-bnoipath")
- # Find the CreateExportList program that comes with this toolchain.
- find_program(CMAKE_XL_CreateExportList
- NAMES CreateExportList
- DOC "IBM XL CreateExportList tool"
+ # Construct the export list ourselves to pass only the object files so
+ # that we export only the symbols actually provided by the sources.
+ set(CMAKE_${lang}_CREATE_SHARED_LIBRARY
+ "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o <OBJECT_DIR>/objects.exp <OBJECTS>"
+ "<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> -Wl,-bE:<OBJECT_DIR>/objects.exp <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>"
)
- # CMAKE_XL_CreateExportList is part of the AIX XL compilers but not the linux ones.
- # If we found the tool, we'll use it to create exports, otherwise stick with the regular
- # create shared library compile line.
- if (CMAKE_XL_CreateExportList)
- # The compiler front-end passes all object files, archive files, and shared
- # library files named on the command line to CreateExportList to create a
- # list of all symbols to be exported from the shared library. This causes
- # all archive members to be copied into the shared library whether they are
- # needed or not. Instead we run the tool ourselves to pass only the object
- # files so that we export only the symbols actually provided by the sources.
- set(CMAKE_${lang}_CREATE_SHARED_LIBRARY
- "${CMAKE_XL_CreateExportList} <OBJECT_DIR>/objects.exp <OBJECTS>"
- "<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> -Wl,-bE:<OBJECT_DIR>/objects.exp <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>"
- )
- endif()
+ set(CMAKE_${lang}_LINK_EXECUTABLE_WITH_EXPORTS
+ "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o <OBJECT_DIR>/objects.exp <OBJECTS>"
+ "<CMAKE_${lang}_COMPILER> <FLAGS> <CMAKE_${lang}_LINK_FLAGS> -Wl,-bE:<OBJECT_DIR>/objects.exp <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
endmacro()
diff --git a/Modules/Platform/AIX/ExportImportList b/Modules/Platform/AIX/ExportImportList
new file mode 100755
index 0000000..c17378c
--- /dev/null
+++ b/Modules/Platform/AIX/ExportImportList
@@ -0,0 +1,48 @@
+#!/bin/sh
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+# This script is internal to CMake and meant only to be
+# invoked by CMake-generated build systems on AIX.
+
+usage='usage: ExportImportList -o <out-file> [--] <objects>...'
+
+die() {
+ echo "$@" 1>&2; exit 1
+}
+
+# Process command-line arguments.
+out=''
+while test "$#" != 0; do
+ case "$1" in
+ -o) shift; out="$1" ;;
+ --) shift; break ;;
+ -*) die "$usage" ;;
+ *) break ;;
+ esac
+ shift
+done
+test -n "$out" || die "$usage"
+
+# Collect symbols exported from all object files.
+out_tmp="$out.tmp$$"
+trap 'rm -f "$out_tmp"' EXIT INT TERM
+for f in "$@"; do
+ dump -tov -X 32_64 "$f" |
+ awk '
+ BEGIN {
+ V["EXPORTED"]=" export"
+ V["PROTECTED"]=" protected"
+ }
+ /^\[[0-9]+\]\tm +[^ ]+ +\.(text|data|bss) +[^ ]+ +(extern|weak) +(EXPORTED|PROTECTED| ) / {
+ if (!match($NF,/^(\.|__sinit|__sterm|__[0-9]+__)/)) {
+ print $NF V[$(NF-1)]
+ }
+ }
+ '
+done > "$out_tmp"
+
+# Generate the export/import file.
+{
+ sort -u "$out_tmp"
+} > "$out"
diff --git a/Modules/Platform/Apple-XL-C.cmake b/Modules/Platform/Apple-XL-C.cmake
index 2aeb132..e4fc3dd 100644
--- a/Modules/Platform/Apple-XL-C.cmake
+++ b/Modules/Platform/Apple-XL-C.cmake
@@ -1,4 +1,3 @@
-set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-qmkshrobj")
set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle")
# Enable shared library versioning.
diff --git a/Modules/Platform/Apple-XL-CXX.cmake b/Modules/Platform/Apple-XL-CXX.cmake
index f8e1906..ea330c8 100644
--- a/Modules/Platform/Apple-XL-CXX.cmake
+++ b/Modules/Platform/Apple-XL-CXX.cmake
@@ -1,4 +1,3 @@
-set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-qmkshrobj")
set(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS "-bundle")
# Enable shared library versioning.
diff --git a/Modules/Platform/Linux-XL-C.cmake b/Modules/Platform/Linux-XL-C.cmake
index d595e44..ef0c52b 100644
--- a/Modules/Platform/Linux-XL-C.cmake
+++ b/Modules/Platform/Linux-XL-C.cmake
@@ -1,2 +1 @@
-set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-qmkshrobj")
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-export-dynamic")
diff --git a/Modules/Platform/Linux-XL-CXX.cmake b/Modules/Platform/Linux-XL-CXX.cmake
index 5ceb255..aa57d6e 100644
--- a/Modules/Platform/Linux-XL-CXX.cmake
+++ b/Modules/Platform/Linux-XL-CXX.cmake
@@ -1,2 +1 @@
-set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-qmkshrobj")
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "-Wl,-export-dynamic")
diff --git a/Modules/Platform/Linux-XL-Fortran.cmake b/Modules/Platform/Linux-XL-Fortran.cmake
index a878991..d9b4c2d 100644
--- a/Modules/Platform/Linux-XL-Fortran.cmake
+++ b/Modules/Platform/Linux-XL-Fortran.cmake
@@ -1,2 +1 @@
-set(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-qmkshrobj")
set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-Wl,-export-dynamic")
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index de66762..9c00c80 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 15)
-set(CMake_VERSION_PATCH 20190705)
+set(CMake_VERSION_PATCH 20190717)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
index 045d93d..fa64d79 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
@@ -604,7 +604,7 @@ std::string cmCPackWIXGenerator::GetRootFolderId() const
bool cmCPackWIXGenerator::GenerateMainSourceFileFromTemplate()
{
- std::string wixTemplate = FindTemplate("WIX.template.in");
+ std::string wixTemplate = FindTemplate("Internal/CPack/WIX.template.in");
if (GetOption("CPACK_WIX_TEMPLATE") != 0) {
wixTemplate = GetOption("CPACK_WIX_TEMPLATE");
}
diff --git a/Source/CPack/cmCPackExternalGenerator.cxx b/Source/CPack/cmCPackExternalGenerator.cxx
index 9dc9853..b4c7a5a 100644
--- a/Source/CPack/cmCPackExternalGenerator.cxx
+++ b/Source/CPack/cmCPackExternalGenerator.cxx
@@ -2,7 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCPackExternalGenerator.h"
-#include "cmAlgorithms.h"
#include "cmCPackComponentGroup.h"
#include "cmCPackLog.h"
#include "cmMakefile.h"
@@ -17,6 +16,8 @@
#include <utility>
#include <vector>
+#include "cm_memory.hxx"
+
int cmCPackExternalGenerator::InitializeInternal()
{
this->SetOption("CPACK_EXTERNAL_KNOWN_VERSIONS", "1.0");
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 7e07ff4..4a91698 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -7,7 +7,7 @@
#include "cmsys/RegularExpression.hxx"
#include <algorithm>
#include <cstring>
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <utility>
#include "cmCPackComponentGroup.h"
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index e2020c5..87c36fa 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -36,7 +36,8 @@ int cmCPackNSISGenerator::PackageFiles()
{
// TODO: Fix nsis to force out file name
- std::string nsisInFileName = this->FindTemplate("NSIS.template.in");
+ std::string nsisInFileName =
+ this->FindTemplate("Internal/CPack/NSIS.template.in");
if (nsisInFileName.empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPack error: Could not find NSIS installer template file."
@@ -44,7 +45,7 @@ int cmCPackNSISGenerator::PackageFiles()
return false;
}
std::string nsisInInstallOptions =
- this->FindTemplate("NSIS.InstallOptions.ini.in");
+ this->FindTemplate("Internal/CPack/NSIS.InstallOptions.ini.in");
if (nsisInInstallOptions.empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPack error: Could not find NSIS installer options file."
diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx
index 90e0afe..41470c9 100644
--- a/Source/CPack/cmCPackOSXX11Generator.cxx
+++ b/Source/CPack/cmCPackOSXX11Generator.cxx
@@ -245,7 +245,7 @@ bool cmCPackOSXX11Generator::CopyResourcePlistFile(
const std::string& name, const std::string& dir,
const char* outputFileName /* = 0 */, bool copyOnly /* = false */)
{
- std::string inFName = "CPack.";
+ std::string inFName = "Internal/CPack/CPack.";
inFName += name;
inFName += ".in";
std::string inFileName = this->FindTemplate(inFName.c_str());
diff --git a/Source/CPack/cmCPackPKGGenerator.cxx b/Source/CPack/cmCPackPKGGenerator.cxx
index 8c22c65..d361921 100644
--- a/Source/CPack/cmCPackPKGGenerator.cxx
+++ b/Source/CPack/cmCPackPKGGenerator.cxx
@@ -48,7 +48,7 @@ std::string cmCPackPKGGenerator::GetPackageName(
void cmCPackPKGGenerator::WriteDistributionFile(const char* metapackageFile)
{
std::string distributionTemplate =
- this->FindTemplate("CPack.distribution.dist.in");
+ this->FindTemplate("Internal/CPack/CPack.distribution.dist.in");
if (distributionTemplate.empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Cannot find input file: " << distributionTemplate
@@ -305,7 +305,7 @@ bool cmCPackPKGGenerator::CopyResourcePlistFile(const std::string& name,
outName = name.c_str();
}
- std::string inFName = "CPack.";
+ std::string inFName = "Internal/CPack/CPack.";
inFName += name;
inFName += ".in";
std::string inFileName = this->FindTemplate(inFName.c_str());
diff --git a/Source/CPack/cmCPackSTGZGenerator.cxx b/Source/CPack/cmCPackSTGZGenerator.cxx
index aba15d2..4666dc2 100644
--- a/Source/CPack/cmCPackSTGZGenerator.cxx
+++ b/Source/CPack/cmCPackSTGZGenerator.cxx
@@ -21,7 +21,8 @@ int cmCPackSTGZGenerator::InitializeInternal()
{
this->SetOptionIfNotSet("CPACK_INCLUDE_TOPLEVEL_DIRECTORY", "0");
- std::string inFile = this->FindTemplate("CPack.STGZ_Header.sh.in");
+ std::string inFile =
+ this->FindTemplate("Internal/CPack/CPack.STGZ_Header.sh.in");
if (inFile.empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Cannot find template file: " << inFile << std::endl);
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 58b9e70..c6018cf 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -5,7 +5,6 @@
#include "cmsys/Encoding.hxx"
#include <iostream>
#include <map>
-#include <memory> // IWYU pragma: keep
#include <sstream>
#include <stddef.h>
#include <string>
@@ -29,19 +28,20 @@
#include "cmSystemTools.h"
#include "cmake.h"
-static const char* cmDocumentationName[][2] = {
+namespace {
+const char* cmDocumentationName[][2] = {
{ nullptr, " cpack - Packaging driver provided by CMake." },
{ nullptr, nullptr }
};
-static const char* cmDocumentationUsage[][2] = {
+const char* cmDocumentationUsage[][2] = {
// clang-format off
{ nullptr, " cpack [options]" },
{ nullptr, nullptr }
// clang-format on
};
-static const char* cmDocumentationOptions[][2] = {
+const char* cmDocumentationOptions[][2] = {
{ "-G <generators>", "Override/define CPACK_GENERATOR" },
{ "-C <Configuration>", "Specify the project configuration" },
{ "-D <var>=<value>", "Set a CPack variable." },
@@ -90,10 +90,11 @@ int cpackDefinitionArgument(const char* argument, const char* cValue,
return 1;
}
-static void cpackProgressCallback(const std::string& message, float /*unused*/)
+void cpackProgressCallback(const std::string& message, float /*unused*/)
{
std::cout << "-- " << message << std::endl;
}
+} // namespace
// this is CPack.
int main(int argc, char const* const* argv)
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx
index 9ad9669..3aea1f4 100644
--- a/Source/CTest/cmCTestBuildAndTestHandler.cxx
+++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx
@@ -76,6 +76,11 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring,
if (config) {
args.push_back("-DCMAKE_BUILD_TYPE:STRING=" + std::string(config));
}
+ if (!this->BuildMakeProgram.empty() &&
+ (this->BuildGenerator.find("Make") != std::string::npos ||
+ this->BuildGenerator.find("Ninja") != std::string::npos)) {
+ args.push_back("-DCMAKE_MAKE_PROGRAM:FILEPATH=" + this->BuildMakeProgram);
+ }
for (std::string const& opt : this->BuildOptions) {
args.push_back(opt);
diff --git a/Source/CTest/cmCTestBuildCommand.h b/Source/CTest/cmCTestBuildCommand.h
index 77b0549..a62c301 100644
--- a/Source/CTest/cmCTestBuildCommand.h
+++ b/Source/CTest/cmCTestBuildCommand.h
@@ -6,13 +6,16 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestHandlerCommand.h"
+#include "cmCommand.h"
#include <string>
+#include <utility>
#include <vector>
+#include "cm_memory.hxx"
+
class cmCTestBuildHandler;
class cmCTestGenericHandler;
-class cmCommand;
class cmExecutionStatus;
class cmGlobalGenerator;
@@ -30,12 +33,12 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override
+ std::unique_ptr<cmCommand> Clone() override
{
- cmCTestBuildCommand* ni = new cmCTestBuildCommand;
+ auto ni = cm::make_unique<cmCTestBuildCommand>();
ni->CTest = this->CTest;
ni->CTestScriptHandler = this->CTestScriptHandler;
- return ni;
+ return std::unique_ptr<cmCommand>(std::move(ni));
}
/**
diff --git a/Source/CTest/cmCTestConfigureCommand.h b/Source/CTest/cmCTestConfigureCommand.h
index 0cbcbfa..4677c83 100644
--- a/Source/CTest/cmCTestConfigureCommand.h
+++ b/Source/CTest/cmCTestConfigureCommand.h
@@ -6,11 +6,14 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestHandlerCommand.h"
+#include "cmCommand.h"
#include <string>
+#include <utility>
+
+#include "cm_memory.hxx"
class cmCTestGenericHandler;
-class cmCommand;
/** \class cmCTestConfigure
* \brief Run a ctest script
@@ -25,12 +28,12 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override
+ std::unique_ptr<cmCommand> Clone() override
{
- cmCTestConfigureCommand* ni = new cmCTestConfigureCommand;
+ auto ni = cm::make_unique<cmCTestConfigureCommand>();
ni->CTest = this->CTest;
ni->CTestScriptHandler = this->CTestScriptHandler;
- return ni;
+ return std::unique_ptr<cmCommand>(std::move(ni));
}
/**
diff --git a/Source/CTest/cmCTestCoverageCommand.h b/Source/CTest/cmCTestCoverageCommand.h
index 1ae2d86..08f31f7 100644
--- a/Source/CTest/cmCTestCoverageCommand.h
+++ b/Source/CTest/cmCTestCoverageCommand.h
@@ -6,12 +6,15 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestHandlerCommand.h"
+#include "cmCommand.h"
#include <set>
#include <string>
+#include <utility>
+
+#include "cm_memory.hxx"
class cmCTestGenericHandler;
-class cmCommand;
/** \class cmCTestCoverage
* \brief Run a ctest script
@@ -26,12 +29,12 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override
+ std::unique_ptr<cmCommand> Clone() override
{
- cmCTestCoverageCommand* ni = new cmCTestCoverageCommand;
+ auto ni = cm::make_unique<cmCTestCoverageCommand>();
ni->CTest = this->CTest;
ni->CTestScriptHandler = this->CTestScriptHandler;
- return ni;
+ return std::unique_ptr<cmCommand>(std::move(ni));
}
/**
diff --git a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h
index 9425ece..84250cb 100644
--- a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h
+++ b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h
@@ -6,11 +6,14 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestCommand.h"
+#include "cmCommand.h"
#include <string>
+#include <utility>
#include <vector>
-class cmCommand;
+#include "cm_memory.hxx"
+
class cmExecutionStatus;
/** \class cmCTestEmptyBinaryDirectory
@@ -27,13 +30,12 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override
+ std::unique_ptr<cmCommand> Clone() override
{
- cmCTestEmptyBinaryDirectoryCommand* ni =
- new cmCTestEmptyBinaryDirectoryCommand;
+ auto ni = cm::make_unique<cmCTestEmptyBinaryDirectoryCommand>();
ni->CTest = this->CTest;
ni->CTestScriptHandler = this->CTestScriptHandler;
- return ni;
+ return std::unique_ptr<cmCommand>(std::move(ni));
}
/**
diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx
index a96513e..237ca82 100644
--- a/Source/CTest/cmCTestLaunch.cxx
+++ b/Source/CTest/cmCTestLaunch.cxx
@@ -6,7 +6,6 @@
#include "cmsys/Process.h"
#include "cmsys/RegularExpression.hxx"
#include <iostream>
-#include <memory> // IWYU pragma: keep
#include <stdlib.h>
#include <string.h>
diff --git a/Source/CTest/cmCTestMemCheckCommand.h b/Source/CTest/cmCTestMemCheckCommand.h
index b6b3c40..837a687 100644
--- a/Source/CTest/cmCTestMemCheckCommand.h
+++ b/Source/CTest/cmCTestMemCheckCommand.h
@@ -5,10 +5,14 @@
#include "cmConfigure.h" // IWYU pragma: keep
+#include <utility>
+
+#include "cm_memory.hxx"
+
#include "cmCTestTestCommand.h"
+#include "cmCommand.h"
class cmCTestGenericHandler;
-class cmCommand;
/** \class cmCTestMemCheck
* \brief Run a ctest script
@@ -23,12 +27,12 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override
+ std::unique_ptr<cmCommand> Clone() override
{
- cmCTestMemCheckCommand* ni = new cmCTestMemCheckCommand;
+ auto ni = cm::make_unique<cmCTestMemCheckCommand>();
ni->CTest = this->CTest;
ni->CTestScriptHandler = this->CTestScriptHandler;
- return ni;
+ return std::unique_ptr<cmCommand>(std::move(ni));
}
protected:
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index ef63073..37a8abf 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -29,11 +29,13 @@
#include <iostream>
#include <list>
#include <math.h>
+#include <memory>
#include <sstream>
#include <stack>
#include <stdlib.h>
#include <unordered_map>
#include <utility>
+#include <vector>
namespace cmsys {
class RegularExpression;
diff --git a/Source/CTest/cmCTestReadCustomFilesCommand.h b/Source/CTest/cmCTestReadCustomFilesCommand.h
index ba25c51..db2ac5e 100644
--- a/Source/CTest/cmCTestReadCustomFilesCommand.h
+++ b/Source/CTest/cmCTestReadCustomFilesCommand.h
@@ -6,11 +6,14 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestCommand.h"
+#include "cmCommand.h"
#include <string>
+#include <utility>
#include <vector>
-class cmCommand;
+#include "cm_memory.hxx"
+
class cmExecutionStatus;
/** \class cmCTestReadCustomFiles
@@ -27,11 +30,11 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override
+ std::unique_ptr<cmCommand> Clone() override
{
- cmCTestReadCustomFilesCommand* ni = new cmCTestReadCustomFilesCommand;
+ auto ni = cm::make_unique<cmCTestReadCustomFilesCommand>();
ni->CTest = this->CTest;
- return ni;
+ return std::unique_ptr<cmCommand>(std::move(ni));
}
/**
diff --git a/Source/CTest/cmCTestRunScriptCommand.h b/Source/CTest/cmCTestRunScriptCommand.h
index 9d8b4b5..6961f6e 100644
--- a/Source/CTest/cmCTestRunScriptCommand.h
+++ b/Source/CTest/cmCTestRunScriptCommand.h
@@ -6,11 +6,14 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestCommand.h"
+#include "cmCommand.h"
#include <string>
+#include <utility>
#include <vector>
-class cmCommand;
+#include "cm_memory.hxx"
+
class cmExecutionStatus;
/** \class cmCTestRunScript
@@ -27,12 +30,12 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override
+ std::unique_ptr<cmCommand> Clone() override
{
- cmCTestRunScriptCommand* ni = new cmCTestRunScriptCommand;
+ auto ni = cm::make_unique<cmCTestRunScriptCommand>();
ni->CTest = this->CTest;
ni->CTestScriptHandler = this->CTestScriptHandler;
- return ni;
+ return std::unique_ptr<cmCommand>(std::move(ni));
}
/**
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index 31976b9..f9ac1eb 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -11,7 +11,6 @@
#include "cmsys/RegularExpression.hxx"
#include <chrono>
-#include <cmAlgorithms.h>
#include <cstdint>
#include <cstring>
#include <iomanip>
@@ -20,6 +19,8 @@
#include <stdio.h>
#include <utility>
+#include "cm_memory.hxx"
+
cmCTestRunTest::cmCTestRunTest(cmCTestMultiProcessHandler& multiHandler)
: MultiTestHandler(multiHandler)
{
@@ -85,27 +86,30 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
if (pass.first.find(this->ProcessOutput)) {
found = true;
reason = "Required regular expression found.";
+ reason += " Regex=[";
+ reason += pass.second;
+ reason += "]";
break;
}
}
if (!found) {
reason = "Required regular expression not found.";
+ reason += " Regex=[";
+ for (auto& pass : this->TestProperties->RequiredRegularExpressions) {
+ reason += pass.second;
+ reason += "\n";
+ }
+ reason += "]";
forceFail = true;
}
- reason += "Regex=[";
- for (auto& pass : this->TestProperties->RequiredRegularExpressions) {
- reason += pass.second;
- reason += "\n";
- }
- reason += "]";
}
if (!this->TestProperties->ErrorRegularExpressions.empty() &&
this->FailedDependencies.empty()) {
- for (auto& pass : this->TestProperties->ErrorRegularExpressions) {
- if (pass.first.find(this->ProcessOutput)) {
+ for (auto& fail : this->TestProperties->ErrorRegularExpressions) {
+ if (fail.first.find(this->ProcessOutput)) {
reason = "Error regular expression found in output.";
reason += " Regex=[";
- reason += pass.second;
+ reason += fail.second;
reason += "]";
forceFail = true;
break;
diff --git a/Source/CTest/cmCTestRunTest.h b/Source/CTest/cmCTestRunTest.h
index 38cc417..43dfe8e 100644
--- a/Source/CTest/cmCTestRunTest.h
+++ b/Source/CTest/cmCTestRunTest.h
@@ -5,6 +5,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
+#include <memory>
#include <set>
#include <stddef.h>
#include <string>
@@ -12,7 +13,7 @@
#include "cmCTestTestHandler.h"
#include "cmDuration.h"
-#include "cmProcess.h" // IWYU pragma: keep (for unique_ptr)
+#include "cmProcess.h"
class cmCTest;
class cmCTestMultiProcessHandler;
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx
index a739f44..861bd06 100644
--- a/Source/CTest/cmCTestScriptHandler.cxx
+++ b/Source/CTest/cmCTestScriptHandler.cxx
@@ -12,6 +12,8 @@
#include <string.h>
#include <utility>
+#include "cm_memory.hxx"
+
#include "cmCTest.h"
#include "cmCTestBuildCommand.h"
#include "cmCTestCommand.h"
@@ -27,6 +29,7 @@
#include "cmCTestTestCommand.h"
#include "cmCTestUpdateCommand.h"
#include "cmCTestUploadCommand.h"
+#include "cmCommand.h"
#include "cmDuration.h"
#include "cmFunctionBlocker.h"
#include "cmGeneratedFileStream.h"
@@ -167,12 +170,12 @@ void cmCTestScriptHandler::UpdateElapsedTime()
}
}
-void cmCTestScriptHandler::AddCTestCommand(std::string const& name,
- cmCTestCommand* command)
+void cmCTestScriptHandler::AddCTestCommand(
+ std::string const& name, std::unique_ptr<cmCTestCommand> command)
{
command->CTest = this->CTest;
command->CTestScriptHandler = this;
- this->CMake->GetState()->AddBuiltinCommand(name, command);
+ this->CMake->GetState()->AddBuiltinCommand(name, std::move(command));
}
int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg)
@@ -295,21 +298,28 @@ void cmCTestScriptHandler::CreateCMake()
}
});
- this->AddCTestCommand("ctest_build", new cmCTestBuildCommand);
- this->AddCTestCommand("ctest_configure", new cmCTestConfigureCommand);
- this->AddCTestCommand("ctest_coverage", new cmCTestCoverageCommand);
+ this->AddCTestCommand("ctest_build", cm::make_unique<cmCTestBuildCommand>());
+ this->AddCTestCommand("ctest_configure",
+ cm::make_unique<cmCTestConfigureCommand>());
+ this->AddCTestCommand("ctest_coverage",
+ cm::make_unique<cmCTestCoverageCommand>());
this->AddCTestCommand("ctest_empty_binary_directory",
- new cmCTestEmptyBinaryDirectoryCommand);
- this->AddCTestCommand("ctest_memcheck", new cmCTestMemCheckCommand);
+ cm::make_unique<cmCTestEmptyBinaryDirectoryCommand>());
+ this->AddCTestCommand("ctest_memcheck",
+ cm::make_unique<cmCTestMemCheckCommand>());
this->AddCTestCommand("ctest_read_custom_files",
- new cmCTestReadCustomFilesCommand);
- this->AddCTestCommand("ctest_run_script", new cmCTestRunScriptCommand);
- this->AddCTestCommand("ctest_sleep", new cmCTestSleepCommand);
- this->AddCTestCommand("ctest_start", new cmCTestStartCommand);
- this->AddCTestCommand("ctest_submit", new cmCTestSubmitCommand);
- this->AddCTestCommand("ctest_test", new cmCTestTestCommand);
- this->AddCTestCommand("ctest_update", new cmCTestUpdateCommand);
- this->AddCTestCommand("ctest_upload", new cmCTestUploadCommand);
+ cm::make_unique<cmCTestReadCustomFilesCommand>());
+ this->AddCTestCommand("ctest_run_script",
+ cm::make_unique<cmCTestRunScriptCommand>());
+ this->AddCTestCommand("ctest_sleep", cm::make_unique<cmCTestSleepCommand>());
+ this->AddCTestCommand("ctest_start", cm::make_unique<cmCTestStartCommand>());
+ this->AddCTestCommand("ctest_submit",
+ cm::make_unique<cmCTestSubmitCommand>());
+ this->AddCTestCommand("ctest_test", cm::make_unique<cmCTestTestCommand>());
+ this->AddCTestCommand("ctest_update",
+ cm::make_unique<cmCTestUpdateCommand>());
+ this->AddCTestCommand("ctest_upload",
+ cm::make_unique<cmCTestUploadCommand>());
}
// this sets up some variables for the script to use, creates the required
diff --git a/Source/CTest/cmCTestScriptHandler.h b/Source/CTest/cmCTestScriptHandler.h
index d93b5f8..b2e8cbf 100644
--- a/Source/CTest/cmCTestScriptHandler.h
+++ b/Source/CTest/cmCTestScriptHandler.h
@@ -9,6 +9,7 @@
#include "cmDuration.h"
#include <chrono>
+#include <memory>
#include <string>
#include <vector>
@@ -131,7 +132,8 @@ private:
int RunConfigurationDashboard();
// Add ctest command
- void AddCTestCommand(std::string const& name, cmCTestCommand* command);
+ void AddCTestCommand(std::string const& name,
+ std::unique_ptr<cmCTestCommand> command);
// Try to remove the binary directory once
static bool TryToRemoveBinaryDirectoryOnce(const std::string& directoryPath);
diff --git a/Source/CTest/cmCTestSleepCommand.h b/Source/CTest/cmCTestSleepCommand.h
index 5cd185a..7b17081 100644
--- a/Source/CTest/cmCTestSleepCommand.h
+++ b/Source/CTest/cmCTestSleepCommand.h
@@ -6,11 +6,14 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestCommand.h"
+#include "cmCommand.h"
#include <string>
+#include <utility>
#include <vector>
-class cmCommand;
+#include "cm_memory.hxx"
+
class cmExecutionStatus;
/** \class cmCTestSleep
@@ -27,12 +30,12 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override
+ std::unique_ptr<cmCommand> Clone() override
{
- cmCTestSleepCommand* ni = new cmCTestSleepCommand;
+ auto ni = cm::make_unique<cmCTestSleepCommand>();
ni->CTest = this->CTest;
ni->CTestScriptHandler = this->CTestScriptHandler;
- return ni;
+ return std::unique_ptr<cmCommand>(std::move(ni));
}
/**
diff --git a/Source/CTest/cmCTestStartCommand.h b/Source/CTest/cmCTestStartCommand.h
index 542f27c..7c71f36 100644
--- a/Source/CTest/cmCTestStartCommand.h
+++ b/Source/CTest/cmCTestStartCommand.h
@@ -6,12 +6,15 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestCommand.h"
+#include "cmCommand.h"
#include <iosfwd>
#include <string>
+#include <utility>
#include <vector>
-class cmCommand;
+#include "cm_memory.hxx"
+
class cmExecutionStatus;
/** \class cmCTestStart
@@ -27,14 +30,14 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override
+ std::unique_ptr<cmCommand> Clone() override
{
- cmCTestStartCommand* ni = new cmCTestStartCommand;
+ auto ni = cm::make_unique<cmCTestStartCommand>();
ni->CTest = this->CTest;
ni->CTestScriptHandler = this->CTestScriptHandler;
ni->CreateNewTag = this->CreateNewTag;
ni->Quiet = this->Quiet;
- return ni;
+ return std::unique_ptr<cmCommand>(std::move(ni));
}
/**
diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx
index afc3e67..bf43d88 100644
--- a/Source/CTest/cmCTestSubmitCommand.cxx
+++ b/Source/CTest/cmCTestSubmitCommand.cxx
@@ -4,11 +4,15 @@
#include "cmCTest.h"
#include "cmCTestSubmitHandler.h"
+#include "cmCommand.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmSystemTools.h"
#include <sstream>
+#include <utility>
+
+#include "cm_memory.hxx"
class cmExecutionStatus;
@@ -27,12 +31,12 @@ cmCTestSubmitCommand::cmCTestSubmitCommand()
/**
* This is a virtual constructor for the command.
*/
-cmCommand* cmCTestSubmitCommand::Clone()
+std::unique_ptr<cmCommand> cmCTestSubmitCommand::Clone()
{
- cmCTestSubmitCommand* ni = new cmCTestSubmitCommand;
+ auto ni = cm::make_unique<cmCTestSubmitCommand>();
ni->CTest = this->CTest;
ni->CTestScriptHandler = this->CTestScriptHandler;
- return ni;
+ return std::unique_ptr<cmCommand>(std::move(ni));
}
cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
diff --git a/Source/CTest/cmCTestSubmitCommand.h b/Source/CTest/cmCTestSubmitCommand.h
index 1e27046..5bbcd39 100644
--- a/Source/CTest/cmCTestSubmitCommand.h
+++ b/Source/CTest/cmCTestSubmitCommand.h
@@ -8,12 +8,13 @@
#include "cmCTest.h"
#include "cmCTestHandlerCommand.h"
+#include <memory>
#include <set>
#include <string>
#include <vector>
-class cmCTestGenericHandler;
class cmCommand;
+class cmCTestGenericHandler;
class cmExecutionStatus;
/** \class cmCTestSubmit
@@ -26,7 +27,7 @@ class cmCTestSubmitCommand : public cmCTestHandlerCommand
{
public:
cmCTestSubmitCommand();
- cmCommand* Clone() override;
+ std::unique_ptr<cmCommand> Clone() override;
bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus& status) override;
diff --git a/Source/CTest/cmCTestTestCommand.h b/Source/CTest/cmCTestTestCommand.h
index 11c0db9..d74136c 100644
--- a/Source/CTest/cmCTestTestCommand.h
+++ b/Source/CTest/cmCTestTestCommand.h
@@ -6,11 +6,14 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestHandlerCommand.h"
+#include "cmCommand.h"
#include <string>
+#include <utility>
+
+#include "cm_memory.hxx"
class cmCTestGenericHandler;
-class cmCommand;
/** \class cmCTestTest
* \brief Run a ctest script
@@ -25,12 +28,12 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override
+ std::unique_ptr<cmCommand> Clone() override
{
- cmCTestTestCommand* ni = new cmCTestTestCommand;
+ auto ni = cm::make_unique<cmCTestTestCommand>();
ni->CTest = this->CTest;
ni->CTestScriptHandler = this->CTestScriptHandler;
- return ni;
+ return std::unique_ptr<cmCommand>(std::move(ni));
}
/**
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 0ed56c8..9916ca3 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -11,12 +11,14 @@
#include <functional>
#include <iomanip>
#include <iterator>
-#include <memory> // IWYU pragma: keep
#include <set>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
+#include <utility>
+
+#include "cm_memory.hxx"
#include "cmAlgorithms.h"
#include "cmCTest.h"
@@ -43,11 +45,11 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override
+ std::unique_ptr<cmCommand> Clone() override
{
- cmCTestSubdirCommand* c = new cmCTestSubdirCommand;
+ auto c = cm::make_unique<cmCTestSubdirCommand>();
c->TestHandler = this->TestHandler;
- return c;
+ return std::unique_ptr<cmCommand>(std::move(c));
}
/**
@@ -122,11 +124,11 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override
+ std::unique_ptr<cmCommand> Clone() override
{
- cmCTestAddSubdirectoryCommand* c = new cmCTestAddSubdirectoryCommand;
+ auto c = cm::make_unique<cmCTestAddSubdirectoryCommand>();
c->TestHandler = this->TestHandler;
- return c;
+ return std::unique_ptr<cmCommand>(std::move(c));
}
/**
@@ -187,11 +189,11 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override
+ std::unique_ptr<cmCommand> Clone() override
{
- cmCTestAddTestCommand* c = new cmCTestAddTestCommand;
+ auto c = cm::make_unique<cmCTestAddTestCommand>();
c->TestHandler = this->TestHandler;
- return c;
+ return std::unique_ptr<cmCommand>(std::move(c));
}
/**
@@ -220,11 +222,11 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override
+ std::unique_ptr<cmCommand> Clone() override
{
- cmCTestSetTestsPropertiesCommand* c = new cmCTestSetTestsPropertiesCommand;
+ auto c = cm::make_unique<cmCTestSetTestsPropertiesCommand>();
c->TestHandler = this->TestHandler;
- return c;
+ return std::unique_ptr<cmCommand>(std::move(c));
}
/**
@@ -249,12 +251,11 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override
+ std::unique_ptr<cmCommand> Clone() override
{
- cmCTestSetDirectoryPropertiesCommand* c =
- new cmCTestSetDirectoryPropertiesCommand;
+ auto c = cm::make_unique<cmCTestSetDirectoryPropertiesCommand>();
c->TestHandler = this->TestHandler;
- return c;
+ return std::unique_ptr<cmCommand>(std::move(c));
}
/**
@@ -1686,32 +1687,31 @@ void cmCTestTestHandler::GetListOfTests()
this->CTest->GetConfigType().c_str());
// Add handler for ADD_TEST
- cmCTestAddTestCommand* newCom1 = new cmCTestAddTestCommand;
+ auto newCom1 = cm::make_unique<cmCTestAddTestCommand>();
newCom1->TestHandler = this;
- cm.GetState()->AddBuiltinCommand("add_test", newCom1);
+ cm.GetState()->AddBuiltinCommand("add_test", std::move(newCom1));
// Add handler for SUBDIRS
- cmCTestSubdirCommand* newCom2 = new cmCTestSubdirCommand;
+ auto newCom2 = cm::make_unique<cmCTestSubdirCommand>();
newCom2->TestHandler = this;
- cm.GetState()->AddBuiltinCommand("subdirs", newCom2);
+ cm.GetState()->AddBuiltinCommand("subdirs", std::move(newCom2));
// Add handler for ADD_SUBDIRECTORY
- cmCTestAddSubdirectoryCommand* newCom3 = new cmCTestAddSubdirectoryCommand;
+ auto newCom3 = cm::make_unique<cmCTestAddSubdirectoryCommand>();
newCom3->TestHandler = this;
- cm.GetState()->AddBuiltinCommand("add_subdirectory", newCom3);
+ cm.GetState()->AddBuiltinCommand("add_subdirectory", std::move(newCom3));
// Add handler for SET_TESTS_PROPERTIES
- cmCTestSetTestsPropertiesCommand* newCom4 =
- new cmCTestSetTestsPropertiesCommand;
+ auto newCom4 = cm::make_unique<cmCTestSetTestsPropertiesCommand>();
newCom4->TestHandler = this;
- cm.GetState()->AddBuiltinCommand("set_tests_properties", newCom4);
+ cm.GetState()->AddBuiltinCommand("set_tests_properties", std::move(newCom4));
// Add handler for SET_DIRECTORY_PROPERTIES
cm.GetState()->RemoveBuiltinCommand("set_directory_properties");
- cmCTestSetDirectoryPropertiesCommand* newCom5 =
- new cmCTestSetDirectoryPropertiesCommand;
+ auto newCom5 = cm::make_unique<cmCTestSetDirectoryPropertiesCommand>();
newCom5->TestHandler = this;
- cm.GetState()->AddBuiltinCommand("set_directory_properties", newCom5);
+ cm.GetState()->AddBuiltinCommand("set_directory_properties",
+ std::move(newCom5));
const char* testFilename;
if (cmSystemTools::FileExists("CTestTestfile.cmake")) {
diff --git a/Source/CTest/cmCTestUpdateCommand.h b/Source/CTest/cmCTestUpdateCommand.h
index 3b2f3e1..55c4b80 100644
--- a/Source/CTest/cmCTestUpdateCommand.h
+++ b/Source/CTest/cmCTestUpdateCommand.h
@@ -6,11 +6,14 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestHandlerCommand.h"
+#include "cmCommand.h"
#include <string>
+#include <utility>
+
+#include "cm_memory.hxx"
class cmCTestGenericHandler;
-class cmCommand;
/** \class cmCTestUpdate
* \brief Run a ctest script
@@ -25,12 +28,12 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override
+ std::unique_ptr<cmCommand> Clone() override
{
- cmCTestUpdateCommand* ni = new cmCTestUpdateCommand;
+ auto ni = cm::make_unique<cmCTestUpdateCommand>();
ni->CTest = this->CTest;
ni->CTestScriptHandler = this->CTestScriptHandler;
- return ni;
+ return std::unique_ptr<cmCommand>(std::move(ni));
}
/**
diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx
index 5cfc4a7..d80b5a5 100644
--- a/Source/CTest/cmCTestUpdateHandler.cxx
+++ b/Source/CTest/cmCTestUpdateHandler.cxx
@@ -2,7 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCTestUpdateHandler.h"
-#include "cmAlgorithms.h"
#include "cmCLocaleEnvironmentScope.h"
#include "cmCTest.h"
#include "cmCTestBZR.h"
@@ -18,9 +17,10 @@
#include "cmXMLWriter.h"
#include <chrono>
-#include <memory> // IWYU pragma: keep
#include <sstream>
+#include "cm_memory.hxx"
+
static const char* cmCTestUpdateHandlerUpdateStrings[] = {
"Unknown", "CVS", "SVN", "BZR", "GIT", "HG", "P4"
};
diff --git a/Source/CTest/cmCTestUploadCommand.h b/Source/CTest/cmCTestUploadCommand.h
index 0d3b06e..2bb072f 100644
--- a/Source/CTest/cmCTestUploadCommand.h
+++ b/Source/CTest/cmCTestUploadCommand.h
@@ -6,12 +6,15 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestHandlerCommand.h"
+#include "cmCommand.h"
#include <set>
#include <string>
+#include <utility>
+
+#include "cm_memory.hxx"
class cmCTestGenericHandler;
-class cmCommand;
/** \class cmCTestUpload
* \brief Run a ctest script
@@ -25,12 +28,12 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override
+ std::unique_ptr<cmCommand> Clone() override
{
- cmCTestUploadCommand* ni = new cmCTestUploadCommand;
+ auto ni = cm::make_unique<cmCTestUploadCommand>();
ni->CTest = this->CTest;
ni->CTestScriptHandler = this->CTestScriptHandler;
- return ni;
+ return std::unique_ptr<cmCommand>(std::move(ni));
}
/**
diff --git a/Source/cmAddCompileDefinitionsCommand.h b/Source/cmAddCompileDefinitionsCommand.h
index e985dca..5f90ed9 100644
--- a/Source/cmAddCompileDefinitionsCommand.h
+++ b/Source/cmAddCompileDefinitionsCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -18,7 +20,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmAddCompileDefinitionsCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmAddCompileDefinitionsCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmAddCompileOptionsCommand.h b/Source/cmAddCompileOptionsCommand.h
index 3d53d09..b34b7fc 100644
--- a/Source/cmAddCompileOptionsCommand.h
+++ b/Source/cmAddCompileOptionsCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -18,7 +20,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmAddCompileOptionsCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmAddCompileOptionsCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmAddCustomCommandCommand.h b/Source/cmAddCustomCommandCommand.h
index 6af4f10..931aeab 100644
--- a/Source/cmAddCustomCommandCommand.h
+++ b/Source/cmAddCustomCommandCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -24,7 +26,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmAddCustomCommandCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmAddCustomCommandCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmAddCustomTargetCommand.h b/Source/cmAddCustomTargetCommand.h
index 1a55116..db577bc 100644
--- a/Source/cmAddCustomTargetCommand.h
+++ b/Source/cmAddCustomTargetCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -25,7 +27,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmAddCustomTargetCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmAddCustomTargetCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmAddDefinitionsCommand.h b/Source/cmAddDefinitionsCommand.h
index 7b75638..0e32c83 100644
--- a/Source/cmAddDefinitionsCommand.h
+++ b/Source/cmAddDefinitionsCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -24,7 +26,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmAddDefinitionsCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmAddDefinitionsCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmAddDependenciesCommand.h b/Source/cmAddDependenciesCommand.h
index e10df71..ce912d3 100644
--- a/Source/cmAddDependenciesCommand.h
+++ b/Source/cmAddDependenciesCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -23,7 +25,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmAddDependenciesCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmAddDependenciesCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmAddExecutableCommand.h b/Source/cmAddExecutableCommand.h
index bdf607d..ec57c3f 100644
--- a/Source/cmAddExecutableCommand.h
+++ b/Source/cmAddExecutableCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -24,7 +26,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmAddExecutableCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmAddExecutableCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmAddLibraryCommand.h b/Source/cmAddLibraryCommand.h
index aa21261..56dab41 100644
--- a/Source/cmAddLibraryCommand.h
+++ b/Source/cmAddLibraryCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -24,7 +26,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmAddLibraryCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmAddLibraryCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmAddLinkOptionsCommand.h b/Source/cmAddLinkOptionsCommand.h
index 30fff00..8e46be6 100644
--- a/Source/cmAddLinkOptionsCommand.h
+++ b/Source/cmAddLinkOptionsCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -18,7 +20,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmAddLinkOptionsCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmAddLinkOptionsCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmAddSubDirectoryCommand.h b/Source/cmAddSubDirectoryCommand.h
index 0ea4423..664334e 100644
--- a/Source/cmAddSubDirectoryCommand.h
+++ b/Source/cmAddSubDirectoryCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -25,7 +27,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmAddSubDirectoryCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmAddSubDirectoryCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmAddTestCommand.h b/Source/cmAddTestCommand.h
index bea3f3d..3d37d2b 100644
--- a/Source/cmAddTestCommand.h
+++ b/Source/cmAddTestCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -23,7 +25,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmAddTestCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmAddTestCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h
index d1e32b0..d153076 100644
--- a/Source/cmAlgorithms.h
+++ b/Source/cmAlgorithms.h
@@ -11,7 +11,6 @@
#include <algorithm>
#include <functional>
#include <iterator>
-#include <memory>
#include <sstream>
#include <string.h>
#include <string>
@@ -340,20 +339,6 @@ inline void cmStripSuffixIfExists(std::string& str, const std::string& suffix)
namespace cm {
-#if defined(CMake_HAVE_CXX_MAKE_UNIQUE)
-
-using std::make_unique;
-
-#else
-
-template <typename T, typename... Args>
-std::unique_ptr<T> make_unique(Args&&... args)
-{
- return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
-}
-
-#endif
-
#if __cplusplus >= 201703L || defined(_MSVC_LANG) && _MSVC_LANG >= 201703L
using std::size;
diff --git a/Source/cmAuxSourceDirectoryCommand.h b/Source/cmAuxSourceDirectoryCommand.h
index 3742e3e..973a464 100644
--- a/Source/cmAuxSourceDirectoryCommand.h
+++ b/Source/cmAuxSourceDirectoryCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -27,7 +29,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmAuxSourceDirectoryCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmAuxSourceDirectoryCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmBinUtilsLinuxELFLinker.cxx b/Source/cmBinUtilsLinuxELFLinker.cxx
index 4fb15f2..86846cb 100644
--- a/Source/cmBinUtilsLinuxELFLinker.cxx
+++ b/Source/cmBinUtilsLinuxELFLinker.cxx
@@ -2,7 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmBinUtilsLinuxELFLinker.h"
-#include "cmAlgorithms.h"
+
#include "cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool.h"
#include "cmLDConfigLDConfigTool.h"
#include "cmMakefile.h"
@@ -12,9 +12,10 @@
#include <cmsys/RegularExpression.hxx>
-#include <memory>
#include <sstream>
+#include "cm_memory.hxx"
+
static std::string ReplaceOrigin(const std::string& rpath,
const std::string& origin)
{
diff --git a/Source/cmBinUtilsLinuxELFLinker.h b/Source/cmBinUtilsLinuxELFLinker.h
index 348edc4..e209637 100644
--- a/Source/cmBinUtilsLinuxELFLinker.h
+++ b/Source/cmBinUtilsLinuxELFLinker.h
@@ -9,7 +9,7 @@
#include "cmLDConfigTool.h"
#include "cmStateTypes.h"
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <string>
#include <vector>
diff --git a/Source/cmBinUtilsMacOSMachOLinker.cxx b/Source/cmBinUtilsMacOSMachOLinker.cxx
index e219847..ac93155 100644
--- a/Source/cmBinUtilsMacOSMachOLinker.cxx
+++ b/Source/cmBinUtilsMacOSMachOLinker.cxx
@@ -12,6 +12,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
cmBinUtilsMacOSMachOLinker::cmBinUtilsMacOSMachOLinker(
cmRuntimeDependencyArchive* archive)
: cmBinUtilsLinker(archive)
diff --git a/Source/cmBinUtilsMacOSMachOLinker.h b/Source/cmBinUtilsMacOSMachOLinker.h
index 0350d1e..f4f309d 100644
--- a/Source/cmBinUtilsMacOSMachOLinker.h
+++ b/Source/cmBinUtilsMacOSMachOLinker.h
@@ -8,7 +8,7 @@
#include "cmBinUtilsMacOSMachOGetRuntimeDependenciesTool.h"
#include "cmStateTypes.h"
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <string>
#include <vector>
diff --git a/Source/cmBinUtilsWindowsPELinker.cxx b/Source/cmBinUtilsWindowsPELinker.cxx
index 796e9ed..31602c4 100644
--- a/Source/cmBinUtilsWindowsPELinker.cxx
+++ b/Source/cmBinUtilsWindowsPELinker.cxx
@@ -2,16 +2,17 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmBinUtilsWindowsPELinker.h"
-#include "cmAlgorithms.h"
+
#include "cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool.h"
#include "cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.h"
#include "cmRuntimeDependencyArchive.h"
#include "cmSystemTools.h"
-#include <memory>
#include <sstream>
#include <vector>
+#include "cm_memory.hxx"
+
#ifdef _WIN32
# include <windows.h>
#endif
diff --git a/Source/cmBinUtilsWindowsPELinker.h b/Source/cmBinUtilsWindowsPELinker.h
index d742195..8d2bf4b 100644
--- a/Source/cmBinUtilsWindowsPELinker.h
+++ b/Source/cmBinUtilsWindowsPELinker.h
@@ -8,7 +8,7 @@
#include "cmBinUtilsWindowsPEGetRuntimeDependenciesTool.h"
#include "cmStateTypes.h"
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <string>
class cmRuntimeDependencyArchive;
diff --git a/Source/cmBreakCommand.h b/Source/cmBreakCommand.h
index 3b18567..e6f218e 100644
--- a/Source/cmBreakCommand.h
+++ b/Source/cmBreakCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -23,7 +25,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmBreakCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmBreakCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmBuildCommand.h b/Source/cmBuildCommand.h
index e0529a4..d373103 100644
--- a/Source/cmBuildCommand.h
+++ b/Source/cmBuildCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -23,7 +25,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmBuildCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmBuildCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmBuildNameCommand.h b/Source/cmBuildNameCommand.h
index 4bb72d1..bd2d146 100644
--- a/Source/cmBuildNameCommand.h
+++ b/Source/cmBuildNameCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -15,7 +17,10 @@ class cmExecutionStatus;
class cmBuildNameCommand : public cmCommand
{
public:
- cmCommand* Clone() override { return new cmBuildNameCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmBuildNameCommand>();
+ }
bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus& status) override;
};
diff --git a/Source/cmCMakeHostSystemInformationCommand.h b/Source/cmCMakeHostSystemInformationCommand.h
index b871641..8ea2d55 100644
--- a/Source/cmCMakeHostSystemInformationCommand.h
+++ b/Source/cmCMakeHostSystemInformationCommand.h
@@ -9,6 +9,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -28,9 +30,9 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override
+ std::unique_ptr<cmCommand> Clone() override
{
- return new cmCMakeHostSystemInformationCommand;
+ return cm::make_unique<cmCMakeHostSystemInformationCommand>();
}
/**
diff --git a/Source/cmCMakeMinimumRequired.h b/Source/cmCMakeMinimumRequired.h
index f9b61e1..3881133 100644
--- a/Source/cmCMakeMinimumRequired.h
+++ b/Source/cmCMakeMinimumRequired.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -23,7 +25,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmCMakeMinimumRequired; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmCMakeMinimumRequired>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmCMakePolicyCommand.h b/Source/cmCMakePolicyCommand.h
index cca1406..919402c 100644
--- a/Source/cmCMakePolicyCommand.h
+++ b/Source/cmCMakePolicyCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -24,7 +26,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmCMakePolicyCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmCMakePolicyCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index d1226c3..83e3eff 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -15,7 +15,6 @@
#include <ctype.h>
#include <iostream>
#include <map>
-#include <memory> // IWYU pragma: keep
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
@@ -30,6 +29,8 @@
# include <unistd.h> // IWYU pragma: keep
#endif
+#include "cm_memory.hxx"
+
#include "cmAlgorithms.h"
#include "cmCTestBuildAndTestHandler.h"
#include "cmCTestBuildHandler.h"
@@ -1098,9 +1099,10 @@ int cmCTest::RunMakeCommand(const std::string& command, std::string& output,
cmProcessOutput processOutput(encoding);
std::string strdata;
cmCTestLog(this, HANDLER_PROGRESS_OUTPUT,
- " Each . represents " << tick_len << " bytes of output"
- << std::endl
- << " " << std::flush);
+ " Each . represents " << tick_len
+ << " bytes of output\n"
+ " "
+ << std::flush);
while (cmsysProcess_WaitForData(cp, &data, &length, nullptr)) {
processOutput.DecodeText(data, length, strdata);
for (char& cc : strdata) {
@@ -1115,8 +1117,7 @@ int cmCTest::RunMakeCommand(const std::string& command, std::string& output,
if (tick % tick_line_len == 0 && tick > 0) {
cmCTestLog(this, HANDLER_PROGRESS_OUTPUT,
" Size: " << int((double(output.size()) / 1024.0) + 1)
- << "K" << std::endl
- << " " << std::flush);
+ << "K\n " << std::flush);
}
}
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT,
@@ -1324,18 +1325,14 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
if (output) {
*output += outerr;
}
- cmCTestLog(this, HANDLER_VERBOSE_OUTPUT,
- outerr << std::endl
- << std::flush);
+ cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, outerr << std::endl);
} else if (result == cmsysProcess_State_Error) {
std::string outerr = "\n*** ERROR executing: ";
outerr += cmsysProcess_GetErrorString(cp);
if (output) {
*output += outerr;
}
- cmCTestLog(this, HANDLER_VERBOSE_OUTPUT,
- outerr << std::endl
- << std::flush);
+ cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, outerr << std::endl);
}
cmsysProcess_Delete(cp);
@@ -3077,11 +3074,11 @@ void cmCTest::Log(int logType, const char* file, int line, const char* msg,
} else {
*this->Impl->OutputLogFile << cmCTestStringLogType[logType];
}
- *this->Impl->OutputLogFile << "] " << std::endl << std::flush;
+ *this->Impl->OutputLogFile << "] " << std::endl;
}
*this->Impl->OutputLogFile << msg << std::flush;
if (logType != this->Impl->OutputLogFileLastTag) {
- *this->Impl->OutputLogFile << std::endl << std::flush;
+ *this->Impl->OutputLogFile << std::endl;
this->Impl->OutputLogFileLastTag = logType;
}
}
@@ -3194,7 +3191,7 @@ void cmCTest::OutputTestErrors(std::vector<char> const& process_output)
if (!process_output.empty()) {
test_outputs.append(process_output.data(), process_output.size());
}
- cmCTestLog(this, HANDLER_OUTPUT, test_outputs << std::endl << std::flush);
+ cmCTestLog(this, HANDLER_OUTPUT, test_outputs << std::endl);
}
bool cmCTest::CompressString(std::string& str)
diff --git a/Source/cmCTest.h b/Source/cmCTest.h
index d300c33..7f66378 100644
--- a/Source/cmCTest.h
+++ b/Source/cmCTest.h
@@ -10,7 +10,7 @@
#include <chrono>
#include <map>
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <sstream>
#include <string>
#include <time.h>
diff --git a/Source/cmCommand.h b/Source/cmCommand.h
index 9ccd773..cdd2aba 100644
--- a/Source/cmCommand.h
+++ b/Source/cmCommand.h
@@ -5,6 +5,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
+#include <memory>
#include <string>
#include <vector>
@@ -75,7 +76,7 @@ public:
/**
* This is a virtual constructor for the command.
*/
- virtual cmCommand* Clone() = 0;
+ virtual std::unique_ptr<cmCommand> Clone() = 0;
/**
* Return the last error string.
diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx
index 63c5397..96c7105 100644
--- a/Source/cmCommands.cxx
+++ b/Source/cmCommands.cxx
@@ -1,5 +1,8 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
+
+#include "cm_memory.hxx"
+
#include "cmCommands.h"
#include "cmPolicies.h"
#include "cmState.h"
@@ -17,6 +20,7 @@
#include "cmBuildCommand.h"
#include "cmCMakeMinimumRequired.h"
#include "cmCMakePolicyCommand.h"
+#include "cmCommand.h"
#include "cmConfigureFileCommand.h"
#include "cmContinueCommand.h"
#include "cmCreateTestSourceList.h"
@@ -112,52 +116,64 @@
void GetScriptingCommands(cmState* state)
{
- state->AddBuiltinCommand("break", new cmBreakCommand);
+ state->AddBuiltinCommand("break", cm::make_unique<cmBreakCommand>());
state->AddBuiltinCommand("cmake_minimum_required",
- new cmCMakeMinimumRequired);
- state->AddBuiltinCommand("cmake_policy", new cmCMakePolicyCommand);
- state->AddBuiltinCommand("configure_file", new cmConfigureFileCommand);
- state->AddBuiltinCommand("continue", new cmContinueCommand);
- state->AddBuiltinCommand("exec_program", new cmExecProgramCommand);
- state->AddBuiltinCommand("execute_process", new cmExecuteProcessCommand);
- state->AddBuiltinCommand("file", new cmFileCommand);
- state->AddBuiltinCommand("find_file", new cmFindFileCommand);
- state->AddBuiltinCommand("find_library", new cmFindLibraryCommand);
- state->AddBuiltinCommand("find_package", new cmFindPackageCommand);
- state->AddBuiltinCommand("find_path", new cmFindPathCommand);
- state->AddBuiltinCommand("find_program", new cmFindProgramCommand);
- state->AddBuiltinCommand("foreach", new cmForEachCommand);
- state->AddBuiltinCommand("function", new cmFunctionCommand);
+ cm::make_unique<cmCMakeMinimumRequired>());
+ state->AddBuiltinCommand("cmake_policy",
+ cm::make_unique<cmCMakePolicyCommand>());
+ state->AddBuiltinCommand("configure_file",
+ cm::make_unique<cmConfigureFileCommand>());
+ state->AddBuiltinCommand("continue", cm::make_unique<cmContinueCommand>());
+ state->AddBuiltinCommand("exec_program",
+ cm::make_unique<cmExecProgramCommand>());
+ state->AddBuiltinCommand("execute_process",
+ cm::make_unique<cmExecuteProcessCommand>());
+ state->AddBuiltinCommand("file", cm::make_unique<cmFileCommand>());
+ state->AddBuiltinCommand("find_file", cm::make_unique<cmFindFileCommand>());
+ state->AddBuiltinCommand("find_library",
+ cm::make_unique<cmFindLibraryCommand>());
+ state->AddBuiltinCommand("find_package",
+ cm::make_unique<cmFindPackageCommand>());
+ state->AddBuiltinCommand("find_path", cm::make_unique<cmFindPathCommand>());
+ state->AddBuiltinCommand("find_program",
+ cm::make_unique<cmFindProgramCommand>());
+ state->AddBuiltinCommand("foreach", cm::make_unique<cmForEachCommand>());
+ state->AddBuiltinCommand("function", cm::make_unique<cmFunctionCommand>());
state->AddBuiltinCommand("get_cmake_property",
- new cmGetCMakePropertyCommand);
+ cm::make_unique<cmGetCMakePropertyCommand>());
state->AddBuiltinCommand("get_directory_property",
- new cmGetDirectoryPropertyCommand);
+ cm::make_unique<cmGetDirectoryPropertyCommand>());
state->AddBuiltinCommand("get_filename_component",
- new cmGetFilenameComponentCommand);
- state->AddBuiltinCommand("get_property", new cmGetPropertyCommand);
- state->AddBuiltinCommand("if", new cmIfCommand);
- state->AddBuiltinCommand("include", new cmIncludeCommand);
- state->AddBuiltinCommand("include_guard", new cmIncludeGuardCommand);
- state->AddBuiltinCommand("list", new cmListCommand);
- state->AddBuiltinCommand("macro", new cmMacroCommand);
- state->AddBuiltinCommand("make_directory", new cmMakeDirectoryCommand);
- state->AddBuiltinCommand("mark_as_advanced", new cmMarkAsAdvancedCommand);
- state->AddBuiltinCommand("math", new cmMathCommand);
- state->AddBuiltinCommand("message", new cmMessageCommand);
- state->AddBuiltinCommand("option", new cmOptionCommand);
+ cm::make_unique<cmGetFilenameComponentCommand>());
+ state->AddBuiltinCommand("get_property",
+ cm::make_unique<cmGetPropertyCommand>());
+ state->AddBuiltinCommand("if", cm::make_unique<cmIfCommand>());
+ state->AddBuiltinCommand("include", cm::make_unique<cmIncludeCommand>());
+ state->AddBuiltinCommand("include_guard",
+ cm::make_unique<cmIncludeGuardCommand>());
+ state->AddBuiltinCommand("list", cm::make_unique<cmListCommand>());
+ state->AddBuiltinCommand("macro", cm::make_unique<cmMacroCommand>());
+ state->AddBuiltinCommand("make_directory",
+ cm::make_unique<cmMakeDirectoryCommand>());
+ state->AddBuiltinCommand("mark_as_advanced",
+ cm::make_unique<cmMarkAsAdvancedCommand>());
+ state->AddBuiltinCommand("math", cm::make_unique<cmMathCommand>());
+ state->AddBuiltinCommand("message", cm::make_unique<cmMessageCommand>());
+ state->AddBuiltinCommand("option", cm::make_unique<cmOptionCommand>());
state->AddBuiltinCommand("cmake_parse_arguments",
- new cmParseArgumentsCommand);
- state->AddBuiltinCommand("return", new cmReturnCommand);
+ cm::make_unique<cmParseArgumentsCommand>());
+ state->AddBuiltinCommand("return", cm::make_unique<cmReturnCommand>());
state->AddBuiltinCommand("separate_arguments",
- new cmSeparateArgumentsCommand);
- state->AddBuiltinCommand("set", new cmSetCommand);
+ cm::make_unique<cmSeparateArgumentsCommand>());
+ state->AddBuiltinCommand("set", cm::make_unique<cmSetCommand>());
state->AddBuiltinCommand("set_directory_properties",
- new cmSetDirectoryPropertiesCommand);
- state->AddBuiltinCommand("set_property", new cmSetPropertyCommand);
- state->AddBuiltinCommand("site_name", new cmSiteNameCommand);
- state->AddBuiltinCommand("string", new cmStringCommand);
- state->AddBuiltinCommand("unset", new cmUnsetCommand);
- state->AddBuiltinCommand("while", new cmWhileCommand);
+ cm::make_unique<cmSetDirectoryPropertiesCommand>());
+ state->AddBuiltinCommand("set_property",
+ cm::make_unique<cmSetPropertyCommand>());
+ state->AddBuiltinCommand("site_name", cm::make_unique<cmSiteNameCommand>());
+ state->AddBuiltinCommand("string", cm::make_unique<cmStringCommand>());
+ state->AddBuiltinCommand("unset", cm::make_unique<cmUnsetCommand>());
+ state->AddBuiltinCommand("while", cm::make_unique<cmWhileCommand>());
state->AddUnexpectedCommand(
"else",
@@ -195,17 +211,21 @@ void GetScriptingCommands(cmState* state)
"match the opening WHILE command.");
#if defined(CMAKE_BUILD_WITH_CMAKE)
- state->AddBuiltinCommand("cmake_host_system_information",
- new cmCMakeHostSystemInformationCommand);
- state->AddBuiltinCommand("remove", new cmRemoveCommand);
- state->AddBuiltinCommand("variable_watch", new cmVariableWatchCommand);
- state->AddBuiltinCommand("write_file", new cmWriteFileCommand);
+ state->AddBuiltinCommand(
+ "cmake_host_system_information",
+ cm::make_unique<cmCMakeHostSystemInformationCommand>());
+ state->AddBuiltinCommand("remove", cm::make_unique<cmRemoveCommand>());
+ state->AddBuiltinCommand("variable_watch",
+ cm::make_unique<cmVariableWatchCommand>());
+ state->AddBuiltinCommand("write_file",
+ cm::make_unique<cmWriteFileCommand>());
state->AddDisallowedCommand(
- "build_name", new cmBuildNameCommand, cmPolicies::CMP0036,
+ "build_name", cm::make_unique<cmBuildNameCommand>(), cmPolicies::CMP0036,
"The build_name command should not be called; see CMP0036.");
state->AddDisallowedCommand(
- "use_mangled_mesa", new cmUseMangledMesaCommand, cmPolicies::CMP0030,
+ "use_mangled_mesa", cm::make_unique<cmUseMangledMesaCommand>(),
+ cmPolicies::CMP0030,
"The use_mangled_mesa command should not be called; see CMP0030.");
#endif
@@ -214,100 +234,131 @@ void GetScriptingCommands(cmState* state)
void GetProjectCommands(cmState* state)
{
state->AddBuiltinCommand("add_custom_command",
- new cmAddCustomCommandCommand);
- state->AddBuiltinCommand("add_custom_target", new cmAddCustomTargetCommand);
- state->AddBuiltinCommand("add_definitions", new cmAddDefinitionsCommand);
- state->AddBuiltinCommand("add_dependencies", new cmAddDependenciesCommand);
- state->AddBuiltinCommand("add_executable", new cmAddExecutableCommand);
- state->AddBuiltinCommand("add_library", new cmAddLibraryCommand);
- state->AddBuiltinCommand("add_subdirectory", new cmAddSubDirectoryCommand);
- state->AddBuiltinCommand("add_test", new cmAddTestCommand);
- state->AddBuiltinCommand("build_command", new cmBuildCommand);
+ cm::make_unique<cmAddCustomCommandCommand>());
+ state->AddBuiltinCommand("add_custom_target",
+ cm::make_unique<cmAddCustomTargetCommand>());
+ state->AddBuiltinCommand("add_definitions",
+ cm::make_unique<cmAddDefinitionsCommand>());
+ state->AddBuiltinCommand("add_dependencies",
+ cm::make_unique<cmAddDependenciesCommand>());
+ state->AddBuiltinCommand("add_executable",
+ cm::make_unique<cmAddExecutableCommand>());
+ state->AddBuiltinCommand("add_library",
+ cm::make_unique<cmAddLibraryCommand>());
+ state->AddBuiltinCommand("add_subdirectory",
+ cm::make_unique<cmAddSubDirectoryCommand>());
+ state->AddBuiltinCommand("add_test", cm::make_unique<cmAddTestCommand>());
+ state->AddBuiltinCommand("build_command", cm::make_unique<cmBuildCommand>());
state->AddBuiltinCommand("create_test_sourcelist",
- new cmCreateTestSourceList);
- state->AddBuiltinCommand("define_property", new cmDefinePropertyCommand);
- state->AddBuiltinCommand("enable_language", new cmEnableLanguageCommand);
- state->AddBuiltinCommand("enable_testing", new cmEnableTestingCommand);
+ cm::make_unique<cmCreateTestSourceList>());
+ state->AddBuiltinCommand("define_property",
+ cm::make_unique<cmDefinePropertyCommand>());
+ state->AddBuiltinCommand("enable_language",
+ cm::make_unique<cmEnableLanguageCommand>());
+ state->AddBuiltinCommand("enable_testing",
+ cm::make_unique<cmEnableTestingCommand>());
state->AddBuiltinCommand("get_source_file_property",
- new cmGetSourceFilePropertyCommand);
+ cm::make_unique<cmGetSourceFilePropertyCommand>());
state->AddBuiltinCommand("get_target_property",
- new cmGetTargetPropertyCommand);
- state->AddBuiltinCommand("get_test_property", new cmGetTestPropertyCommand);
+ cm::make_unique<cmGetTargetPropertyCommand>());
+ state->AddBuiltinCommand("get_test_property",
+ cm::make_unique<cmGetTestPropertyCommand>());
state->AddBuiltinCommand("include_directories",
- new cmIncludeDirectoryCommand);
- state->AddBuiltinCommand("include_regular_expression",
- new cmIncludeRegularExpressionCommand);
- state->AddBuiltinCommand("install", new cmInstallCommand);
- state->AddBuiltinCommand("install_files", new cmInstallFilesCommand);
- state->AddBuiltinCommand("install_targets", new cmInstallTargetsCommand);
- state->AddBuiltinCommand("link_directories", new cmLinkDirectoriesCommand);
- state->AddBuiltinCommand("project", new cmProjectCommand);
- state->AddBuiltinCommand("set_source_files_properties",
- new cmSetSourceFilesPropertiesCommand);
+ cm::make_unique<cmIncludeDirectoryCommand>());
+ state->AddBuiltinCommand(
+ "include_regular_expression",
+ cm::make_unique<cmIncludeRegularExpressionCommand>());
+ state->AddBuiltinCommand("install", cm::make_unique<cmInstallCommand>());
+ state->AddBuiltinCommand("install_files",
+ cm::make_unique<cmInstallFilesCommand>());
+ state->AddBuiltinCommand("install_targets",
+ cm::make_unique<cmInstallTargetsCommand>());
+ state->AddBuiltinCommand("link_directories",
+ cm::make_unique<cmLinkDirectoriesCommand>());
+ state->AddBuiltinCommand("project", cm::make_unique<cmProjectCommand>());
+ state->AddBuiltinCommand(
+ "set_source_files_properties",
+ cm::make_unique<cmSetSourceFilesPropertiesCommand>());
state->AddBuiltinCommand("set_target_properties",
- new cmSetTargetPropertiesCommand);
+ cm::make_unique<cmSetTargetPropertiesCommand>());
state->AddBuiltinCommand("set_tests_properties",
- new cmSetTestsPropertiesCommand);
- state->AddBuiltinCommand("subdirs", new cmSubdirCommand);
- state->AddBuiltinCommand("target_compile_definitions",
- new cmTargetCompileDefinitionsCommand);
+ cm::make_unique<cmSetTestsPropertiesCommand>());
+ state->AddBuiltinCommand("subdirs", cm::make_unique<cmSubdirCommand>());
+ state->AddBuiltinCommand(
+ "target_compile_definitions",
+ cm::make_unique<cmTargetCompileDefinitionsCommand>());
state->AddBuiltinCommand("target_compile_features",
- new cmTargetCompileFeaturesCommand);
+ cm::make_unique<cmTargetCompileFeaturesCommand>());
state->AddBuiltinCommand("target_compile_options",
- new cmTargetCompileOptionsCommand);
- state->AddBuiltinCommand("target_include_directories",
- new cmTargetIncludeDirectoriesCommand);
+ cm::make_unique<cmTargetCompileOptionsCommand>());
+ state->AddBuiltinCommand(
+ "target_include_directories",
+ cm::make_unique<cmTargetIncludeDirectoriesCommand>());
state->AddBuiltinCommand("target_link_libraries",
- new cmTargetLinkLibrariesCommand);
- state->AddBuiltinCommand("target_sources", new cmTargetSourcesCommand);
- state->AddBuiltinCommand("try_compile", new cmTryCompileCommand);
- state->AddBuiltinCommand("try_run", new cmTryRunCommand);
+ cm::make_unique<cmTargetLinkLibrariesCommand>());
+ state->AddBuiltinCommand("target_sources",
+ cm::make_unique<cmTargetSourcesCommand>());
+ state->AddBuiltinCommand("try_compile",
+ cm::make_unique<cmTryCompileCommand>());
+ state->AddBuiltinCommand("try_run", cm::make_unique<cmTryRunCommand>());
#if defined(CMAKE_BUILD_WITH_CMAKE)
state->AddBuiltinCommand("add_compile_definitions",
- new cmAddCompileDefinitionsCommand);
+ cm::make_unique<cmAddCompileDefinitionsCommand>());
state->AddBuiltinCommand("add_compile_options",
- new cmAddCompileOptionsCommand);
+ cm::make_unique<cmAddCompileOptionsCommand>());
state->AddBuiltinCommand("aux_source_directory",
- new cmAuxSourceDirectoryCommand);
- state->AddBuiltinCommand("export", new cmExportCommand);
- state->AddBuiltinCommand("fltk_wrap_ui", new cmFLTKWrapUICommand);
- state->AddBuiltinCommand("include_external_msproject",
- new cmIncludeExternalMSProjectCommand);
- state->AddBuiltinCommand("install_programs", new cmInstallProgramsCommand);
- state->AddBuiltinCommand("add_link_options", new cmAddLinkOptionsCommand);
- state->AddBuiltinCommand("link_libraries", new cmLinkLibrariesCommand);
+ cm::make_unique<cmAuxSourceDirectoryCommand>());
+ state->AddBuiltinCommand("export", cm::make_unique<cmExportCommand>());
+ state->AddBuiltinCommand("fltk_wrap_ui",
+ cm::make_unique<cmFLTKWrapUICommand>());
+ state->AddBuiltinCommand(
+ "include_external_msproject",
+ cm::make_unique<cmIncludeExternalMSProjectCommand>());
+ state->AddBuiltinCommand("install_programs",
+ cm::make_unique<cmInstallProgramsCommand>());
+ state->AddBuiltinCommand("add_link_options",
+ cm::make_unique<cmAddLinkOptionsCommand>());
+ state->AddBuiltinCommand("link_libraries",
+ cm::make_unique<cmLinkLibrariesCommand>());
state->AddBuiltinCommand("target_link_options",
- new cmTargetLinkOptionsCommand);
+ cm::make_unique<cmTargetLinkOptionsCommand>());
state->AddBuiltinCommand("target_link_directories",
- new cmTargetLinkDirectoriesCommand);
- state->AddBuiltinCommand("load_cache", new cmLoadCacheCommand);
- state->AddBuiltinCommand("qt_wrap_cpp", new cmQTWrapCPPCommand);
- state->AddBuiltinCommand("qt_wrap_ui", new cmQTWrapUICommand);
+ cm::make_unique<cmTargetLinkDirectoriesCommand>());
+ state->AddBuiltinCommand("load_cache",
+ cm::make_unique<cmLoadCacheCommand>());
+ state->AddBuiltinCommand("qt_wrap_cpp",
+ cm::make_unique<cmQTWrapCPPCommand>());
+ state->AddBuiltinCommand("qt_wrap_ui", cm::make_unique<cmQTWrapUICommand>());
state->AddBuiltinCommand("remove_definitions",
- new cmRemoveDefinitionsCommand);
- state->AddBuiltinCommand("source_group", new cmSourceGroupCommand);
+ cm::make_unique<cmRemoveDefinitionsCommand>());
+ state->AddBuiltinCommand("source_group",
+ cm::make_unique<cmSourceGroupCommand>());
state->AddDisallowedCommand(
- "export_library_dependencies", new cmExportLibraryDependenciesCommand,
- cmPolicies::CMP0033,
+ "export_library_dependencies",
+ cm::make_unique<cmExportLibraryDependenciesCommand>(), cmPolicies::CMP0033,
"The export_library_dependencies command should not be called; "
"see CMP0033.");
state->AddDisallowedCommand(
- "load_command", new cmLoadCommandCommand, cmPolicies::CMP0031,
+ "load_command", cm::make_unique<cmLoadCommandCommand>(),
+ cmPolicies::CMP0031,
"The load_command command should not be called; see CMP0031.");
state->AddDisallowedCommand(
- "output_required_files", new cmOutputRequiredFilesCommand,
+ "output_required_files", cm::make_unique<cmOutputRequiredFilesCommand>(),
cmPolicies::CMP0032,
"The output_required_files command should not be called; see CMP0032.");
state->AddDisallowedCommand(
- "subdir_depends", new cmSubdirDependsCommand, cmPolicies::CMP0029,
+ "subdir_depends", cm::make_unique<cmSubdirDependsCommand>(),
+ cmPolicies::CMP0029,
"The subdir_depends command should not be called; see CMP0029.");
state->AddDisallowedCommand(
- "utility_source", new cmUtilitySourceCommand, cmPolicies::CMP0034,
+ "utility_source", cm::make_unique<cmUtilitySourceCommand>(),
+ cmPolicies::CMP0034,
"The utility_source command should not be called; see CMP0034.");
state->AddDisallowedCommand(
- "variable_requires", new cmVariableRequiresCommand, cmPolicies::CMP0035,
+ "variable_requires", cm::make_unique<cmVariableRequiresCommand>(),
+ cmPolicies::CMP0035,
"The variable_requires command should not be called; see CMP0035.");
#endif
}
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index a7618c7..54fc54c 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -23,6 +23,8 @@
#include <string.h>
#include <utility>
+#include "cm_memory.hxx"
+
/*
This file computes an ordered list of link items to use when linking a
diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h
index 0b1f00c..839c27a 100644
--- a/Source/cmComputeLinkDepends.h
+++ b/Source/cmComputeLinkDepends.h
@@ -10,6 +10,7 @@
#include "cmTargetLinkLibraryType.h"
#include <map>
+#include <memory>
#include <queue>
#include <set>
#include <string>
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index b366ebb..5a03670 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -268,10 +268,6 @@ cmComputeLinkInformation::cmComputeLinkInformation(
return;
}
- // Check whether we should use an import library for linking a target.
- this->UseImportLibrary =
- this->Makefile->IsDefinitionSet("CMAKE_IMPORT_LIBRARY_SUFFIX");
-
// Check whether we should skip dependencies on shared library files.
this->LinkDependsNoShared =
this->Target->GetPropertyAsBool("LINK_DEPENDS_NO_SHARED");
@@ -280,7 +276,7 @@ cmComputeLinkInformation::cmComputeLinkInformation(
// to use when creating a plugin (module) that obtains symbols from
// the program that will load it.
this->LoaderFlag = nullptr;
- if (!this->UseImportLibrary &&
+ if (!this->Target->IsDLLPlatform() &&
this->Target->GetType() == cmStateEnums::MODULE_LIBRARY) {
std::string loader_flag_var = "CMAKE_SHARED_MODULE_LOADER_";
loader_flag_var += this->LinkLanguage;
@@ -493,9 +489,7 @@ bool cmComputeLinkInformation::Compute()
std::set<cmGeneratorTarget const*> const& wrongItems =
cld.GetOldWrongConfigItems();
for (cmGeneratorTarget const* tgt : wrongItems) {
- bool implib = (this->UseImportLibrary &&
- (tgt->GetType() == cmStateEnums::SHARED_LIBRARY));
- cmStateEnums::ArtifactType artifact = implib
+ cmStateEnums::ArtifactType artifact = tgt->HasImportLibrary(this->Config)
? cmStateEnums::ImportLibraryArtifact
: cmStateEnums::RuntimeBinaryArtifact;
this->OldLinkDirItems.push_back(
@@ -578,7 +572,7 @@ void cmComputeLinkInformation::AddItem(std::string const& item,
// Compute the proper name to use to link this library.
const std::string& config = this->Config;
bool impexe = (tgt && tgt->IsExecutableWithExports());
- if (impexe && !this->UseImportLibrary && !this->LoaderFlag) {
+ if (impexe && !tgt->HasImportLibrary(config) && !this->LoaderFlag) {
// Skip linking to executables on platforms with no import
// libraries or loader flags.
return;
@@ -592,7 +586,7 @@ void cmComputeLinkInformation::AddItem(std::string const& item,
// platform. Add it now.
std::string linkItem;
linkItem = this->LoaderFlag;
- cmStateEnums::ArtifactType artifact = this->UseImportLibrary
+ cmStateEnums::ArtifactType artifact = tgt->HasImportLibrary(config)
? cmStateEnums::ImportLibraryArtifact
: cmStateEnums::RuntimeBinaryArtifact;
@@ -616,10 +610,7 @@ void cmComputeLinkInformation::AddItem(std::string const& item,
// Its object-files should already have been extracted for linking.
} else {
// Decide whether to use an import library.
- bool implib =
- (this->UseImportLibrary &&
- (impexe || tgt->GetType() == cmStateEnums::SHARED_LIBRARY));
- cmStateEnums::ArtifactType artifact = implib
+ cmStateEnums::ArtifactType artifact = tgt->HasImportLibrary(config)
? cmStateEnums::ImportLibraryArtifact
: cmStateEnums::RuntimeBinaryArtifact;
@@ -694,7 +685,7 @@ void cmComputeLinkInformation::AddSharedDepItem(std::string const& item,
// linked will be able to find it.
std::string lib;
if (tgt) {
- cmStateEnums::ArtifactType artifact = this->UseImportLibrary
+ cmStateEnums::ArtifactType artifact = tgt->HasImportLibrary(this->Config)
? cmStateEnums::ImportLibraryArtifact
: cmStateEnums::RuntimeBinaryArtifact;
lib = tgt->GetFullPath(this->Config, artifact);
diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h
index 863639c..3be2c7f 100644
--- a/Source/cmComputeLinkInformation.h
+++ b/Source/cmComputeLinkInformation.h
@@ -179,7 +179,6 @@ private:
bool OldLinkDirMode;
bool OpenBSD;
bool LinkDependsNoShared;
- bool UseImportLibrary;
bool RuntimeUseChrpath;
bool NoSONameUsesPath;
bool LinkWithRuntimePath;
diff --git a/Source/cmConfigureFileCommand.h b/Source/cmConfigureFileCommand.h
index 5603c50..b3a99d7 100644
--- a/Source/cmConfigureFileCommand.h
+++ b/Source/cmConfigureFileCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
#include "cmNewLineStyle.h"
@@ -16,7 +18,10 @@ class cmExecutionStatus;
class cmConfigureFileCommand : public cmCommand
{
public:
- cmCommand* Clone() override { return new cmConfigureFileCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmConfigureFileCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmContinueCommand.h b/Source/cmContinueCommand.h
index d383d1d..a85010a 100644
--- a/Source/cmContinueCommand.h
+++ b/Source/cmContinueCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -23,7 +25,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmContinueCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmContinueCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmCreateTestSourceList.h b/Source/cmCreateTestSourceList.h
index 005b32c..5aa6af4 100644
--- a/Source/cmCreateTestSourceList.h
+++ b/Source/cmCreateTestSourceList.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -23,7 +25,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmCreateTestSourceList; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmCreateTestSourceList>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmCryptoHash.cxx b/Source/cmCryptoHash.cxx
index d914eb1..5e919af 100644
--- a/Source/cmCryptoHash.cxx
+++ b/Source/cmCryptoHash.cxx
@@ -2,13 +2,13 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCryptoHash.h"
-#include "cmAlgorithms.h"
#include "cm_kwiml.h"
#include "cm_rhash.h"
#include "cmsys/FStream.hxx"
+
#include <string.h>
-#include <memory> // IWYU pragma: keep
+#include "cm_memory.hxx"
static unsigned int const cmCryptoHashAlgoToId[] = {
/* clang-format needs this comment to break after the opening brace */
diff --git a/Source/cmCryptoHash.h b/Source/cmCryptoHash.h
index b712f09..c7d3377 100644
--- a/Source/cmCryptoHash.h
+++ b/Source/cmCryptoHash.h
@@ -5,7 +5,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <stddef.h>
#include <string>
#include <vector>
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index 89aaad0..5e8731a 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -12,7 +12,7 @@
#include "cmStateTypes.h"
#include "cmSystemTools.h"
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <stddef.h>
#include <utility>
diff --git a/Source/cmDefinePropertyCommand.h b/Source/cmDefinePropertyCommand.h
index a9c1856..36f97df 100644
--- a/Source/cmDefinePropertyCommand.h
+++ b/Source/cmDefinePropertyCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -15,7 +17,10 @@ class cmExecutionStatus;
class cmDefinePropertyCommand : public cmCommand
{
public:
- cmCommand* Clone() override { return new cmDefinePropertyCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmDefinePropertyCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmDisallowedCommand.h b/Source/cmDisallowedCommand.h
index d85c00f..eed59ca 100644
--- a/Source/cmDisallowedCommand.h
+++ b/Source/cmDisallowedCommand.h
@@ -6,8 +6,11 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
+#include <utility>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
#include "cmPolicies.h"
@@ -16,20 +19,20 @@ class cmExecutionStatus;
class cmDisallowedCommand : public cmCommand
{
public:
- cmDisallowedCommand(cmCommand* command, cmPolicies::PolicyID policy,
- const char* message)
- : Command(command)
+ cmDisallowedCommand(std::unique_ptr<cmCommand> command,
+ cmPolicies::PolicyID policy, const char* message)
+ : Command(std::move(command))
, Policy(policy)
, Message(message)
{
}
- ~cmDisallowedCommand() override { delete this->Command; }
+ ~cmDisallowedCommand() override = default;
- cmCommand* Clone() override
+ std::unique_ptr<cmCommand> Clone() override
{
- return new cmDisallowedCommand(this->Command->Clone(), this->Policy,
- this->Message);
+ return cm::make_unique<cmDisallowedCommand>(this->Command->Clone(),
+ this->Policy, this->Message);
}
bool InitialPass(std::vector<std::string> const& args,
@@ -40,7 +43,7 @@ public:
bool HasFinalPass() const override { return this->Command->HasFinalPass(); }
private:
- cmCommand* Command;
+ std::unique_ptr<cmCommand> Command;
cmPolicies::PolicyID Policy;
const char* Message;
};
diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx
index 2226463..51eb814 100644
--- a/Source/cmELF.cxx
+++ b/Source/cmELF.cxx
@@ -6,7 +6,7 @@
#include "cm_kwiml.h"
#include "cmsys/FStream.hxx"
#include <map>
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <sstream>
#include <stddef.h>
#include <utility>
diff --git a/Source/cmEnableLanguageCommand.h b/Source/cmEnableLanguageCommand.h
index 97645a9..dc43e34 100644
--- a/Source/cmEnableLanguageCommand.h
+++ b/Source/cmEnableLanguageCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -26,7 +28,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmEnableLanguageCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmEnableLanguageCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmEnableTestingCommand.h b/Source/cmEnableTestingCommand.h
index 88a17b9..fd50ebc 100644
--- a/Source/cmEnableTestingCommand.h
+++ b/Source/cmEnableTestingCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -31,7 +33,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmEnableTestingCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmEnableTestingCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmExecProgramCommand.h b/Source/cmExecProgramCommand.h
index ae0fa9b..70f833a 100644
--- a/Source/cmExecProgramCommand.h
+++ b/Source/cmExecProgramCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
#include "cmProcessOutput.h"
@@ -27,7 +29,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmExecProgramCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmExecProgramCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx
index 494afbb..689fc20 100644
--- a/Source/cmExecuteProcessCommand.cxx
+++ b/Source/cmExecuteProcessCommand.cxx
@@ -4,10 +4,12 @@
#include "cm_static_string_view.hxx"
#include "cmsys/Process.h"
+
#include <algorithm>
#include <ctype.h> /* isspace */
#include <iostream>
#include <stdio.h>
+#include <vector>
#include "cmAlgorithms.h"
#include "cmArgumentParser.h"
diff --git a/Source/cmExecuteProcessCommand.h b/Source/cmExecuteProcessCommand.h
index b415deb..1d5445f 100644
--- a/Source/cmExecuteProcessCommand.h
+++ b/Source/cmExecuteProcessCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -24,7 +26,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmExecuteProcessCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmExecuteProcessCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmExportBuildAndroidMKGenerator.cxx b/Source/cmExportBuildAndroidMKGenerator.cxx
index ced27c9..e693155 100644
--- a/Source/cmExportBuildAndroidMKGenerator.cxx
+++ b/Source/cmExportBuildAndroidMKGenerator.cxx
@@ -3,7 +3,6 @@
#include "cmExportBuildAndroidMKGenerator.h"
#include <algorithm>
-#include <memory> // IWYU pragma: keep
#include <sstream>
#include <utility>
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index 5800629..de3e0e2 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -236,14 +236,15 @@ void cmExportBuildFileGenerator::SetImportLocationProperty(
}
// Add the import library for windows DLLs.
- if (target->HasImportLibrary(config) &&
- mf->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX")) {
+ if (target->HasImportLibrary(config)) {
std::string prop = "IMPORTED_IMPLIB";
prop += suffix;
std::string value =
target->GetFullPath(config, cmStateEnums::ImportLibraryArtifact);
- target->GetImplibGNUtoMS(config, value, value,
- "${CMAKE_IMPORT_LIBRARY_SUFFIX}");
+ if (mf->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX")) {
+ target->GetImplibGNUtoMS(config, value, value,
+ "${CMAKE_IMPORT_LIBRARY_SUFFIX}");
+ }
properties[prop] = value;
}
}
diff --git a/Source/cmExportCommand.h b/Source/cmExportCommand.h
index 99f9932..50463af 100644
--- a/Source/cmExportCommand.h
+++ b/Source/cmExportCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -18,7 +20,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmExportCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmExportCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index c366183..29afc9f 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -20,11 +20,12 @@
#include "cmsys/FStream.hxx"
#include <assert.h>
-#include <memory> // IWYU pragma: keep
#include <sstream>
#include <string.h>
#include <utility>
+#include "cm_memory.hxx"
+
static std::string cmExportFileGeneratorEscape(std::string const& str)
{
// Escape a property value for writing into a .cmake file.
diff --git a/Source/cmExportLibraryDependenciesCommand.cxx b/Source/cmExportLibraryDependenciesCommand.cxx
index b60a053..87ef2a9 100644
--- a/Source/cmExportLibraryDependenciesCommand.cxx
+++ b/Source/cmExportLibraryDependenciesCommand.cxx
@@ -4,10 +4,10 @@
#include "cmsys/FStream.hxx"
#include <map>
-#include <memory> // IWYU pragma: keep
#include <utility>
-#include "cmAlgorithms.h"
+#include "cm_memory.hxx"
+
#include "cmGeneratedFileStream.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
diff --git a/Source/cmExportLibraryDependenciesCommand.h b/Source/cmExportLibraryDependenciesCommand.h
index 8414866..5255d63 100644
--- a/Source/cmExportLibraryDependenciesCommand.h
+++ b/Source/cmExportLibraryDependenciesCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -15,9 +17,9 @@ class cmExecutionStatus;
class cmExportLibraryDependenciesCommand : public cmCommand
{
public:
- cmCommand* Clone() override
+ std::unique_ptr<cmCommand> Clone() override
{
- return new cmExportLibraryDependenciesCommand;
+ return cm::make_unique<cmExportLibraryDependenciesCommand>();
}
bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus& status) override;
diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx
index c169032..a3c9802 100644
--- a/Source/cmExportTryCompileFileGenerator.cxx
+++ b/Source/cmExportTryCompileFileGenerator.cxx
@@ -13,7 +13,7 @@
#include "cmTarget.h"
#include <map>
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <utility>
cmExportTryCompileFileGenerator::cmExportTryCompileFileGenerator(
diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx
index 6fe8c14..30b3f0d 100644
--- a/Source/cmExtraCodeLiteGenerator.cxx
+++ b/Source/cmExtraCodeLiteGenerator.cxx
@@ -217,22 +217,21 @@ std::string cmExtraCodeLiteGenerator::CollectSourceFiles(
case cmStateEnums::STATIC_LIBRARY:
case cmStateEnums::SHARED_LIBRARY:
case cmStateEnums::MODULE_LIBRARY: {
+ cmake const* cm = makefile->GetCMakeInstance();
std::vector<cmSourceFile*> sources;
gt->GetSourceFiles(sources,
makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"));
for (cmSourceFile* s : sources) {
+ std::string const& fullPath = s->GetFullPath();
+ std::string const& extLower =
+ cmSystemTools::LowerCase(s->GetExtension());
// check whether it is a source or a include file
// then put it accordingly into one of the two containers
- switch (cmSystemTools::GetFileFormat(s->GetExtension())) {
- case cmSystemTools::C_FILE_FORMAT:
- case cmSystemTools::CXX_FILE_FORMAT:
- case cmSystemTools::CUDA_FILE_FORMAT:
- case cmSystemTools::FORTRAN_FILE_FORMAT: {
- cFiles[s->GetFullPath()] = s;
- } break;
- default: {
- otherFiles.insert(s->GetFullPath());
- }
+ if (cm->IsSourceExtension(extLower) || cm->IsCudaExtension(extLower) ||
+ cm->IsFortranExtension(extLower)) {
+ cFiles[fullPath] = s;
+ } else {
+ otherFiles.insert(fullPath);
}
}
}
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index aece3bc..06709f1 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -44,6 +44,8 @@ void AppendDictionary(cmXMLWriter& xml, const char* key, T const& value)
cmExtraEclipseCDT4Generator::cmExtraEclipseCDT4Generator()
{
+ this->IsOutOfSourceBuild = false;
+ this->GenerateSourceProject = false;
this->SupportsVirtualFolders = true;
this->GenerateLinkedResources = true;
this->SupportsGmakeErrorParser = true;
@@ -164,6 +166,29 @@ void cmExtraEclipseCDT4Generator::Generate()
// create a .cproject file
this->CreateCProjectFile();
+
+ // create resource settings
+ this->CreateSettingsResourcePrefsFile();
+}
+
+void cmExtraEclipseCDT4Generator::CreateSettingsResourcePrefsFile()
+{
+ cmLocalGenerator* lg = this->GlobalGenerator->GetLocalGenerators()[0];
+ cmMakefile* mf = lg->GetMakefile();
+
+ const std::string filename =
+ this->HomeOutputDirectory + "/.settings/org.eclipse.core.resources.prefs";
+
+ cmGeneratedFileStream fout(filename);
+ if (!fout) {
+ return;
+ }
+
+ fout << "eclipse.preferences.version=1" << std::endl;
+ const char* encoding = mf->GetDefinition("CMAKE_ECLIPSE_RESOURCE_ENCODING");
+ if (encoding) {
+ fout << "encoding/<project>=" << encoding << std::endl;
+ }
}
void cmExtraEclipseCDT4Generator::CreateSourceProjectFile()
diff --git a/Source/cmExtraEclipseCDT4Generator.h b/Source/cmExtraEclipseCDT4Generator.h
index 5136660..ef038d9 100644
--- a/Source/cmExtraEclipseCDT4Generator.h
+++ b/Source/cmExtraEclipseCDT4Generator.h
@@ -43,6 +43,9 @@ private:
// create .project file in the source tree
void CreateSourceProjectFile();
+ // create .settings/org.eclipse.core.resources.prefs
+ void CreateSettingsResourcePrefsFile();
+
// create .project file
void CreateProjectFile();
diff --git a/Source/cmFLTKWrapUICommand.h b/Source/cmFLTKWrapUICommand.h
index 044755e..bff4f01 100644
--- a/Source/cmFLTKWrapUICommand.h
+++ b/Source/cmFLTKWrapUICommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -25,7 +27,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmFLTKWrapUICommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmFLTKWrapUICommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmFileAPI.h b/Source/cmFileAPI.h
index 602efa8..aa5a42f 100644
--- a/Source/cmFileAPI.h
+++ b/Source/cmFileAPI.h
@@ -10,7 +10,7 @@
#include "cm_jsoncpp_writer.h"
#include <map>
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <string>
#include <unordered_set>
#include <vector>
diff --git a/Source/cmFileAPICodemodel.cxx b/Source/cmFileAPICodemodel.cxx
index 0fb166a..7b916cd 100644
--- a/Source/cmFileAPICodemodel.cxx
+++ b/Source/cmFileAPICodemodel.cxx
@@ -31,6 +31,7 @@
#include <algorithm>
#include <cassert>
#include <map>
+#include <memory>
#include <set>
#include <string>
#include <unordered_map>
@@ -1075,17 +1076,16 @@ Json::Value Target::DumpArtifacts()
}
// Add Windows-specific artifacts produced by the linker.
+ if (this->GT->HasImportLibrary(this->Config)) {
+ Json::Value artifact = Json::objectValue;
+ artifact["path"] =
+ RelativeIfUnder(this->TopBuild,
+ this->GT->GetFullPath(
+ this->Config, cmStateEnums::ImportLibraryArtifact));
+ artifacts.append(std::move(artifact)); // NOLINT(*)
+ }
if (this->GT->IsDLLPlatform() &&
this->GT->GetType() != cmStateEnums::STATIC_LIBRARY) {
- if (this->GT->GetType() == cmStateEnums::SHARED_LIBRARY ||
- this->GT->IsExecutableWithExports()) {
- Json::Value artifact = Json::objectValue;
- artifact["path"] =
- RelativeIfUnder(this->TopBuild,
- this->GT->GetFullPath(
- this->Config, cmStateEnums::ImportLibraryArtifact));
- artifacts.append(std::move(artifact)); // NOLINT(*)
- }
cmGeneratorTarget::OutputInfo const* output =
this->GT->GetOutputInfo(this->Config);
if (output && !output->PdbDir.empty()) {
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 980ad21..9871f49 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -13,7 +13,6 @@
#include <cmath>
#include <ctype.h>
#include <map>
-#include <memory> // IWYU pragma: keep
#include <set>
#include <sstream>
#include <stdio.h>
@@ -21,6 +20,8 @@
#include <utility>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmAlgorithms.h"
#include "cmArgumentParser.h"
#include "cmCryptoHash.h"
diff --git a/Source/cmFileCommand.h b/Source/cmFileCommand.h
index cfff894..d4b980e 100644
--- a/Source/cmFileCommand.h
+++ b/Source/cmFileCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -22,7 +24,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmFileCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmFileCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmFileTimes.cxx b/Source/cmFileTimes.cxx
index fd4f679..3824e9b 100644
--- a/Source/cmFileTimes.cxx
+++ b/Source/cmFileTimes.cxx
@@ -2,11 +2,12 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmFileTimes.h"
-#include "cmAlgorithms.h"
#include "cm_sys_stat.h"
#include <utility>
+#include "cm_memory.hxx"
+
#if defined(_WIN32)
# include "cmSystemTools.h"
# include <windows.h>
diff --git a/Source/cmFileTimes.h b/Source/cmFileTimes.h
index cbf0fe2..191d89e 100644
--- a/Source/cmFileTimes.h
+++ b/Source/cmFileTimes.h
@@ -5,7 +5,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <string>
/** \class cmFileTimes
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx
index c6b9049..a5937a0 100644
--- a/Source/cmFindCommon.cxx
+++ b/Source/cmFindCommon.cxx
@@ -148,7 +148,7 @@ void cmFindCommon::SelectDefaultMacMode()
void cmFindCommon::SelectDefaultSearchModes()
{
const std::array<std::pair<bool&, std::string>, 5> search_paths = {
- { { this->NoPackageRootPath, "CMAKE_FIND_USE_PACAKGE_ROOT_PATH" },
+ { { this->NoPackageRootPath, "CMAKE_FIND_USE_PACKAGE_ROOT_PATH" },
{ this->NoCMakePath, "CMAKE_FIND_USE_CMAKE_PATH" },
{ this->NoCMakeEnvironmentPath,
"CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH" },
diff --git a/Source/cmFindFileCommand.h b/Source/cmFindFileCommand.h
index 4309449..152b505 100644
--- a/Source/cmFindFileCommand.h
+++ b/Source/cmFindFileCommand.h
@@ -5,9 +5,10 @@
#include "cmConfigure.h" // IWYU pragma: keep
-#include "cmFindPathCommand.h"
+#include "cm_memory.hxx"
-class cmCommand;
+#include "cmCommand.h"
+#include "cmFindPathCommand.h"
/** \class cmFindFileCommand
* \brief Define a command to search for an executable program.
@@ -24,7 +25,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmFindFileCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmFindFileCommand>();
+ }
};
#endif
diff --git a/Source/cmFindLibraryCommand.h b/Source/cmFindLibraryCommand.h
index fb8a700..af17d60 100644
--- a/Source/cmFindLibraryCommand.h
+++ b/Source/cmFindLibraryCommand.h
@@ -8,9 +8,11 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
+#include "cmCommand.h"
#include "cmFindBase.h"
-class cmCommand;
class cmExecutionStatus;
/** \class cmFindLibraryCommand
@@ -27,7 +29,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmFindLibraryCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmFindLibraryCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 557069b..c6d599e 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -13,12 +13,13 @@
#include <deque>
#include <functional>
#include <iterator>
-#include <memory> // IWYU pragma: keep
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <utility>
+#include "cm_memory.hxx"
+
#include "cmAlgorithms.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
@@ -188,7 +189,12 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args,
}
// Check if User Package Registry should be disabled
- if (this->Makefile->IsOn("CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY")) {
+ // The `CMAKE_FIND_USE_PACKAGE_REGISTRY` has
+ // priority over the deprecated CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY
+ if (const char* def =
+ this->Makefile->GetDefinition("CMAKE_FIND_USE_PACKAGE_REGISTRY")) {
+ this->NoUserRegistry = !cmSystemTools::IsOn(def);
+ } else if (this->Makefile->IsOn("CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY")) {
this->NoUserRegistry = true;
}
@@ -817,8 +823,9 @@ bool cmFindPackageCommand::HandlePackageMode(
}
}
- if (this->Makefile->IsOn("CMAKE_FIND_PACKAGE_PREFER_CONFIG") && !found &&
- handlePackageModeType == HandlePackageModeType::Config) {
+ if (this->UseFindModules && !found &&
+ handlePackageModeType == HandlePackageModeType::Config &&
+ this->Makefile->IsOn("CMAKE_FIND_PACKAGE_PREFER_CONFIG")) {
// Config mode failed. Allow Module case.
result = false;
}
diff --git a/Source/cmFindPackageCommand.h b/Source/cmFindPackageCommand.h
index 316ca0f..f6645ae 100644
--- a/Source/cmFindPackageCommand.h
+++ b/Source/cmFindPackageCommand.h
@@ -3,6 +3,7 @@
#ifndef cmFindPackageCommand_h
#define cmFindPackageCommand_h
+#include "cmCommand.h"
#include "cmConfigure.h" // IWYU pragma: keep
#include "cmPolicies.h"
@@ -14,6 +15,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
// IWYU insists we should forward-declare instead of including <functional>,
// but we cannot forward-declare reliably because some C++ standard libraries
// put the template in an inline namespace.
@@ -27,7 +30,6 @@ namespace std {
#include "cmFindCommon.h"
-class cmCommand;
class cmExecutionStatus;
class cmSearchPath;
@@ -65,7 +67,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmFindPackageCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmFindPackageCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmFindPathCommand.h b/Source/cmFindPathCommand.h
index cb0db4c..89e2cef 100644
--- a/Source/cmFindPathCommand.h
+++ b/Source/cmFindPathCommand.h
@@ -8,9 +8,11 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
+#include "cmCommand.h"
#include "cmFindBase.h"
-class cmCommand;
class cmExecutionStatus;
/** \class cmFindPathCommand
@@ -27,7 +29,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmFindPathCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmFindPathCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmFindProgramCommand.h b/Source/cmFindProgramCommand.h
index 147936c..40e455e 100644
--- a/Source/cmFindProgramCommand.h
+++ b/Source/cmFindProgramCommand.h
@@ -8,9 +8,11 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
+#include "cmCommand.h"
#include "cmFindBase.h"
-class cmCommand;
class cmExecutionStatus;
/** \class cmFindProgramCommand
@@ -28,7 +30,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmFindProgramCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmFindProgramCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx
index 08003eb..94c1b1a 100644
--- a/Source/cmForEachCommand.cxx
+++ b/Source/cmForEachCommand.cxx
@@ -2,12 +2,12 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmForEachCommand.h"
-#include <memory> // IWYU pragma: keep
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
-#include "cmAlgorithms.h"
+#include "cm_memory.hxx"
+
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
diff --git a/Source/cmForEachCommand.h b/Source/cmForEachCommand.h
index 5131a4f..cd112b8 100644
--- a/Source/cmForEachCommand.h
+++ b/Source/cmForEachCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
#include "cmFunctionBlocker.h"
#include "cmListFileCache.h"
@@ -39,7 +41,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmForEachCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmForEachCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmFortranParserImpl.cxx b/Source/cmFortranParserImpl.cxx
index 18e3c10..e8b1da8 100644
--- a/Source/cmFortranParserImpl.cxx
+++ b/Source/cmFortranParserImpl.cxx
@@ -79,7 +79,13 @@ std::string cmFortranParser_s::ModName(std::string const& mod_name) const
std::string cmFortranParser_s::SModName(std::string const& mod_name,
std::string const& sub_name) const
{
- return mod_name + this->Compiler.SModSep + sub_name + this->Compiler.SModExt;
+ std::string const& SModExt =
+ this->Compiler.SModExt.empty() ? ".mod" : this->Compiler.SModExt;
+ // An empty separator means that the compiler does not use a prefix.
+ if (this->Compiler.SModSep.empty()) {
+ return sub_name + SModExt;
+ }
+ return mod_name + this->Compiler.SModSep + sub_name + SModExt;
}
bool cmFortranParser_FilePush(cmFortranParser* parser, const char* fname)
diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx
index 9067a5f..8e003ad 100644
--- a/Source/cmFunctionCommand.cxx
+++ b/Source/cmFunctionCommand.cxx
@@ -3,6 +3,9 @@
#include "cmFunctionCommand.h"
#include <sstream>
+#include <utility>
+
+#include "cm_memory.hxx"
#include "cmAlgorithms.h"
#include "cmExecutionStatus.h"
@@ -18,15 +21,15 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override
+ std::unique_ptr<cmCommand> Clone() override
{
- cmFunctionHelperCommand* newC = new cmFunctionHelperCommand;
+ auto newC = cm::make_unique<cmFunctionHelperCommand>();
// we must copy when we clone
newC->Args = this->Args;
newC->Functions = this->Functions;
newC->Policies = this->Policies;
newC->FilePath = this->FilePath;
- return newC;
+ return std::unique_ptr<cmCommand>(std::move(newC));
}
/**
@@ -129,12 +132,12 @@ bool cmFunctionFunctionBlocker::IsFunctionBlocked(
// if this is the endfunction for this function then execute
if (!this->Depth) {
// create a new command and add it to cmake
- cmFunctionHelperCommand* f = new cmFunctionHelperCommand();
+ auto f = cm::make_unique<cmFunctionHelperCommand>();
f->Args = this->Args;
f->Functions = this->Functions;
f->FilePath = this->GetStartingContext().FilePath;
mf.RecordPolicies(f->Policies);
- mf.GetState()->AddScriptedCommand(this->Args[0], f);
+ mf.GetState()->AddScriptedCommand(this->Args[0], std::move(f));
// remove the function blocker now that the function is defined
mf.RemoveFunctionBlocker(this, lff);
return true;
diff --git a/Source/cmFunctionCommand.h b/Source/cmFunctionCommand.h
index 8b37df0..449a180 100644
--- a/Source/cmFunctionCommand.h
+++ b/Source/cmFunctionCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
#include "cmFunctionBlocker.h"
#include "cmListFileCache.h"
@@ -34,7 +36,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmFunctionCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmFunctionCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index 175a26d..4d3a005 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -3,7 +3,7 @@
#include "cmGeneratorExpression.h"
#include "cmsys/RegularExpression.hxx"
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <utility>
#include "assert.h"
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index fd36c4b..ef76651 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -8,7 +8,7 @@
#include "cmListFileCache.h"
#include <map>
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <set>
#include <string>
#include <utility>
diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx b/Source/cmGeneratorExpressionEvaluationFile.cxx
index 326cb0e..11c2dcc 100644
--- a/Source/cmGeneratorExpressionEvaluationFile.cxx
+++ b/Source/cmGeneratorExpressionEvaluationFile.cxx
@@ -3,7 +3,7 @@
#include "cmGeneratorExpressionEvaluationFile.h"
#include "cmsys/FStream.hxx"
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <sstream>
#include <utility>
diff --git a/Source/cmGeneratorExpressionEvaluationFile.h b/Source/cmGeneratorExpressionEvaluationFile.h
index 89a2390..06ebeac 100644
--- a/Source/cmGeneratorExpressionEvaluationFile.h
+++ b/Source/cmGeneratorExpressionEvaluationFile.h
@@ -6,7 +6,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include <map>
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <string>
#include <vector>
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index a60c75c..d828dac 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -33,7 +33,7 @@
#include <errno.h>
#include <iterator>
#include <map>
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <set>
#include <sstream>
#include <stdlib.h>
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 85a8dbb..a2c0503 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -7,7 +7,7 @@
#include <assert.h>
#include <errno.h>
#include <iterator>
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <queue>
#include <sstream>
#include <stdio.h>
@@ -259,9 +259,6 @@ cmGeneratorTarget::cmGeneratorTarget(cmTarget* t, cmLocalGenerator* lg)
t->GetSourceBacktraces(),
this->SourceEntries, true);
- this->DLLPlatform =
- !this->Makefile->GetSafeDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX").empty();
-
this->PolicyMap = t->GetPolicyMap();
}
@@ -468,7 +465,7 @@ std::string cmGeneratorTarget::GetFilePrefix(
const std::string& config, cmStateEnums::ArtifactType artifact) const
{
if (this->IsImported()) {
- const char* prefix = this->GetFilePrefixInternal(artifact);
+ const char* prefix = this->GetFilePrefixInternal(config, artifact);
return prefix ? prefix : std::string();
}
@@ -481,7 +478,7 @@ std::string cmGeneratorTarget::GetFileSuffix(
const std::string& config, cmStateEnums::ArtifactType artifact) const
{
if (this->IsImported()) {
- const char* suffix = this->GetFileSuffixInternal(artifact);
+ const char* suffix = this->GetFileSuffixInternal(config, artifact);
return suffix ? suffix : std::string();
}
@@ -508,7 +505,8 @@ std::string cmGeneratorTarget::GetFilePostfix(const std::string& config) const
}
const char* cmGeneratorTarget::GetFilePrefixInternal(
- cmStateEnums::ArtifactType artifact, const std::string& language) const
+ std::string const& config, cmStateEnums::ArtifactType artifact,
+ const std::string& language) const
{
// no prefix for non-main target types.
if (this->GetType() != cmStateEnums::STATIC_LIBRARY &&
@@ -523,8 +521,7 @@ const char* cmGeneratorTarget::GetFilePrefixInternal(
// Return an empty prefix for the import library if this platform
// does not support import libraries.
- if (isImportedLibraryArtifact &&
- !this->Makefile->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX")) {
+ if (isImportedLibraryArtifact && !this->NeedImportLibraryName(config)) {
return nullptr;
}
@@ -558,7 +555,8 @@ const char* cmGeneratorTarget::GetFilePrefixInternal(
return targetPrefix;
}
const char* cmGeneratorTarget::GetFileSuffixInternal(
- cmStateEnums::ArtifactType artifact, const std::string& language) const
+ std::string const& config, cmStateEnums::ArtifactType artifact,
+ const std::string& language) const
{
// no suffix for non-main target types.
if (this->GetType() != cmStateEnums::STATIC_LIBRARY &&
@@ -573,8 +571,7 @@ const char* cmGeneratorTarget::GetFileSuffixInternal(
// Return an empty suffix for the import library if this platform
// does not support import libraries.
- if (isImportedLibraryArtifact &&
- !this->Makefile->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX")) {
+ if (isImportedLibraryArtifact && !this->NeedImportLibraryName(config)) {
return nullptr;
}
@@ -2357,7 +2354,7 @@ void cmGeneratorTarget::ComputeModuleDefinitionInfo(
bool cmGeneratorTarget::IsDLLPlatform() const
{
- return this->DLLPlatform;
+ return this->Target->IsDLLPlatform();
}
void cmGeneratorTarget::GetAutoUicOptions(std::vector<std::string>& result,
@@ -2757,6 +2754,13 @@ std::string cmGeneratorTarget::GetCreateRuleVariable(
case cmStateEnums::MODULE_LIBRARY:
return "CMAKE_" + lang + "_CREATE_SHARED_MODULE";
case cmStateEnums::EXECUTABLE:
+ if (this->IsExecutableWithExports()) {
+ std::string linkExeWithExports =
+ "CMAKE_" + lang + "_LINK_EXECUTABLE_WITH_EXPORTS";
+ if (this->Makefile->IsDefinitionSet(linkExeWithExports)) {
+ return linkExeWithExports;
+ }
+ }
return "CMAKE_" + lang + "_LINK_EXECUTABLE";
default:
break;
@@ -3924,8 +3928,7 @@ void cmGeneratorTarget::GetFullNameInternal(
// Return an empty name for the import library if this platform
// does not support import libraries.
- if (isImportedLibraryArtifact &&
- !this->Makefile->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX")) {
+ if (isImportedLibraryArtifact && !this->NeedImportLibraryName(config)) {
outPrefix.clear();
outBase.clear();
outSuffix.clear();
@@ -3934,8 +3937,8 @@ void cmGeneratorTarget::GetFullNameInternal(
// retrieve prefix and suffix
std::string ll = this->GetLinkerLanguage(config);
- const char* targetPrefix = this->GetFilePrefixInternal(artifact, ll);
- const char* targetSuffix = this->GetFileSuffixInternal(artifact, ll);
+ const char* targetPrefix = this->GetFilePrefixInternal(config, artifact, ll);
+ const char* targetSuffix = this->GetFileSuffixInternal(config, artifact, ll);
// The implib option is only allowed for shared libraries, module
// libraries, and executables.
@@ -6363,6 +6366,16 @@ bool cmGeneratorTarget::HasImportLibrary(std::string const& config) const
this->GetManagedType(config) != ManagedType::Managed);
}
+bool cmGeneratorTarget::NeedImportLibraryName(std::string const& config) const
+{
+ return this->HasImportLibrary(config) ||
+ // On DLL platforms we always generate the import library name
+ // just in case the sources have export markup.
+ (this->IsDLLPlatform() &&
+ (this->GetType() == cmStateEnums::EXECUTABLE ||
+ this->GetType() == cmStateEnums::MODULE_LIBRARY));
+}
+
std::string cmGeneratorTarget::GetSupportDirectory() const
{
std::string dir = this->LocalGenerator->GetCurrentBinaryDirectory();
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 627a055..e86535d 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -743,9 +743,13 @@ private:
mutable std::map<std::string, bool> DebugCompatiblePropertiesDone;
- const char* GetFilePrefixInternal(cmStateEnums::ArtifactType artifact,
+ bool NeedImportLibraryName(std::string const& config) const;
+
+ const char* GetFilePrefixInternal(std::string const& config,
+ cmStateEnums::ArtifactType artifact,
const std::string& language = "") const;
- const char* GetFileSuffixInternal(cmStateEnums::ArtifactType artifact,
+ const char* GetFileSuffixInternal(std::string const& config,
+ cmStateEnums::ArtifactType artifact,
const std::string& language = "") const;
std::string GetFullNameInternal(const std::string& config,
@@ -909,7 +913,6 @@ private:
mutable bool DebugSourcesDone;
mutable bool LinkImplementationLanguageIsContextDependent;
mutable bool UtilityItemsDone;
- bool DLLPlatform;
bool ComputePDBOutputDir(const std::string& kind, const std::string& config,
std::string& out) const;
diff --git a/Source/cmGetCMakePropertyCommand.h b/Source/cmGetCMakePropertyCommand.h
index 1f29c78..7790a6b 100644
--- a/Source/cmGetCMakePropertyCommand.h
+++ b/Source/cmGetCMakePropertyCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -15,7 +17,10 @@ class cmExecutionStatus;
class cmGetCMakePropertyCommand : public cmCommand
{
public:
- cmCommand* Clone() override { return new cmGetCMakePropertyCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmGetCMakePropertyCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmGetDirectoryPropertyCommand.h b/Source/cmGetDirectoryPropertyCommand.h
index 02ea056..63a198a 100644
--- a/Source/cmGetDirectoryPropertyCommand.h
+++ b/Source/cmGetDirectoryPropertyCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -15,7 +17,10 @@ class cmExecutionStatus;
class cmGetDirectoryPropertyCommand : public cmCommand
{
public:
- cmCommand* Clone() override { return new cmGetDirectoryPropertyCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmGetDirectoryPropertyCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmGetFilenameComponentCommand.h b/Source/cmGetFilenameComponentCommand.h
index 8c26655..1780b96 100644
--- a/Source/cmGetFilenameComponentCommand.h
+++ b/Source/cmGetFilenameComponentCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -24,7 +26,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmGetFilenameComponentCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmGetFilenameComponentCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmGetPropertyCommand.h b/Source/cmGetPropertyCommand.h
index c3f653e..50e4014 100644
--- a/Source/cmGetPropertyCommand.h
+++ b/Source/cmGetPropertyCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -17,7 +19,10 @@ class cmGetPropertyCommand : public cmCommand
public:
cmGetPropertyCommand();
- cmCommand* Clone() override { return new cmGetPropertyCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmGetPropertyCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmGetSourceFilePropertyCommand.h b/Source/cmGetSourceFilePropertyCommand.h
index 43bc330..387a7f4 100644
--- a/Source/cmGetSourceFilePropertyCommand.h
+++ b/Source/cmGetSourceFilePropertyCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -15,7 +17,10 @@ class cmExecutionStatus;
class cmGetSourceFilePropertyCommand : public cmCommand
{
public:
- cmCommand* Clone() override { return new cmGetSourceFilePropertyCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmGetSourceFilePropertyCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmGetTargetPropertyCommand.h b/Source/cmGetTargetPropertyCommand.h
index 63ee5fd..1a53195 100644
--- a/Source/cmGetTargetPropertyCommand.h
+++ b/Source/cmGetTargetPropertyCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -15,7 +17,10 @@ class cmExecutionStatus;
class cmGetTargetPropertyCommand : public cmCommand
{
public:
- cmCommand* Clone() override { return new cmGetTargetPropertyCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmGetTargetPropertyCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmGetTestPropertyCommand.h b/Source/cmGetTestPropertyCommand.h
index 4a74f59..a53a7f7 100644
--- a/Source/cmGetTestPropertyCommand.h
+++ b/Source/cmGetTestPropertyCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -15,7 +17,10 @@ class cmExecutionStatus;
class cmGetTestPropertyCommand : public cmCommand
{
public:
- cmCommand* Clone() override { return new cmGetTestPropertyCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmGetTestPropertyCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index b80da72..997595b 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -22,9 +22,11 @@
#include "cmTarget.h"
#include <algorithm>
+#include <memory>
#include <ostream>
#include <set>
#include <utility>
+#include <vector>
cmGhsMultiTargetGenerator::cmGhsMultiTargetGenerator(cmGeneratorTarget* target)
: GeneratorTarget(target)
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index b250dd7..ec4107b 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1679,6 +1679,7 @@ void cmGlobalGenerator::ClearGeneratorMembers()
cmDeleteAll(this->LocalGenerators);
this->LocalGenerators.clear();
+ this->AliasTargets.clear();
this->ExportSets.clear();
this->TargetDependencies.clear();
this->TargetSearchIndex.clear();
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 7fd5433..e36825c 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -7,6 +7,7 @@
#include <iosfwd>
#include <map>
+#include <memory>
#include <set>
#include <string>
#include <unordered_map>
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 2d52356..69a7da9 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -9,10 +9,11 @@
#include <algorithm>
#include <ctype.h>
#include <iterator>
-#include <memory> // IWYU pragma: keep
#include <sstream>
#include <stdio.h>
+#include "cm_memory.hxx"
+
#include "cmAlgorithms.h"
#include "cmDocumentationEntry.h"
#include "cmFortranParser.h"
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index 15dd404..99afc1d 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -7,7 +7,7 @@
#include <iosfwd>
#include <map>
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <set>
#include <string>
#include <unordered_map>
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index aa584ad..35af0e1 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -7,6 +7,8 @@
#include <sstream>
#include <utility>
+#include "cm_memory.hxx"
+
#include "cmAlgorithms.h"
#include "cmDocumentationEntry.h"
#include "cmGeneratedFileStream.h"
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 7c2bcd3..d99a906 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -5,11 +5,12 @@
#include "cmsys/RegularExpression.hxx"
#include <assert.h>
#include <iomanip>
-#include <memory> // IWYU pragma: keep
#include <sstream>
#include <stdio.h>
#include <string.h>
+#include "cm_memory.hxx"
+
#include "cmAlgorithms.h"
#include "cmComputeLinkInformation.h"
#include "cmCustomCommand.h"
diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx
index a75d8a9..9befb78 100644
--- a/Source/cmGraphVizWriter.cxx
+++ b/Source/cmGraphVizWriter.cxx
@@ -4,7 +4,7 @@
#include <cstddef>
#include <iostream>
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <sstream>
#include <utility>
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx
index d1f8f58..c58ad06 100644
--- a/Source/cmIfCommand.cxx
+++ b/Source/cmIfCommand.cxx
@@ -11,8 +11,6 @@
#include "cmSystemTools.h"
#include "cmake.h"
-#include <memory> // IWYU pragma: keep
-
static std::string cmIfCommandError(
std::vector<cmExpandedCommandArgument> const& args)
{
diff --git a/Source/cmIfCommand.h b/Source/cmIfCommand.h
index d34ed02..4a67760 100644
--- a/Source/cmIfCommand.h
+++ b/Source/cmIfCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
#include "cmFunctionBlocker.h"
#include "cmListFileCache.h"
@@ -38,7 +40,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmIfCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmIfCommand>();
+ }
/**
* This overrides the default InvokeInitialPass implementation.
diff --git a/Source/cmIncludeCommand.h b/Source/cmIncludeCommand.h
index 3b843b2..94d3fbd 100644
--- a/Source/cmIncludeCommand.h
+++ b/Source/cmIncludeCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -24,7 +26,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmIncludeCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmIncludeCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmIncludeDirectoryCommand.h b/Source/cmIncludeDirectoryCommand.h
index 01d98db..4df94eb 100644
--- a/Source/cmIncludeDirectoryCommand.h
+++ b/Source/cmIncludeDirectoryCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -24,7 +26,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmIncludeDirectoryCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmIncludeDirectoryCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmIncludeExternalMSProjectCommand.h b/Source/cmIncludeExternalMSProjectCommand.h
index 945acdc..9f76576 100644
--- a/Source/cmIncludeExternalMSProjectCommand.h
+++ b/Source/cmIncludeExternalMSProjectCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -25,7 +27,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmIncludeExternalMSProjectCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmIncludeExternalMSProjectCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmIncludeGuardCommand.h b/Source/cmIncludeGuardCommand.h
index eaad9b8..4306c4c 100644
--- a/Source/cmIncludeGuardCommand.h
+++ b/Source/cmIncludeGuardCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -24,7 +26,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmIncludeGuardCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmIncludeGuardCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmIncludeRegularExpressionCommand.h b/Source/cmIncludeRegularExpressionCommand.h
index 8da991d..1723c8b 100644
--- a/Source/cmIncludeRegularExpressionCommand.h
+++ b/Source/cmIncludeRegularExpressionCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -24,7 +26,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmIncludeRegularExpressionCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmIncludeRegularExpressionCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index dba4bbb..750ed8c 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -389,10 +389,6 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
return true;
}
- // Check whether this is a DLL platform.
- bool dll_platform =
- !this->Makefile->GetSafeDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX").empty();
-
for (std::string const& tgt : targetList) {
if (this->Makefile->IsAlias(tgt)) {
@@ -472,7 +468,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
// Shared libraries are handled differently on DLL and non-DLL
// platforms. All windows platforms are DLL platforms including
// cygwin. Currently no other platform is a DLL platform.
- if (dll_platform) {
+ if (target.IsDLLPlatform()) {
// When in namelink only mode skip all libraries on Windows.
if (namelinkMode == cmInstallTargetGenerator::NamelinkModeOnly) {
continue;
@@ -641,7 +637,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
// On DLL platforms an executable may also have an import
// library. Install it to the archive destination if it
// exists.
- if (dll_platform && !archiveArgs.GetDestination().empty() &&
+ if (target.IsDLLPlatform() && !archiveArgs.GetDestination().empty() &&
target.IsExecutableWithExports()) {
// The import library uses the ARCHIVE properties.
archiveGenerator = CreateInstallTargetGenerator(
diff --git a/Source/cmInstallCommand.h b/Source/cmInstallCommand.h
index 202c438..28bf443 100644
--- a/Source/cmInstallCommand.h
+++ b/Source/cmInstallCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -25,7 +27,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmInstallCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmInstallCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmInstallDirectoryGenerator.cxx b/Source/cmInstallDirectoryGenerator.cxx
index 14288f6..c8ebc8c 100644
--- a/Source/cmInstallDirectoryGenerator.cxx
+++ b/Source/cmInstallDirectoryGenerator.cxx
@@ -8,7 +8,7 @@
#include "cmMakefile.h"
#include "cmSystemTools.h"
-#include <memory> // IWYU pragma: keep
+#include <memory>
cmInstallDirectoryGenerator::cmInstallDirectoryGenerator(
std::vector<std::string> const& dirs, const char* dest,
diff --git a/Source/cmInstallFilesCommand.h b/Source/cmInstallFilesCommand.h
index a52f45e..e068b0e 100644
--- a/Source/cmInstallFilesCommand.h
+++ b/Source/cmInstallFilesCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -24,7 +26,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmInstallFilesCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmInstallFilesCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmInstallFilesGenerator.cxx b/Source/cmInstallFilesGenerator.cxx
index 2ed9f73..e8e82cc 100644
--- a/Source/cmInstallFilesGenerator.cxx
+++ b/Source/cmInstallFilesGenerator.cxx
@@ -6,7 +6,7 @@
#include "cmInstallType.h"
#include "cmSystemTools.h"
-#include <memory> // IWYU pragma: keep
+#include <memory>
class cmLocalGenerator;
diff --git a/Source/cmInstallProgramsCommand.h b/Source/cmInstallProgramsCommand.h
index 5c705eb..3242365 100644
--- a/Source/cmInstallProgramsCommand.h
+++ b/Source/cmInstallProgramsCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -24,7 +26,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmInstallProgramsCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmInstallProgramsCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmInstallScriptGenerator.cxx b/Source/cmInstallScriptGenerator.cxx
index 5832d27..b7b7817 100644
--- a/Source/cmInstallScriptGenerator.cxx
+++ b/Source/cmInstallScriptGenerator.cxx
@@ -2,6 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmInstallScriptGenerator.h"
+#include <memory>
#include <ostream>
#include <vector>
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index 0774436..d891ad8 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -4,6 +4,7 @@
#include <assert.h>
#include <map>
+#include <memory>
#include <set>
#include <sstream>
#include <utility>
diff --git a/Source/cmInstallTargetsCommand.h b/Source/cmInstallTargetsCommand.h
index 9950fb7..55e69ba 100644
--- a/Source/cmInstallTargetsCommand.h
+++ b/Source/cmInstallTargetsCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -25,7 +27,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmInstallTargetsCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmInstallTargetsCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmInstalledFile.h b/Source/cmInstalledFile.h
index b7d602e..eb827be 100644
--- a/Source/cmInstalledFile.h
+++ b/Source/cmInstalledFile.h
@@ -8,7 +8,7 @@
#include "cmGeneratorExpression.h"
#include <map>
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <string>
#include <vector>
diff --git a/Source/cmJsonObjects.cxx b/Source/cmJsonObjects.cxx
index 8d065e1..2423faf 100644
--- a/Source/cmJsonObjects.cxx
+++ b/Source/cmJsonObjects.cxx
@@ -31,6 +31,7 @@
#include <functional>
#include <limits>
#include <map>
+#include <memory>
#include <set>
#include <string>
#include <unordered_map>
@@ -515,9 +516,11 @@ static Json::Value DumpTarget(cmGeneratorTarget* target,
Json::Value artifacts = Json::arrayValue;
artifacts.append(
target->GetFullPath(config, cmStateEnums::RuntimeBinaryArtifact));
- if (target->IsDLLPlatform()) {
+ if (target->HasImportLibrary(config)) {
artifacts.append(
target->GetFullPath(config, cmStateEnums::ImportLibraryArtifact));
+ }
+ if (target->IsDLLPlatform()) {
const cmGeneratorTarget::OutputInfo* output =
target->GetOutputInfo(config);
if (output && !output->PdbDir.empty()) {
diff --git a/Source/cmLinkDirectoriesCommand.h b/Source/cmLinkDirectoriesCommand.h
index ae4fb7f..1a439de 100644
--- a/Source/cmLinkDirectoriesCommand.h
+++ b/Source/cmLinkDirectoriesCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -26,7 +28,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmLinkDirectoriesCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmLinkDirectoriesCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmLinkLibrariesCommand.h b/Source/cmLinkLibrariesCommand.h
index af25fba..484ab0a 100644
--- a/Source/cmLinkLibrariesCommand.h
+++ b/Source/cmLinkLibrariesCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -25,7 +27,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmLinkLibrariesCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmLinkLibrariesCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmLinkLineComputer.cxx b/Source/cmLinkLineComputer.cxx
index 469faca..8746b35 100644
--- a/Source/cmLinkLineComputer.cxx
+++ b/Source/cmLinkLineComputer.cxx
@@ -110,8 +110,7 @@ std::string cmLinkLineComputer::ComputeLinkPath(
if (target->GetType() == cmStateEnums::STATIC_LIBRARY ||
target->GetType() == cmStateEnums::SHARED_LIBRARY) {
cmStateEnums::ArtifactType type = cmStateEnums::RuntimeBinaryArtifact;
- if (target->GetType() == cmStateEnums::SHARED_LIBRARY &&
- target->IsDLLPlatform()) {
+ if (target->HasImportLibrary(cli.GetConfig())) {
type = cmStateEnums::ImportLibraryArtifact;
}
diff --git a/Source/cmLinkLineDeviceComputer.cxx b/Source/cmLinkLineDeviceComputer.cxx
index d27da3e..8d2add6 100644
--- a/Source/cmLinkLineDeviceComputer.cxx
+++ b/Source/cmLinkLineDeviceComputer.cxx
@@ -90,12 +90,17 @@ std::string cmLinkLineDeviceComputer::ComputeLinkLibraries(
}
if (item.Target) {
- bool skip = true;
- if (item.Target->GetType() == cmStateEnums::STATIC_LIBRARY) {
- if ((!item.Target->GetPropertyAsBool("CUDA_RESOLVE_DEVICE_SYMBOLS")) &&
- item.Target->GetPropertyAsBool("CUDA_SEPARABLE_COMPILATION")) {
- skip = false;
- }
+ bool skip = false;
+ switch (item.Target->GetType()) {
+ case cmStateEnums::MODULE_LIBRARY:
+ case cmStateEnums::INTERFACE_LIBRARY:
+ skip = true;
+ break;
+ case cmStateEnums::STATIC_LIBRARY:
+ skip = item.Target->GetPropertyAsBool("CUDA_RESOLVE_DEVICE_SYMBOLS");
+ break;
+ default:
+ break;
}
if (skip) {
continue;
diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx
index 1b01ea2..a2e665f 100644
--- a/Source/cmListCommand.cxx
+++ b/Source/cmListCommand.cxx
@@ -13,6 +13,9 @@
#include <stdio.h>
#include <stdlib.h> // required for atoi
#include <utility>
+#include <vector>
+
+#include "cm_memory.hxx"
#include "cmAlgorithms.h"
#include "cmGeneratorExpression.h"
diff --git a/Source/cmListCommand.h b/Source/cmListCommand.h
index ea3d643..70c7f4e 100644
--- a/Source/cmListCommand.h
+++ b/Source/cmListCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -22,7 +24,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmListCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmListCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h
index 9457415..5de1a74 100644
--- a/Source/cmListFileCache.h
+++ b/Source/cmListFileCache.h
@@ -6,7 +6,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include <iosfwd>
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <stddef.h>
#include <string>
#include <utility>
diff --git a/Source/cmLoadCacheCommand.h b/Source/cmLoadCacheCommand.h
index e0f6e4f..45e52f0 100644
--- a/Source/cmLoadCacheCommand.h
+++ b/Source/cmLoadCacheCommand.h
@@ -9,6 +9,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -24,7 +26,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmLoadCacheCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmLoadCacheCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx
index 69751b6..235dcd4 100644
--- a/Source/cmLoadCommandCommand.cxx
+++ b/Source/cmLoadCommandCommand.cxx
@@ -3,10 +3,14 @@
#include "cmLoadCommandCommand.h"
#include <signal.h>
+
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <utility>
+
+#include "cm_memory.hxx"
#include "cmCPluginAPI.cxx"
#include "cmCPluginAPI.h"
@@ -39,12 +43,12 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override
+ std::unique_ptr<cmCommand> Clone() override
{
- cmLoadedCommand* newC = new cmLoadedCommand;
+ auto newC = cm::make_unique<cmLoadedCommand>();
// we must copy when we clone
memcpy(&newC->info, &this->info, sizeof(info));
- return newC;
+ return std::unique_ptr<cmLoadedCommand>(std::move(newC));
}
/**
@@ -237,9 +241,9 @@ bool cmLoadCommandCommand::InitialPass(std::vector<std::string> const& args,
// function blocker
if (initFunction) {
// create a function blocker and set it up
- cmLoadedCommand* f = new cmLoadedCommand();
+ auto f = cm::make_unique<cmLoadedCommand>();
(*initFunction)(&f->info);
- this->Makefile->GetState()->AddScriptedCommand(args[0], f);
+ this->Makefile->GetState()->AddScriptedCommand(args[0], std::move(f));
return true;
}
this->SetError("Attempt to load command failed. "
diff --git a/Source/cmLoadCommandCommand.h b/Source/cmLoadCommandCommand.h
index 021e6c7..d81cefb 100644
--- a/Source/cmLoadCommandCommand.h
+++ b/Source/cmLoadCommandCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -15,7 +17,10 @@ class cmExecutionStatus;
class cmLoadCommandCommand : public cmCommand
{
public:
- cmCommand* Clone() override { return new cmLoadCommandCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmLoadCommandCommand>();
+ }
bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus& status) override;
};
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 801f0e8..4ffd6e0 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -26,22 +26,24 @@
#include "cmTestGenerator.h"
#include "cmVersion.h"
#include "cmake.h"
+#include "cmsys/RegularExpression.hxx"
#if defined(CMAKE_BUILD_WITH_CMAKE)
# define CM_LG_ENCODE_OBJECT_NAMES
# include "cmCryptoHash.h"
#endif
-#include "cmsys/RegularExpression.hxx"
#include <algorithm>
#include <assert.h>
#include <initializer_list>
#include <iterator>
+#include <memory>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <unordered_set>
#include <utility>
+#include <vector>
#if defined(__HAIKU__)
# include <FindDirectory.h>
@@ -1513,8 +1515,10 @@ std::string cmLocalGenerator::GetLinkLibsCMP0065(
}
CM_FALLTHROUGH;
case cmPolicies::OLD:
- // OLD behavior is to always add the flags
- add_shlib_flags = true;
+ // OLD behavior is to always add the flags, except on AIX where
+ // we compute symbol exports if ENABLE_EXPORTS is on.
+ add_shlib_flags =
+ !(tgt.Target->IsAIX() && tgt.GetPropertyAsBool("ENABLE_EXPORTS"));
break;
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS:
@@ -1523,8 +1527,10 @@ std::string cmLocalGenerator::GetLinkLibsCMP0065(
cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0065));
CM_FALLTHROUGH;
case cmPolicies::NEW:
- // NEW behavior is to only add the flags if ENABLE_EXPORTS is on
- add_shlib_flags = tgt.GetPropertyAsBool("ENABLE_EXPORTS");
+ // NEW behavior is to only add the flags if ENABLE_EXPORTS is on,
+ // except on AIX where we compute symbol exports.
+ add_shlib_flags =
+ !tgt.Target->IsAIX() && tgt.GetPropertyAsBool("ENABLE_EXPORTS");
break;
}
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 81cafa3..248f4a6 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -5,7 +5,7 @@
#include <algorithm>
#include <assert.h>
#include <iterator>
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <sstream>
#include <stdio.h>
#include <utility>
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index c392e97..1ec1fd9 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -5,11 +5,12 @@
#include "cmsys/FStream.hxx"
#include "cmsys/Terminal.h"
#include <algorithm>
-#include <memory> // IWYU pragma: keep
#include <sstream>
#include <stdio.h>
#include <utility>
+#include "cm_memory.hxx"
+
#include "cmAlgorithms.h"
#include "cmCustomCommand.h" // IWYU pragma: keep
#include "cmCustomCommandGenerator.h"
diff --git a/Source/cmLocalVisualStudioGenerator.h b/Source/cmLocalVisualStudioGenerator.h
index 3fdafd2..585eb3c 100644
--- a/Source/cmLocalVisualStudioGenerator.h
+++ b/Source/cmLocalVisualStudioGenerator.h
@@ -6,7 +6,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include <map>
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <string>
#include "cmGlobalVisualStudioGenerator.h"
diff --git a/Source/cmMachO.cxx b/Source/cmMachO.cxx
index ac6dce9..bec3ad8 100644
--- a/Source/cmMachO.cxx
+++ b/Source/cmMachO.cxx
@@ -4,10 +4,13 @@
#include "cmAlgorithms.h"
#include "cmsys/FStream.hxx"
+
#include <cstddef>
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
// Include the Mach-O format information system header.
#include <mach-o/fat.h>
#include <mach-o/loader.h>
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index e9c6aea..3d553b7 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -6,6 +6,8 @@
#include <stdio.h>
#include <utility>
+#include "cm_memory.hxx"
+
#include "cmAlgorithms.h"
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
@@ -21,15 +23,15 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override
+ std::unique_ptr<cmCommand> Clone() override
{
- cmMacroHelperCommand* newC = new cmMacroHelperCommand;
+ auto newC = cm::make_unique<cmMacroHelperCommand>();
// we must copy when we clone
newC->Args = this->Args;
newC->Functions = this->Functions;
newC->FilePath = this->FilePath;
newC->Policies = this->Policies;
- return newC;
+ return std::unique_ptr<cmCommand>(std::move(newC));
}
/**
@@ -164,12 +166,12 @@ bool cmMacroFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff,
if (!this->Depth) {
mf.AppendProperty("MACROS", this->Args[0].c_str());
// create a new command and add it to cmake
- cmMacroHelperCommand* f = new cmMacroHelperCommand();
+ auto f = cm::make_unique<cmMacroHelperCommand>();
f->Args = this->Args;
f->Functions = this->Functions;
f->FilePath = this->GetStartingContext().FilePath;
mf.RecordPolicies(f->Policies);
- mf.GetState()->AddScriptedCommand(this->Args[0], f);
+ mf.GetState()->AddScriptedCommand(this->Args[0], std::move(f));
// remove the function blocker now that the macro is defined
mf.RemoveFunctionBlocker(this, lff);
return true;
diff --git a/Source/cmMacroCommand.h b/Source/cmMacroCommand.h
index b54ed66..3ebd959 100644
--- a/Source/cmMacroCommand.h
+++ b/Source/cmMacroCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
#include "cmFunctionBlocker.h"
#include "cmListFileCache.h"
@@ -34,7 +36,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmMacroCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmMacroCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmMakeDirectoryCommand.h b/Source/cmMakeDirectoryCommand.h
index d2637f3..b1fb49b 100644
--- a/Source/cmMakeDirectoryCommand.h
+++ b/Source/cmMakeDirectoryCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -27,7 +29,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmMakeDirectoryCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmMakeDirectoryCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index bd98f08..501ea69 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -9,7 +9,7 @@
#include <cstring>
#include <ctype.h>
#include <iterator>
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
@@ -118,7 +118,6 @@ cmMakefile::~cmMakefile()
cmDeleteAll(this->SourceFiles);
cmDeleteAll(this->Tests);
cmDeleteAll(this->ImportedTargetsOwned);
- cmDeleteAll(this->FinalPassCommands);
cmDeleteAll(this->FunctionBlockers);
cmDeleteAll(this->EvaluationFiles);
}
@@ -418,7 +417,7 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff,
}
} else if (pcmd->HasFinalPass()) {
// use the command
- this->FinalPassCommands.push_back(pcmd.release());
+ this->FinalPassCommands.push_back(std::move(pcmd));
}
}
} else {
@@ -776,8 +775,8 @@ void cmMakefile::FinalPass()
// give all the commands a chance to do something
// after the file has been parsed before generation
- for (cmCommand* fpCommand : this->FinalPassCommands) {
- fpCommand->FinalPass();
+ for (auto& command : this->FinalPassCommands) {
+ command->FinalPass();
}
// go through all configured files and see which ones still exist.
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index d223347..1b4ead7 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -8,7 +8,7 @@
#include "cmsys/RegularExpression.hxx"
#include <deque>
#include <map>
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <set>
#include <stack>
#include <stddef.h>
@@ -937,7 +937,7 @@ protected:
size_t ObjectLibrariesSourceGroupIndex;
#endif
- std::vector<cmCommand*> FinalPassCommands;
+ std::vector<std::unique_ptr<cmCommand>> FinalPassCommands;
cmGlobalGenerator* GlobalGenerator;
bool IsFunctionBlocked(const cmListFileFunction& lff,
cmExecutionStatus& status);
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 6b9b9c7..a7f2a97 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -2,13 +2,14 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmMakefileExecutableTargetGenerator.h"
-#include <memory> // IWYU pragma: keep
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmAlgorithms.h"
#include "cmGeneratedFileStream.h"
#include "cmGeneratorTarget.h"
@@ -482,9 +483,8 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
// Construct the main link rule.
std::vector<std::string> real_link_commands;
- std::string linkRuleVar = "CMAKE_";
- linkRuleVar += linkLanguage;
- linkRuleVar += "_LINK_EXECUTABLE";
+ std::string linkRuleVar = this->GeneratorTarget->GetCreateRuleVariable(
+ linkLanguage, this->ConfigName);
std::string linkRule = this->GetLinkRule(linkRuleVar);
std::vector<std::string> commands1;
cmSystemTools::ExpandListArgument(linkRule, real_link_commands);
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index b9f7c6d..bdde4b8 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -2,13 +2,14 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmMakefileLibraryTargetGenerator.h"
-#include <memory> // IWYU pragma: keep
#include <set>
#include <sstream>
#include <stddef.h>
#include <utility>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmAlgorithms.h"
#include "cmGeneratedFileStream.h"
#include "cmGeneratorTarget.h"
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index b3bab4b..b5a6246 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -2,7 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmMakefileTargetGenerator.h"
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <sstream>
#include <stdio.h>
#include <utility>
diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h
index c570a7c..9eeeed0 100644
--- a/Source/cmMakefileTargetGenerator.h
+++ b/Source/cmMakefileTargetGenerator.h
@@ -7,6 +7,7 @@
#include <iosfwd>
#include <map>
+#include <memory>
#include <set>
#include <string>
#include <vector>
diff --git a/Source/cmMakefileUtilityTargetGenerator.cxx b/Source/cmMakefileUtilityTargetGenerator.cxx
index 4236995..8ed6be5 100644
--- a/Source/cmMakefileUtilityTargetGenerator.cxx
+++ b/Source/cmMakefileUtilityTargetGenerator.cxx
@@ -7,7 +7,8 @@
#include <utility>
#include <vector>
-#include "cmAlgorithms.h"
+#include "cm_memory.hxx"
+
#include "cmGeneratedFileStream.h"
#include "cmGeneratorTarget.h"
#include "cmGlobalUnixMakefileGenerator3.h"
diff --git a/Source/cmMarkAsAdvancedCommand.h b/Source/cmMarkAsAdvancedCommand.h
index 5dd198f..e367c46 100644
--- a/Source/cmMarkAsAdvancedCommand.h
+++ b/Source/cmMarkAsAdvancedCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -23,7 +25,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmMarkAsAdvancedCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmMarkAsAdvancedCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmMathCommand.h b/Source/cmMathCommand.h
index 0c6c76b..23633d3 100644
--- a/Source/cmMathCommand.h
+++ b/Source/cmMathCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -19,7 +21,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmMathCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmMathCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmMessageCommand.h b/Source/cmMessageCommand.h
index 819ebda..ef89d59 100644
--- a/Source/cmMessageCommand.h
+++ b/Source/cmMessageCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -22,7 +24,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmMessageCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmMessageCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmMessenger.cxx b/Source/cmMessenger.cxx
index 1d790e2..0d2b21f 100644
--- a/Source/cmMessenger.cxx
+++ b/Source/cmMessenger.cxx
@@ -100,8 +100,7 @@ void displayMessage(MessageType t, std::ostringstream& msg)
"it.";
} else if (t == MessageType::AUTHOR_ERROR) {
msg << "This error is for project developers. Use -Wno-error=dev to "
- "suppress "
- "it.";
+ "suppress it.";
}
// Add a terminating blank line.
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index f65abc8..88040f8 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -6,11 +6,12 @@
#include <assert.h>
#include <iterator>
#include <map>
-#include <memory> // IWYU pragma: keep
#include <set>
#include <sstream>
#include <utility>
+#include "cm_memory.hxx"
+
#include "cmAlgorithms.h"
#include "cmCustomCommand.h" // IWYU pragma: keep
#include "cmCustomCommandGenerator.h"
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 2139a45..de79817 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -8,10 +8,11 @@
#include <assert.h>
#include <iterator>
#include <map>
-#include <memory> // IWYU pragma: keep
#include <ostream>
#include <utility>
+#include "cm_memory.hxx"
+
#include "cmAlgorithms.h"
#include "cmComputeLinkInformation.h"
#include "cmCustomCommandGenerator.h"
diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h
index 3055e18..a99d8e7 100644
--- a/Source/cmNinjaTargetGenerator.h
+++ b/Source/cmNinjaTargetGenerator.h
@@ -13,7 +13,7 @@
#include "cmOSXBundleGenerator.h"
#include <map>
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <set>
#include <string>
#include <vector>
diff --git a/Source/cmOptionCommand.h b/Source/cmOptionCommand.h
index 34e0e6f..eddab03 100644
--- a/Source/cmOptionCommand.h
+++ b/Source/cmOptionCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -23,7 +25,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmOptionCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmOptionCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmOrderDirectories.cxx b/Source/cmOrderDirectories.cxx
index 585db42..2d055ff 100644
--- a/Source/cmOrderDirectories.cxx
+++ b/Source/cmOrderDirectories.cxx
@@ -13,6 +13,7 @@
#include <assert.h>
#include <functional>
#include <sstream>
+#include <vector>
/*
Directory ordering computation.
diff --git a/Source/cmOutputRequiredFilesCommand.h b/Source/cmOutputRequiredFilesCommand.h
index 09e622b..faffabd 100644
--- a/Source/cmOutputRequiredFilesCommand.h
+++ b/Source/cmOutputRequiredFilesCommand.h
@@ -10,6 +10,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmDependInformation;
@@ -18,7 +20,10 @@ class cmExecutionStatus;
class cmOutputRequiredFilesCommand : public cmCommand
{
public:
- cmCommand* Clone() override { return new cmOutputRequiredFilesCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmOutputRequiredFilesCommand>();
+ }
bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus& status) override;
diff --git a/Source/cmParseArgumentsCommand.h b/Source/cmParseArgumentsCommand.h
index b8ba61d..692ea64 100644
--- a/Source/cmParseArgumentsCommand.h
+++ b/Source/cmParseArgumentsCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -21,7 +23,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmParseArgumentsCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmParseArgumentsCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmProjectCommand.h b/Source/cmProjectCommand.h
index f1d03e7..8b9bcc8 100644
--- a/Source/cmProjectCommand.h
+++ b/Source/cmProjectCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -26,7 +28,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmProjectCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmProjectCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmQTWrapCPPCommand.h b/Source/cmQTWrapCPPCommand.h
index c1dcd54..88a2210 100644
--- a/Source/cmQTWrapCPPCommand.h
+++ b/Source/cmQTWrapCPPCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -24,7 +26,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmQTWrapCPPCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmQTWrapCPPCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmQTWrapUICommand.h b/Source/cmQTWrapUICommand.h
index 15cab40..6a346d4 100644
--- a/Source/cmQTWrapUICommand.h
+++ b/Source/cmQTWrapUICommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -23,7 +25,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmQTWrapUICommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmQTWrapUICommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmQtAutoGen.h b/Source/cmQtAutoGen.h
index 9c52129..619fff1 100644
--- a/Source/cmQtAutoGen.h
+++ b/Source/cmQtAutoGen.h
@@ -5,7 +5,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <string>
#include <vector>
diff --git a/Source/cmQtAutoGenGlobalInitializer.cxx b/Source/cmQtAutoGenGlobalInitializer.cxx
index ef8a56b..f172b77 100644
--- a/Source/cmQtAutoGenGlobalInitializer.cxx
+++ b/Source/cmQtAutoGenGlobalInitializer.cxx
@@ -4,7 +4,6 @@
#include "cmQtAutoGen.h"
#include "cmQtAutoGenInitializer.h"
-#include "cmAlgorithms.h"
#include "cmCustomCommandLines.h"
#include "cmDuration.h"
#include "cmGeneratorTarget.h"
@@ -17,9 +16,10 @@
#include "cmSystemTools.h"
#include "cmTarget.h"
-#include <memory>
#include <utility>
+#include "cm_memory.hxx"
+
cmQtAutoGenGlobalInitializer::Keywords::Keywords()
: AUTOMOC("AUTOMOC")
, AUTOUIC("AUTOUIC")
diff --git a/Source/cmQtAutoGenGlobalInitializer.h b/Source/cmQtAutoGenGlobalInitializer.h
index d56153a..d7f4cc6 100644
--- a/Source/cmQtAutoGenGlobalInitializer.h
+++ b/Source/cmQtAutoGenGlobalInitializer.h
@@ -8,7 +8,7 @@
#include "cmQtAutoGen.h"
#include <map>
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <string>
#include <unordered_map>
#include <vector>
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index 9985f93..4b12419 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -38,6 +38,8 @@
#include <utility>
#include <vector>
+#include "cm_memory.hxx"
+
static std::size_t GetParallelCPUCount()
{
static std::size_t count = 0;
@@ -620,6 +622,7 @@ bool cmQtAutoGenInitializer::InitRcc()
bool cmQtAutoGenInitializer::InitScanFiles()
{
cmMakefile* makefile = this->Target->Target->GetMakefile();
+ cmake const* cm = makefile->GetCMakeInstance();
auto const& kw = this->GlobalInitializer->kw();
auto makeMUFile = [this, &kw](cmSourceFile* sf, std::string const& fullPath,
@@ -665,25 +668,21 @@ bool cmQtAutoGenInitializer::InitScanFiles()
if (!pathError.empty() || fullPath.empty()) {
continue;
}
- std::string const& ext = sf->GetExtension();
+ std::string const& extLower =
+ cmSystemTools::LowerCase(sf->GetExtension());
// Register files that will be scanned by moc or uic
if (this->MocOrUicEnabled()) {
- switch (cmSystemTools::GetFileFormat(ext)) {
- case cmSystemTools::HEADER_FILE_FORMAT:
- addMUFile(makeMUFile(sf, fullPath, true), true);
- break;
- case cmSystemTools::CXX_FILE_FORMAT:
- addMUFile(makeMUFile(sf, fullPath, true), false);
- break;
- default:
- break;
+ if (cm->IsHeaderExtension(extLower)) {
+ addMUFile(makeMUFile(sf, fullPath, true), true);
+ } else if (cm->IsSourceExtension(extLower)) {
+ addMUFile(makeMUFile(sf, fullPath, true), false);
}
}
// Register rcc enabled files
if (this->Rcc.Enabled) {
- if ((ext == kw.qrc) && !sf->GetPropertyAsBool(kw.SKIP_AUTOGEN) &&
+ if ((extLower == kw.qrc) && !sf->GetPropertyAsBool(kw.SKIP_AUTOGEN) &&
!sf->GetPropertyAsBool(kw.SKIP_AUTORCC)) {
// Register qrc file
Qrc qrc;
@@ -715,7 +714,7 @@ bool cmQtAutoGenInitializer::InitScanFiles()
extraHeaders.reserve(this->AutogenTarget.Sources.size() * 2);
// Header search suffixes and extensions
std::array<std::string, 2> const suffixes{ { "", "_p" } };
- auto const& exts = makefile->GetCMakeInstance()->GetHeaderExtensions();
+ auto const& exts = cm->GetHeaderExtensions();
// Scan through sources
for (auto const& pair : this->AutogenTarget.Sources) {
MUFile const& muf = *pair.second;
@@ -784,10 +783,10 @@ bool cmQtAutoGenInitializer::InitScanFiles()
if (!pathError.empty() || fullPath.empty()) {
continue;
}
- std::string const& ext = sf->GetExtension();
+ std::string const& extLower =
+ cmSystemTools::LowerCase(sf->GetExtension());
- auto const fileFormat = cmSystemTools::GetFileFormat(ext);
- if (fileFormat == cmSystemTools::HEADER_FILE_FORMAT) {
+ if (cm->IsHeaderExtension(extLower)) {
if (this->AutogenTarget.Headers.find(sf) ==
this->AutogenTarget.Headers.end()) {
auto muf = makeMUFile(sf, fullPath, false);
@@ -795,7 +794,7 @@ bool cmQtAutoGenInitializer::InitScanFiles()
this->AutogenTarget.Headers.emplace(sf, std::move(muf));
}
}
- } else if (fileFormat == cmSystemTools::CXX_FILE_FORMAT) {
+ } else if (cm->IsSourceExtension(extLower)) {
if (this->AutogenTarget.Sources.find(sf) ==
this->AutogenTarget.Sources.end()) {
auto muf = makeMUFile(sf, fullPath, false);
@@ -803,7 +802,7 @@ bool cmQtAutoGenInitializer::InitScanFiles()
this->AutogenTarget.Sources.emplace(sf, std::move(muf));
}
}
- } else if (this->Uic.Enabled && (ext == kw.ui)) {
+ } else if (this->Uic.Enabled && (extLower == kw.ui)) {
// .ui file
std::string realPath = cmSystemTools::GetRealPath(fullPath);
bool const skipAutogen = sf->GetPropertyAsBool(kw.SKIP_AUTOGEN);
diff --git a/Source/cmQtAutoGenInitializer.h b/Source/cmQtAutoGenInitializer.h
index aa073d1..eb0d35e 100644
--- a/Source/cmQtAutoGenInitializer.h
+++ b/Source/cmQtAutoGenInitializer.h
@@ -8,7 +8,7 @@
#include "cmQtAutoGen.h"
#include <map>
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <ostream>
#include <set>
#include <string>
diff --git a/Source/cmQtAutoGenerator.cxx b/Source/cmQtAutoGenerator.cxx
index e1c435b..2516d84 100644
--- a/Source/cmQtAutoGenerator.cxx
+++ b/Source/cmQtAutoGenerator.cxx
@@ -5,7 +5,8 @@
#include "cmsys/FStream.hxx"
-#include "cmAlgorithms.h"
+#include "cm_memory.hxx"
+
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmState.h"
diff --git a/Source/cmQtAutoMocUic.cxx b/Source/cmQtAutoMocUic.cxx
index 889f47d..44d2db0 100644
--- a/Source/cmQtAutoMocUic.cxx
+++ b/Source/cmQtAutoMocUic.cxx
@@ -5,11 +5,12 @@
#include <algorithm>
#include <array>
#include <list>
-#include <memory>
#include <set>
#include <sstream>
#include <utility>
+#include "cm_memory.hxx"
+
#include "cmAlgorithms.h"
#include "cmCryptoHash.h"
#include "cmGeneratedFileStream.h"
diff --git a/Source/cmQtAutoMocUic.h b/Source/cmQtAutoMocUic.h
index 8061c13..dc18328 100644
--- a/Source/cmQtAutoMocUic.h
+++ b/Source/cmQtAutoMocUic.h
@@ -14,7 +14,7 @@
#include <atomic>
#include <cstddef>
#include <map>
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <set>
#include <string>
#include <unordered_map>
diff --git a/Source/cmRemoveCommand.h b/Source/cmRemoveCommand.h
index 7b11849..088d8ad 100644
--- a/Source/cmRemoveCommand.h
+++ b/Source/cmRemoveCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -23,7 +25,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmRemoveCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmRemoveCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmRemoveDefinitionsCommand.h b/Source/cmRemoveDefinitionsCommand.h
index a5cb204..85d01d4 100644
--- a/Source/cmRemoveDefinitionsCommand.h
+++ b/Source/cmRemoveDefinitionsCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -25,7 +27,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmRemoveDefinitionsCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmRemoveDefinitionsCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmReturnCommand.h b/Source/cmReturnCommand.h
index ef39614..e9264d2 100644
--- a/Source/cmReturnCommand.h
+++ b/Source/cmReturnCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -23,7 +25,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmReturnCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmReturnCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmRuntimeDependencyArchive.cxx b/Source/cmRuntimeDependencyArchive.cxx
index a1d1f95..45aff69 100644
--- a/Source/cmRuntimeDependencyArchive.cxx
+++ b/Source/cmRuntimeDependencyArchive.cxx
@@ -3,7 +3,6 @@
#include "cmRuntimeDependencyArchive.h"
-#include "cmAlgorithms.h"
#include "cmBinUtilsLinuxELFLinker.h"
#include "cmBinUtilsMacOSMachOLinker.h"
#include "cmBinUtilsWindowsPELinker.h"
@@ -27,6 +26,8 @@
#include <utility>
#include <vector>
+#include "cm_memory.hxx"
+
#if defined(_WIN32)
static void AddVisualStudioPath(std::vector<std::string>& paths,
const std::string& prefix,
diff --git a/Source/cmRuntimeDependencyArchive.h b/Source/cmRuntimeDependencyArchive.h
index ec3ecd4..67efec7 100644
--- a/Source/cmRuntimeDependencyArchive.h
+++ b/Source/cmRuntimeDependencyArchive.h
@@ -9,7 +9,7 @@
#include "cmsys/RegularExpression.hxx"
#include <map>
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <set>
#include <string>
#include <vector>
diff --git a/Source/cmSeparateArgumentsCommand.h b/Source/cmSeparateArgumentsCommand.h
index 988ad23..76e2002 100644
--- a/Source/cmSeparateArgumentsCommand.h
+++ b/Source/cmSeparateArgumentsCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -23,7 +25,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmSeparateArgumentsCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmSeparateArgumentsCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmServer.cxx b/Source/cmServer.cxx
index 1903fd9..9df1883 100644
--- a/Source/cmServer.cxx
+++ b/Source/cmServer.cxx
@@ -2,7 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmServer.h"
-#include "cmAlgorithms.h"
#include "cmConnection.h"
#include "cmFileMonitor.h"
#include "cmJsonObjectDictionary.h"
@@ -18,10 +17,11 @@
#include <cassert>
#include <cstdint>
#include <iostream>
-#include <memory>
#include <mutex>
#include <utility>
+#include "cm_memory.hxx"
+
void on_signal(uv_signal_t* signal, int signum)
{
auto conn = static_cast<cmServerBase*>(signal->data);
diff --git a/Source/cmServer.h b/Source/cmServer.h
index aba4924..ab2ad23 100644
--- a/Source/cmServer.h
+++ b/Source/cmServer.h
@@ -10,7 +10,7 @@
#include "cmUVHandlePtr.h"
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <string>
#include <vector>
diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx
index 558391f..c5de742 100644
--- a/Source/cmServerProtocol.cxx
+++ b/Source/cmServerProtocol.cxx
@@ -2,7 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmServerProtocol.h"
-#include "cmAlgorithms.h"
#include "cmExternalMakefileProjectGenerator.h"
#include "cmFileMonitor.h"
#include "cmGlobalGenerator.h"
@@ -19,11 +18,12 @@
#include <algorithm>
#include <cassert>
#include <functional>
-#include <memory>
#include <string>
#include <utility>
#include <vector>
+#include "cm_memory.hxx"
+
// Get rid of some windows macros:
#undef max
diff --git a/Source/cmSetCommand.h b/Source/cmSetCommand.h
index 76e3eae..1c5a435 100644
--- a/Source/cmSetCommand.h
+++ b/Source/cmSetCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -23,7 +25,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmSetCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmSetCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmSetDirectoryPropertiesCommand.h b/Source/cmSetDirectoryPropertiesCommand.h
index 473347c..5416127 100644
--- a/Source/cmSetDirectoryPropertiesCommand.h
+++ b/Source/cmSetDirectoryPropertiesCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -16,7 +18,10 @@ class cmMakefile;
class cmSetDirectoryPropertiesCommand : public cmCommand
{
public:
- cmCommand* Clone() override { return new cmSetDirectoryPropertiesCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmSetDirectoryPropertiesCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmSetPropertyCommand.h b/Source/cmSetPropertyCommand.h
index f1126bb..4051e48 100644
--- a/Source/cmSetPropertyCommand.h
+++ b/Source/cmSetPropertyCommand.h
@@ -9,6 +9,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -22,7 +24,10 @@ class cmSetPropertyCommand : public cmCommand
public:
cmSetPropertyCommand();
- cmCommand* Clone() override { return new cmSetPropertyCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmSetPropertyCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmSetSourceFilesPropertiesCommand.h b/Source/cmSetSourceFilesPropertiesCommand.h
index afb19f6..6fd6c41 100644
--- a/Source/cmSetSourceFilesPropertiesCommand.h
+++ b/Source/cmSetSourceFilesPropertiesCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -16,7 +18,10 @@ class cmMakefile;
class cmSetSourceFilesPropertiesCommand : public cmCommand
{
public:
- cmCommand* Clone() override { return new cmSetSourceFilesPropertiesCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmSetSourceFilesPropertiesCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmSetTargetPropertiesCommand.h b/Source/cmSetTargetPropertiesCommand.h
index c9755da..7e4606e 100644
--- a/Source/cmSetTargetPropertiesCommand.h
+++ b/Source/cmSetTargetPropertiesCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -16,7 +18,10 @@ class cmMakefile;
class cmSetTargetPropertiesCommand : public cmCommand
{
public:
- cmCommand* Clone() override { return new cmSetTargetPropertiesCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmSetTargetPropertiesCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmSetTestsPropertiesCommand.h b/Source/cmSetTestsPropertiesCommand.h
index 84b2645..d73e95a 100644
--- a/Source/cmSetTestsPropertiesCommand.h
+++ b/Source/cmSetTestsPropertiesCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -16,7 +18,10 @@ class cmMakefile;
class cmSetTestsPropertiesCommand : public cmCommand
{
public:
- cmCommand* Clone() override { return new cmSetTestsPropertiesCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmSetTestsPropertiesCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmSiteNameCommand.h b/Source/cmSiteNameCommand.h
index 2d8dc17..0190abb 100644
--- a/Source/cmSiteNameCommand.h
+++ b/Source/cmSiteNameCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -23,7 +25,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmSiteNameCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmSiteNameCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmSourceGroupCommand.h b/Source/cmSourceGroupCommand.h
index ec5ad32..eec4ec0 100644
--- a/Source/cmSourceGroupCommand.h
+++ b/Source/cmSourceGroupCommand.h
@@ -9,6 +9,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -25,7 +27,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmSourceGroupCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmSourceGroupCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index 587cda5..9748cf5 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -6,8 +6,11 @@
#include <algorithm>
#include <assert.h>
#include <string.h>
+#include <type_traits>
#include <utility>
+#include "cm_memory.hxx"
+
#include "cmAlgorithms.h"
#include "cmCacheManager.h"
#include "cmCommand.h"
@@ -27,11 +30,7 @@ cmState::cmState()
this->GlobVerificationManager = cm::make_unique<cmGlobVerificationManager>();
}
-cmState::~cmState()
-{
- cmDeleteAll(this->BuiltinCommands);
- cmDeleteAll(this->ScriptedCommands);
-}
+cmState::~cmState() = default;
const char* cmState::GetTargetTypeName(cmStateEnums::TargetType targetType)
{
@@ -419,50 +418,55 @@ void cmState::SetIsGeneratorMultiConfig(bool b)
this->IsGeneratorMultiConfig = b;
}
-void cmState::AddBuiltinCommand(std::string const& name, cmCommand* command)
+void cmState::AddBuiltinCommand(std::string const& name,
+ std::unique_ptr<cmCommand> command)
{
assert(name == cmSystemTools::LowerCase(name));
assert(this->BuiltinCommands.find(name) == this->BuiltinCommands.end());
- this->BuiltinCommands.insert(std::make_pair(name, command));
+ this->BuiltinCommands.insert(
+ std::map<std::string, std::unique_ptr<cmCommand>>::value_type(
+ name, std::move(command)));
}
-void cmState::AddDisallowedCommand(std::string const& name, cmCommand* command,
+void cmState::AddDisallowedCommand(std::string const& name,
+ std::unique_ptr<cmCommand> command,
cmPolicies::PolicyID policy,
const char* message)
{
- this->AddBuiltinCommand(name,
- new cmDisallowedCommand(command, policy, message));
+ this->AddBuiltinCommand(
+ name,
+ cm::make_unique<cmDisallowedCommand>(std::move(command), policy, message));
}
void cmState::AddUnexpectedCommand(std::string const& name, const char* error)
{
- this->AddBuiltinCommand(name, new cmUnexpectedCommand(name, error));
+ this->AddBuiltinCommand(name,
+ cm::make_unique<cmUnexpectedCommand>(name, error));
}
-void cmState::AddScriptedCommand(std::string const& name, cmCommand* command)
+void cmState::AddScriptedCommand(std::string const& name,
+ std::unique_ptr<cmCommand> command)
{
std::string sName = cmSystemTools::LowerCase(name);
// if the command already exists, give a new name to the old command.
if (cmCommand* oldCmd = this->GetCommand(sName)) {
std::string const newName = "_" + sName;
- std::map<std::string, cmCommand*>::iterator pos =
- this->ScriptedCommands.find(newName);
+ auto pos = this->ScriptedCommands.find(newName);
if (pos != this->ScriptedCommands.end()) {
- delete pos->second;
this->ScriptedCommands.erase(pos);
}
this->ScriptedCommands.insert(std::make_pair(newName, oldCmd->Clone()));
}
// if the command already exists, free the old one
- std::map<std::string, cmCommand*>::iterator pos =
- this->ScriptedCommands.find(sName);
+ auto pos = this->ScriptedCommands.find(sName);
if (pos != this->ScriptedCommands.end()) {
- delete pos->second;
this->ScriptedCommands.erase(pos);
}
- this->ScriptedCommands.insert(std::make_pair(sName, command));
+ this->ScriptedCommands.insert(
+ std::map<std::string, std::unique_ptr<cmCommand>>::value_type(
+ sName, std::move(command)));
}
cmCommand* cmState::GetCommand(std::string const& name) const
@@ -472,14 +476,13 @@ cmCommand* cmState::GetCommand(std::string const& name) const
cmCommand* cmState::GetCommandByExactName(std::string const& name) const
{
- std::map<std::string, cmCommand*>::const_iterator pos;
- pos = this->ScriptedCommands.find(name);
+ auto pos = this->ScriptedCommands.find(name);
if (pos != this->ScriptedCommands.end()) {
- return pos->second;
+ return pos->second.get();
}
pos = this->BuiltinCommands.find(name);
if (pos != this->BuiltinCommands.end()) {
- return pos->second;
+ return pos->second.get();
}
return nullptr;
}
@@ -504,16 +507,13 @@ std::vector<std::string> cmState::GetCommandNames() const
void cmState::RemoveBuiltinCommand(std::string const& name)
{
assert(name == cmSystemTools::LowerCase(name));
- std::map<std::string, cmCommand*>::iterator i =
- this->BuiltinCommands.find(name);
+ auto i = this->BuiltinCommands.find(name);
assert(i != this->BuiltinCommands.end());
- delete i->second;
this->BuiltinCommands.erase(i);
}
void cmState::RemoveUserDefinedCommands()
{
- cmDeleteAll(this->ScriptedCommands);
this->ScriptedCommands.clear();
}
diff --git a/Source/cmState.h b/Source/cmState.h
index accd838..7e88030 100644
--- a/Source/cmState.h
+++ b/Source/cmState.h
@@ -6,6 +6,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include <map>
+#include <memory>
#include <set>
#include <string>
#include <vector>
@@ -145,11 +146,14 @@ public:
// Returns a command from its name, or nullptr
cmCommand* GetCommandByExactName(std::string const& name) const;
- void AddBuiltinCommand(std::string const& name, cmCommand* command);
- void AddDisallowedCommand(std::string const& name, cmCommand* command,
+ void AddBuiltinCommand(std::string const& name,
+ std::unique_ptr<cmCommand> command);
+ void AddDisallowedCommand(std::string const& name,
+ std::unique_ptr<cmCommand> command,
cmPolicies::PolicyID policy, const char* message);
void AddUnexpectedCommand(std::string const& name, const char* error);
- void AddScriptedCommand(std::string const& name, cmCommand* command);
+ void AddScriptedCommand(std::string const& name,
+ std::unique_ptr<cmCommand> command);
void RemoveBuiltinCommand(std::string const& name);
void RemoveUserDefinedCommands();
std::vector<std::string> GetCommandNames() const;
@@ -208,8 +212,8 @@ private:
std::map<cmProperty::ScopeType, cmPropertyDefinitionMap> PropertyDefinitions;
std::vector<std::string> EnabledLanguages;
- std::map<std::string, cmCommand*> BuiltinCommands;
- std::map<std::string, cmCommand*> ScriptedCommands;
+ std::map<std::string, std::unique_ptr<cmCommand>> BuiltinCommands;
+ std::map<std::string, std::unique_ptr<cmCommand>> ScriptedCommands;
cmPropertyMap GlobalProperties;
std::unique_ptr<cmCacheManager> CacheManager;
std::unique_ptr<cmGlobVerificationManager> GlobVerificationManager;
diff --git a/Source/cmStateDirectory.cxx b/Source/cmStateDirectory.cxx
index 6ca1c9f..3f70ed3 100644
--- a/Source/cmStateDirectory.cxx
+++ b/Source/cmStateDirectory.cxx
@@ -6,6 +6,7 @@
#include <algorithm>
#include <assert.h>
#include <iterator>
+#include <vector>
#include "cmAlgorithms.h"
#include "cmProperty.h"
diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx
index 998f904..4ad0870 100644
--- a/Source/cmStringCommand.cxx
+++ b/Source/cmStringCommand.cxx
@@ -8,7 +8,6 @@
#include <algorithm>
#include <ctype.h>
#include <iterator>
-#include <memory> // IWYU pragma: keep
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
diff --git a/Source/cmStringCommand.h b/Source/cmStringCommand.h
index acde605..f48ea17 100644
--- a/Source/cmStringCommand.h
+++ b/Source/cmStringCommand.h
@@ -9,6 +9,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -23,7 +25,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmStringCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmStringCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmSubdirCommand.h b/Source/cmSubdirCommand.h
index adab757..3499c46 100644
--- a/Source/cmSubdirCommand.h
+++ b/Source/cmSubdirCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -25,7 +27,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmSubdirCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmSubdirCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmSubdirDependsCommand.h b/Source/cmSubdirDependsCommand.h
index 2db28c6..64c28b9 100644
--- a/Source/cmSubdirDependsCommand.h
+++ b/Source/cmSubdirDependsCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -15,7 +17,10 @@ class cmExecutionStatus;
class cmSubdirDependsCommand : public cmCommand
{
public:
- cmCommand* Clone() override { return new cmSubdirDependsCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmSubdirDependsCommand>();
+ }
bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus& status) override;
};
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 1501481..723f280 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -1264,65 +1264,6 @@ bool cmSystemTools::SimpleGlob(const std::string& glob,
return res;
}
-cmSystemTools::FileFormat cmSystemTools::GetFileFormat(std::string const& ext)
-{
- if (ext.empty()) {
- return cmSystemTools::NO_FILE_FORMAT;
- }
- if (ext == "c" || ext == ".c" || ext == "m" || ext == ".m") {
- return cmSystemTools::C_FILE_FORMAT;
- }
- if (ext == "C" || ext == ".C" || ext == "M" || ext == ".M" || ext == "c++" ||
- ext == ".c++" || ext == "cc" || ext == ".cc" || ext == "cpp" ||
- ext == ".cpp" || ext == "cxx" || ext == ".cxx" || ext == "mm" ||
- ext == ".mm") {
- return cmSystemTools::CXX_FILE_FORMAT;
- }
- if (ext == "f" || ext == ".f" || ext == "F" || ext == ".F" || ext == "f77" ||
- ext == ".f77" || ext == "f90" || ext == ".f90" || ext == "for" ||
- ext == ".for" || ext == "f95" || ext == ".f95") {
- return cmSystemTools::FORTRAN_FILE_FORMAT;
- }
- if (ext == "java" || ext == ".java") {
- return cmSystemTools::JAVA_FILE_FORMAT;
- }
- if (ext == "cu" || ext == ".cu") {
- return cmSystemTools::CUDA_FILE_FORMAT;
- }
- if (ext == "H" || ext == ".H" || ext == "h" || ext == ".h" || ext == "h++" ||
- ext == ".h++" || ext == "hm" || ext == ".hm" || ext == "hpp" ||
- ext == ".hpp" || ext == "hxx" || ext == ".hxx" || ext == "in" ||
- ext == ".in" || ext == "txx" || ext == ".txx") {
- return cmSystemTools::HEADER_FILE_FORMAT;
- }
- if (ext == "rc" || ext == ".rc") {
- return cmSystemTools::RESOURCE_FILE_FORMAT;
- }
- if (ext == "def" || ext == ".def") {
- return cmSystemTools::DEFINITION_FILE_FORMAT;
- }
- if (ext == "lib" || ext == ".lib" || ext == "a" || ext == ".a") {
- return cmSystemTools::STATIC_LIBRARY_FILE_FORMAT;
- }
- if (ext == "o" || ext == ".o" || ext == "obj" || ext == ".obj") {
- return cmSystemTools::OBJECT_FILE_FORMAT;
- }
-#ifdef __APPLE__
- if (ext == "dylib" || ext == ".dylib") {
- return cmSystemTools::SHARED_LIBRARY_FILE_FORMAT;
- }
- if (ext == "so" || ext == ".so" || ext == "bundle" || ext == ".bundle") {
- return cmSystemTools::MODULE_FILE_FORMAT;
- }
-#else // __APPLE__
- if (ext == "so" || ext == ".so" || ext == "sl" || ext == ".sl" ||
- ext == "dll" || ext == ".dll") {
- return cmSystemTools::SHARED_LIBRARY_FILE_FORMAT;
- }
-#endif // __APPLE__
- return cmSystemTools::UNKNOWN_FILE_FORMAT;
-}
-
std::string cmSystemTools::ConvertToOutputPath(std::string const& path)
{
#if defined(_WIN32) && !defined(__CYGWIN__)
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index 016c266..a9c03bd 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -299,27 +299,6 @@ public:
static void EnableRunCommandOutput() { s_DisableRunCommandOutput = false; }
static bool GetRunCommandOutput() { return s_DisableRunCommandOutput; }
- /**
- * Some constants for different file formats.
- */
- enum FileFormat
- {
- NO_FILE_FORMAT = 0,
- C_FILE_FORMAT,
- CXX_FILE_FORMAT,
- FORTRAN_FILE_FORMAT,
- JAVA_FILE_FORMAT,
- CUDA_FILE_FORMAT,
- HEADER_FILE_FORMAT,
- RESOURCE_FILE_FORMAT,
- DEFINITION_FILE_FORMAT,
- STATIC_LIBRARY_FILE_FORMAT,
- SHARED_LIBRARY_FILE_FORMAT,
- MODULE_FILE_FORMAT,
- OBJECT_FILE_FORMAT,
- UNKNOWN_FILE_FORMAT
- };
-
enum CompareOp
{
OP_EQUAL = 1,
@@ -350,11 +329,6 @@ public:
*/
static int strverscmp(std::string const& lhs, std::string const& rhs);
- /**
- * Determine the file type based on the extension
- */
- static FileFormat GetFileFormat(std::string const& ext);
-
/** Windows if this is true, the CreateProcess in RunCommand will
* not show new console windows when running programs.
*/
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index b10b30f..9290d27 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -12,6 +12,8 @@
#include <string.h>
#include <unordered_set>
+#include "cm_memory.hxx"
+
#include "cmAlgorithms.h"
#include "cmCustomCommand.h"
#include "cmGeneratorExpression.h"
@@ -168,7 +170,8 @@ public:
cmPropertyMap Properties;
bool IsGeneratorProvided;
bool HaveInstallRule;
- bool DLLPlatform;
+ bool IsDLLPlatform;
+ bool IsAIX;
bool IsAndroid;
bool IsImportedTarget;
bool ImportedGloballyVisible;
@@ -216,7 +219,8 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
impl->Name = name;
impl->IsGeneratorProvided = false;
impl->HaveInstallRule = false;
- impl->DLLPlatform = false;
+ impl->IsDLLPlatform = false;
+ impl->IsAIX = false;
impl->IsAndroid = false;
impl->IsImportedTarget =
(vis == VisibilityImported || vis == VisibilityImportedGlobally);
@@ -224,9 +228,13 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
impl->BuildInterfaceIncludesAppended = false;
// Check whether this is a DLL platform.
- impl->DLLPlatform =
+ impl->IsDLLPlatform =
!impl->Makefile->GetSafeDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX").empty();
+ // Check whether we are targeting AIX.
+ impl->IsAIX =
+ (impl->Makefile->GetSafeDefinition("CMAKE_SYSTEM_NAME") == "AIX");
+
// Check whether we are targeting an Android platform.
impl->IsAndroid =
(impl->Makefile->GetSafeDefinition("CMAKE_SYSTEM_NAME") == "Android");
@@ -1657,6 +1665,16 @@ cmPropertyMap const& cmTarget::GetProperties() const
return impl->Properties;
}
+bool cmTarget::IsDLLPlatform() const
+{
+ return impl->IsDLLPlatform;
+}
+
+bool cmTarget::IsAIX() const
+{
+ return impl->IsAIX;
+}
+
bool cmTarget::IsImported() const
{
return impl->IsImportedTarget;
@@ -1872,7 +1890,7 @@ bool cmTarget::GetMappedConfig(std::string const& desired_config,
// If we needed to find one of the mapped configurations but did not
// On a DLL platform there may be only IMPORTED_IMPLIB for a shared
// library or an executable with exports.
- bool allowImp = (impl->DLLPlatform &&
+ bool allowImp = (this->IsDLLPlatform() &&
(this->GetType() == cmStateEnums::SHARED_LIBRARY ||
this->IsExecutableWithExports()));
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index fdcca47..a808bb4 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -6,7 +6,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include <iosfwd>
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <set>
#include <string>
#include <utility>
@@ -177,6 +177,12 @@ public:
//! Get all properties
cmPropertyMap const& GetProperties() const;
+ //! Return whether or not the target is for a DLL platform.
+ bool IsDLLPlatform() const;
+
+ //! Return whether or not we are targeting AIX.
+ bool IsAIX() const;
+
bool IsImported() const;
bool IsImportedGloballyVisible() const;
diff --git a/Source/cmTargetCompileDefinitionsCommand.h b/Source/cmTargetCompileDefinitionsCommand.h
index d41483a..25af21d 100644
--- a/Source/cmTargetCompileDefinitionsCommand.h
+++ b/Source/cmTargetCompileDefinitionsCommand.h
@@ -8,9 +8,11 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
+#include "cmCommand.h"
#include "cmTargetPropCommandBase.h"
-class cmCommand;
class cmExecutionStatus;
class cmTarget;
@@ -20,7 +22,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmTargetCompileDefinitionsCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmTargetCompileDefinitionsCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmTargetCompileFeaturesCommand.h b/Source/cmTargetCompileFeaturesCommand.h
index 45240a5..07948fa 100644
--- a/Source/cmTargetCompileFeaturesCommand.h
+++ b/Source/cmTargetCompileFeaturesCommand.h
@@ -8,15 +8,20 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
+#include "cmCommand.h"
#include "cmTargetPropCommandBase.h"
-class cmCommand;
class cmExecutionStatus;
class cmTarget;
class cmTargetCompileFeaturesCommand : public cmTargetPropCommandBase
{
- cmCommand* Clone() override { return new cmTargetCompileFeaturesCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmTargetCompileFeaturesCommand>();
+ }
bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus& status) override;
diff --git a/Source/cmTargetCompileOptionsCommand.h b/Source/cmTargetCompileOptionsCommand.h
index 6fb151a..a571cfb 100644
--- a/Source/cmTargetCompileOptionsCommand.h
+++ b/Source/cmTargetCompileOptionsCommand.h
@@ -8,9 +8,11 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
+#include "cmCommand.h"
#include "cmTargetPropCommandBase.h"
-class cmCommand;
class cmExecutionStatus;
class cmTarget;
@@ -20,7 +22,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmTargetCompileOptionsCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmTargetCompileOptionsCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmTargetIncludeDirectoriesCommand.h b/Source/cmTargetIncludeDirectoriesCommand.h
index 57bf8fc..6defab2 100644
--- a/Source/cmTargetIncludeDirectoriesCommand.h
+++ b/Source/cmTargetIncludeDirectoriesCommand.h
@@ -8,9 +8,11 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
+#include "cmCommand.h"
#include "cmTargetPropCommandBase.h"
-class cmCommand;
class cmExecutionStatus;
class cmTarget;
@@ -20,7 +22,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmTargetIncludeDirectoriesCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmTargetIncludeDirectoriesCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmTargetLinkDirectoriesCommand.h b/Source/cmTargetLinkDirectoriesCommand.h
index 52c75a0..a2fcfa9 100644
--- a/Source/cmTargetLinkDirectoriesCommand.h
+++ b/Source/cmTargetLinkDirectoriesCommand.h
@@ -8,9 +8,11 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
+#include "cmCommand.h"
#include "cmTargetPropCommandBase.h"
-class cmCommand;
class cmExecutionStatus;
class cmTarget;
@@ -20,7 +22,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmTargetLinkDirectoriesCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmTargetLinkDirectoriesCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmTargetLinkLibrariesCommand.h b/Source/cmTargetLinkLibrariesCommand.h
index 54f8cf4..6698ce0 100644
--- a/Source/cmTargetLinkLibrariesCommand.h
+++ b/Source/cmTargetLinkLibrariesCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
#include "cmTargetLinkLibraryType.h"
@@ -30,7 +32,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmTargetLinkLibrariesCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmTargetLinkLibrariesCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmTargetLinkOptionsCommand.h b/Source/cmTargetLinkOptionsCommand.h
index a1fc9fc..3710739 100644
--- a/Source/cmTargetLinkOptionsCommand.h
+++ b/Source/cmTargetLinkOptionsCommand.h
@@ -8,9 +8,11 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
+#include "cmCommand.h"
#include "cmTargetPropCommandBase.h"
-class cmCommand;
class cmExecutionStatus;
class cmTarget;
@@ -20,7 +22,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmTargetLinkOptionsCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmTargetLinkOptionsCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmTargetSourcesCommand.h b/Source/cmTargetSourcesCommand.h
index b01e3ca..90fd45f 100644
--- a/Source/cmTargetSourcesCommand.h
+++ b/Source/cmTargetSourcesCommand.h
@@ -8,9 +8,11 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
+#include "cmCommand.h"
#include "cmTargetPropCommandBase.h"
-class cmCommand;
class cmExecutionStatus;
class cmTarget;
@@ -20,7 +22,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmTargetSourcesCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmTargetSourcesCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx
index 498953e..916784c 100644
--- a/Source/cmTestGenerator.cxx
+++ b/Source/cmTestGenerator.cxx
@@ -2,8 +2,10 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmTestGenerator.h"
+#include <memory>
#include <ostream>
#include <utility>
+#include <vector>
#include "cmGeneratorExpression.h"
#include "cmGeneratorTarget.h"
diff --git a/Source/cmTryCompileCommand.h b/Source/cmTryCompileCommand.h
index 8237878..ec9f8b8 100644
--- a/Source/cmTryCompileCommand.h
+++ b/Source/cmTryCompileCommand.h
@@ -8,9 +8,11 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
+#include "cmCommand.h"
#include "cmCoreTryCompile.h"
-class cmCommand;
class cmExecutionStatus;
/** \class cmTryCompileCommand
@@ -24,7 +26,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmTryCompileCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmTryCompileCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmTryRunCommand.h b/Source/cmTryRunCommand.h
index c54622c..bacfcdb 100644
--- a/Source/cmTryRunCommand.h
+++ b/Source/cmTryRunCommand.h
@@ -8,9 +8,11 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
+#include "cmCommand.h"
#include "cmCoreTryCompile.h"
-class cmCommand;
class cmExecutionStatus;
/** \class cmTryRunCommand
@@ -24,7 +26,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmTryRunCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmTryRunCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmUVProcessChain.cxx b/Source/cmUVProcessChain.cxx
index 90ece0b..56d6c09 100644
--- a/Source/cmUVProcessChain.cxx
+++ b/Source/cmUVProcessChain.cxx
@@ -2,7 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmUVProcessChain.h"
-#include "cmAlgorithms.h"
#include "cmGetPipes.h"
#include "cmUVHandlePtr.h"
#include "cmUVStreambuf.h"
@@ -10,10 +9,12 @@
#include <assert.h>
+#include <istream> // IWYU pragma: keep
#include <iterator>
-#include <memory>
#include <utility>
+#include "cm_memory.hxx"
+
struct cmUVProcessChain::InternalData
{
struct BasicStreamData
diff --git a/Source/cmUVProcessChain.h b/Source/cmUVProcessChain.h
index 2b33520..75f8f66 100644
--- a/Source/cmUVProcessChain.h
+++ b/Source/cmUVProcessChain.h
@@ -7,7 +7,7 @@
#include <array>
#include <iosfwd>
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <string>
#include <vector>
diff --git a/Source/cmUnexpectedCommand.h b/Source/cmUnexpectedCommand.h
index 33d6bdc..6e4cee5 100644
--- a/Source/cmUnexpectedCommand.h
+++ b/Source/cmUnexpectedCommand.h
@@ -9,6 +9,8 @@
#include <utility>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -22,9 +24,9 @@ public:
{
}
- cmCommand* Clone() override
+ std::unique_ptr<cmCommand> Clone() override
{
- return new cmUnexpectedCommand(this->Name, this->Error);
+ return cm::make_unique<cmUnexpectedCommand>(this->Name, this->Error);
}
bool InitialPass(std::vector<std::string> const& args,
diff --git a/Source/cmUnsetCommand.h b/Source/cmUnsetCommand.h
index 4e1208a..9b78d44 100644
--- a/Source/cmUnsetCommand.h
+++ b/Source/cmUnsetCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -23,7 +25,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmUnsetCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmUnsetCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cmUseMangledMesaCommand.h b/Source/cmUseMangledMesaCommand.h
index e2f1d9b..1c01596 100644
--- a/Source/cmUseMangledMesaCommand.h
+++ b/Source/cmUseMangledMesaCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -15,7 +17,10 @@ class cmExecutionStatus;
class cmUseMangledMesaCommand : public cmCommand
{
public:
- cmCommand* Clone() override { return new cmUseMangledMesaCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmUseMangledMesaCommand>();
+ }
bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus& status) override;
diff --git a/Source/cmUtilitySourceCommand.h b/Source/cmUtilitySourceCommand.h
index 165ecef..cef7fed 100644
--- a/Source/cmUtilitySourceCommand.h
+++ b/Source/cmUtilitySourceCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -15,7 +17,10 @@ class cmExecutionStatus;
class cmUtilitySourceCommand : public cmCommand
{
public:
- cmCommand* Clone() override { return new cmUtilitySourceCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmUtilitySourceCommand>();
+ }
bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus& status) override;
};
diff --git a/Source/cmVariableRequiresCommand.h b/Source/cmVariableRequiresCommand.h
index 94970c5..38e7490 100644
--- a/Source/cmVariableRequiresCommand.h
+++ b/Source/cmVariableRequiresCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -15,7 +17,10 @@ class cmExecutionStatus;
class cmVariableRequiresCommand : public cmCommand
{
public:
- cmCommand* Clone() override { return new cmVariableRequiresCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmVariableRequiresCommand>();
+ }
bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus& status) override;
};
diff --git a/Source/cmVariableWatch.h b/Source/cmVariableWatch.h
index 1230101..acac2c1 100644
--- a/Source/cmVariableWatch.h
+++ b/Source/cmVariableWatch.h
@@ -6,7 +6,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include <map>
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <string>
#include <vector>
diff --git a/Source/cmVariableWatchCommand.h b/Source/cmVariableWatchCommand.h
index 6a8115d..0dbb0cb 100644
--- a/Source/cmVariableWatchCommand.h
+++ b/Source/cmVariableWatchCommand.h
@@ -9,6 +9,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -23,7 +25,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmVariableWatchCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmVariableWatchCommand>();
+ }
//! Default constructor
cmVariableWatchCommand();
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 0420881..ae347fe 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -19,9 +19,10 @@
#include "windows.h"
#include <iterator>
-#include <memory> // IWYU pragma: keep
#include <set>
+#include "cm_memory.hxx"
+
static void ConvertToWindowsSlash(std::string& s);
static std::string cmVS10EscapeXML(std::string arg)
@@ -1218,7 +1219,7 @@ void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValues(
this->GeneratorTarget->GetPropertyAsBool("VS_WINRT_EXTENSIONS")) {
e1.Element("CharacterSet", "Unicode");
} else if (this->GeneratorTarget->GetType() <=
- cmStateEnums::MODULE_LIBRARY &&
+ cmStateEnums::OBJECT_LIBRARY &&
this->ClOptions[config]->UsingSBCS()) {
e1.Element("CharacterSet", "NotSet");
} else {
diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx
index a01fa6f..31a878d 100644
--- a/Source/cmWhileCommand.cxx
+++ b/Source/cmWhileCommand.cxx
@@ -9,8 +9,6 @@
#include "cmMessageType.h"
#include "cmSystemTools.h"
-#include <memory> // IWYU pragma: keep
-
cmWhileFunctionBlocker::cmWhileFunctionBlocker(cmMakefile* mf)
: Makefile(mf)
, Depth(0)
diff --git a/Source/cmWhileCommand.h b/Source/cmWhileCommand.h
index 6f6d405..857d1c8 100644
--- a/Source/cmWhileCommand.h
+++ b/Source/cmWhileCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
#include "cmFunctionBlocker.h"
#include "cmListFileCache.h"
@@ -39,7 +41,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmWhileCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmWhileCommand>();
+ }
/**
* This overrides the default InvokeInitialPass implementation.
diff --git a/Source/cmWorkerPool.cxx b/Source/cmWorkerPool.cxx
index cbf070e..974100b 100644
--- a/Source/cmWorkerPool.cxx
+++ b/Source/cmWorkerPool.cxx
@@ -16,6 +16,8 @@
#include <stddef.h>
#include <thread>
+#include "cm_memory.hxx"
+
/**
* @brief libuv pipe buffer class
*/
diff --git a/Source/cmWorkerPool.h b/Source/cmWorkerPool.h
index f08bb4f..d708118 100644
--- a/Source/cmWorkerPool.h
+++ b/Source/cmWorkerPool.h
@@ -5,14 +5,13 @@
#include "cmConfigure.h" // IWYU pragma: keep
-#include "cmAlgorithms.h" // IWYU pragma: keep
-
-#include <memory> // IWYU pragma: keep
#include <stdint.h>
#include <string>
#include <utility>
#include <vector>
+#include "cm_memory.hxx"
+
// -- Types
class cmWorkerPoolInternal;
diff --git a/Source/cmWriteFileCommand.h b/Source/cmWriteFileCommand.h
index 9028f84..3961898 100644
--- a/Source/cmWriteFileCommand.h
+++ b/Source/cmWriteFileCommand.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "cm_memory.hxx"
+
#include "cmCommand.h"
class cmExecutionStatus;
@@ -22,7 +24,10 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override { return new cmWriteFileCommand; }
+ std::unique_ptr<cmCommand> Clone() override
+ {
+ return cm::make_unique<cmWriteFileCommand>();
+ }
/**
* This is called when the command is first encountered in
diff --git a/Source/cm_memory.hxx b/Source/cm_memory.hxx
new file mode 100644
index 0000000..9f5e678
--- /dev/null
+++ b/Source/cm_memory.hxx
@@ -0,0 +1,31 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#ifndef cm_memory_hxx
+#define cm_memory_hxx
+
+#include "cmConfigure.h" // IWYU pragma: keep
+
+#include <memory> // IWYU pragma: export
+#if !defined(CMake_HAVE_CXX_MAKE_UNIQUE)
+# include <utility>
+#endif
+
+namespace cm {
+
+#if defined(CMake_HAVE_CXX_MAKE_UNIQUE)
+
+using std::make_unique;
+
+#else
+
+template <typename T, typename... Args>
+std::unique_ptr<T> make_unique(Args&&... args)
+{
+ return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
+}
+
+#endif
+
+} // namespace cm
+
+#endif
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 8f2f86d..7250e51 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -2,6 +2,8 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmake.h"
+#include "cm_memory.hxx"
+
#include "cmAlgorithms.h"
#include "cmCommands.h"
#include "cmDocumentation.h"
@@ -104,8 +106,6 @@
#include <cstring>
#include <initializer_list>
#include <iostream>
-#include <iterator>
-#include <memory> // IWYU pragma: keep
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
@@ -122,9 +122,9 @@ typedef std::unordered_map<std::string, Json::Value> JsonValueMapType;
static bool cmakeCheckStampFile(const std::string& stampName);
static bool cmakeCheckStampList(const std::string& stampList);
-void cmWarnUnusedCliWarning(const std::string& variable, int /*unused*/,
- void* ctx, const char* /*unused*/,
- const cmMakefile* /*unused*/)
+static void cmWarnUnusedCliWarning(const std::string& variable, int /*unused*/,
+ void* ctx, const char* /*unused*/,
+ const cmMakefile* /*unused*/)
{
cmake* cm = reinterpret_cast<cmake*>(ctx);
cm->MarkCliAsUsed(variable);
@@ -184,40 +184,36 @@ cmake::cmake(Role role, cmState::Mode mode)
// Make sure we can capture the build tool output.
cmSystemTools::EnableVSConsoleOutput();
- // Set up a list of source and header extensions
- // these are used to find files when the extension
- // is not given
- // The "c" extension MUST precede the "C" extension.
- this->SourceFileExtensions.emplace_back("c");
- this->SourceFileExtensions.emplace_back("C");
-
- this->SourceFileExtensions.emplace_back("c++");
- this->SourceFileExtensions.emplace_back("cc");
- this->SourceFileExtensions.emplace_back("cpp");
- this->SourceFileExtensions.emplace_back("cxx");
- this->SourceFileExtensions.emplace_back("cu");
- this->SourceFileExtensions.emplace_back("m");
- this->SourceFileExtensions.emplace_back("M");
- this->SourceFileExtensions.emplace_back("mm");
-
- std::copy(this->SourceFileExtensions.begin(),
- this->SourceFileExtensions.end(),
- std::inserter(this->SourceFileExtensionsSet,
- this->SourceFileExtensionsSet.end()));
-
- this->HeaderFileExtensions.emplace_back("h");
- this->HeaderFileExtensions.emplace_back("hh");
- this->HeaderFileExtensions.emplace_back("h++");
- this->HeaderFileExtensions.emplace_back("hm");
- this->HeaderFileExtensions.emplace_back("hpp");
- this->HeaderFileExtensions.emplace_back("hxx");
- this->HeaderFileExtensions.emplace_back("in");
- this->HeaderFileExtensions.emplace_back("txx");
-
- std::copy(this->HeaderFileExtensions.begin(),
- this->HeaderFileExtensions.end(),
- std::inserter(this->HeaderFileExtensionsSet,
- this->HeaderFileExtensionsSet.end()));
+ // Set up a list of source and header extensions.
+ // These are used to find files when the extension is not given.
+ {
+ auto fillExts = [](FileExtensions& exts,
+ std::initializer_list<const char*> extList) {
+ // Fill ordered vector
+ exts.ordered.reserve(extList.size());
+ for (const char* ext : extList) {
+ exts.ordered.emplace_back(ext);
+ };
+ // Fill unordered set
+ exts.unordered.insert(exts.ordered.begin(), exts.ordered.end());
+ };
+
+ // Source extensions
+ // The "c" extension MUST precede the "C" extension.
+ fillExts(this->SourceFileExtensions,
+ { "c", "C", "c++", "cc", "cpp", "cxx", "cu", "m", "M", "mm" });
+
+ // Header extensions
+ fillExts(this->HeaderFileExtensions,
+ { "h", "hh", "h++", "hm", "hpp", "hxx", "in", "txx" });
+
+ // Cuda extensions
+ fillExts(this->CudaFileExtensions, { "cu" });
+
+ // Fortran extensions
+ fillExts(this->FortranFileExtensions,
+ { "f", "F", "for", "f77", "f90", "f95", "f03" });
+ }
}
cmake::~cmake()
diff --git a/Source/cmake.h b/Source/cmake.h
index e14a081..6aa00e1 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -7,7 +7,7 @@
#include <functional>
#include <map>
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <set>
#include <string>
#include <unordered_set>
@@ -121,6 +121,17 @@ public:
bool isAlias;
};
+ struct FileExtensions
+ {
+ bool Test(std::string const& ext) const
+ {
+ return (this->unordered.find(ext) != this->unordered.end());
+ }
+
+ std::vector<std::string> ordered;
+ std::unordered_set<std::string> unordered;
+ };
+
typedef std::map<std::string, cmInstalledFile> InstalledFilesMap;
static const int NO_BUILD_PARALLEL_LEVEL = -1;
@@ -233,24 +244,42 @@ public:
const std::vector<std::string>& GetSourceExtensions() const
{
- return this->SourceFileExtensions;
+ return this->SourceFileExtensions.ordered;
}
bool IsSourceExtension(const std::string& ext) const
{
- return this->SourceFileExtensionsSet.find(ext) !=
- this->SourceFileExtensionsSet.end();
+ return this->SourceFileExtensions.Test(ext);
}
const std::vector<std::string>& GetHeaderExtensions() const
{
- return this->HeaderFileExtensions;
+ return this->HeaderFileExtensions.ordered;
}
bool IsHeaderExtension(const std::string& ext) const
{
- return this->HeaderFileExtensionsSet.find(ext) !=
- this->HeaderFileExtensionsSet.end();
+ return this->HeaderFileExtensions.Test(ext);
+ }
+
+ const std::vector<std::string>& GetCudaExtensions() const
+ {
+ return this->CudaFileExtensions.ordered;
+ }
+
+ bool IsCudaExtension(const std::string& ext) const
+ {
+ return this->CudaFileExtensions.Test(ext);
+ }
+
+ const std::vector<std::string>& GetFortranExtensions() const
+ {
+ return this->FortranFileExtensions.ordered;
+ }
+
+ bool IsFortranExtension(const std::string& ext) const
+ {
+ return this->FortranFileExtensions.Test(ext);
}
// Strips the extension (if present and known) from a filename
@@ -531,10 +560,10 @@ private:
std::string CheckStampList;
std::string VSSolutionFile;
std::string EnvironmentGenerator;
- std::vector<std::string> SourceFileExtensions;
- std::unordered_set<std::string> SourceFileExtensionsSet;
- std::vector<std::string> HeaderFileExtensions;
- std::unordered_set<std::string> HeaderFileExtensionsSet;
+ FileExtensions SourceFileExtensions;
+ FileExtensions HeaderFileExtensions;
+ FileExtensions CudaFileExtensions;
+ FileExtensions FortranFileExtensions;
bool ClearBuildSystem;
bool DebugTryCompile;
std::unique_ptr<cmFileTimeCache> FileTimeCache;
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 64026ca..cfb3cee 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -31,13 +31,14 @@
#include <string>
#include <vector>
+namespace {
#ifdef CMAKE_BUILD_WITH_CMAKE
-static const char* cmDocumentationName[][2] = {
+const char* cmDocumentationName[][2] = {
{ nullptr, " cmake - Cross-Platform Makefile Generator." },
{ nullptr, nullptr }
};
-static const char* cmDocumentationUsage[][2] = {
+const char* cmDocumentationUsage[][2] = {
{ nullptr,
" cmake [options] <path-to-source>\n"
" cmake [options] <path-to-existing-build>\n"
@@ -49,40 +50,12 @@ static const char* cmDocumentationUsage[][2] = {
{ nullptr, nullptr }
};
-static const char* cmDocumentationUsageNote[][2] = {
+const char* cmDocumentationUsageNote[][2] = {
{ nullptr, "Run 'cmake --help' for more information." },
{ nullptr, nullptr }
};
-# define CMAKE_BUILD_OPTIONS \
- " <dir> = Project binary directory to be built.\n" \
- " --parallel [<jobs>], -j [<jobs>]\n" \
- " = Build in parallel using the given number of jobs. \n" \
- " If <jobs> is omitted the native build tool's \n" \
- " default number is used.\n" \
- " The CMAKE_BUILD_PARALLEL_LEVEL environment " \
- "variable\n" \
- " specifies a default parallel level when this " \
- "option\n" \
- " is not given.\n" \
- " --target <tgt>..., -t <tgt>... \n" \
- " = Build <tgt> instead of default targets.\n" \
- " --config <cfg> = For multi-configuration tools, choose <cfg>.\n" \
- " --clean-first = Build target 'clean' first, then build.\n" \
- " (To clean only, use --target 'clean'.)\n" \
- " --verbose, -v = Enable verbose output - if supported - including\n" \
- " the build commands to be executed. \n" \
- " -- = Pass remaining options to the native tool.\n"
-
-# define CMAKE_INSTALL_OPTIONS \
- " <dir> = Project binary directory to install.\n" \
- " --config <cfg> = For multi-configuration tools, choose <cfg>.\n" \
- " --component <comp> = Component-based install. Only install <comp>.\n" \
- " --prefix <prefix> = The installation prefix CMAKE_INSTALL_PREFIX.\n" \
- " --strip = Performing install/strip.\n" \
- " -v --verbose = Enable verbose output.\n"
-
-static const char* cmDocumentationOptions[][2] = {
+const char* cmDocumentationOptions[][2] = {
CMAKE_STANDARD_OPTIONS_TABLE,
{ "-E", "CMake command mode." },
{ "-L[A][H]", "List non-advanced cached variables." },
@@ -96,7 +69,7 @@ static const char* cmDocumentationOptions[][2] = {
"Generate graphviz of dependencies, see "
"CMakeGraphVizOptions.cmake for more." },
{ "--system-information [file]", "Dump information about this system." },
- { "--loglevel=<error|warn|notice|status|verbose|debug|trace>",
+ { "--loglevel=<ERROR|WARNING|NOTICE|STATUS|VERBOSE|DEBUG|TRACE>",
"Set the verbosity of messages from CMake files." },
{ "--debug-trycompile",
"Do not delete the try_compile build tree. Only "
@@ -117,7 +90,7 @@ static const char* cmDocumentationOptions[][2] = {
#endif
-static int do_command(int ac, char const* const* av)
+int do_command(int ac, char const* const* av)
{
std::vector<std::string> args;
args.reserve(ac - 1);
@@ -126,12 +99,7 @@ static int do_command(int ac, char const* const* av)
return cmcmd::ExecuteCMakeCommand(args);
}
-int do_cmake(int ac, char const* const* av);
-static int do_build(int ac, char const* const* av);
-static int do_install(int ac, char const* const* av);
-static int do_open(int ac, char const* const* av);
-
-static cmMakefile* cmakemainGetMakefile(cmake* cm)
+cmMakefile* cmakemainGetMakefile(cmake* cm)
{
if (cm && cm->GetDebugOutput()) {
cmGlobalGenerator* gg = cm->GetGlobalGenerator();
@@ -142,7 +110,7 @@ static cmMakefile* cmakemainGetMakefile(cmake* cm)
return nullptr;
}
-static std::string cmakemainGetStack(cmake* cm)
+std::string cmakemainGetStack(cmake* cm)
{
std::string msg;
cmMakefile* mf = cmakemainGetMakefile(cm);
@@ -156,14 +124,13 @@ static std::string cmakemainGetStack(cmake* cm)
return msg;
}
-static void cmakemainMessageCallback(const std::string& m,
- const char* /*unused*/, cmake* cm)
+void cmakemainMessageCallback(const std::string& m, const char* /*unused*/,
+ cmake* cm)
{
- std::cerr << m << cmakemainGetStack(cm) << std::endl << std::flush;
+ std::cerr << m << cmakemainGetStack(cm) << std::endl;
}
-static void cmakemainProgressCallback(const std::string& m, float prog,
- cmake* cm)
+void cmakemainProgressCallback(const std::string& m, float prog, cmake* cm)
{
cmMakefile* mf = cmakemainGetMakefile(cm);
std::string dir;
@@ -178,48 +145,6 @@ static void cmakemainProgressCallback(const std::string& m, float prog,
if ((prog < 0) || (!dir.empty())) {
std::cout << "-- " << m << dir << cmakemainGetStack(cm) << std::endl;
}
-
- std::cout.flush();
-}
-
-int main(int ac, char const* const* av)
-{
- cmSystemTools::EnsureStdPipes();
-#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE)
- // Replace streambuf so we can output Unicode to console
- cmsys::ConsoleBuf::Manager consoleOut(std::cout);
- consoleOut.SetUTF8Pipes();
- cmsys::ConsoleBuf::Manager consoleErr(std::cerr, true);
- consoleErr.SetUTF8Pipes();
-#endif
- cmsys::Encoding::CommandLineArguments args =
- cmsys::Encoding::CommandLineArguments::Main(ac, av);
- ac = args.argc();
- av = args.argv();
-
- cmSystemTools::EnableMSVCDebugHook();
- cmSystemTools::InitializeLibUV();
- cmSystemTools::FindCMakeResources(av[0]);
- if (ac > 1) {
- if (strcmp(av[1], "--build") == 0) {
- return do_build(ac, av);
- }
- if (strcmp(av[1], "--install") == 0) {
- return do_install(ac, av);
- }
- if (strcmp(av[1], "--open") == 0) {
- return do_open(ac, av);
- }
- if (strcmp(av[1], "-E") == 0) {
- return do_command(ac, av);
- }
- }
- int ret = do_cmake(ac, av);
-#ifdef CMAKE_BUILD_WITH_CMAKE
- cmDynamicLoader::FlushCache();
-#endif
- uv_loop_close(uv_default_loop());
- return ret;
}
int do_cmake(int ac, char const* const* av)
@@ -381,7 +306,6 @@ int do_cmake(int ac, char const* const* av)
return 0;
}
-namespace {
int extract_job_number(int& index, char const* current, char const* next,
int len_of_flag)
{
@@ -411,9 +335,8 @@ int extract_job_number(int& index, char const* current, char const* next,
}
return jobs;
}
-}
-static int do_build(int ac, char const* const* av)
+int do_build(int ac, char const* const* av)
{
#ifndef CMAKE_BUILD_WITH_CMAKE
std::cerr << "This cmake does not support --build\n";
@@ -541,7 +464,24 @@ static int do_build(int ac, char const* const* av)
std::cerr <<
"Usage: cmake --build <dir> [options] [-- [native-options]]\n"
"Options:\n"
- CMAKE_BUILD_OPTIONS
+ " <dir> = Project binary directory to be built.\n"
+ " --parallel [<jobs>], -j [<jobs>]\n"
+ " = Build in parallel using the given number of jobs. \n"
+ " If <jobs> is omitted the native build tool's \n"
+ " default number is used.\n"
+ " The CMAKE_BUILD_PARALLEL_LEVEL environment "
+ "variable\n"
+ " specifies a default parallel level when this "
+ "option\n"
+ " is not given.\n"
+ " --target <tgt>..., -t <tgt>... \n"
+ " = Build <tgt> instead of default targets.\n"
+ " --config <cfg> = For multi-configuration tools, choose <cfg>.\n"
+ " --clean-first = Build target 'clean' first, then build.\n"
+ " (To clean only, use --target 'clean'.)\n"
+ " --verbose, -v = Enable verbose output - if supported - including\n"
+ " the build commands to be executed. \n"
+ " -- = Pass remaining options to the native tool.\n"
;
/* clang-format on */
return 1;
@@ -560,7 +500,7 @@ static int do_build(int ac, char const* const* av)
#endif
}
-static int do_install(int ac, char const* const* av)
+int do_install(int ac, char const* const* av)
{
#ifndef CMAKE_BUILD_WITH_CMAKE
std::cerr << "This cmake does not support --install\n";
@@ -627,8 +567,18 @@ static int do_install(int ac, char const* const* av)
}
if (dir.empty()) {
- std::cerr << "Usage: cmake --install <dir> "
- "[options]\nOptions:\n" CMAKE_INSTALL_OPTIONS;
+ /* clang-format off */
+ std::cerr <<
+ "Usage: cmake --install <dir> [options]\n"
+ "Options:\n"
+ " <dir> = Project binary directory to install.\n"
+ " --config <cfg> = For multi-configuration tools, choose <cfg>.\n"
+ " --component <comp> = Component-based install. Only install <comp>.\n"
+ " --prefix <prefix> = The installation prefix CMAKE_INSTALL_PREFIX.\n"
+ " --strip = Performing install/strip.\n"
+ " -v --verbose = Enable verbose output.\n"
+ ;
+ /* clang-format on */
return 1;
}
@@ -671,7 +621,7 @@ static int do_install(int ac, char const* const* av)
#endif
}
-static int do_open(int ac, char const* const* av)
+int do_open(int ac, char const* const* av)
{
#ifndef CMAKE_BUILD_WITH_CMAKE
std::cerr << "This cmake does not support --open\n";
@@ -713,3 +663,44 @@ static int do_open(int ac, char const* const* av)
return cm.Open(dir, false) ? 0 : 1;
#endif
}
+} // namespace
+
+int main(int ac, char const* const* av)
+{
+ cmSystemTools::EnsureStdPipes();
+#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE)
+ // Replace streambuf so we can output Unicode to console
+ cmsys::ConsoleBuf::Manager consoleOut(std::cout);
+ consoleOut.SetUTF8Pipes();
+ cmsys::ConsoleBuf::Manager consoleErr(std::cerr, true);
+ consoleErr.SetUTF8Pipes();
+#endif
+ cmsys::Encoding::CommandLineArguments args =
+ cmsys::Encoding::CommandLineArguments::Main(ac, av);
+ ac = args.argc();
+ av = args.argv();
+
+ cmSystemTools::EnableMSVCDebugHook();
+ cmSystemTools::InitializeLibUV();
+ cmSystemTools::FindCMakeResources(av[0]);
+ if (ac > 1) {
+ if (strcmp(av[1], "--build") == 0) {
+ return do_build(ac, av);
+ }
+ if (strcmp(av[1], "--install") == 0) {
+ return do_install(ac, av);
+ }
+ if (strcmp(av[1], "--open") == 0) {
+ return do_open(ac, av);
+ }
+ if (strcmp(av[1], "-E") == 0) {
+ return do_command(ac, av);
+ }
+ }
+ int ret = do_cmake(ac, av);
+#ifdef CMAKE_BUILD_WITH_CMAKE
+ cmDynamicLoader::FlushCache();
+#endif
+ uv_loop_close(uv_default_loop());
+ return ret;
+}
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 86082e5..503dce1 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -41,7 +41,7 @@
#include <array>
#include <iostream>
#include <iterator>
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
@@ -114,6 +114,8 @@ void CMakeCommandUsage(const char* program)
<< " touch <file>... - touch a <file>.\n"
<< " touch_nocreate <file>... - touch a <file> but do not create it.\n"
<< " create_symlink old new - create a symbolic link new -> old\n"
+ << " true - do nothing with an exit code of 0\n"
+ << " false - do nothing with an exit code of 1\n"
#if defined(_WIN32) && !defined(__CYGWIN__)
<< "Available on Windows only:\n"
<< " delete_regv key - delete registry value\n"
@@ -891,6 +893,16 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args)
return 0;
}
+ // Command to do nothing with an exit code of 0.
+ if (args[1] == "true") {
+ return 0;
+ }
+
+ // Command to do nothing with an exit code of 1.
+ if (args[1] == "false") {
+ return 1;
+ }
+
// Internal CMake shared library support.
if (args[1] == "cmake_symlink_library" && args.size() == 5) {
return cmcmd::SymlinkLibrary(args);
diff --git a/Tests/Assembler/CMakeLists.txt b/Tests/Assembler/CMakeLists.txt
index fb17ebb..21b265c 100644
--- a/Tests/Assembler/CMakeLists.txt
+++ b/Tests/Assembler/CMakeLists.txt
@@ -7,9 +7,10 @@ set(SRCS)
# (at least) the following toolchains can process assembler files directly
# and also generate assembler files from C:
-if("${CMAKE_GENERATOR}" MATCHES "Makefile|Xcode" AND
+if("${CMAKE_GENERATOR}" MATCHES "Makefile|Xcode|Ninja" AND
NOT CMAKE_OSX_ARCHITECTURES)
- if((CMAKE_C_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang|HP|SunPro|XL)$") OR (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND UNIX))
+ if((CMAKE_C_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang|HP|SunPro|XL)$") OR (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND UNIX)
+ AND NOT (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND "x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC"))
set(C_FLAGS "${CMAKE_C_FLAGS}")
separate_arguments(C_FLAGS)
if(CMAKE_OSX_SYSROOT AND CMAKE_C_SYSROOT_FLAG AND NOT ";${C_FLAGS};" MATCHES ";${CMAKE_C_SYSROOT_FLAG};")
diff --git a/Tests/CMakeLib/testUVProcessChain.cxx b/Tests/CMakeLib/testUVProcessChain.cxx
index 72ae602..63c9943 100644
--- a/Tests/CMakeLib/testUVProcessChain.cxx
+++ b/Tests/CMakeLib/testUVProcessChain.cxx
@@ -1,6 +1,5 @@
#include "cmUVProcessChain.h"
-#include "cmAlgorithms.h"
#include "cmGetPipes.h"
#include "cmUVHandlePtr.h"
#include "cmUVStreambuf.h"
@@ -16,6 +15,8 @@
#include <csignal>
+#include "cm_memory.hxx"
+
struct ExpectedStatus
{
bool Finished;
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index b8b7e21..5b8f255 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -14,8 +14,8 @@ macro(ADD_TEST_MACRO NAME)
${build_generator_args}
--build-project ${proj}
${${NAME}_CTEST_OPTIONS}
- --build-options ${build_options}
- ${${NAME}_BUILD_OPTIONS}
+ --build-options
+ ${${NAME}_BUILD_OPTIONS}
${_test_command})
unset(_test_command)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${dir}")
@@ -127,9 +127,10 @@ if(BUILD_TESTING)
)
endif()
- set(build_options)
if(CMake_TEST_EXPLICIT_MAKE_PROGRAM)
- list(APPEND build_options -DCMAKE_MAKE_PROGRAM:FILEPATH=${CMake_TEST_EXPLICIT_MAKE_PROGRAM})
+ list(APPEND build_generator_args
+ --build-makeprogram ${CMake_TEST_EXPLICIT_MAKE_PROGRAM}
+ )
endif()
# Look for rpmbuild to use for tests.
@@ -528,7 +529,6 @@ if(BUILD_TESTING)
"${CMake_BINARY_DIR}/Tests/BundleUtilities"
${build_generator_args}
--build-project BundleUtilities
- --build-options ${build_options}
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleUtilities")
@@ -541,9 +541,9 @@ if(BUILD_TESTING)
"${CMake_BINARY_DIR}/Tests/Qt4Deploy"
${build_generator_args}
--build-project Qt4Deploy
- --build-options ${build_options}
- -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
- -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
+ --build-options
+ -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
+ -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Deploy")
endif()
@@ -590,7 +590,7 @@ if(BUILD_TESTING)
--build-project ExternalDataTest
--build-noclean
--force-new-ctest-process
- --build-options ${build_options}
+ --build-options
-DMAKE_SUPPORTS_SPACES=${MAKE_SUPPORTS_SPACES}
--test-command ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE} -V
)
@@ -633,7 +633,6 @@ if(BUILD_TESTING)
"${CMake_BINARY_DIR}/Tests/Visibility"
${build_generator_args}
--build-project Visibility
- --build-options ${build_options}
)
list(APPEND TEST_BUILD_DIRS
"${CMake_BINARY_DIR}/Tests/Visibility"
@@ -648,7 +647,7 @@ if(BUILD_TESTING)
${build_generator_args}
--build-project LinkFlags
--build-target LinkFlags
- --build-options ${build_options}
+ --build-options
-DTEST_CONFIG=\${CTEST_CONFIGURATION_TYPE}
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LinkFlags")
@@ -709,7 +708,6 @@ if(BUILD_TESTING)
--build-generator-platform "${CMAKE_GENERATOR_PLATFORM}"
--build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}"
--build-project Simple
- --build-options ${build_options}
--test-command Simple)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${extraGeneratorTestName}")
endif ()
@@ -729,7 +727,6 @@ if(BUILD_TESTING)
--build-project SubProject
${build_generator_args}
--build-target car
- --build-options ${build_options}
--test-command car
)
@@ -755,7 +752,6 @@ if(BUILD_TESTING)
--build-project foo
--build-target foo
--build-exe-dir "${CMake_BINARY_DIR}/Tests/SubProject/foo"
- --build-options ${build_options}
--test-command foo
)
set_tests_properties ( SubProject-Stage2 PROPERTIES DEPENDS SubProject)
@@ -797,7 +793,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-two-config
${build_generator_args}
--build-project Framework
- --build-options ${build_options}
+ --build-options
"-DCMAKE_INSTALL_PREFIX:PATH=${CMake_BINARY_DIR}/Tests/Framework/Install"
--test-command bar)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Framework")
@@ -809,7 +805,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-two-config
${build_generator_args}
--build-project TargetName
- --build-options ${build_options}
--test-command ${CMAKE_CMAKE_COMMAND} -E compare_files
${CMake_SOURCE_DIR}/Tests/TargetName/scripts/hello_world
${CMake_BINARY_DIR}/Tests/TargetName/scripts/hello_world)
@@ -823,7 +818,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project LibName
--build-exe-dir "${CMake_BINARY_DIR}/Tests/LibName/lib"
- --build-options ${build_options}
--test-command foobar
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LibName")
@@ -836,7 +830,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project CustComDepend
--build-exe-dir "${CMake_BINARY_DIR}/Tests/CustComDepend/bin"
- --build-options ${build_options}
--test-command foo bar.c
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustComDepend")
@@ -848,7 +841,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project ArgumentExpansion
--build-exe-dir "${CMake_BINARY_DIR}/Tests/ArgumentExpansion/bin"
- --build-options ${build_options}
)
set_tests_properties(ArgumentExpansion PROPERTIES
FAIL_REGULAR_EXPRESSION "Unexpected: ")
@@ -861,7 +853,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/GeneratorExpression"
${build_generator_args}
--build-project GeneratorExpression
- --build-options ${build_options}
+ --build-options
-DCMAKE_BUILD_TYPE=\${CTEST_CONFIGURATION_TYPE}
--test-command ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE} -V
)
@@ -875,7 +867,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project CustomCommand
--build-exe-dir "${CMake_BINARY_DIR}/Tests/CustomCommand/bin"
- --build-options ${build_options}
+ --build-options
--test-command CustomCommand
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommand")
@@ -893,7 +885,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-two-config
${build_generator_args}
--build-project TestWorkingDir
- --build-options ${build_options}
--test-command working
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommandWorkingDirectory")
@@ -905,7 +896,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project OutOfSource
--build-two-config
- --build-options ${build_options}
--test-command
"${CMake_BINARY_DIR}/Tests/OutOfSource/SubDir/OutOfSourceSubdir/simple")
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/OutOfSource")
@@ -918,7 +908,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/BuildDepends"
${build_generator_args}
--build-project BuildDepends
- --build-options ${build_options}
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BuildDepends")
@@ -931,7 +920,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project TestMissingInstall
--build-two-config
- --build-options ${build_options}
+ --build-options
"-DCMAKE_INSTALL_PREFIX:PATH=${MissingInstallInstallDir}")
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MissingInstall")
@@ -977,7 +966,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/CPackWiXGenerator"
${build_generator_args}
--build-project CPackWiXGenerator
- --build-options ${build_options}
+ --build-options
--test-command ${CMAKE_CMAKE_COMMAND}
"-DCPackWiXGenerator_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/CPackWiXGenerator"
"-Dconfig=\${CTEST_CONFIGURATION_TYPE}"
@@ -997,7 +986,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project CPackUseDefaultVersion
--build-two-config
- --build-options ${build_options}
+ --build-options
${CPackUseDefaultVersion_BUILD_OPTIONS})
set_tests_properties(CPackUseDefaultVersion PROPERTIES PASS_REGULAR_EXPRESSION "CPACK_PACKAGE_VERSION=0\\.1\\.1")
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackUseDefaultVersion")
@@ -1009,7 +998,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project CPackUseProjectVersion
--build-two-config
- --build-options ${build_options}
+ --build-options
${CPackUseProjectVersion_BUILD_OPTIONS})
set_tests_properties(CPackUseProjectVersion PROPERTIES PASS_REGULAR_EXPRESSION "CPACK_PACKAGE_VERSION=1\\.2\\.3")
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackUseProjectVersion")
@@ -1021,7 +1010,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project CPackUseShortProjectVersion
--build-two-config
- --build-options ${build_options}
+ --build-options
${CPackUseProjectVersion_BUILD_OPTIONS})
set_tests_properties(CPackUseShortProjectVersion PROPERTIES PASS_REGULAR_EXPRESSION "CPACK_PACKAGE_VERSION=2")
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackUseShortProjectVersion")
@@ -1049,7 +1038,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-project CPackComponents
--build-two-config
--build-target package
- --build-options ${build_options}
+ --build-options
-DCPACK_BINARY_DEB:BOOL=${CPACK_BINARY_DEB}
-DCPACK_BINARY_RPM:BOOL=${CPACK_BINARY_RPM}
${CPackComponents_BUILD_OPTIONS}
@@ -1109,7 +1098,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/build${CPackGen}-${CPackComponentWay}"
${build_generator_args}
--build-project CPackComponentsForAll
- --build-options ${build_options}
+ --build-options
-DCPACK_GENERATOR:STRING=${CPACK_GENERATOR_STRING_${CPackGen}}
-DCPACK_BINARY_${CPackGen}:BOOL=ON
${CPackRun_CPackComponentWay}
@@ -1148,7 +1137,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/${DEB_TEST_NAMES}/build${CPackGen}-${CPackDEBConfiguration}"
${build_generator_args}
--build-project CPackComponentsDEB
- --build-options ${build_options}
+ --build-options
-DCPACK_GENERATOR:STRING=${CPackGen}
-DCPACK_BINARY_${CPackGen}:BOOL=ON
${CPackRun_CPackDEBConfiguration}
@@ -1188,7 +1177,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/CPackTestAllGenerators"
${build_generator_args}
--build-project CPackTestAllGenerators
- --build-options ${build_options}
--test-command
${CMAKE_CMAKE_COMMAND}
-D dir=${CMake_BINARY_DIR}/Tests/CPackTestAllGenerators
@@ -1219,7 +1207,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-project CPackComponentsPrefix
--build-two-config
--build-target package
- --build-options ${build_options}
+ --build-options
-DCPACK_BINARY_DEB:BOOL=${CPACK_BINARY_DEB}
-DCPACK_BINARY_RPM:BOOL=${CPACK_BINARY_RPM}
-DCPACK_BINARY_ZIP:BOOL=ON
@@ -1242,7 +1230,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-project UseX11
--build-two-config
${X11_build_target_arg}
- --build-options ${build_options}
--test-command UseX11)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/X11")
@@ -1285,7 +1272,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig"
${build_generator_args}
--build-project LoadCommand
- --build-options ${build_options}
--test-command LoadedCommand
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig")
@@ -1300,7 +1286,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project Complex
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Complex/bin"
- --build-options ${build_options}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
--test-command complex
)
@@ -1313,7 +1298,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project Complex
--build-exe-dir "${CMake_BINARY_DIR}/Tests/ComplexOneConfig/bin"
- --build-options ${build_options}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
--test-command complex)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ComplexOneConfig")
@@ -1328,7 +1312,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-project EnvironmentProj
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Environment"
--force-new-ctest-process
- --build-options ${build_options}
--test-command ${CMAKE_CTEST_COMMAND} -V
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Environment")
@@ -1339,7 +1322,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/QtAutomocNoQt"
${build_generator_args}
--build-project QtAutomocNoQt
- --build-options ${build_options}
+ --build-options
-DCMAKE_BUILD_TYPE=\${CTEST_CONFIGURATION_TYPE}
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/QtAutomocNoQt")
@@ -1364,7 +1347,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-project Qt4Targets
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4Targets"
--force-new-ctest-process
- --build-options ${build_options}
+ --build-options
-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
--test-command ${CMAKE_CTEST_COMMAND} -V
)
@@ -1379,7 +1362,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-project Qt4And5Automoc
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4And5AutomocForward"
--force-new-ctest-process
- --build-options ${build_options}
--test-command ${CMAKE_CTEST_COMMAND} -V
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4And5AutomocForward")
@@ -1391,7 +1373,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-project Qt4And5Automoc
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4And5AutomocReverse"
--force-new-ctest-process
- --build-options ${build_options} -DQT_REVERSE_FIND_ORDER=1
+ --build-options -DQT_REVERSE_FIND_ORDER=1
--test-command ${CMAKE_CTEST_COMMAND} -V
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4And5AutomocReverse")
@@ -1505,7 +1487,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-project ExternalProjectTest
--build-exe-dir "${CMake_BINARY_DIR}/Tests/ExternalProject"
--force-new-ctest-process
- --build-options ${build_options}
--test-command ${CMAKE_CTEST_COMMAND} -V
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProject")
@@ -1521,7 +1502,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project ExternalProjectSubdir
--force-new-ctest-process
- --build-options ${build_options}
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProjectSubdir")
@@ -1533,7 +1513,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project ExternalProjectSourceSubdir
--force-new-ctest-process
- --build-options ${build_options}
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProjectSourceSubdir")
@@ -1545,7 +1524,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project ExternalProjectSourceSubdirNotCMake
--force-new-ctest-process
- --build-options ${build_options}
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProjectSourceSubdirNotCMake")
@@ -1557,7 +1535,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-project ExternalProjectLocalTest
--build-exe-dir "${CMake_BINARY_DIR}/Tests/ExternalProjectLocal"
--force-new-ctest-process
- --build-options ${build_options}
--test-command ${CMAKE_CTEST_COMMAND} -V
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProjectLocal")
@@ -1573,7 +1550,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-project ExternalProjectUpdateTest
--build-exe-dir "${CMake_BINARY_DIR}/Tests/ExternalProjectUpdate"
--force-new-ctest-process
- --build-options ${build_options}
--test-command ${CMAKE_CTEST_COMMAND} -V
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProjectUpdate")
@@ -1615,7 +1591,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${tutorial_build_dir}_Build
${build_generator_args}
--build-project Tutorial
- --build-options ${build_options} ${tutorial_build_options}
+ --build-options ${tutorial_build_options}
--test-command Tutorial 25.0)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/${tutorial_build_dir}_Build")
endfunction()
@@ -1637,7 +1613,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/Testing"
${build_generator_args}
--build-project Testing
- --build-options ${build_options}
--test-command ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE}
)
set_tests_properties(testing PROPERTIES PASS_REGULAR_EXPRESSION "Passed")
@@ -1650,7 +1625,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project Wrapping
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
- --build-options ${build_options}
--test-command wrapping
)
add_test(qtwrapping ${CMAKE_CTEST_COMMAND}
@@ -1660,7 +1634,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project Wrapping
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
- --build-options ${build_options}
--test-command qtwrapping
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Wrapping")
@@ -1672,7 +1645,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
--build-project TestDriverTest
- --build-options ${build_options}
--test-command TestDriverTest test1
)
@@ -1683,7 +1655,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
--build-project TestDriverTest
- --build-options ${build_options}
--test-command TestDriverTest test2
)
@@ -1694,7 +1665,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
--build-project TestDriverTest
- --build-options ${build_options}
--test-command TestDriverTest subdir/test3
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TestDriver")
@@ -1706,7 +1676,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Dependency/Exec"
${build_generator_args}
--build-project Dependency
- --build-options ${build_options}
--test-command exec
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Dependency")
@@ -1736,8 +1705,8 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Jump/WithLibOut/Executable"
--build-project Jump
${build_generator_args}
- --build-options ${build_options}
- -DLIBRARY_OUTPUT_PATH:PATH=${CMake_BINARY_DIR}/Tests/Jump/WithLibOut/Lib
+ --build-options
+ -DLIBRARY_OUTPUT_PATH:PATH=${CMake_BINARY_DIR}/Tests/Jump/WithLibOut/Lib
--test-command jumpExecutable
)
@@ -1749,7 +1718,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-run-dir "${CMake_BINARY_DIR}/Tests/Jump/NoLibOut/Executable"
--build-project Jump
${build_generator_args}
- --build-options ${build_options}
--test-command jumpExecutable
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Jump")
@@ -1761,7 +1729,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project Plugin
--build-two-config
- --build-options ${build_options}
--test-command bin/example)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Plugin")
@@ -1777,7 +1744,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/MacRuntimePath"
${build_generator_args}
--build-project MacRuntimePath
- --build-options ${build_options}
+ --build-options
-DCMake_TEST_NESTED_MAKE_PROGRAM:FILEPATH=${CMake_TEST_EXPLICIT_MAKE_PROGRAM}
)
endif()
@@ -1795,7 +1762,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/LinkLineOrder"
${build_generator_args}
--build-project LinkLineOrder
- --build-options ${build_options}
--test-command Exec1
)
@@ -1805,7 +1771,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/LinkLineOrder"
${build_generator_args}
--build-project LinkLineOrder
- --build-options ${build_options}
--test-command Exec2
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LinkLineOrder")
@@ -1825,7 +1790,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/LinkStatic"
${build_generator_args}
--build-project LinkStatic
- --build-options ${build_options}
+ --build-options
-DMATH_LIBRARY:FILEPATH=/usr/lib/libm.a
--test-command LinkStatic
)
@@ -1840,7 +1805,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/SubDirSpaces/Executable Sources"
${build_generator_args}
--build-project SUBDIR
- --build-options ${build_options}
--test-command test
"${CMake_BINARY_DIR}/Tests/SubDirSpaces/ShouldBeHere"
"${CMake_BINARY_DIR}/Tests/SubDirSpaces/testfromsubdir.obj"
@@ -1856,7 +1820,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-exe-dir "${CMake_BINARY_DIR}/Tests/SubDir/Executable"
${build_generator_args}
--build-project SUBDIR
- --build-options ${build_options}
--test-command test
"${CMake_BINARY_DIR}/Tests/SubDir/ShouldBeHere"
"${CMake_BINARY_DIR}/Tests/SubDir/testfromsubdir.obj"
@@ -1869,7 +1832,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-exe-dir "${CMake_BINARY_DIR}/Tests/SubDir/Executable"
${build_generator_args}
--build-project SUBDIR
- --build-options ${build_options}
--test-command test
"${CMake_BINARY_DIR}/Tests/SubDir/ShouldBeHere"
"${CMake_BINARY_DIR}/Tests/SubDir/testfromsubdir.o"
@@ -1877,9 +1839,11 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
endif ()
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubDir")
- if(MSVC)
- ADD_TEST_MACRO(ForceInclude foo)
+ if(MSVC OR (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_SIMULATE_ID STREQUAL "MSVC"))
ADD_TEST_MACRO(PDBDirectoryAndName myexe)
+ if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang" OR NOT "x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
+ ADD_TEST_MACRO(ForceInclude foo)
+ endif()
if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
ADD_TEST_MACRO(PrecompiledHeader foo)
endif()
@@ -1905,7 +1869,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project MakeClean
--build-exe-dir "${CMake_BINARY_DIR}/MakeClean"
- --build-options ${build_options}
--test-command check_clean
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MakeClean")
@@ -2014,7 +1977,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-two-config
${build_generator_args}
--build-project mfc_driver
- --build-options ${build_options}
--test-command ${CMAKE_CTEST_COMMAND}
-C \${CTEST_CONFIGURATION_TYPE} -VV)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MFC")
@@ -2044,7 +2006,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-two-config
${build_generator_args}
--build-project VSExternalInclude
- --build-options ${build_options}
--test-command VSExternalInclude)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSExternalInclude")
@@ -2055,7 +2016,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-two-config
${build_generator_args}
--build-project VSMidl
- --build-options ${build_options}
--test-command VSMidl)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSMidl")
@@ -2342,7 +2302,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-project BundleTest
--build-target install
# --build-target package
- --build-options ${build_options}
+ --build-options
"-DCMAKE_INSTALL_PREFIX:PATH=${BundleTestInstallDir}"
"-DCMake_SOURCE_DIR:PATH=${CMake_SOURCE_DIR}"
--test-command
@@ -2357,7 +2317,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project CFBundleTest
--build-config $<CONFIGURATION>
- --build-options ${build_options}
--test-command
${CMAKE_CMAKE_COMMAND} -DCTEST_CONFIGURATION_TYPE=$<CONFIGURATION>
-Ddir=${CMake_BINARY_DIR}/Tests/CFBundleTest
@@ -2378,7 +2337,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project BundleGeneratorTest
--build-target package
- --build-options ${build_options}
+ --build-options
"-DCMAKE_INSTALL_PREFIX:PATH=${CMake_BINARY_DIR}/Tests/BundleGeneratorTest/InstallDirectory"
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleGeneratorTest")
@@ -2391,7 +2350,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-noclean
--build-project WarnUnusedUnusedViaSet
- --build-options ${build_options}
+ --build-options
"--warn-unused-vars")
set_tests_properties(WarnUnusedUnusedViaSet PROPERTIES
PASS_REGULAR_EXPRESSION "unused variable \\(changing definition\\) 'UNUSED_VARIABLE'")
@@ -2406,7 +2365,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-noclean
--build-project WarnUnusedUnusedViaUnset
- --build-options ${build_options}
+ --build-options
"--warn-unused-vars")
set_tests_properties(WarnUnusedUnusedViaUnset PROPERTIES
PASS_REGULAR_EXPRESSION "CMake Warning \\(dev\\) at CMakeLists.txt:7 \\(set\\):")
@@ -2420,7 +2379,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/WarnUnusedCliUnused"
${build_generator_args}
--build-project WarnUnusedCliUnused
- --build-options ${build_options}
+ --build-options
"-DUNUSED_CLI_VARIABLE=Unused")
set_tests_properties(WarnUnusedCliUnused PROPERTIES
PASS_REGULAR_EXPRESSION "CMake Warning:.*Manually-specified variables were not used by the project:.* UNUSED_CLI_VARIABLE")
@@ -2433,7 +2392,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-noclean
--build-project WarnUnusedCliUsed
- --build-options ${build_options}
+ --build-options
"-DUSED_VARIABLE=Usage proven")
set_tests_properties(WarnUnusedCliUsed PROPERTIES
PASS_REGULAR_EXPRESSION "Usage proven")
@@ -2448,7 +2407,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-noclean
--build-project WarnUninitialized
- --build-options ${build_options}
+ --build-options
"--warn-uninitialized")
set_tests_properties(WarnUninitialized PROPERTIES
PASS_REGULAR_EXPRESSION "uninitialized variable 'USED_VARIABLE'")
@@ -2463,7 +2422,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-project TestsWorkingDirectoryProj
--build-exe-dir "${CMake_BINARY_DIR}/Tests/TestsWorkingDirectory"
--force-new-ctest-process
- --build-options ${build_options}
--test-command ${CMAKE_CTEST_COMMAND} -V -C \${CTEST_CONFIGURATION_TYPE}
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TestsWorkingDirectory")
@@ -3261,7 +3219,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project testf
--build-two-config
- --build-options ${build_options}
--test-command testf)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Fortran")
@@ -3272,7 +3229,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/FortranModules"
${build_generator_args}
--build-project FortranModules
- --build-options ${build_options}
+ --build-options
-DCMake_TEST_NESTED_MAKE_PROGRAM:FILEPATH=${CMake_TEST_EXPLICIT_MAKE_PROGRAM}
-DCMake_TEST_Fortran_SUBMODULES:BOOL=${CMake_TEST_Fortran_SUBMODULES}
${CMake_TEST_FortranModules_BUILD_OPTIONS}
@@ -3295,7 +3252,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project FortranC
--build-two-config
- --build-options ${build_options}
--test-command CMakeFiles/FortranCInterface/FortranCInterface)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/FortranC")
endif()
@@ -3324,7 +3280,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-target hello
--build-two-config
--build-run-dir "${CMake_BINARY_DIR}/Tests/JavaJar/"
- --build-options ${build_options}
--test-command ${JAVA_RUNTIME} -classpath hello.jar HelloWorld)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/JavaJar")
add_test(Java.JarSourceList ${CMAKE_CTEST_COMMAND}
@@ -3336,7 +3291,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-target hello2
--build-two-config
--build-run-dir "${CMake_BINARY_DIR}/Tests/JavaJarSourceList/"
- --build-options ${build_options}
--test-command ${JAVA_RUNTIME} -classpath hello2.jar HelloWorld)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/JavaJarSourceList")
add_test(Java.JarSourceListAndOutput ${CMAKE_CTEST_COMMAND}
@@ -3348,7 +3302,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-target hello3
--build-two-config
--build-run-dir "${CMake_BINARY_DIR}/Tests/JavaJarSourceListAndOutput/hello3"
- --build-options ${build_options}
--test-command ${JAVA_RUNTIME} -classpath hello3.jar HelloWorld)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/JavaJarSourceListAndOutput")
@@ -3374,7 +3327,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-project helloJavah
--build-two-config
--build-run-dir "${CMake_BINARY_DIR}/Tests/JavaJavah/"
- --build-options ${build_options}
--test-command ${JAVA_RUNTIME} -Djava.library.path=${JAVAH_LIBRARY_PATH} -classpath hello3.jar HelloWorld2)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/JavaJavah")
endif()
@@ -3393,7 +3345,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-project helloJavaNativeHeaders
--build-two-config
--build-run-dir "${CMake_BINARY_DIR}/Tests/JavaNativeHeaders/"
- --build-options ${build_options}
--test-command ${JAVA_RUNTIME} -Djava.library.path=${JAVANATIVEHEADERS_LIBRARY_PATH} -classpath hello4.jar HelloWorld3)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/JavaNativeHeaders")
endif()
@@ -3415,9 +3366,9 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/SimpleCOnly_sdcc"
${build_generator_args}
--build-project SimpleC
- --build-options ${build_options}
- "-DCMAKE_SYSTEM_NAME=Generic"
- "-DCMAKE_C_COMPILER=${SDCC_EXECUTABLE}")
+ --build-options
+ "-DCMAKE_SYSTEM_NAME=Generic"
+ "-DCMAKE_C_COMPILER=${SDCC_EXECUTABLE}")
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleCOnly_sdcc")
endif()
@@ -3433,11 +3384,11 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/Simple_Mingw_Linux2Win"
${build_generator_args}
--build-project Simple
- --build-options ${build_options}
- "-DCMAKE_SYSTEM_NAME=Windows"
- "-DCMAKE_C_COMPILER=${MINGW_CC_LINUX2WIN_EXECUTABLE}"
- "-DCMAKE_CXX_COMPILER=${MINGW_CXX_LINUX2WIN_EXECUTABLE}"
- "-DCMAKE_RC_COMPILER=${MINGW_RC_LINUX2WIN_EXECUTABLE}"
+ --build-options
+ "-DCMAKE_SYSTEM_NAME=Windows"
+ "-DCMAKE_C_COMPILER=${MINGW_CC_LINUX2WIN_EXECUTABLE}"
+ "-DCMAKE_CXX_COMPILER=${MINGW_CXX_LINUX2WIN_EXECUTABLE}"
+ "-DCMAKE_RC_COMPILER=${MINGW_RC_LINUX2WIN_EXECUTABLE}"
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_Mingw_Linux2Win")
endif()
@@ -3523,7 +3474,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-two-config
${build_generator_args}
--build-project IncludeDirectories
- --build-options ${build_options}
--test-command IncludeDirectories)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/IncludeDirectories")
@@ -3537,8 +3487,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/IncludeDirectoriesCPATH"
--build-two-config
${build_generator_args}
- --build-project IncludeDirectoriesCPATH
- --build-options ${build_options})
+ --build-project IncludeDirectoriesCPATH)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/IncludeDirectoriesCPATH")
set_tests_properties(IncludeDirectoriesCPATH
PROPERTIES
@@ -3552,7 +3501,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-two-config
${build_generator_args}
--build-project InterfaceLinkLibraries
- --build-options ${build_options}
--test-command InterfaceLinkLibraries)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/InterfaceLinkLibraries")
diff --git a/Tests/CMakeServerLib/testServerBuffering.cpp b/Tests/CMakeServerLib/testServerBuffering.cpp
index 7330ead..8b0b89b 100644
--- a/Tests/CMakeServerLib/testServerBuffering.cpp
+++ b/Tests/CMakeServerLib/testServerBuffering.cpp
@@ -1,6 +1,8 @@
#include "cmConnection.h"
#include "cmServerConnection.h"
+
#include <iostream>
+#include <memory>
#include <string>
#include <vector>
diff --git a/Tests/CPackComponentsDEB/CMakeLists.txt b/Tests/CPackComponentsDEB/CMakeLists.txt
index 9d4b5e9..bc5b6a9 100644
--- a/Tests/CPackComponentsDEB/CMakeLists.txt
+++ b/Tests/CPackComponentsDEB/CMakeLists.txt
@@ -4,8 +4,8 @@
# application (mylibapp). We create a binary installer (a CPack Generator)
# which supports CPack components.
-cmake_minimum_required(VERSION 2.8.3.20101130 FATAL_ERROR)
-project(CPackComponentsDEB)
+cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
+project(CPackComponentsDEB VERSION 1.0.3)
# Use GNUInstallDirs in order to enforce lib64 if needed
include(GNUInstallDirs)
@@ -44,10 +44,6 @@ set(CPACK_PACKAGE_NAME "MyLib")
set(CPACK_PACKAGE_CONTACT "None")
set(CPACK_PACKAGE_VENDOR "CMake.org")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MyLib - CPack Component Installation Example")
-set(CPACK_PACKAGE_VERSION "1.0.2")
-set(CPACK_PACKAGE_VERSION_MAJOR "1")
-set(CPACK_PACKAGE_VERSION_MINOR "0")
-set(CPACK_PACKAGE_VERSION_PATCH "2")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "CPack Component Example")
set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/license.txt)
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake
index 73fd0ab..beccc46 100644
--- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake
@@ -6,7 +6,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
# expected results
-set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb")
+set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.3_*.deb")
set(expected_count 3)
@@ -36,7 +36,6 @@ endif()
# dpkg-deb checks for the dependencies of the packages
find_program(DPKGDEB_EXECUTABLE dpkg-deb)
if(DPKGDEB_EXECUTABLE)
- set(dpkgdeb_output_errors_all "")
foreach(_f IN LISTS actual_output)
# extracts the metadata from the package
@@ -54,32 +53,23 @@ if(DPKGDEB_EXECUTABLE)
message(STATUS "package='${dpkg_package_name}', dependencies='${dpkg_depends}'")
- if("${dpkg_package_name}" STREQUAL "mylib-applications")
- if(NOT "${dpkg_depends}" STREQUAL "depend-application")
- set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
- "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-application'\n")
+ if(dpkg_package_name STREQUAL "mylib-applications")
+ if(NOT dpkg_depends STREQUAL "depend-application")
+ message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-application'\n")
endif()
- elseif("${dpkg_package_name}" STREQUAL "mylib-headers")
- if(NOT "${dpkg_depends}" STREQUAL "mylib-libraries (= 1.0.2), depend-headers")
- set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
- "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'mylib-libraries (= 1.0.2), depend-headers'\n")
+ elseif(dpkg_package_name STREQUAL "mylib-headers")
+ if(NOT dpkg_depends STREQUAL "mylib-libraries (= 1.0.3), depend-headers")
+ message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'mylib-libraries (= 1.0.3), depend-headers'\n")
endif()
- elseif("${dpkg_package_name}" STREQUAL "mylib-libraries")
- if(NOT "${dpkg_depends}" STREQUAL "depend-default")
- set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
- "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-default'\n")
+ elseif(dpkg_package_name STREQUAL "mylib-libraries")
+ if(NOT dpkg_depends STREQUAL "depend-default")
+ message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-default'\n")
endif()
else()
- set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
- "dpkg-deb: ${_f}: component name not found: ${dpkg_package_name}\n")
+ message(SEND_ERROR "dpkg-deb: ${_f}: component name not found: ${dpkg_package_name}\n")
endif()
endforeach()
-
-
- if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "")
- message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
- endif()
else()
message("dpkg-deb executable not found - skipping dpkg-deb test")
endif()
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake
index 81dbbc5..88f3248 100644
--- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake
@@ -6,7 +6,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
# expected results
-set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb")
+set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.3_*.deb")
set(expected_count 3)
set(config_verbose -V)
@@ -36,7 +36,6 @@ endif()
# dpkg-deb checks for the summary of the packages
find_program(DPKGDEB_EXECUTABLE dpkg-deb)
if(DPKGDEB_EXECUTABLE)
- set(dpkgdeb_output_errors_all "")
foreach(_f IN LISTS actual_output)
# extracts the metadata from the package
@@ -54,13 +53,11 @@ if(DPKGDEB_EXECUTABLE)
message(STATUS "package='${dpkg_package_name}', dependencies='${dpkg_depends}'")
- if("${dpkg_package_name}" STREQUAL "mylib-applications")
+ if(dpkg_package_name STREQUAL "mylib-applications")
find_program(DPKG_SHLIBDEP_EXECUTABLE dpkg-shlibdeps)
if(DPKG_SHLIBDEP_EXECUTABLE)
- string(FIND "${dpkg_depends}" "lib" index_libwhatever)
- if(NOT index_libwhatever GREATER "-1")
- set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}"
- "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' does not contain any 'lib'\n")
+ if(NOT dpkg_depends MATCHES "lib")
+ message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' does not contain any 'lib'\n")
endif()
else()
message("dpkg-shlibdeps executable not found - skipping dpkg-shlibdeps test")
@@ -69,29 +66,20 @@ if(DPKGDEB_EXECUTABLE)
# should not contain the default
string(FIND "${dpkg_depends}" "depend-default" index_default)
if(index_default GREATER "0")
- set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}"
- "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' does contains 'depend-default'\n")
+ message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' does contains 'depend-default'\n")
endif()
- elseif("${dpkg_package_name}" STREQUAL "mylib-headers")
- if(NOT "${dpkg_depends}" STREQUAL "mylib-libraries (= 1.0.2), depend-headers")
- set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}"
- "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'mylib-libraries (= 1.0.2), depend-headers'\n")
+ elseif(dpkg_package_name STREQUAL "mylib-headers")
+ if(NOT dpkg_depends STREQUAL "mylib-libraries (= 1.0.3), depend-headers")
+ message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'mylib-libraries (= 1.0.3), depend-headers'\n")
endif()
- elseif("${dpkg_package_name}" STREQUAL "mylib-libraries")
- if(NOT "${dpkg_depends}" STREQUAL "depend-default")
- set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}"
- "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-default'\n")
+ elseif(dpkg_package_name STREQUAL "mylib-libraries")
+ if(NOT dpkg_depends STREQUAL "depend-default")
+ message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-default'\n")
endif()
else()
- set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}"
- "dpkg-deb: ${_f}: component name not found: ${dpkg_package_name}\n")
+ message(SEND_ERROR "dpkg-deb: ${_f}: component name not found: ${dpkg_package_name}\n")
endif()
-
endforeach()
-
- if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "")
- message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
- endif()
else()
message("dpkg-deb executable not found - skipping dpkg-deb test")
endif()
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake
index ad52f56..f74137c 100644
--- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake
@@ -6,7 +6,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
# expected results
-set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb")
+set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.3_*.deb")
set(expected_count 3)
@@ -54,18 +54,18 @@ if(DPKGDEB_EXECUTABLE)
message(STATUS "package='${dpkg_package_name}', description='${dpkg_description}'")
- if("${dpkg_package_name}" STREQUAL "mylib-applications")
+ if(dpkg_package_name STREQUAL "mylib-applications")
if(NOT "${dpkg_description}" STREQUAL "applications_description")
set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
"dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != applications_description")
endif()
- elseif("${dpkg_package_name}" STREQUAL "mylib-headers")
- if(NOT "${dpkg_description}" STREQUAL "headers_description")
+ elseif(dpkg_package_name STREQUAL "mylib-headers")
+ if(NOT dpkg_description STREQUAL "headers_description")
set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
"dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != headers_description")
endif()
- elseif("${dpkg_package_name}" STREQUAL "mylib-libraries")
- if(NOT "${dpkg_description}" STREQUAL "main description")
+ elseif(dpkg_package_name STREQUAL "mylib-libraries")
+ if(NOT dpkg_description STREQUAL "main description")
set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
"dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != 'main description'")
endif()
@@ -77,7 +77,7 @@ if(DPKGDEB_EXECUTABLE)
endforeach()
- if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "")
+ if(NOT dpkgdeb_output_errors_all STREQUAL "")
message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
endif()
else()
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake
index af27c51..241dda5 100644
--- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake
@@ -7,7 +7,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
# expected results
-set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb")
+set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.3_*.deb")
set(expected_count 3)
@@ -54,18 +54,18 @@ if(DPKGDEB_EXECUTABLE)
message(STATUS "package='${dpkg_package_name}', description='${dpkg_description}'")
- if("${dpkg_package_name}" STREQUAL "mylib-applications")
- if(NOT "${dpkg_description}" STREQUAL "main description 2")
+ if(dpkg_package_name STREQUAL "mylib-applications")
+ if(NOT dpkg_description STREQUAL "main description 2")
set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
"dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != applications_description")
endif()
- elseif("${dpkg_package_name}" STREQUAL "mylib-headers")
- if(NOT "${dpkg_description}" STREQUAL "main description 2")
+ elseif(dpkg_package_name STREQUAL "mylib-headers")
+ if(NOT dpkg_description STREQUAL "main description 2")
set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
"dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != headers_description")
endif()
- elseif("${dpkg_package_name}" STREQUAL "mylib-libraries")
- if(NOT "${dpkg_description}" STREQUAL "library description")
+ elseif(dpkg_package_name STREQUAL "mylib-libraries")
+ if(NOT dpkg_description STREQUAL "library description")
set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
"dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != 'main description'")
endif()
@@ -77,7 +77,7 @@ if(DPKGDEB_EXECUTABLE)
endforeach()
- if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "")
+ if(NOT dpkgdeb_output_errors_all STREQUAL "")
message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
endif()
else()
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake
index ec75d61..7cfbb16 100644
--- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake
@@ -5,7 +5,7 @@ endif()
include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
# TODO: currently debian doesn't produce lower cased names
-set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb")
+set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.3_*.deb")
set(expected_count 3)
@@ -44,7 +44,7 @@ if(LINTIAN_EXECUTABLE)
string(APPEND lintian_output_errors_all "${lintian_output_errors}")
endforeach()
- if(NOT "${lintian_output_errors_all}" STREQUAL "")
+ if(NOT lintian_output_errors_all STREQUAL "")
message(FATAL_ERROR "Lintian checks failed:\n${lintian_output_errors_all}")
endif()
else()
@@ -64,13 +64,13 @@ if(DPKGDEB_EXECUTABLE)
DPKGDEB_OUTPUT "${dpkg_output}"
METAENTRY "Maintainer:")
- if(NOT "${dpkgentry}" STREQUAL "None")
+ if(NOT dpkgentry STREQUAL "None")
set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}"
"dpkg-deb: ${_f}: Incorrect value for Maintainer: ${dpkgentry} != None\n")
endif()
endforeach()
- if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "")
+ if(NOT dpkgdeb_output_errors_all STREQUAL "")
message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
endif()
else()
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake
index e57488c..6eff3db 100644
--- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake
@@ -9,7 +9,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
# requirements
# debian now produces lower case names
-set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb")
+set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.3_*.deb")
set(expected_count 3)
@@ -39,7 +39,7 @@ endif()
# dpkg-deb checks for the summary of the packages
find_program(DPKGDEB_EXECUTABLE dpkg-deb)
if(DPKGDEB_EXECUTABLE)
- set(dpkgdeb_output_errors_all)
+ set(dpkgdeb_output_errors_all "")
foreach(_f IN LISTS actual_output)
# extracts the metadata from the package
@@ -53,11 +53,11 @@ if(DPKGDEB_EXECUTABLE)
message(STATUS "package='${dpkg_package_name}'")
- if("${dpkg_package_name}" STREQUAL "mylib-applications")
+ if(dpkg_package_name STREQUAL "mylib-applications")
# pass
- elseif("${dpkg_package_name}" STREQUAL "mylib-headers")
+ elseif(dpkg_package_name STREQUAL "mylib-headers")
# pass
- elseif("${dpkg_package_name}" STREQUAL "mylib-libraries")
+ elseif(dpkg_package_name STREQUAL "mylib-libraries")
# pass
else()
set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
@@ -67,7 +67,7 @@ if(DPKGDEB_EXECUTABLE)
endforeach()
- if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "")
+ if(NOT dpkgdeb_output_errors_all STREQUAL "")
message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
endif()
else()
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake
index 5ee057a..3454dca 100644
--- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake
@@ -6,7 +6,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
# expected results
-set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb")
+set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.3_*.deb")
set(expected_count 3)
set(config_verbose -V)
@@ -36,7 +36,6 @@ endif()
# dpkg-deb checks for the summary of the packages
find_program(DPKGDEB_EXECUTABLE dpkg-deb)
if(DPKGDEB_EXECUTABLE)
- set(dpkgdeb_output_errors_all "")
foreach(_f IN LISTS actual_output)
# extracts the metadata from the package
@@ -54,22 +53,16 @@ if(DPKGDEB_EXECUTABLE)
message(STATUS "package='${_f}', source='${dpkg_package_source}'")
- if(NOT ("${dpkg_package_name}" STREQUAL "mylib-applications"))
- if(NOT ("${dpkg_package_source}" STREQUAL "test-source"))
- set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}"
- "dpkg-deb: ${_f}: Incorrect source for package '${dpkg_package_name}': '${dpkg_package_source}' instead of 'test-source'\n")
+ if(NOT dpkg_package_name STREQUAL "mylib-applications")
+ if(NOT dpkg_package_source STREQUAL "test-source")
+ message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect source for package '${dpkg_package_name}': '${dpkg_package_source}' instead of 'test-source'\n")
endif()
else()
- if(NOT ("${dpkg_package_source}" STREQUAL "test-other-source"))
- set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}"
- "dpkg-deb: ${_f}: Incorrect source for package '${dpkg_package_name}': '${dpkg_package_source}' instead of 'test-other-source'\n")
+ if(NOT dpkg_package_source STREQUAL "test-other-source")
+ message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect source for package '${dpkg_package_name}': '${dpkg_package_source}' instead of 'test-other-source'\n")
endif()
endif()
endforeach()
-
- if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "")
- message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
- endif()
else()
message("dpkg-deb executable not found - skipping dpkg-deb test")
endif()
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake
index 8c0bc4b..764fe9d 100644
--- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake
@@ -5,7 +5,7 @@ endif()
include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
# TODO: currently debian doesn't produce lower cased names
-set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib_1.0.2_*.deb")
+set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib_1.0.3_*.deb")
set(expected_count 1)
set(actual_output)
@@ -33,22 +33,16 @@ endif()
# dpkg-deb checks
find_program(DPKGDEB_EXECUTABLE dpkg-deb)
if(DPKGDEB_EXECUTABLE)
- set(dpkgdeb_output_errors_all "")
foreach(_f IN LISTS actual_output)
run_dpkgdeb(dpkg_output
FILENAME "${_f}"
)
# message(FATAL_ERROR "output = '${dpkg_output}'")
- if("${dpkg_output}" STREQUAL "")
- set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}"
- "dpkg-deb: ${_f}: empty content returned by dpkg-deb")
+ if(dpkg_output STREQUAL "")
+ message(SEND_ERROR "dpkg-deb: ${_f}: empty content returned by dpkg-deb")
endif()
endforeach()
-
- if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "")
- message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
- endif()
else()
message("dpkg-deb executable not found - skipping dpkg-deb test")
endif()
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake
index 2f9e2fc..2093e7e 100644
--- a/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake
@@ -119,13 +119,13 @@ function(lintian_check_specific_errors output_errors)
# regex to avoid
foreach(_s IN LISTS lintian_check_specific_errors_deb_ERROR_REGEX_STRINGS)
- if("${_s}" STREQUAL "")
+ if(_s STREQUAL "")
continue()
endif()
string(REGEX MATCHALL "${_s}" "_TMP_CHECK_ERROR" "${lintian_output}")
- if(NOT "${_TMP_CHECK_ERROR}" STREQUAL "")
+ if(NOT _TMP_CHECK_ERROR STREQUAL "")
string(APPEND ERROR_ACC "\nlintian: ${_f}: output contains an undesirable regex:\n\t${_TMP_CHECK_ERROR}")
endif()
endforeach()
@@ -167,7 +167,7 @@ function(run_dpkgdeb dpkg_deb_output)
ERROR_VARIABLE DPKGDEB_ERROR
OUTPUT_STRIP_TRAILING_WHITESPACE )
- if(NOT ("${DPKGDEB_RESULT}" EQUAL "0"))
+ if(NOT DPKGDEB_RESULT EQUAL "0")
message(FATAL_ERROR "Error '${DPKGDEB_RESULT}' returned by dpkg-deb: '${DPKGDEB_ERROR}'")
endif()
diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt
index affe5d5..519608c 100644
--- a/Tests/FindPackageTest/CMakeLists.txt
+++ b/Tests/FindPackageTest/CMakeLists.txt
@@ -391,16 +391,44 @@ try_compile(EXPORTER_COMPILED
message(STATUS "Searching for export(PACKAGE) test project")
set(CMakeTestExportPackage_DIR "" CACHE FILEPATH
"Wipe out find results for testing." FORCE)
+
+message(STATUS "Searching for export(PACKAGE) with CMAKE_FIND_USE_PACKAGE_REGISTRY=TRUE")
+set(CMAKE_FIND_USE_PACKAGE_REGISTRY TRUE)
+find_package(CMakeTestExportPackage 1.${version} EXACT REQUIRED)
+if(NOT CMakeTestExportPackage_FOUND)
+ message(SEND_ERROR "CMakeTestExportPackage should be FOUND!")
+endif()
+unset(CMAKE_FIND_USE_PACKAGE_REGISTRY)
+
+message(STATUS "Searching for export(PACKAGE) with CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=FALSE")
+set(CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY FALSE)
find_package(CMakeTestExportPackage 1.${version} EXACT REQUIRED)
+if(NOT CMakeTestExportPackage_FOUND)
+ message(SEND_ERROR "CMakeTestExportPackage should be FOUND!")
+endif()
+unset(CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY)
-message(STATUS "Searching for export(PACKAGE) test project with CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=TRUE")
+message(STATUS "Searching for export(PACKAGE) with CMAKE_FIND_USE_PACKAGE_REGISTRY=TRUE and CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=TRUE")
+set(CMAKE_FIND_USE_PACKAGE_REGISTRY TRUE)
set(CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY TRUE)
+set(CMakeTestExportPackage_DIR FALSE)
+find_package(CMakeTestExportPackage 1.${version} EXACT REQUIRED)
+if(NOT CMakeTestExportPackage_FOUND)
+ message(SEND_ERROR "CMakeTestExportPackage should be FOUND!")
+endif()
+unset(CMAKE_FIND_USE_PACKAGE_REGISTRY)
+unset(CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY)
+
+message(STATUS "Searching for export(PACKAGE) with CMAKE_FIND_USE_PACKAGE_REGISTRY=FALSE and CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=FALSE")
+set(CMAKE_FIND_USE_PACKAGE_REGISTRY FALSE)
+set(CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY FALSE)
set(CMakeTestExportPackage_DIR "" CACHE FILEPATH
"Wipe out find results for testing." FORCE)
-find_package(CMakeTestExportPackage 1.${version} EXACT QUIET)
+find_package(CMakeTestExportPackage 1.${version} EXACT QUIET)
if(CMakeTestExportPackage_FOUND)
- message(SEND_ERROR "CMakeTestExportPackage should not be FOUND!")
+ message(SEND_ERROR "CMakeTestExportPackage should be not FOUND!")
endif()
+unset(CMAKE_FIND_USE_PACKAGE_REGISTRY)
unset(CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY)
message(STATUS "Remove export(PACKAGE) test project")
@@ -579,6 +607,26 @@ endif()
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG OFF)
set(CMAKE_PREFIX_PATH)
+set(CMAKE_MODULE_PATH)
+
+############################################################################
+##Test FIND_PACKAGE CMAKE_FIND_PACKAGE_PREFER_CONFIG - Do not recurse
+
+# No CMAKE_PREFIX_PATH
+set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/PreferConfigRecurse)
+
+# Now prefer config mode
+set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON)
+unset(ACME_FOUND)
+unset(ACME_CONFIG)
+
+find_package(ACME)
+if(ACME_FOUND AND ACME_CONFIG)
+ message(SEND_ERROR "Incorrectly found ACME in CONFIG mode, from the MODULE package")
+endif()
+
+set(CMAKE_FIND_PACKAGE_PREFER_CONFIG OFF)
+set(CMAKE_MODULE_PATH)
############################################################################
##Test find_package CMAKE_FIND_PACKAGE_PREFER_CONFIG with module fallback
@@ -592,3 +640,16 @@ find_package(ACME REQUIRED)
if(NOT ACME_FOUND)
message(SEND_ERROR "Did not find ACME package")
endif()
+
+############################################################################
+##Test find_package CMAKE_FIND_PACKAGE_PREFER_CONFIG with NO_MODULE
+
+set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/PreferConfigOnlyModule)
+
+set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON)
+
+find_package(ACME NO_MODULE)
+
+if(ACME_FOUND)
+ message(SEND_ERROR "Should not find ACME package")
+endif()
diff --git a/Tests/FindPackageTest/PreferConfigRecurse/ACMEConfig.cmake b/Tests/FindPackageTest/PreferConfigRecurse/ACMEConfig.cmake
new file mode 100644
index 0000000..7a4e1b3
--- /dev/null
+++ b/Tests/FindPackageTest/PreferConfigRecurse/ACMEConfig.cmake
@@ -0,0 +1 @@
+set(ACME_FOUND TRUE)
diff --git a/Tests/FindPackageTest/PreferConfigRecurse/FindACME.cmake b/Tests/FindPackageTest/PreferConfigRecurse/FindACME.cmake
new file mode 100644
index 0000000..9bdc7db
--- /dev/null
+++ b/Tests/FindPackageTest/PreferConfigRecurse/FindACME.cmake
@@ -0,0 +1 @@
+find_package(ACME NO_MODULE)
diff --git a/Tests/FindProtobuf/Test/CMakeLists.txt b/Tests/FindProtobuf/Test/CMakeLists.txt
index bc89190..fc6b37e 100644
--- a/Tests/FindProtobuf/Test/CMakeLists.txt
+++ b/Tests/FindProtobuf/Test/CMakeLists.txt
@@ -29,6 +29,7 @@ add_test(NAME test_tgt_protoc COMMAND test_tgt_protoc)
add_executable(test_var_protoc main-protoc.cxx)
target_include_directories(test_var_protoc PRIVATE ${Protobuf_INCLUDE_DIRS})
target_link_libraries(test_var_protoc PRIVATE ${Protobuf_PROTOC_LIBRARIES})
+target_compile_features(test_var_protoc PRIVATE cxx_std_11)
add_test(NAME test_var_protoc COMMAND test_var_protoc)
add_test(NAME test_tgt_protoc_version COMMAND protobuf::protoc --version)
@@ -37,14 +38,17 @@ set(Protobuf_IMPORT_DIRS ${Protobuf_INCLUDE_DIRS})
PROTOBUF_GENERATE_CPP(PROTO_SRC PROTO_HEADER msgs/example.proto)
PROTOBUF_GENERATE_CPP(DESC_PROTO_SRC DESC_PROTO_HEADER DESCRIPTORS DESC_PROTO_DESC msgs/example_desc.proto)
add_library(msgs ${PROTO_SRC} ${PROTO_HEADER})
+target_compile_features(msgs PRIVATE cxx_std_11)
add_executable(test_generate main-generate.cxx ${PROTO_SRC})
target_include_directories(test_generate PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(test_generate msgs ${Protobuf_LIBRARIES})
+target_compile_features(test_generate PRIVATE cxx_std_11)
add_test(NAME test_generate COMMAND test_generate)
add_executable(test_desc main-desc.cxx ${DESC_PROTO_SRC})
target_compile_features(test_desc PRIVATE cxx_std_11)
target_include_directories(test_desc PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(test_desc msgs ${Protobuf_LIBRARIES})
+target_compile_features(test_desc PRIVATE cxx_std_11)
add_test(NAME test_desc COMMAND test_desc ${DESC_PROTO_DESC})
diff --git a/Tests/PDBDirectoryAndName/CMakeLists.txt b/Tests/PDBDirectoryAndName/CMakeLists.txt
index 6d8d6cc..44194ca 100644
--- a/Tests/PDBDirectoryAndName/CMakeLists.txt
+++ b/Tests/PDBDirectoryAndName/CMakeLists.txt
@@ -3,8 +3,8 @@ cmake_policy(SET CMP0054 NEW)
project(PDBDirectoryAndName C)
# Make sure the proper compiler is in use.
-if(NOT MSVC AND NOT CMAKE_C_COMPILER_ID STREQUAL "Intel")
- message(FATAL_ERROR "The PDBDirectoryAndName test works only with MSVC or Intel")
+if(NOT MSVC AND NOT CMAKE_C_COMPILER_ID STREQUAL "Intel" AND NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
+ message(FATAL_ERROR "The PDBDirectoryAndName test works only with MSVC, Clang or Intel")
endif()
# Intel 11.1 does not support /Fd but Intel 14.0 does.
diff --git a/Tests/Preprocess/CMakeLists.txt b/Tests/Preprocess/CMakeLists.txt
index 588af03..bce1b3f 100644
--- a/Tests/Preprocess/CMakeLists.txt
+++ b/Tests/Preprocess/CMakeLists.txt
@@ -29,7 +29,10 @@ if("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
set(PP_VS 1)
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND
- "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC" AND
+ "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC")
+ set(CLANG_MSVC_WINDOWS 1)
+endif()
+if(CLANG_MSVC_WINDOWS AND
"x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
set(CLANG_GNULIKE_WINDOWS 1)
endif()
@@ -106,7 +109,7 @@ endif()
set(EXPR_OP1 "/")
if((NOT MSVC OR PP_NMAKE) AND
NOT CMAKE_C_COMPILER_ID STREQUAL "Intel" AND
- NOT CLANG_GNULIKE_WINDOWS)
+ NOT CLANG_MSVC_WINDOWS)
# MSVC cl, Intel icl: %
# When the cl compiler is invoked from the command line then % must
# be written %% (to distinguish from %ENV% syntax). However cl does
diff --git a/Tests/QtAutogen/SameName/CMakeLists.txt b/Tests/QtAutogen/SameName/CMakeLists.txt
index 0a80d5e..1919cc7 100644
--- a/Tests/QtAutogen/SameName/CMakeLists.txt
+++ b/Tests/QtAutogen/SameName/CMakeLists.txt
@@ -18,9 +18,11 @@ add_executable(sameName
ccc/data.qrc
item.cpp
object.h
+ object.hh
object.h++
object.hpp
object.hxx
+ object_upper_ext.H
data.qrc
main.cpp
)
diff --git a/Tests/QtAutogen/SameName/main.cpp b/Tests/QtAutogen/SameName/main.cpp
index 92f15cd..725f4cd 100644
--- a/Tests/QtAutogen/SameName/main.cpp
+++ b/Tests/QtAutogen/SameName/main.cpp
@@ -6,8 +6,10 @@
#include "item.hpp"
#include "object.h"
#include "object.h++"
+#include "object.hh"
#include "object.hpp"
#include "object.hxx"
+#include "object_upper_ext.H"
int main(int argv, char** args)
{
@@ -20,8 +22,10 @@ int main(int argv, char** args)
::ccc::Item ccc_item;
// Object instances
::Object_h obj_h;
+ ::Object_hh obj_hh;
::Object_hplpl obj_hplpl;
::Object_hpp obj_hpp;
::Object_hxx obj_hxx;
+ ::Object_Upper_Ext_H obj_upper_ext_h;
return 0;
}
diff --git a/Tests/QtAutogen/SameName/object.hh b/Tests/QtAutogen/SameName/object.hh
new file mode 100644
index 0000000..3e16f83
--- /dev/null
+++ b/Tests/QtAutogen/SameName/object.hh
@@ -0,0 +1,13 @@
+#ifndef OBJECT_HH
+#define OBJECT_HH
+
+#include <QObject>
+
+class Object_hh : public QObject
+{
+ Q_OBJECT
+ Q_SLOT
+ void go(){};
+};
+
+#endif
diff --git a/Tests/QtAutogen/SameName/object_upper_ext.H b/Tests/QtAutogen/SameName/object_upper_ext.H
new file mode 100644
index 0000000..3266087
--- /dev/null
+++ b/Tests/QtAutogen/SameName/object_upper_ext.H
@@ -0,0 +1,13 @@
+#ifndef OBJECT_UPPER_EXT_H
+#define OBJECT_UPPER_EXT_H
+
+#include <QObject>
+
+class Object_Upper_Ext_H : public QObject
+{
+ Q_OBJECT
+ Q_SLOT
+ void go(){};
+};
+
+#endif
diff --git a/Tests/RunCMake/CMP0065/RunCMakeTest.cmake b/Tests/RunCMake/CMP0065/RunCMakeTest.cmake
index 254a4ec..e86b50e 100644
--- a/Tests/RunCMake/CMP0065/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMP0065/RunCMakeTest.cmake
@@ -1,8 +1,11 @@
include(RunCMake)
run_cmake(OLDBad1)
-run_cmake(OLDBad2)
-run_cmake(NEWBad)
+if(NOT CMAKE_SYSTEM_NAME STREQUAL "AIX")
+ # Tests with ENABLE_EXPORTS ON. For AIX we do not use the flags at all.
+ run_cmake(OLDBad2)
+ run_cmake(NEWBad)
+endif()
run_cmake(NEWGood)
run_cmake(WARN-OFF)
run_cmake(WARN-ON)
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 735ad5f..c952b1a 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -120,7 +120,7 @@ add_RunCMake_test(CMP0081)
# CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS variable, which both the VS and Xcode
# generators ignore. The policy will have no effect on those generators.
if(NOT CMAKE_GENERATOR MATCHES "Visual Studio|Xcode")
- add_RunCMake_test(CMP0065)
+ add_RunCMake_test(CMP0065 -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME})
endif()
if(CMAKE_GENERATOR MATCHES "Make")
add_RunCMake_test(Make -DMAKE_IS_GNU=${MAKE_IS_GNU})
diff --git a/Tests/RunCMake/CTestCommandLine/FailRegexFound-check.cmake b/Tests/RunCMake/CTestCommandLine/FailRegexFound-check.cmake
new file mode 100644
index 0000000..1097788
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/FailRegexFound-check.cmake
@@ -0,0 +1,13 @@
+set(last_test_log "${RunCMake_TEST_BINARY_DIR}/Testing/Temporary/LastTest.log")
+if(EXISTS "${last_test_log}")
+ file(READ "${last_test_log}" last_test_log_content)
+ string(REGEX REPLACE "\n+$" "" last_test_log_content "${last_test_log_content}")
+ if(NOT last_test_log_content MATCHES "
+Test Pass Reason:
+Error regular expression found in output. Regex=[[]test1]")
+ string(REPLACE "\n" "\n " last_test_log_content " ${last_test_log_content}")
+ set(RunCMake_TEST_FAILED "LastTest.log does not have expected content:\n${last_test_log_content}")
+ endif()
+else()
+ set(RunCMake_TEST_FAILED "LastTest.log missing:\n ${last_test_log}")
+endif()
diff --git a/Tests/RunCMake/CTestCommandLine/RequiredRegexFound-check.cmake b/Tests/RunCMake/CTestCommandLine/RequiredRegexFound-check.cmake
new file mode 100644
index 0000000..bde60d1
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/RequiredRegexFound-check.cmake
@@ -0,0 +1,13 @@
+set(last_test_log "${RunCMake_TEST_BINARY_DIR}/Testing/Temporary/LastTest.log")
+if(EXISTS "${last_test_log}")
+ file(READ "${last_test_log}" last_test_log_content)
+ string(REGEX REPLACE "\n+$" "" last_test_log_content "${last_test_log_content}")
+ if(NOT last_test_log_content MATCHES "
+Test Pass Reason:
+Required regular expression found. Regex=[[]test1]")
+ string(REPLACE "\n" "\n " last_test_log_content " ${last_test_log_content}")
+ set(RunCMake_TEST_FAILED "LastTest.log does not have expected content:\n${last_test_log_content}")
+ endif()
+else()
+ set(RunCMake_TEST_FAILED "LastTest.log missing:\n ${last_test_log}")
+endif()
diff --git a/Tests/RunCMake/CTestCommandLine/RequiredRegexNotFound-check.cmake b/Tests/RunCMake/CTestCommandLine/RequiredRegexNotFound-check.cmake
new file mode 100644
index 0000000..6d420f3
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/RequiredRegexNotFound-check.cmake
@@ -0,0 +1,16 @@
+set(last_test_log "${RunCMake_TEST_BINARY_DIR}/Testing/Temporary/LastTest.log")
+if(EXISTS "${last_test_log}")
+ file(READ "${last_test_log}" last_test_log_content)
+ string(REGEX REPLACE "\n+$" "" last_test_log_content "${last_test_log_content}")
+ if(NOT last_test_log_content MATCHES "
+Test Pass Reason:
+Required regular expression not found. Regex=[[]foo
+toast1
+bar
+]")
+ string(REPLACE "\n" "\n " last_test_log_content " ${last_test_log_content}")
+ set(RunCMake_TEST_FAILED "LastTest.log does not have expected content:\n${last_test_log_content}")
+ endif()
+else()
+ set(RunCMake_TEST_FAILED "LastTest.log missing:\n ${last_test_log}")
+endif()
diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
index d524f41..f417db0 100644
--- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
@@ -78,6 +78,48 @@ endfunction()
run_LabelCount()
+function(run_RequiredRegexFoundTest)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/RequiredRegexFound)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" "
+add_test(test1 \"${CMAKE_COMMAND}\" -E echo \"test1\")
+set_tests_properties(test1 PROPERTIES PASS_REGULAR_EXPRESSION \"foo;test1;bar\")
+")
+
+ run_cmake_command(RequiredRegexFound ${CMAKE_CTEST_COMMAND} -V)
+endfunction()
+run_RequiredRegexFoundTest()
+
+function(run_RequiredRegexNotFoundTest)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/RequiredRegexNotFound)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" "
+add_test(test1 \"${CMAKE_COMMAND}\" -E echo \"test1\")
+set_tests_properties(test1 PROPERTIES PASS_REGULAR_EXPRESSION \"foo;toast1;bar\" WILL_FAIL True)
+")
+
+ run_cmake_command(RequiredRegexNotFound ${CMAKE_CTEST_COMMAND} -V)
+endfunction()
+run_RequiredRegexNotFoundTest()
+
+function(run_FailRegexFoundTest)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/FailRegexFound)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" "
+add_test(test1 \"${CMAKE_COMMAND}\" -E echo \"test1\")
+set_tests_properties(test1 PROPERTIES FAIL_REGULAR_EXPRESSION \"foo;test1;bar\" WILL_FAIL True)
+")
+
+ run_cmake_command(FailRegexFound ${CMAKE_CTEST_COMMAND} -V)
+endfunction()
+run_FailRegexFoundTest()
+
function(run_SerialFailed)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SerialFailed)
set(RunCMake_TEST_NO_CLEAN 1)
diff --git a/Tests/RunCMake/CommandLine/E_false-extraargs-result.txt b/Tests/RunCMake/CommandLine/E_false-extraargs-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_false-extraargs-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_false-result.txt b/Tests/RunCMake/CommandLine/E_false-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_false-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index c9d3a4d..4e19871 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -26,6 +26,10 @@ run_cmake_command(E_echo_append ${CMAKE_COMMAND} -E echo_append)
run_cmake_command(E_rename-no-arg ${CMAKE_COMMAND} -E rename)
run_cmake_command(E_server-arg ${CMAKE_COMMAND} -E server --extra-arg)
run_cmake_command(E_server-pipe ${CMAKE_COMMAND} -E server --pipe=)
+run_cmake_command(E_true ${CMAKE_COMMAND} -E true)
+run_cmake_command(E_true-extraargs ${CMAKE_COMMAND} -E true ignored)
+run_cmake_command(E_false ${CMAKE_COMMAND} -E false)
+run_cmake_command(E_false-extraargs ${CMAKE_COMMAND} -E false ignored)
run_cmake_command(E_touch_nocreate-no-arg ${CMAKE_COMMAND} -E touch_nocreate)
run_cmake_command(E_touch-nonexistent-dir ${CMAKE_COMMAND} -E touch "${RunCMake_BINARY_DIR}/touch-nonexistent-dir/foo")
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/ParseImplicitIncludeInfo.cmake b/Tests/RunCMake/ParseImplicitIncludeInfo/ParseImplicitIncludeInfo.cmake
index b495d98..5880378 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/ParseImplicitIncludeInfo.cmake
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/ParseImplicitIncludeInfo.cmake
@@ -12,6 +12,7 @@ set(targets
aix-C-XL-13.1.3 aix-CXX-XL-13.1.3
aix-C-XLClang-16.1.0.1 aix-CXX-XLClang-16.1.0.1
craype-C-Cray-8.7 craype-CXX-Cray-8.7 craype-Fortran-Cray-8.7
+ craype-C-Cray-9.0-hlist-ad craype-CXX-Cray-9.0-hlist-ad craype-Fortran-Cray-9.0-hlist-ad
craype-C-GNU-7.3.0 craype-CXX-GNU-7.3.0 craype-Fortran-GNU-7.3.0
craype-C-Intel-18.0.2.20180210 craype-CXX-Intel-18.0.2.20180210
craype-Fortran-Intel-18.0.2.20180210
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Cray-9.0-hlist-ad.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Cray-9.0-hlist-ad.input
new file mode 100644
index 0000000..e82bd97
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Cray-9.0-hlist-ad.input
@@ -0,0 +1,54 @@
+CMAKE_LANG=C
+CMAKE_C_COMPILER_ABI=ELF
+CMAKE_C_COMPILER_AR=
+CMAKE_C_COMPILER_ARCHITECTURE_ID=
+CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_C_COMPILER_ID=Cray
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=9.0
+CMAKE_C_COMPILER_VERSION_INTERAL=
+Change Dir: /home/generic.user/Code/tmp/build/CMakeFiles/CMakeTmp
+
+Run Build Command(s):/usr/bin/gmake cmTC_9ceca/fast && /usr/bin/gmake -f CMakeFiles/cmTC_9ceca.dir/build.make CMakeFiles/cmTC_9ceca.dir/build
+gmake[1]: Entering directory '/home/generic.user/Code/tmp/build/CMakeFiles/CMakeTmp'
+Building C object CMakeFiles/cmTC_9ceca.dir/CMakeCCompilerABI.c.o
+/opt/cray/pe/craype/2.6.0/bin/cc -hlist=ad -v -o CMakeFiles/cmTC_9ceca.dir/CMakeCCompilerABI.c.o -c /home/generic.user/Code/cmake/source/master/Modules/CMakeCCompilerABI.c
+rm /lus/scratch/tmp/pe_14877/CMakeCCompilerABI_1.s
+
+/opt/cray/pe/cce/9.0.0/cce/x86_64/bin/ccfe -hc -hcpu=broadwell -D __CRAYXC -D __CRAY_BROADWELL -D __CRAYXT_COMPUTE_LINUX_TARGET -hnetwork=aries -hdecomp -nostdinc -isystem /opt/cray/pe/cce/9.0.0/cce/x86_64/include/craylibs -isystem /opt/cray/pe/cce/9.0.0/cce/x86_64/include/basic -isystem /opt/gcc/8.1.0/snos/lib/gcc/x86_64-suse-linux/8.1.0/include -isystem /opt/gcc/8.1.0/snos/lib/gcc/x86_64-suse-linux/8.1.0/include-fixed -isystem /opt/gcc/8.1.0/snos/include -isystem /usr/include -I /opt/cray/pe/mpt/7.7.8/gni/mpich-cray/9.0/include -I /opt/cray/pe/libsci/19.06.1/CRAY/9.0/x86_64/include -I /opt/cray/rca/2.2.18-6.0.7.0_33.3__g2aa4f39.ari/include -I /opt/cray/pe/pmi/5.0.14/include -I /opt/cray/xpmem/2.2.15-6.0.7.1_5.8__g7549d06.ari/include -I /opt/cray/dmapp/7.1.1-6.0.7.0_34.3__g5a674e0.ari/include -I /opt/cray/gni-headers/5.0.12.0-6.0.7.0_24.1__g3b1768f.ari/include -I /opt/cray/ugni/6.0.14.0-6.0.7.0_23.1__gea11d3d.ari/include -I /opt/cray/udreg/2.3.2-6.0.7.0_33.18__g5196236.ari/include -I /opt/cray/alps/6.6.43-6.0.7.0_26.4__ga796da3.ari/include -I /opt/cray/wlm_detect/1.3.3-6.0.7.0_47.2__g7109084.ari/include -I /opt/cray/krca/2.2.4-6.0.7.1_5.23__g8505b97.ari/include -I /opt/cray-hss-devel/8.0.0/include -D__PEDRVR_GCC_BASE_ACTIVE__ -hpl=/lus/scratch/tmp/pe_14877//pldir -CY "driver.cc -h cpu=broadwell -h dynamic -D __CRAYXC -D __CRAY_BROADWELL -D __CRAYXT_COMPUTE_LINUX_TARGET -h network=aries -h list=ad -v -o CMakeFiles/cmTC_9ceca.dir/CMakeCCompilerABI.c.o -c /home/generic.user/Code/cmake/source/master/Modules/CMakeCCompilerABI.c -isystem /opt/cray/pe/cce/9.0.0/cce/x86_64/include/craylibs -isystem /opt/cray/pe/cce/9.0.0/cce/x86_64/include/basic -isystem /opt/gcc/8.1.0/snos/lib/gcc/x86_64-suse-linux/8.1.0/include -isystem /opt/gcc/8.1.0/snos/lib/gcc/x86_64-suse-linux/8.1.0/include-fixed -isystem /opt/gcc/8.1.0/snos/include -isystem /usr/include -I /opt/cray/pe/mpt/7.7.8/gni/mpich-cray/9.0/include -I /opt/cray/pe/libsci/19.06.1/CRAY/9.0/x86_64/include -I /opt/cray/rca/2.2.18-6.0.7.0_33.3__g2aa4f39.ari/include -I /opt/cray/pe/pmi/5.0.14/include -I /opt/cray/xpmem/2.2.15-6.0.7.1_5.8__g7549d06.ari/include -I /opt/cray/dmapp/7.1.1-6.0.7.0_34.3__g5a674e0.ari/include -I /opt/cray/gni-headers/5.0.12.0-6.0.7.0_24.1__g3b1768f.ari/include -I /opt/cray/ugni/6.0.14.0-6.0.7.0_23.1__gea11d3d.ari/include -I /opt/cray/udreg/2.3.2-6.0.7.0_33.18__g5196236.ari/include -I /opt/cray/alps/6.6.43-6.0.7.0_26.4__ga796da3.ari/include -I /opt/cray/wlm_detect/1.3.3-6.0.7.0_47.2__g7109084.ari/include -I /opt/cray/krca/2.2.4-6.0.7.1_5.23__g8505b97.ari/include -I /opt/cray-hss-devel/8.0.0/include" -ru87000 -CZ /lus/scratch/tmp/pe_14877/CMakeCCompilerABI.T -Cx -CX /lus/scratch/tmp/pe_14877/CMakeCCompilerABI.xml -CL -hdecompile=/home/generic.user/Code/tmp/build/CMakeFiles/CMakeTmp/CMakeFiles/cmTC_9ceca.dir/CMakeCCompilerABI. -S /lus/scratch/tmp/pe_14877/CMakeCCompilerABI_1.s -hipa3 -ufile_id=1 /home/generic.user/Code/cmake/source/master/Modules/CMakeCCompilerABI.c
+
+/opt/cray/pe/cce/9.0.0/cce/x86_64/bin/optcg /lus/scratch/tmp/pe_14877//pldir 1
+
+/opt/cray/pe/cce/9.0.0/binutils/x86_64/x86_64-pc-linux-gnu/bin/as -o CMakeFiles/cmTC_9ceca.dir/CMakeCCompilerABI.c.o --64 /lus/scratch/tmp/pe_14877/CMakeCCompilerABI_1.s
+rm /lus/scratch/tmp/pe_14877/CMakeCCompilerABI_1.s
+
+/opt/cray/pe/cce/9.0.0/cce/x86_64/bin/clx -ra -q -o CMakeFiles/cmTC_9ceca.dir/CMakeCCompilerABI.lst /home/generic.user/Code/cmake/source/master/Modules/CMakeCCompilerABI.c /lus/scratch/tmp/pe_14877/CMakeCCompilerABI.T
+rm /lus/scratch/tmp/pe_14877/CMakeCCompilerABI.T
+rm /lus/scratch/tmp/pe_14877//CMakeCCompilerABI.xml
+rm /lus/scratch/tmp/pe_14877//CMakeCCompilerABI_1.xml.Ttmp
+rm /lus/scratch/tmp/pe_14877//CMakeCCompilerABI.Tfe
+rm /lus/scratch/tmp/pe_14877//CMakeCCompilerABI_1.cif.Ttmp
+rm /lus/scratch/tmp/pe_14877//pldir/gline_1
+rm /lus/scratch/tmp/pe_14877//pldir/PL_path
+rm /lus/scratch/tmp/pe_14877//pldir/CMakeCCompilerABI_1.inl
+rm /lus/scratch/tmp/pe_14877//pldir/PL_global_data
+rm /lus/scratch/tmp/pe_14877//pldir/iline_1
+rm /lus/scratch/tmp/pe_14877//pldir/PL_module_list
+rmdir /lus/scratch/tmp/pe_14877//pldir
+rmdir /lus/scratch/tmp/pe_14877/
+Linking C executable cmTC_9ceca
+/home/generic.user/Code/cmake/build/master/bin/cmake -E cmake_link_script CMakeFiles/cmTC_9ceca.dir/link.txt --verbose=1
+/opt/cray/pe/craype/2.6.0/bin/cc -hlist=ad -v -dynamic CMakeFiles/cmTC_9ceca.dir/CMakeCCompilerABI.c.o -o cmTC_9ceca
+
+/opt/cray/pe/cce/9.0.0/binutils/x86_64/x86_64-pc-linux-gnu/bin/ld --eh-frame-hdr -m elf_x86_64 --enable-new-dtags --dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib64//crt1.o /usr/lib64//crti.o /opt/gcc/8.1.0/snos/lib/gcc/x86_64-suse-linux/8.1.0//crtbegin.o /opt/gcc/8.1.0/snos/lib/gcc/x86_64-suse-linux/8.1.0//crtfastmath.o /opt/cray/pe/cce/9.0.0/cce/x86_64/lib/no_mmap.o CMakeFiles/cmTC_9ceca.dir/CMakeCCompilerABI.c.o -Bdynamic -rpath=/opt/cray/pe/cce/9.0.0/cce/x86_64/lib -L /opt/gcc/8.1.0/snos/lib64 -rpath=/opt/cray/pe/gcc-libs -L /opt/cray/dmapp/default/lib64 -L /opt/cray/pe/mpt/7.7.8/gni/mpich-cray/9.0/lib -L /opt/cray/pe/libsci/19.06.1/CRAY/9.0/x86_64/lib -L /opt/cray/rca/2.2.18-6.0.7.0_33.3__g2aa4f39.ari/lib64 -L /opt/cray/pe/atp/2.1.3/libApp -L /opt/cray/pe/cce/9.0.0/cce/x86_64/lib/pkgconfig/../ --no-as-needed -lAtpSigHandler -lAtpSigHCommData --undefined=_ATP_Data_Globals --undefined=__atpHandlerInstall -L /usr/lib64 -L /lib64 -rpath=/usr/lib64 -rpath=/lib64 -lrca --as-needed -lmpich_cray_90 --no-as-needed --as-needed -lsci_cray_mpi --no-as-needed --as-needed -lsci_cray --no-as-needed --as-needed -lpgas-dmapp --no-as-needed -lquadmath -lmodules -lfi -lcraymath -lf -lu -lcsup --as-needed -latomic --no-as-needed --whole-archive -ltcmalloc_minimal --no-whole-archive -lcray-c++-rts -lstdc++ -lpthread -L /opt/cray/pe/cce/9.0.0/cce-clang/x86_64/lib/clang/9.0.0/lib/linux --start-group -lc -lcsup -lgcc_eh -lm -lclang_rt.craypgo-x86_64 -lgcc --end-group -L /opt/gcc/8.1.0/snos/lib/gcc/x86_64-suse-linux/8.1.0 -L /opt/cray/pe/cce/9.0.0/binutils/x86_64/x86_64-pc-linux-gnu/..//x86_64-unknown-linux-gnu/lib -EL -o cmTC_9ceca /opt/gcc/8.1.0/snos/lib/gcc/x86_64-suse-linux/8.1.0//crtend.o /usr/lib64//crtn.o
+
+/opt/cray/pe/cce/9.0.0/binutils/x86_64/bin/objcopy --remove-section=.note.ftn_module_data cmTC_9ceca
+rm /lus/scratch/tmp/pe_14889//pldir/PL_path
+rm /lus/scratch/tmp/pe_14889//pldir/PL_global_data
+rm /lus/scratch/tmp/pe_14889//pldir/PL_module_list
+rmdir /lus/scratch/tmp/pe_14889//pldir
+rmdir /lus/scratch/tmp/pe_14889/
+gmake[1]: Leaving directory '/home/generic.user/Code/tmp/build/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Cray-9.0-hlist-ad.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Cray-9.0-hlist-ad.output
new file mode 100644
index 0000000..42b194a
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Cray-9.0-hlist-ad.output
@@ -0,0 +1 @@
+/opt/cray/pe/cce/9.0.0/cce/x86_64/include/craylibs;/opt/cray/pe/cce/9.0.0/cce/x86_64/include/basic;/opt/gcc/8.1.0/snos/lib/gcc/x86_64-suse-linux/8.1.0/include;/opt/gcc/8.1.0/snos/lib/gcc/x86_64-suse-linux/8.1.0/include-fixed;/opt/gcc/8.1.0/snos/include;/usr/include;/opt/cray/pe/mpt/7.7.8/gni/mpich-cray/9.0/include;/opt/cray/pe/libsci/19.06.1/CRAY/9.0/x86_64/include;/opt/cray/rca/2.2.18-6.0.7.0_33.3__g2aa4f39.ari/include;/opt/cray/pe/pmi/5.0.14/include;/opt/cray/xpmem/2.2.15-6.0.7.1_5.8__g7549d06.ari/include;/opt/cray/dmapp/7.1.1-6.0.7.0_34.3__g5a674e0.ari/include;/opt/cray/gni-headers/5.0.12.0-6.0.7.0_24.1__g3b1768f.ari/include;/opt/cray/ugni/6.0.14.0-6.0.7.0_23.1__gea11d3d.ari/include;/opt/cray/udreg/2.3.2-6.0.7.0_33.18__g5196236.ari/include;/opt/cray/alps/6.6.43-6.0.7.0_26.4__ga796da3.ari/include;/opt/cray/wlm_detect/1.3.3-6.0.7.0_47.2__g7109084.ari/include;/opt/cray/krca/2.2.4-6.0.7.1_5.23__g8505b97.ari/include;/opt/cray-hss-devel/8.0.0/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Cray-9.0-hlist-ad.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Cray-9.0-hlist-ad.input
new file mode 100644
index 0000000..06a4ac9
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Cray-9.0-hlist-ad.input
@@ -0,0 +1,54 @@
+CMAKE_LANG=CXX
+CMAKE_CXX_COMPILER_ABI=ELF
+CMAKE_CXX_COMPILER_AR=
+CMAKE_CXX_COMPILER_ARCHITECTURE_ID=
+CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CXX_COMPILER_ID=Cray
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=9.0
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+Change Dir: /home/generic.user/Code/tmp/build/CMakeFiles/CMakeTmp
+
+Run Build Command(s):/usr/bin/gmake cmTC_aa1be/fast && /usr/bin/gmake -f CMakeFiles/cmTC_aa1be.dir/build.make CMakeFiles/cmTC_aa1be.dir/build
+gmake[1]: Entering directory '/home/generic.user/Code/tmp/build/CMakeFiles/CMakeTmp'
+Building CXX object CMakeFiles/cmTC_aa1be.dir/CMakeCXXCompilerABI.cpp.o
+/opt/cray/pe/craype/2.6.0/bin/CC -hlist=ad -v -o CMakeFiles/cmTC_aa1be.dir/CMakeCXXCompilerABI.cpp.o -c /home/generic.user/Code/cmake/source/master/Modules/CMakeCXXCompilerABI.cpp
+rm /lus/scratch/tmp/pe_14901/CMakeCXXCompilerABI_1.s
+
+/opt/cray/pe/cce/9.0.0/cce/x86_64/bin/ccfe -hcpu=broadwell -D __CRAYXC -D __CRAY_BROADWELL -D __CRAYXT_COMPUTE_LINUX_TARGET -hnetwork=aries -hdecomp -nostdinc -isystem /opt/cray/pe/cce/9.0.0/cce/x86_64/include/craylibs -isystem /opt/gcc/8.1.0/snos/include/g++ -isystem /opt/gcc/8.1.0/snos/include/g++/x86_64-suse-linux -isystem /opt/gcc/8.1.0/snos/include/g++/backward -isystem /opt/gcc/8.1.0/snos/lib/gcc/x86_64-suse-linux/8.1.0/include -isystem /opt/gcc/8.1.0/snos/lib/gcc/x86_64-suse-linux/8.1.0/include-fixed -isystem /opt/cray/pe/cce/9.0.0/cce/x86_64/include/c++ -isystem /opt/cray/pe/cce/9.0.0/cce/x86_64/include/basic -isystem /opt/gcc/8.1.0/snos/include -isystem /usr/include -I /opt/cray/pe/mpt/7.7.8/gni/mpich-cray/9.0/include -I /opt/cray/pe/libsci/19.06.1/CRAY/9.0/x86_64/include -I /opt/cray/rca/2.2.18-6.0.7.0_33.3__g2aa4f39.ari/include -I /opt/cray/pe/pmi/5.0.14/include -I /opt/cray/xpmem/2.2.15-6.0.7.1_5.8__g7549d06.ari/include -I /opt/cray/dmapp/7.1.1-6.0.7.0_34.3__g5a674e0.ari/include -I /opt/cray/gni-headers/5.0.12.0-6.0.7.0_24.1__g3b1768f.ari/include -I /opt/cray/ugni/6.0.14.0-6.0.7.0_23.1__gea11d3d.ari/include -I /opt/cray/udreg/2.3.2-6.0.7.0_33.18__g5196236.ari/include -I /opt/cray/alps/6.6.43-6.0.7.0_26.4__ga796da3.ari/include -I /opt/cray/wlm_detect/1.3.3-6.0.7.0_47.2__g7109084.ari/include -I /opt/cray/krca/2.2.4-6.0.7.1_5.23__g8505b97.ari/include -I /opt/cray-hss-devel/8.0.0/include -D__PEDRVR_GCC_BASE_ACTIVE__ -hpl=/lus/scratch/tmp/pe_14901//pldir -CY "driver.CC -h cpu=broadwell -h dynamic -D __CRAYXC -D __CRAY_BROADWELL -D __CRAYXT_COMPUTE_LINUX_TARGET -h network=aries -h list=ad -v -o CMakeFiles/cmTC_aa1be.dir/CMakeCXXCompilerABI.cpp.o -c /home/generic.user/Code/cmake/source/master/Modules/CMakeCXXCompilerABI.cpp -isystem /opt/cray/pe/cce/9.0.0/cce/x86_64/include/craylibs -isystem /opt/gcc/8.1.0/snos/include/g++ -isystem /opt/gcc/8.1.0/snos/include/g++/x86_64-suse-linux -isystem /opt/gcc/8.1.0/snos/include/g++/backward -isystem /opt/gcc/8.1.0/snos/lib/gcc/x86_64-suse-linux/8.1.0/include -isystem /opt/gcc/8.1.0/snos/lib/gcc/x86_64-suse-linux/8.1.0/include-fixed -isystem /opt/cray/pe/cce/9.0.0/cce/x86_64/include/c++ -isystem /opt/cray/pe/cce/9.0.0/cce/x86_64/include/basic -isystem /opt/gcc/8.1.0/snos/include -isystem /usr/include -I /opt/cray/pe/mpt/7.7.8/gni/mpich-cray/9.0/include -I /opt/cray/pe/libsci/19.06.1/CRAY/9.0/x86_64/include -I /opt/cray/rca/2.2.18-6.0.7.0_33.3__g2aa4f39.ari/include -I /opt/cray/pe/pmi/5.0.14/include -I /opt/cray/xpmem/2.2.15-6.0.7.1_5.8__g7549d06.ari/include -I /opt/cray/dmapp/7.1.1-6.0.7.0_34.3__g5a674e0.ari/include -I /opt/cray/gni-headers/5.0.12.0-6.0.7.0_24.1__g3b1768f.ari/include -I /opt/cray/ugni/6.0.14.0-6.0.7.0_23.1__gea11d3d.ari/include -I /opt/cray/udreg/2.3.2-6.0.7.0_33.18__g5196236.ari/include -I /opt/cray/alps/6.6.43-6.0.7.0_26.4__ga796da3.ari/include -I /opt/cray/wlm_detect/1.3.3-6.0.7.0_47.2__g7109084.ari/include -I /opt/cray/krca/2.2.4-6.0.7.1_5.23__g8505b97.ari/include -I /opt/cray-hss-devel/8.0.0/include" -ru87000 -hipafrom=/opt/cray/pe/cce/9.0.0/cce/x86_64/lib/libcray-c++-rts.a -CZ /lus/scratch/tmp/pe_14901/CMakeCXXCompilerABI.T -Cx -CX /lus/scratch/tmp/pe_14901/CMakeCXXCompilerABI.xml -CL -hdecompile=/home/generic.user/Code/tmp/build/CMakeFiles/CMakeTmp/CMakeFiles/cmTC_aa1be.dir/CMakeCXXCompilerABI. -S /lus/scratch/tmp/pe_14901/CMakeCXXCompilerABI_1.s -hipa4 -ufile_id=1 /home/generic.user/Code/cmake/source/master/Modules/CMakeCXXCompilerABI.cpp
+
+/opt/cray/pe/cce/9.0.0/cce/x86_64/bin/optcg /lus/scratch/tmp/pe_14901//pldir 1
+
+/opt/cray/pe/cce/9.0.0/binutils/x86_64/x86_64-pc-linux-gnu/bin/as -o CMakeFiles/cmTC_aa1be.dir/CMakeCXXCompilerABI.cpp.o --64 /lus/scratch/tmp/pe_14901/CMakeCXXCompilerABI_1.s
+rm /lus/scratch/tmp/pe_14901/CMakeCXXCompilerABI_1.s
+
+/opt/cray/pe/cce/9.0.0/cce/x86_64/bin/clx -ra -q -o CMakeFiles/cmTC_aa1be.dir/CMakeCXXCompilerABI.lst /home/generic.user/Code/cmake/source/master/Modules/CMakeCXXCompilerABI.cpp /lus/scratch/tmp/pe_14901/CMakeCXXCompilerABI.T
+rm /lus/scratch/tmp/pe_14901/CMakeCXXCompilerABI.T
+rm /lus/scratch/tmp/pe_14901//CMakeCXXCompilerABI_1.xml.Ttmp
+rm /lus/scratch/tmp/pe_14901//CMakeCXXCompilerABI_1.cif.Ttmp
+rm /lus/scratch/tmp/pe_14901//CMakeCXXCompilerABI.Tfe
+rm /lus/scratch/tmp/pe_14901//CMakeCXXCompilerABI.xml
+rm /lus/scratch/tmp/pe_14901//pldir/gline_1
+rm /lus/scratch/tmp/pe_14901//pldir/PL_path
+rm /lus/scratch/tmp/pe_14901//pldir/CMakeCXXCompilerABI_1.inl
+rm /lus/scratch/tmp/pe_14901//pldir/PL_global_data
+rm /lus/scratch/tmp/pe_14901//pldir/iline_1
+rm /lus/scratch/tmp/pe_14901//pldir/PL_module_list
+rmdir /lus/scratch/tmp/pe_14901//pldir
+rmdir /lus/scratch/tmp/pe_14901/
+Linking CXX executable cmTC_aa1be
+/home/generic.user/Code/cmake/build/master/bin/cmake -E cmake_link_script CMakeFiles/cmTC_aa1be.dir/link.txt --verbose=1
+/opt/cray/pe/craype/2.6.0/bin/CC -hlist=ad -v -dynamic CMakeFiles/cmTC_aa1be.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_aa1be
+
+/opt/cray/pe/cce/9.0.0/binutils/x86_64/x86_64-pc-linux-gnu/bin/ld --eh-frame-hdr -m elf_x86_64 --enable-new-dtags --dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib64//crt1.o /usr/lib64//crti.o /opt/gcc/8.1.0/snos/lib/gcc/x86_64-suse-linux/8.1.0//crtbegin.o /opt/gcc/8.1.0/snos/lib/gcc/x86_64-suse-linux/8.1.0//crtfastmath.o /opt/cray/pe/cce/9.0.0/cce/x86_64/lib/no_mmap.o CMakeFiles/cmTC_aa1be.dir/CMakeCXXCompilerABI.cpp.o -Bdynamic -rpath=/opt/cray/pe/cce/9.0.0/cce/x86_64/lib -L /opt/gcc/8.1.0/snos/lib64 -rpath=/opt/cray/pe/gcc-libs -L /opt/cray/dmapp/default/lib64 -L /opt/cray/pe/mpt/7.7.8/gni/mpich-cray/9.0/lib -L /opt/cray/dmapp/default/lib64 -L /opt/cray/pe/mpt/7.7.8/gni/mpich-cray/9.0/lib -L /opt/cray/pe/libsci/19.06.1/CRAY/9.0/x86_64/lib -L /opt/cray/rca/2.2.18-6.0.7.0_33.3__g2aa4f39.ari/lib64 -L /opt/cray/pe/atp/2.1.3/libApp -L /opt/cray/pe/cce/9.0.0/cce/x86_64/lib/pkgconfig/../ --no-as-needed -lAtpSigHandler -lAtpSigHCommData --undefined=_ATP_Data_Globals --undefined=__atpHandlerInstall -L /usr/lib64 -L /lib64 -rpath=/usr/lib64 -rpath=/lib64 -lrca --as-needed -lmpich_cray_90 --no-as-needed --as-needed -lmpichcxx_cray_90 --no-as-needed --as-needed -lsci_cray_mpi --no-as-needed --as-needed -lsci_cray --no-as-needed --as-needed -lpgas-dmapp --no-as-needed -lquadmath -lmodules -lfi -lcraymath -lf -lu -lcsup --as-needed -latomic --no-as-needed -lcray-c++-rts -lcray-c++-rts -lstdc++ -lsupc++ --whole-archive -ltcmalloc_minimal --no-whole-archive -lcray-c++-rts -lstdc++ -lpthread -L /opt/cray/pe/cce/9.0.0/cce-clang/x86_64/lib/clang/9.0.0/lib/linux --start-group -lc -lcsup -lgcc_eh -lm -lclang_rt.craypgo-x86_64 -lgcc --end-group -L /opt/gcc/8.1.0/snos/lib/gcc/x86_64-suse-linux/8.1.0 -L /opt/cray/pe/cce/9.0.0/binutils/x86_64/x86_64-pc-linux-gnu/..//x86_64-unknown-linux-gnu/lib -EL -o cmTC_aa1be /opt/gcc/8.1.0/snos/lib/gcc/x86_64-suse-linux/8.1.0//crtend.o /usr/lib64//crtn.o
+
+/opt/cray/pe/cce/9.0.0/binutils/x86_64/bin/objcopy --remove-section=.note.ftn_module_data cmTC_aa1be
+rm /lus/scratch/tmp/pe_14913//pldir/PL_path
+rm /lus/scratch/tmp/pe_14913//pldir/PL_global_data
+rm /lus/scratch/tmp/pe_14913//pldir/PL_module_list
+rmdir /lus/scratch/tmp/pe_14913//pldir
+rmdir /lus/scratch/tmp/pe_14913/
+gmake[1]: Leaving directory '/home/generic.user/Code/tmp/build/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Cray-9.0-hlist-ad.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Cray-9.0-hlist-ad.output
new file mode 100644
index 0000000..a3b8768
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Cray-9.0-hlist-ad.output
@@ -0,0 +1 @@
+/opt/cray/pe/cce/9.0.0/cce/x86_64/include/craylibs;/opt/gcc/8.1.0/snos/include/g\+\+;/opt/gcc/8.1.0/snos/include/g\+\+/x86_64-suse-linux;/opt/gcc/8.1.0/snos/include/g\+\+/backward;/opt/gcc/8.1.0/snos/lib/gcc/x86_64-suse-linux/8.1.0/include;/opt/gcc/8.1.0/snos/lib/gcc/x86_64-suse-linux/8.1.0/include-fixed;/opt/cray/pe/cce/9.0.0/cce/x86_64/include/c\+\+;/opt/cray/pe/cce/9.0.0/cce/x86_64/include/basic;/opt/gcc/8.1.0/snos/include;/usr/include;/opt/cray/pe/mpt/7.7.8/gni/mpich-cray/9.0/include;/opt/cray/pe/libsci/19.06.1/CRAY/9.0/x86_64/include;/opt/cray/rca/2.2.18-6.0.7.0_33.3__g2aa4f39.ari/include;/opt/cray/pe/pmi/5.0.14/include;/opt/cray/xpmem/2.2.15-6.0.7.1_5.8__g7549d06.ari/include;/opt/cray/dmapp/7.1.1-6.0.7.0_34.3__g5a674e0.ari/include;/opt/cray/gni-headers/5.0.12.0-6.0.7.0_24.1__g3b1768f.ari/include;/opt/cray/ugni/6.0.14.0-6.0.7.0_23.1__gea11d3d.ari/include;/opt/cray/udreg/2.3.2-6.0.7.0_33.18__g5196236.ari/include;/opt/cray/alps/6.6.43-6.0.7.0_26.4__ga796da3.ari/include;/opt/cray/wlm_detect/1.3.3-6.0.7.0_47.2__g7109084.ari/include;/opt/cray/krca/2.2.4-6.0.7.1_5.23__g8505b97.ari/include;/opt/cray-hss-devel/8.0.0/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-9.0-hlist-ad.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-9.0-hlist-ad.input
new file mode 100644
index 0000000..0ba430a
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-9.0-hlist-ad.input
@@ -0,0 +1,53 @@
+CMAKE_LANG=Fortran
+CMAKE_Fortran_COMPILER_ABI=ELF
+CMAKE_Fortran_COMPILER_AR=
+CMAKE_Fortran_COMPILER_ARCHITECTURE_ID=
+CMAKE_Fortran_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_Fortran_COMPILER_ID=Cray
+CMAKE_Fortran_COMPILER_LAUNCHER=
+CMAKE_Fortran_COMPILER_LOADED=1
+CMAKE_Fortran_COMPILER_RANLIB=
+CMAKE_Fortran_COMPILER_TARGET=
+CMAKE_Fortran_COMPILER_VERSION=9.0
+CMAKE_Fortran_COMPILER_VERSION_INTERAL=
+Change Dir: /home/generic.user/Code/tmp/build/CMakeFiles/CMakeTmp
+
+Run Build Command(s):/usr/bin/gmake cmTC_61c1d/fast && /usr/bin/gmake -f CMakeFiles/cmTC_61c1d.dir/build.make CMakeFiles/cmTC_61c1d.dir/build
+gmake[1]: Entering directory '/home/generic.user/Code/tmp/build/CMakeFiles/CMakeTmp'
+Building Fortran object CMakeFiles/cmTC_61c1d.dir/CMakeFortranCompilerABI.F.o
+/opt/cray/pe/craype/2.6.0/bin/ftn -hlist=ad -em -J. -v -c /home/generic.user/Code/cmake/source/master/Modules/CMakeFortranCompilerABI.F -o CMakeFiles/cmTC_61c1d.dir/CMakeFortranCompilerABI.F.o
+
+/opt/cray/pe/cce/9.0.0/cce/x86_64/bin/ftnfe -h cpu=broadwell -D__CRAYXC -D__CRAY_BROADWELL -D__CRAYXT_COMPUTE_LINUX_TARGET -h network=aries -hdecomp -em -J. -I/opt/cray/pe/cce/9.0.0/cce/x86_64/include/craylibs -I/usr/include -I/usr/include -I/opt/cray/pe/mpt/7.7.8/gni/mpich-cray/9.0/include -I/opt/cray/pe/libsci/19.06.1/CRAY/9.0/x86_64/include -I/opt/cray/rca/2.2.18-6.0.7.0_33.3__g2aa4f39.ari/include -I/opt/cray/pe/pmi/5.0.14/include -I/opt/cray/xpmem/2.2.15-6.0.7.1_5.8__g7549d06.ari/include -I/opt/cray/dmapp/7.1.1-6.0.7.0_34.3__g5a674e0.ari/include -I/opt/cray/gni-headers/5.0.12.0-6.0.7.0_24.1__g3b1768f.ari/include -I/opt/cray/ugni/6.0.14.0-6.0.7.0_23.1__gea11d3d.ari/include -I/opt/cray/udreg/2.3.2-6.0.7.0_33.18__g5196236.ari/include -I/opt/cray/alps/6.6.43-6.0.7.0_26.4__ga796da3.ari/include -I/opt/cray/wlm_detect/1.3.3-6.0.7.0_47.2__g7109084.ari/include -I/opt/cray/krca/2.2.4-6.0.7.1_5.23__g8505b97.ari/include -I/opt/cray-hss-devel/8.0.0/include -hpl=/lus/scratch/tmp/pe_16260//pldir -Ca -CY "ftn_driver.exe -hcpu=broadwell -hdynamic -D__CRAYXC -D__CRAY_BROADWELL -D__CRAYXT_COMPUTE_LINUX_TARGET -hnetwork=aries -hlist=ad -em -J. -v -c /home/generic.user/Code/cmake/source/master/Modules/CMakeFortranCompilerABI.F -oCMakeFiles/cmTC_61c1d.dir/CMakeFortranCompilerABI.F.o -I/opt/cray/pe/cce/9.0.0/cce/x86_64/include/craylibs -I/usr/include -I/usr/include -I/opt/cray/pe/mpt/7.7.8/gni/mpich-cray/9.0/include -I/opt/cray/pe/libsci/19.06.1/CRAY/9.0/x86_64/include -I/opt/cray/rca/2.2.18-6.0.7.0_33.3__g2aa4f39.ari/include -I/opt/cray/pe/pmi/5.0.14/include -I/opt/cray/xpmem/2.2.15-6.0.7.1_5.8__g7549d06.ari/include -I/opt/cray/dmapp/7.1.1-6.0.7.0_34.3__g5a674e0.ari/include -I/opt/cray/gni-headers/5.0.12.0-6.0.7.0_24.1__g3b1768f.ari/include -I/opt/cray/ugni/6.0.14.0-6.0.7.0_23.1__gea11d3d.ari/include -I/opt/cray/udreg/2.3.2-6.0.7.0_33.18__g5196236.ari/include -I/opt/cray/alps/6.6.43-6.0.7.0_26.4__ga796da3.ari/include -I/opt/cray/wlm_detect/1.3.3-6.0.7.0_47.2__g7109084.ari/include -I/opt/cray/krca/2.2.4-6.0.7.1_5.23__g8505b97.ari/include -I/opt/cray-hss-devel/8.0.0/include" -usystem_mod=/opt/cray/pe/cce/9.0.0/cce/x86_64/lib/libmodules.a -usystem_mod=/opt/cray/pe/cce/9.0.0/cce/x86_64/lib/libomp.a -usystem_mod=/opt/cray/pe/cce/9.0.0/cce/x86_64/lib/omp_lib.a -usystem_mod=/opt/cray/pe/cce/9.0.0/cce/x86_64/lib/libopenacc.a -usystem_mod=/opt/cray/pe/mpt/7.7.8/gni/mpich-cray/9.0/include -usystem_mod=/opt/cray/pe/libsci/19.06.1/CRAY/9.0/x86_64/include -usystem_mod=/opt/cray/rca/2.2.18-6.0.7.0_33.3__g2aa4f39.ari/include -usystem_mod=/opt/cray/pe/pmi/5.0.14/include -usystem_mod=/opt/cray/xpmem/2.2.15-6.0.7.1_5.8__g7549d06.ari/include -usystem_mod=/opt/cray/dmapp/7.1.1-6.0.7.0_34.3__g5a674e0.ari/include -usystem_mod=/opt/cray/gni-headers/5.0.12.0-6.0.7.0_24.1__g3b1768f.ari/include -usystem_mod=/opt/cray/ugni/6.0.14.0-6.0.7.0_23.1__gea11d3d.ari/include -usystem_mod=/opt/cray/udreg/2.3.2-6.0.7.0_33.18__g5196236.ari/include -usystem_mod=/opt/cray/alps/6.6.43-6.0.7.0_26.4__ga796da3.ari/include -usystem_mod=/opt/cray/wlm_detect/1.3.3-6.0.7.0_47.2__g7109084.ari/include -usystem_mod=/opt/cray/krca/2.2.4-6.0.7.1_5.23__g8505b97.ari/include -usystem_mod=/opt/cray-hss-devel/8.0.0/include -usystem_mod=/opt/cray/pe/cce/9.0.0/cce/x86_64/lib/libcraymp.a -udv -ffixed -CZ/lus/scratch/tmp/pe_16260/CMakeFortranCompilerABI.T -Cx -CX/lus/scratch/tmp/pe_16260/CMakeFortranCompilerABI.xml -hdecompile=/home/generic.user/Code/tmp/build/CMakeFiles/CMakeTmp/CMakeFiles/cmTC_61c1d.dir/CMakeFortranCompilerABI. -S /lus/scratch/tmp/pe_16260/CMakeFortranCompilerABI_1.s -Oipa3 -uo=/home/generic.user/Code/tmp/build/CMakeFiles/CMakeTmp/CMakeFiles/cmTC_61c1d.dir/CMakeFortranCompilerABI.F.o -ufile_id=1 /home/generic.user/Code/cmake/source/master/Modules/CMakeFortranCompilerABI.F
+
+/opt/cray/pe/cce/9.0.0/cce/x86_64/bin/optcg /lus/scratch/tmp/pe_16260//pldir 1
+
+/opt/cray/pe/cce/9.0.0/binutils/x86_64/x86_64-pc-linux-gnu/bin/as -o CMakeFiles/cmTC_61c1d.dir/CMakeFortranCompilerABI.F.o --64 /lus/scratch/tmp/pe_16260/CMakeFortranCompilerABI_1.s
+rm /lus/scratch/tmp/pe_16260/CMakeFortranCompilerABI_1.s
+
+/opt/cray/pe/cce/9.0.0/cce/x86_64/bin/ftnlx -ra -q -o CMakeFiles/cmTC_61c1d.dir/CMakeFortranCompilerABI.lst /home/generic.user/Code/cmake/source/master/Modules/CMakeFortranCompilerABI.F /lus/scratch/tmp/pe_16260/CMakeFortranCompilerABI.T
+rm /lus/scratch/tmp/pe_16260/CMakeFortranCompilerABI.T
+rm /lus/scratch/tmp/pe_16260//CMakeFortranCompilerABI.xml
+rm /lus/scratch/tmp/pe_16260//CMakeFortranCompilerABI_1.cif.Ttmp
+rm /lus/scratch/tmp/pe_16260//CMakeFortranCompilerABI_1.xml.Ttmp
+rm /lus/scratch/tmp/pe_16260//pldir/gline_1
+rm /lus/scratch/tmp/pe_16260//pldir/PL_path
+rm /lus/scratch/tmp/pe_16260//pldir/CMakeFortranCompilerABI_1.inl
+rm /lus/scratch/tmp/pe_16260//pldir/PL_global_data
+rm /lus/scratch/tmp/pe_16260//pldir/iline_1
+rm /lus/scratch/tmp/pe_16260//pldir/PL_module_list
+rmdir /lus/scratch/tmp/pe_16260//pldir
+rm /lus/scratch/tmp/pe_16260//CMakeFortranCompilerABI.Tfe
+rmdir /lus/scratch/tmp/pe_16260/
+Linking Fortran executable cmTC_61c1d
+/home/generic.user/Code/cmake/build/master/bin/cmake -E cmake_link_script CMakeFiles/cmTC_61c1d.dir/link.txt --verbose=1
+/opt/cray/pe/craype/2.6.0/bin/ftn -v -hlist=ad CMakeFiles/cmTC_61c1d.dir/CMakeFortranCompilerABI.F.o -o cmTC_61c1d
+
+/opt/cray/pe/cce/9.0.0/binutils/x86_64/x86_64-pc-linux-gnu/bin/ld --eh-frame-hdr -m elf_x86_64 --enable-new-dtags --dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib64//crt1.o /usr/lib64//crti.o /opt/gcc/8.1.0/snos/lib/gcc/x86_64-suse-linux/8.1.0//crtbegin.o /opt/gcc/8.1.0/snos/lib/gcc/x86_64-suse-linux/8.1.0//crtfastmath.o /opt/cray/pe/cce/9.0.0/cce/x86_64/lib/no_mmap.o CMakeFiles/cmTC_61c1d.dir/CMakeFortranCompilerABI.F.o -Bdynamic -rpath=/opt/cray/pe/cce/9.0.0/cce/x86_64/lib -L/opt/gcc/8.1.0/snos/lib64 -rpath=/opt/cray/pe/gcc-libs -L/opt/cray/dmapp/default/lib64 -L/opt/cray/pe/mpt/7.7.8/gni/mpich-cray/9.0/lib -L/opt/cray/dmapp/default/lib64 -L/opt/cray/pe/mpt/7.7.8/gni/mpich-cray/9.0/lib -L/opt/cray/pe/libsci/19.06.1/CRAY/9.0/x86_64/lib -L/opt/cray/rca/2.2.18-6.0.7.0_33.3__g2aa4f39.ari/lib64 -L/opt/cray/pe/atp/2.1.3/libApp -L/opt/cray/pe/cce/9.0.0/cce/x86_64/lib/pkgconfig/../ --no-as-needed -lAtpSigHandler -lAtpSigHCommData --undefined=_ATP_Data_Globals --undefined=__atpHandlerInstall -L/usr/lib64 -L/lib64 -rpath=/usr/lib64 -rpath=/lib64 -lrca --as-needed -lmpich_cray_90 --no-as-needed --as-needed -lmpichf90_cray_90 --no-as-needed --as-needed -lsci_cray_mpi --no-as-needed --as-needed -lsci_cray --no-as-needed --as-needed -lpgas-dmapp --no-as-needed -lquadmath -lmodules -lfi -lcraymath -lf -lu -lcsup --as-needed -lgfortran --no-as-needed --whole-archive -ltcmalloc_minimal --no-whole-archive -lcray-c++-rts -lstdc++ -lpthread -L/opt/cray/pe/cce/9.0.0/cce-clang/x86_64/lib/clang/9.0.0/lib/linux --start-group -lc -lcsup -lgcc_eh -lm -lclang_rt.craypgo-x86_64 -lgcc --end-group -L /opt/gcc/8.1.0/snos/lib/gcc/x86_64-suse-linux/8.1.0 -L /opt/cray/pe/cce/9.0.0/binutils/x86_64/x86_64-pc-linux-gnu/..//x86_64-unknown-linux-gnu/lib -EL -o cmTC_61c1d /opt/gcc/8.1.0/snos/lib/gcc/x86_64-suse-linux/8.1.0//crtend.o /usr/lib64//crtn.o
+
+/opt/cray/pe/cce/9.0.0/binutils/x86_64/bin/objcopy --remove-section=.note.ftn_module_data cmTC_61c1d
+rm /lus/scratch/tmp/pe_16273//pldir/PL_path
+rm /lus/scratch/tmp/pe_16273//pldir/PL_global_data
+rm /lus/scratch/tmp/pe_16273//pldir/PL_module_list
+rmdir /lus/scratch/tmp/pe_16273//pldir
+rmdir /lus/scratch/tmp/pe_16273/
+gmake[1]: Leaving directory '/home/generic.user/Code/tmp/build/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-9.0-hlist-ad.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-9.0-hlist-ad.output
new file mode 100644
index 0000000..234483b
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-9.0-hlist-ad.output
@@ -0,0 +1 @@
+/opt/cray/pe/cce/9.0.0/cce/x86_64/include/craylibs;/usr/include;/opt/cray/pe/mpt/7.7.8/gni/mpich-cray/9.0/include;/opt/cray/pe/libsci/19.06.1/CRAY/9.0/x86_64/include;/opt/cray/rca/2.2.18-6.0.7.0_33.3__g2aa4f39.ari/include;/opt/cray/pe/pmi/5.0.14/include;/opt/cray/xpmem/2.2.15-6.0.7.1_5.8__g7549d06.ari/include;/opt/cray/dmapp/7.1.1-6.0.7.0_34.3__g5a674e0.ari/include;/opt/cray/gni-headers/5.0.12.0-6.0.7.0_24.1__g3b1768f.ari/include;/opt/cray/ugni/6.0.14.0-6.0.7.0_23.1__gea11d3d.ari/include;/opt/cray/udreg/2.3.2-6.0.7.0_33.18__g5196236.ari/include;/opt/cray/alps/6.6.43-6.0.7.0_26.4__ga796da3.ari/include;/opt/cray/wlm_detect/1.3.3-6.0.7.0_47.2__g7109084.ari/include;/opt/cray/krca/2.2.4-6.0.7.1_5.23__g8505b97.ari/include;/opt/cray-hss-devel/8.0.0/include
diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake
index e730d6e..568bdf8 100644
--- a/Tests/RunCMake/RunCMake.cmake
+++ b/Tests/RunCMake/RunCMake.cmake
@@ -144,8 +144,6 @@ function(run_cmake test)
"|Error kstat returned"
"|Hit xcodebuild bug"
"|[^\n]*xcodebuild[^\n]*warning: file type[^\n]*is based on missing file type"
- "|ld: 0711-224 WARNING: Duplicate symbol: .__init_aix_libgcc_cxa_atexit"
- "|ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information"
"|[^\n]*is a member of multiple groups"
"|[^\n]*from Time Machine by path"
"|[^\n]*Bullseye Testing Technology"
diff --git a/Tests/RunCMake/VS10Project/VsPackageReferences-check.cmake b/Tests/RunCMake/VS10Project/VsPackageReferences-check.cmake
index 4ff5327..512a1c9 100644
--- a/Tests/RunCMake/VS10Project/VsPackageReferences-check.cmake
+++ b/Tests/RunCMake/VS10Project/VsPackageReferences-check.cmake
@@ -25,7 +25,7 @@ foreach(i 1 2)
if(line MATCHES "^ *<PackageReference .* Version=\"${testVersion}\".*>$")
set(Library${i}Found TRUE)
message(STATUS "foo.vcxproj is using package reference ${testLibrary} with version ${testVersion}")
- elseif()
+ else()
message(STATUS "foo.vcxproj failed to define reference ${testLibrary} with version ${testVersion}")
set(Library${i}Found FALSE)
endif()
diff --git a/Tests/RunCMake/find_program/RelAndAbsPath.cmake b/Tests/RunCMake/find_program/RelAndAbsPath.cmake
index e6bdef7..3c60a20 100644
--- a/Tests/RunCMake/find_program/RelAndAbsPath.cmake
+++ b/Tests/RunCMake/find_program/RelAndAbsPath.cmake
@@ -46,7 +46,7 @@ set(CMAKE_PREFIX_PATH ".")
set(CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH OFF)
set(CMAKE_FIND_USE_CMAKE_PATH OFF)
set(CMAKE_FIND_USE_CMAKE_SYSTEM_PATH OFF)
-set(CMAKE_FIND_USE_PACAKGE_ROOT_PATH OFF)
+set(CMAKE_FIND_USE_PACKAGE_ROOT_PATH OFF)
set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH OFF)
find_program(PROG_CWD
NAMES testCWD
diff --git a/Utilities/IWYU/mapping.imp b/Utilities/IWYU/mapping.imp
index 0393ff1..9fff442 100644
--- a/Utilities/IWYU/mapping.imp
+++ b/Utilities/IWYU/mapping.imp
@@ -42,10 +42,19 @@
{ symbol: [ "std::istringstream", private, "<sstream>", public ] },
{ symbol: [ "std::ostringstream", private, "<sstream>", public ] },
- # HACK: iwyu suggests those two files each time vector[] is used.
+ # HACK: iwyu suggests <ext/alloc_traits.h> and <memory> each time vector[] is used.
# https://github.com/include-what-you-use/include-what-you-use/issues/166
{ include: [ "<ext/alloc_traits.h>", private, "<vector>", public ] },
- { include: [ "<memory>", public, "<vector>", public ] },
+ { symbol: [ "std::allocator_traits<std::allocator<cmComputeComponentGraph::TarjanEntry> >::value_type", private, "<vector>", public ] },
+ { symbol: [ "std::allocator_traits<std::allocator<cmFortranFile> >::value_type", private, "<vector>", public ] },
+ { symbol: [ "std::allocator_traits<std::allocator<cmGraphEdgeList> >::value_type", private, "<vector>", public ] },
+ { symbol: [ "std::allocator_traits<std::allocator<cmOrderDirectories::ConflictList> >::value_type", private, "<vector>", public ] },
+ { symbol: [ "std::allocator_traits<std::allocator<cmStateSnapshot> >::value_type", private, "<vector>", public ] },
+ { symbol: [ "std::allocator_traits<std::allocator<std::basic_string<char> > >::value_type", private, "<vector>", public ] },
+ { symbol: [ "std::allocator_traits<std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::value_type", private, "<vector>", public ] },
+ { symbol: [ "std::allocator_traits<std::allocator<std::vector<std::basic_string<char>, std::allocator<std::basic_string<char> > > > >::value_type", private, "<vector>", public ] },
+ { symbol: [ "std::allocator_traits<std::allocator<std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >::value_type", private, "<vector>", public ] },
+ { symbol: [ "std::allocator_traits<std::allocator<uv_stdio_container_s> >::value_type", private, "<vector>", public ] },
# TODO: enable this block and remove some <utility> includes?
#{ symbol: [ "std::pair", private, "<utility>", public ] },
diff --git a/Utilities/Release/create-cmake-release.cmake b/Utilities/Release/create-cmake-release.cmake
index b3cc352..0622ad8 100644
--- a/Utilities/Release/create-cmake-release.cmake
+++ b/Utilities/Release/create-cmake-release.cmake
@@ -5,30 +5,10 @@ endif()
file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/logs)
-set(RELEASE_SCRIPTS_BATCH_1
- win32_release.cmake # Windows x86
- osx_release.cmake # OS X x86_64
- linux64_release.cmake # Linux x86_64
-)
-
-set(RELEASE_SCRIPTS_BATCH_2
- win64_release.cmake # Windows x64
-)
-
-function(write_batch_shell_script filename)
- set(scripts ${ARGN})
- set(i 0)
- file(WRITE ${filename} "#!/bin/bash")
- foreach(f ${scripts})
- math(EXPR x "420*(${i}/4)")
- math(EXPR y "160*(${i}%4)")
- file(APPEND ${filename}
- "
-\"${CMAKE_COMMAND}\" -DCMAKE_CREATE_VERSION=${CMAKE_CREATE_VERSION} -DCMAKE_DOC_TARBALL=\"${CMAKE_DOC_TARBALL}\" -P \"${CMAKE_ROOT}/Utilities/Release/${f}\" < /dev/null >& \"${CMAKE_CURRENT_SOURCE_DIR}/logs/${f}-${CMAKE_CREATE_VERSION}.log\" &
-xterm -geometry 64x6+${x}+${y} -sb -sl 2000 -T ${f}-${CMAKE_CREATE_VERSION}.log -e tail -f \"${CMAKE_CURRENT_SOURCE_DIR}/logs/${f}-${CMAKE_CREATE_VERSION}.log\" &
+function(write_rel_shell_script filename script)
+ file(WRITE ${filename} "#!/usr/bin/env bash
+\"${CMAKE_COMMAND}\" -DCMAKE_CREATE_VERSION=${CMAKE_CREATE_VERSION} -DCMAKE_DOC_TARBALL=\"${CMAKE_DOC_TARBALL}\" -P \"${CMAKE_CURRENT_LIST_DIR}/${script}.cmake\" < /dev/null 2>&1 | tee \"${CMAKE_CURRENT_SOURCE_DIR}/logs/${script}-${CMAKE_CREATE_VERSION}.log\"
")
- math(EXPR i "${i}+1")
- endforeach()
execute_process(COMMAND chmod a+x ${filename})
endfunction()
@@ -65,12 +45,16 @@ echo 'Failed to create \${name}.tar.gz'
endfunction()
write_docs_shell_script("create-${CMAKE_CREATE_VERSION}-docs.sh")
-write_batch_shell_script("create-${CMAKE_CREATE_VERSION}-batch1.sh" ${RELEASE_SCRIPTS_BATCH_1})
-write_batch_shell_script("create-${CMAKE_CREATE_VERSION}-batch2.sh" ${RELEASE_SCRIPTS_BATCH_2})
-
-message("Run one at a time:
- ./create-${CMAKE_CREATE_VERSION}-docs.sh &&
- ./create-${CMAKE_CREATE_VERSION}-batch1.sh &&
- ./create-${CMAKE_CREATE_VERSION}-batch2.sh &&
+write_rel_shell_script("create-${CMAKE_CREATE_VERSION}-linux64.sh" linux64_release) # Linux x86_64
+write_rel_shell_script("create-${CMAKE_CREATE_VERSION}-macos.sh" osx_release ) # macOS x86_64
+write_rel_shell_script("create-${CMAKE_CREATE_VERSION}-win64.sh" win64_release ) # Windows x64
+write_rel_shell_script("create-${CMAKE_CREATE_VERSION}-win32.sh" win32_release ) # Windows x86
+
+message("Build docs first and then build for each platform:
+ ./create-${CMAKE_CREATE_VERSION}-docs.sh &&
+ ./create-${CMAKE_CREATE_VERSION}-linux64.sh &&
+ ./create-${CMAKE_CREATE_VERSION}-macos.sh &&
+ ./create-${CMAKE_CREATE_VERSION}-win64.sh &&
+ ./create-${CMAKE_CREATE_VERSION}-win32.sh &&
echo done
")
diff --git a/Utilities/cmcurl/CMake/CurlSymbolHiding.cmake b/Utilities/cmcurl/CMake/CurlSymbolHiding.cmake
index 15ba46e..60ee8e6 100644
--- a/Utilities/cmcurl/CMake/CurlSymbolHiding.cmake
+++ b/Utilities/cmcurl/CMake/CurlSymbolHiding.cmake
@@ -53,7 +53,7 @@ elseif(MSVC)
message(WARNING "Hiding private symbols regardless CURL_HIDDEN_SYMBOLS being disabled.")
set(HIDES_CURL_PRIVATE_SYMBOLS TRUE)
endif()
-elseif()
+else()
set(HIDES_CURL_PRIVATE_SYMBOLS FALSE)
endif()