summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.clang-tidy4
-rw-r--r--.gitattributes1
-rw-r--r--CMakeLists.txt3
-rw-r--r--Help/command/file.rst46
-rw-r--r--Help/command/get_filename_component.rst7
-rw-r--r--Help/command/if.rst2
-rw-r--r--Help/command/set.rst9
-rw-r--r--Help/command/try_compile.rst44
-rw-r--r--Help/command/try_run.rst14
-rw-r--r--Help/dev/review.rst19
-rw-r--r--Help/dev/source.rst10
-rw-r--r--Help/envvar/CMAKE_NO_VERBOSE.rst8
-rw-r--r--Help/envvar/VERBOSE.rst10
-rw-r--r--Help/generator/Green Hills MULTI.rst1
-rw-r--r--Help/generator/VS_TOOLSET_HOST_ARCH.txt7
-rw-r--r--Help/generator/Visual Studio 12 2013.rst3
-rw-r--r--Help/generator/Visual Studio 14 2015.rst3
-rw-r--r--Help/generator/Visual Studio 15 2017.rst3
-rw-r--r--Help/generator/Visual Studio 16 2019.rst4
-rw-r--r--Help/generator/Xcode.rst4
-rw-r--r--Help/manual/cmake-env-variables.7.rst2
-rw-r--r--Help/manual/cmake-gui.1.rst9
-rw-r--r--Help/manual/cmake-properties.7.rst1
-rw-r--r--Help/manual/cmake-toolchains.7.rst71
-rw-r--r--Help/manual/cmake-variables.7.rst30
-rw-r--r--Help/manual/cmake.1.rst13
-rw-r--r--Help/policy/CMP0083.rst7
-rw-r--r--Help/prop_tgt/CUDA_RESOLVE_DEVICE_SYMBOLS.rst12
-rw-r--r--Help/prop_tgt/EXCLUDE_FROM_ALL.rst12
-rw-r--r--Help/prop_tgt/GHS_NO_SOURCE_GROUP_FILE.rst13
-rw-r--r--Help/release/3.14.rst381
-rw-r--r--Help/release/dev/0-sample-topic.rst7
-rw-r--r--Help/release/dev/EXCLUDE_FROM_ALL.rst7
-rw-r--r--Help/release/dev/ExternalProject-log-options.rst8
-rw-r--r--Help/release/dev/ExternalProject-non-cmake-source-subdir.rst7
-rw-r--r--Help/release/dev/FindCURL-components.rst5
-rw-r--r--Help/release/dev/FindGDAL-target.rst4
-rw-r--r--Help/release/dev/FindGIF-modernize.rst4
-rw-r--r--Help/release/dev/FindICE-more-exe.rst5
-rw-r--r--Help/release/dev/FindLibLZMA-target.rst4
-rw-r--r--Help/release/dev/FindMatlab-2018a-API.rst7
-rw-r--r--Help/release/dev/FindOctave.rst4
-rw-r--r--Help/release/dev/FindPostgreSQL-target.rst4
-rw-r--r--Help/release/dev/FindPython-NumPy-component.rst5
-rw-r--r--Help/release/dev/FindSQLite3-module.rst4
-rw-r--r--Help/release/dev/FindX11-imported-targets.rst32
-rw-r--r--Help/release/dev/INTERFACE_POSITION_INDEPENDENT_CODE.rst5
-rw-r--r--Help/release/dev/UseSWIG-CMP0086.rst6
-rw-r--r--Help/release/dev/UseSWIG-source-file-ext.rst5
-rw-r--r--Help/release/dev/autogen-origin-depends.rst7
-rw-r--r--Help/release/dev/autogen_executables.rst9
-rw-r--r--Help/release/dev/autogen_global_target.rst8
-rw-r--r--Help/release/dev/better-empty-list-behavior.rst9
-rw-r--r--Help/release/dev/bison_target_policy.rst6
-rw-r--r--Help/release/dev/check-fortran-run.rst6
-rw-r--r--Help/release/dev/check-functions-LINK_OPTIONS.rst5
-rw-r--r--Help/release/dev/cmake_role-global-property.rst6
-rw-r--r--Help/release/dev/cpack-deb-tar-format.rst7
-rw-r--r--Help/release/dev/cppcheck-exit-code.rst6
-rw-r--r--Help/release/dev/ctest-done.rst5
-rw-r--r--Help/release/dev/ctest-show-only-json-v1.rst6
-rw-r--r--Help/release/dev/ctest-submit-url.rst7
-rw-r--r--Help/release/dev/deprecate-findqt.rst8
-rw-r--r--Help/release/dev/deprecate-policy-old.rst8
-rw-r--r--Help/release/dev/file-read_symlink.rst5
-rw-r--r--Help/release/dev/file-size.rst5
-rw-r--r--Help/release/dev/fileapi.rst5
-rw-r--r--Help/release/dev/find-package-resolve-symlinks.rst6
-rw-r--r--Help/release/dev/find_fontconfig.rst6
-rw-r--r--Help/release/dev/find_libinput.rst6
-rw-r--r--Help/release/dev/findgit-imported-target.rst5
-rw-r--r--Help/release/dev/findpython-script.rst6
-rw-r--r--Help/release/dev/fortran-compiler-id.rst5
-rw-r--r--Help/release/dev/genex-in_list-empty-args.rst5
-rw-r--r--Help/release/dev/if-supports-cache-defined.rst5
-rw-r--r--Help/release/dev/install-code-script-genex.rst5
-rw-r--r--Help/release/dev/install-defaults.rst12
-rw-r--r--Help/release/dev/install-subdirectory-order.rst5
-rw-r--r--Help/release/dev/link-option-PIE.rst9
-rw-r--r--Help/release/dev/max-recursion-depth.rst6
-rw-r--r--Help/release/dev/object-library-link.rst5
-rw-r--r--Help/release/dev/rel-win7.rst6
-rw-r--r--Help/release/dev/relative-rpath.rst8
-rw-r--r--Help/release/dev/submit-method.rst6
-rw-r--r--Help/release/dev/try_compile-LINK_OPTIONS.rst5
-rw-r--r--Help/release/dev/vs-debug-utility-targets.rst6
-rw-r--r--Help/release/dev/vs2019.rst13
-rw-r--r--Help/release/index.rst3
-rw-r--r--Help/variable/CMAKE_GENERATOR_TOOLSET.rst4
-rw-r--r--Help/variable/CMAKE_GHS_NO_SOURCE_GROUP_FILE.rst6
-rw-r--r--Help/variable/CMAKE_HOME_DIRECTORY.rst7
-rw-r--r--Help/variable/CMAKE_LANG_COMPILER_ID.rst2
-rw-r--r--Help/variable/CMAKE_LANG_CREATE_SHARED_LIBRARY.rst3
-rw-r--r--Help/variable/CMAKE_LANG_CREATE_SHARED_MODULE.rst3
-rw-r--r--Help/variable/CMAKE_LANG_IMPLICIT_INCLUDE_DIRECTORIES.rst7
-rw-r--r--Help/variable/CMAKE_Swift_LANGUAGE_VERSION.rst8
-rw-r--r--Help/variable/CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE.rst10
-rw-r--r--Help/variable/MSYS.rst4
-rw-r--r--Modules/CMakeDetermineASMCompiler.cmake2
-rw-r--r--Modules/CMakeDetermineCCompiler.cmake2
-rw-r--r--Modules/CMakeDetermineCXXCompiler.cmake2
-rw-r--r--Modules/CMakeDetermineCompilerABI.cmake14
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake28
-rw-r--r--Modules/CMakeDetermineVSServicePack.cmake2
-rw-r--r--Modules/CMakeFortranCompiler.cmake.in1
-rw-r--r--Modules/CMakeParseImplicitIncludeInfo.cmake154
-rw-r--r--Modules/CMakeTestCCompiler.cmake8
-rw-r--r--Modules/CMakeTestCXXCompiler.cmake8
-rw-r--r--Modules/CPack.background.png.inbin47076 -> 44108 bytes
-rw-r--r--Modules/CPackIFW.cmake2
-rw-r--r--Modules/CheckCXXSourceRuns.cmake7
-rw-r--r--Modules/CheckFortranSourceRuns.cmake7
-rw-r--r--Modules/Compiler/Cray-CXX.cmake2
-rw-r--r--Modules/Compiler/CrayPrgEnv-C.cmake6
-rw-r--r--Modules/Compiler/CrayPrgEnv-CXX.cmake6
-rw-r--r--Modules/Compiler/CrayPrgEnv-Cray-C.cmake7
-rw-r--r--Modules/Compiler/CrayPrgEnv-Cray-CXX.cmake7
-rw-r--r--Modules/Compiler/CrayPrgEnv-Cray-Fortran.cmake7
-rw-r--r--Modules/Compiler/CrayPrgEnv-Fortran.cmake6
-rw-r--r--Modules/Compiler/CrayPrgEnv-GNU-C.cmake7
-rw-r--r--Modules/Compiler/CrayPrgEnv-GNU-CXX.cmake7
-rw-r--r--Modules/Compiler/CrayPrgEnv-GNU-Fortran.cmake7
-rw-r--r--Modules/Compiler/CrayPrgEnv-Intel-C.cmake7
-rw-r--r--Modules/Compiler/CrayPrgEnv-Intel-CXX.cmake7
-rw-r--r--Modules/Compiler/CrayPrgEnv-Intel-Fortran.cmake7
-rw-r--r--Modules/Compiler/CrayPrgEnv-PGI-C.cmake7
-rw-r--r--Modules/Compiler/CrayPrgEnv-PGI-CXX.cmake7
-rw-r--r--Modules/Compiler/CrayPrgEnv-PGI-Fortran.cmake7
-rw-r--r--Modules/Compiler/CrayPrgEnv.cmake57
-rw-r--r--Modules/Compiler/Flang-Fortran.cmake3
-rw-r--r--Modules/Compiler/GNU-Fortran.cmake3
-rw-r--r--Modules/Compiler/Intel-CXX-FeatureTests.cmake2
-rw-r--r--Modules/Compiler/Intel-Fortran.cmake3
-rw-r--r--Modules/Compiler/PGI-Fortran.cmake3
-rw-r--r--Modules/Compiler/XL-Fortran.cmake3
-rw-r--r--Modules/CompilerId/Xcode-3.pbxproj.in4
-rw-r--r--Modules/ExternalProject.cmake3
-rw-r--r--Modules/FetchContent.cmake284
-rw-r--r--Modules/FindBLAS.cmake119
-rw-r--r--Modules/FindBoost.cmake8
-rw-r--r--Modules/FindDoxygen.cmake4
-rw-r--r--Modules/FindHDF5.cmake140
-rw-r--r--Modules/FindLAPACK.cmake88
-rw-r--r--Modules/FindLibXml2.cmake2
-rw-r--r--Modules/FindMatlab.cmake4
-rw-r--r--Modules/FindOctave.cmake14
-rw-r--r--Modules/FindPythonInterp.cmake14
-rw-r--r--Modules/FindXalanC.cmake2
-rw-r--r--Modules/FindXercesC.cmake2
-rw-r--r--Modules/Platform/Darwin-Initialize.cmake8
-rw-r--r--Modules/Platform/Darwin.cmake10
-rw-r--r--Modules/Platform/UnixPaths.cmake28
-rw-r--r--Modules/Platform/Windows-Intel-C.cmake2
-rw-r--r--Modules/Platform/Windows-Intel-CXX.cmake2
-rw-r--r--Modules/Platform/iOS-Determine-CXX.cmake1
-rw-r--r--Modules/Platform/iOS-Initialize.cmake7
-rw-r--r--Modules/Platform/iOS.cmake1
-rw-r--r--Modules/Platform/tvOS-Determine-CXX.cmake1
-rw-r--r--Modules/Platform/tvOS-Initialize.cmake7
-rw-r--r--Modules/Platform/tvOS.cmake1
-rw-r--r--Modules/Platform/watchOS-Determine-CXX.cmake1
-rw-r--r--Modules/Platform/watchOS-Initialize.cmake7
-rw-r--r--Modules/Platform/watchOS.cmake1
-rw-r--r--Modules/UseJava.cmake294
-rw-r--r--Source/CMakeLists.txt3
-rw-r--r--Source/CMakeVersion.cmake6
-rw-r--r--Source/CPack/IFW/cmCPackIFWGenerator.cxx4
-rw-r--r--Source/CPack/IFW/cmCPackIFWInstaller.cxx7
-rw-r--r--Source/CPack/IFW/cmCPackIFWPackage.cxx4
-rw-r--r--Source/CPack/cmCPack7zGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackArchiveGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackBundleGenerator.cxx8
-rw-r--r--Source/CPack/cmCPackDebGenerator.cxx8
-rw-r--r--Source/CPack/cmCPackDragNDropGenerator.cxx7
-rw-r--r--Source/CPack/cmCPackFreeBSDGenerator.cxx6
-rw-r--r--Source/CPack/cmCPackGenerator.cxx16
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackOSXX11Generator.cxx8
-rw-r--r--Source/CPack/cmCPackPKGGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackPackageMakerGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackProductBuildGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackRPMGenerator.cxx8
-rw-r--r--Source/CPack/cmCPackSTGZGenerator.cxx8
-rw-r--r--Source/CPack/cmCPackTGZGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackTXZGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackTarBZip2Generator.cxx4
-rw-r--r--Source/CPack/cmCPackTarCompressGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackZIPGenerator.cxx4
-rw-r--r--Source/CPack/cpack.cxx8
-rw-r--r--Source/CTest/cmCTestBZR.cxx4
-rw-r--r--Source/CTest/cmCTestBuildAndTestHandler.cxx47
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx5
-rw-r--r--Source/CTest/cmCTestCVS.cxx4
-rw-r--r--Source/CTest/cmCTestConfigureHandler.cxx4
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx4
-rw-r--r--Source/CTest/cmCTestGIT.cxx5
-rw-r--r--Source/CTest/cmCTestGenericHandler.cxx4
-rw-r--r--Source/CTest/cmCTestGlobalVC.cxx4
-rw-r--r--Source/CTest/cmCTestHG.cxx4
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx5
-rw-r--r--Source/CTest/cmCTestP4.cxx4
-rw-r--r--Source/CTest/cmCTestRunTest.h2
-rw-r--r--Source/CTest/cmCTestSVN.cxx4
-rw-r--r--Source/CTest/cmCTestScriptHandler.cxx17
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx6
-rw-r--r--Source/CTest/cmCTestUpdateHandler.cxx4
-rw-r--r--Source/CTest/cmCTestVC.cxx4
-rw-r--r--Source/CTest/cmParseBlanketJSCoverage.cxx2
-rw-r--r--Source/CTest/cmParseCoberturaCoverage.cxx17
-rw-r--r--Source/CTest/cmParseDelphiCoverage.cxx2
-rw-r--r--Source/CTest/cmParseJacocoCoverage.cxx5
-rw-r--r--Source/CTest/cmParseMumpsCoverage.cxx4
-rw-r--r--Source/CTest/cmProcess.cxx4
-rw-r--r--Source/CursesDialog/ccmake.cxx12
-rw-r--r--Source/CursesDialog/cmCursesBoolWidget.h5
-rw-r--r--Source/CursesDialog/cmCursesCacheEntryComposite.h7
-rw-r--r--Source/CursesDialog/cmCursesDummyWidget.h5
-rw-r--r--Source/CursesDialog/cmCursesFilePathWidget.h5
-rw-r--r--Source/CursesDialog/cmCursesForm.h5
-rw-r--r--Source/CursesDialog/cmCursesLabelWidget.cxx4
-rw-r--r--Source/CursesDialog/cmCursesLabelWidget.h5
-rw-r--r--Source/CursesDialog/cmCursesLongMessageForm.h5
-rw-r--r--Source/CursesDialog/cmCursesMainForm.cxx22
-rw-r--r--Source/CursesDialog/cmCursesMainForm.h8
-rw-r--r--Source/CursesDialog/cmCursesOptionsWidget.h5
-rw-r--r--Source/CursesDialog/cmCursesPathWidget.h5
-rw-r--r--Source/CursesDialog/cmCursesStringWidget.h5
-rw-r--r--Source/CursesDialog/cmCursesWidget.h5
-rw-r--r--Source/LexerParser/cmListFileLexer.c2
-rw-r--r--Source/LexerParser/cmListFileLexer.in.l2
-rw-r--r--Source/QtDialog/CMakeSetup.cxx55
-rw-r--r--Source/QtDialog/CMakeSetup128.pngbin10944 -> 7981 bytes
-rw-r--r--Source/QtDialog/CMakeSetup32.pngbin2097 -> 1632 bytes
-rw-r--r--Source/QtDialog/CMakeSetup64.pngbin4676 -> 3566 bytes
-rw-r--r--Source/QtDialog/Delete16.pngbin731 -> 538 bytes
-rw-r--r--Source/QtDialog/FirstConfigure.cxx20
-rw-r--r--Source/QtDialog/Plus16.pngbin358 -> 207 bytes
-rw-r--r--Source/QtDialog/QCMake.cxx50
-rw-r--r--Source/QtDialog/QCMake.h12
-rw-r--r--Source/QtDialog/QCMakeCacheView.cxx4
-rw-r--r--Source/cmAlgorithms.h8
-rw-r--r--Source/cmBase32.cxx8
-rw-r--r--Source/cmCLocaleEnvironmentScope.h6
-rw-r--r--Source/cmCPackPropertiesGenerator.h6
-rw-r--r--Source/cmCPluginAPI.cxx1
-rw-r--r--Source/cmCTest.h2
-rw-r--r--Source/cmCacheManager.h1
-rw-r--r--Source/cmCallVisualStudioMacro.cxx4
-rw-r--r--Source/cmCommand.h9
-rw-r--r--Source/cmCommandArgumentParserHelper.h6
-rw-r--r--Source/cmCommandArgumentsHelper.h8
-rw-r--r--Source/cmCommonTargetGenerator.cxx6
-rw-r--r--Source/cmComputeComponentGraph.cxx4
-rw-r--r--Source/cmComputeLinkDepends.h8
-rw-r--r--Source/cmComputeLinkInformation.cxx2
-rw-r--r--Source/cmComputeLinkInformation.h2
-rw-r--r--Source/cmComputeTargetDepends.cxx4
-rw-r--r--Source/cmConfigure.cmake.h.in4
-rw-r--r--Source/cmConnection.cxx4
-rw-r--r--Source/cmConnection.h7
-rw-r--r--Source/cmCoreTryCompile.cxx2
-rw-r--r--Source/cmCryptoHash.h5
-rw-r--r--Source/cmDefinitions.h2
-rw-r--r--Source/cmDepends.cxx8
-rw-r--r--Source/cmDepends.h5
-rw-r--r--Source/cmDependsC.cxx13
-rw-r--r--Source/cmDependsC.h6
-rw-r--r--Source/cmDependsFortran.cxx15
-rw-r--r--Source/cmDependsFortran.h9
-rw-r--r--Source/cmDependsJava.cxx8
-rw-r--r--Source/cmDependsJava.h5
-rw-r--r--Source/cmDocumentation.h1
-rw-r--r--Source/cmDocumentationEntry.h2
-rw-r--r--Source/cmDocumentationFormatter.cxx8
-rw-r--r--Source/cmDynamicLoader.cxx4
-rw-r--r--Source/cmDynamicLoader.h6
-rw-r--r--Source/cmExecutionStatus.h2
-rw-r--r--Source/cmExpandedCommandArgument.cxx4
-rw-r--r--Source/cmExportFileGenerator.h2
-rw-r--r--Source/cmExprParserHelper.cxx4
-rw-r--r--Source/cmExternalMakefileProjectGenerator.cxx4
-rw-r--r--Source/cmExternalMakefileProjectGenerator.h2
-rw-r--r--Source/cmExtraCodeBlocksGenerator.cxx6
-rw-r--r--Source/cmExtraCodeLiteGenerator.cxx2
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx2
-rw-r--r--Source/cmExtraKateGenerator.cxx6
-rw-r--r--Source/cmFLTKWrapUICommand.cxx2
-rw-r--r--Source/cmFileAPICodemodel.cxx4
-rw-r--r--Source/cmFileCommand.cxx6
-rw-r--r--Source/cmFileLock.h5
-rw-r--r--Source/cmFileLockPool.cxx8
-rw-r--r--Source/cmFileLockPool.h10
-rw-r--r--Source/cmFileLockUnix.cxx4
-rw-r--r--Source/cmFileMonitor.cxx6
-rw-r--r--Source/cmFileMonitor.h4
-rw-r--r--Source/cmFilePathChecksum.cxx4
-rw-r--r--Source/cmFileTimeComparison.cxx27
-rw-r--r--Source/cmFileTimeComparison.h7
-rw-r--r--Source/cmFindCommon.cxx4
-rw-r--r--Source/cmFindLibraryCommand.cxx1
-rw-r--r--Source/cmFindPackageCommand.cxx14
-rw-r--r--Source/cmFindPackageCommand.h2
-rw-r--r--Source/cmFortranParser.h16
-rw-r--r--Source/cmFortranParserImpl.cxx29
-rw-r--r--Source/cmFunctionBlocker.h2
-rw-r--r--Source/cmFunctionCommand.cxx5
-rw-r--r--Source/cmFunctionCommand.h4
-rw-r--r--Source/cmGeneratedFileStream.cxx4
-rw-r--r--Source/cmGeneratedFileStream.h5
-rw-r--r--Source/cmGeneratorExpression.cxx4
-rw-r--r--Source/cmGeneratorExpression.h22
-rw-r--r--Source/cmGeneratorExpressionDAGChecker.cxx10
-rw-r--r--Source/cmGeneratorExpressionEvaluator.h12
-rw-r--r--Source/cmGeneratorExpressionLexer.cxx4
-rw-r--r--Source/cmGeneratorExpressionNode.cxx102
-rw-r--r--Source/cmGeneratorExpressionNode.h2
-rw-r--r--Source/cmGeneratorTarget.cxx26
-rw-r--r--Source/cmGeneratorTarget.h10
-rw-r--r--Source/cmGetFilenameComponentCommand.cxx4
-rw-r--r--Source/cmGhsMultiTargetGenerator.cxx13
-rw-r--r--Source/cmGlobVerificationManager.h4
-rw-r--r--Source/cmGlobalBorlandMakefileGenerator.cxx2
-rw-r--r--Source/cmGlobalBorlandMakefileGenerator.h2
-rw-r--r--Source/cmGlobalCommonGenerator.cxx4
-rw-r--r--Source/cmGlobalGenerator.cxx49
-rw-r--r--Source/cmGlobalGenerator.h56
-rw-r--r--Source/cmGlobalGeneratorFactory.h2
-rw-r--r--Source/cmGlobalGhsMultiGenerator.cxx25
-rw-r--r--Source/cmGlobalGhsMultiGenerator.h2
-rw-r--r--Source/cmGlobalJOMMakefileGenerator.cxx2
-rw-r--r--Source/cmGlobalJOMMakefileGenerator.h2
-rw-r--r--Source/cmGlobalNMakeMakefileGenerator.cxx2
-rw-r--r--Source/cmGlobalNMakeMakefileGenerator.h2
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx40
-rw-r--r--Source/cmGlobalNinjaGenerator.h10
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx43
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.h3
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx62
-rw-r--r--Source/cmGlobalVisualStudio10Generator.h4
-rw-r--r--Source/cmGlobalVisualStudio12Generator.cxx4
-rw-r--r--Source/cmGlobalVisualStudio14Generator.cxx13
-rw-r--r--Source/cmGlobalVisualStudio14Generator.h3
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx36
-rw-r--r--Source/cmGlobalVisualStudio7Generator.h2
-rw-r--r--Source/cmGlobalVisualStudioGenerator.cxx40
-rw-r--r--Source/cmGlobalVisualStudioVersionedGenerator.cxx48
-rw-r--r--Source/cmGlobalWatcomWMakeGenerator.cxx2
-rw-r--r--Source/cmGlobalWatcomWMakeGenerator.h2
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx100
-rw-r--r--Source/cmGlobalXCodeGenerator.h9
-rw-r--r--Source/cmIDEFlagTable.h3
-rw-r--r--Source/cmIDEOptions.cxx2
-rw-r--r--Source/cmIDEOptions.h12
-rw-r--r--Source/cmIfCommand.h13
-rw-r--r--Source/cmInstallCommand.cxx2
-rw-r--r--Source/cmInstallCommandArguments.cxx4
-rw-r--r--Source/cmInstallCommandArguments.h1
-rw-r--r--Source/cmInstallDirectoryGenerator.cxx4
-rw-r--r--Source/cmInstallFilesGenerator.cxx4
-rw-r--r--Source/cmInstallGenerator.cxx4
-rw-r--r--Source/cmInstallGenerator.h5
-rw-r--r--Source/cmInstallScriptGenerator.cxx4
-rw-r--r--Source/cmInstallSubdirectoryGenerator.cxx4
-rw-r--r--Source/cmInstallTargetGenerator.cxx65
-rw-r--r--Source/cmInstallTargetGenerator.h1
-rw-r--r--Source/cmInstalledFile.cxx8
-rw-r--r--Source/cmJsonObjects.cxx4
-rw-r--r--Source/cmLinkItem.cxx4
-rw-r--r--Source/cmLinkItem.h4
-rw-r--r--Source/cmLinkLineComputer.cxx4
-rw-r--r--Source/cmLinkLineComputer.h5
-rw-r--r--Source/cmLinkLineDeviceComputer.cxx4
-rw-r--r--Source/cmLinkLineDeviceComputer.h12
-rw-r--r--Source/cmListCommand.cxx4
-rw-r--r--Source/cmListFileCache.cxx8
-rw-r--r--Source/cmListFileCache.h16
-rw-r--r--Source/cmLocalCommonGenerator.cxx6
-rw-r--r--Source/cmLocalGenerator.cxx237
-rw-r--r--Source/cmLocalGenerator.h46
-rw-r--r--Source/cmLocalNinjaGenerator.cxx13
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx30
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.h6
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx10
-rw-r--r--Source/cmLocalVisualStudioGenerator.cxx7
-rw-r--r--Source/cmLocalXCodeGenerator.cxx4
-rw-r--r--Source/cmLocale.h6
-rw-r--r--Source/cmMSVC60LinkLineComputer.h6
-rw-r--r--Source/cmMachO.cxx2
-rw-r--r--Source/cmMacroCommand.cxx5
-rw-r--r--Source/cmMacroCommand.h4
-rw-r--r--Source/cmMakefile.cxx17
-rw-r--r--Source/cmMakefile.h10
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx8
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx23
-rw-r--r--Source/cmMakefileTargetGenerator.cxx2
-rw-r--r--Source/cmMessageCommand.cxx2
-rw-r--r--Source/cmMessenger.cxx4
-rw-r--r--Source/cmNewLineStyle.cxx4
-rw-r--r--Source/cmNinjaLinkLineComputer.h5
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx29
-rw-r--r--Source/cmNinjaTargetGenerator.cxx34
-rw-r--r--Source/cmNinjaUtilityTargetGenerator.cxx4
-rw-r--r--Source/cmOSXBundleGenerator.h2
-rw-r--r--Source/cmOrderDirectories.cxx2
-rw-r--r--Source/cmOutputConverter.cxx12
-rw-r--r--Source/cmOutputConverter.h10
-rw-r--r--Source/cmOutputRequiredFilesCommand.cxx2
-rw-r--r--Source/cmProcessOutput.cxx4
-rw-r--r--Source/cmProcessTools.h2
-rw-r--r--Source/cmQTWrapCPPCommand.cxx2
-rw-r--r--Source/cmQTWrapUICommand.cxx2
-rw-r--r--Source/cmQtAutoGenGlobalInitializer.cxx68
-rw-r--r--Source/cmQtAutoGenGlobalInitializer.h6
-rw-r--r--Source/cmQtAutoGenInitializer.cxx273
-rw-r--r--Source/cmQtAutoGenInitializer.h7
-rw-r--r--Source/cmQtAutoGenerator.h7
-rw-r--r--Source/cmQtAutoGeneratorMocUic.cxx53
-rw-r--r--Source/cmQtAutoGeneratorMocUic.h28
-rw-r--r--Source/cmQtAutoGeneratorRcc.cxx9
-rw-r--r--Source/cmQtAutoGeneratorRcc.h4
-rw-r--r--Source/cmScriptGenerator.cxx4
-rw-r--r--Source/cmScriptGenerator.h7
-rw-r--r--Source/cmSearchPath.cxx4
-rw-r--r--Source/cmServer.cxx26
-rw-r--r--Source/cmServer.h12
-rw-r--r--Source/cmServerConnection.cxx4
-rw-r--r--Source/cmServerProtocol.cxx13
-rw-r--r--Source/cmServerProtocol.h5
-rw-r--r--Source/cmSetCommand.cxx19
-rw-r--r--Source/cmSourceFile.cxx149
-rw-r--r--Source/cmSourceFile.h12
-rw-r--r--Source/cmSourceFileLocation.cxx14
-rw-r--r--Source/cmSourceFileLocation.h9
-rw-r--r--Source/cmState.cxx13
-rw-r--r--Source/cmState.h2
-rw-r--r--Source/cmStateDirectory.cxx9
-rw-r--r--Source/cmStateDirectory.h3
-rw-r--r--Source/cmStringReplaceHelper.h2
-rw-r--r--Source/cmSystemTools.cxx66
-rw-r--r--Source/cmSystemTools.h42
-rw-r--r--Source/cmTarget.cxx6
-rw-r--r--Source/cmTest.cxx4
-rw-r--r--Source/cmTestGenerator.cxx4
-rw-r--r--Source/cmTestGenerator.h5
-rw-r--r--Source/cmTimestamp.h2
-rw-r--r--Source/cmUVHandlePtr.h7
-rw-r--r--Source/cmUseMangledMesaCommand.cxx2
-rw-r--r--Source/cmUtilitySourceCommand.cxx2
-rw-r--r--Source/cmVSSetupHelper.cxx10
-rw-r--r--Source/cmVSSetupHelper.h2
-rw-r--r--Source/cmVariableWatch.cxx8
-rw-r--r--Source/cmVariableWatch.h1
-rw-r--r--Source/cmVariableWatchCommand.cxx4
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx51
-rw-r--r--Source/cmVisualStudio10TargetGenerator.h8
-rw-r--r--Source/cmVisualStudio10ToolsetOptions.cxx22
-rw-r--r--Source/cmXMLWriter.h5
-rw-r--r--Source/cm_codecvt.cxx4
-rw-r--r--Source/cm_thread.hxx12
-rw-r--r--Source/cmake.cxx52
-rw-r--r--Source/cmake.h31
-rw-r--r--Source/cmakemain.cxx52
-rw-r--r--Source/cmcmd.cxx41
-rw-r--r--Source/kwsys/CMakeLists.txt25
-rw-r--r--Source/kwsys/SystemInformation.cxx3
-rw-r--r--Source/kwsys/kwsysPlatformTests.cmake5
-rw-r--r--Templates/MSBuild/FlagTables/v10_CSharp.json10
-rw-r--r--Templates/MSBuild/FlagTables/v11_CSharp.json10
-rw-r--r--Templates/MSBuild/FlagTables/v12_CSharp.json10
-rw-r--r--Templates/MSBuild/FlagTables/v140_CSharp.json10
-rw-r--r--Templates/MSBuild/FlagTables/v141_CSharp.json10
-rw-r--r--Templates/MSBuild/FlagTables/v142_CL.json1212
-rw-r--r--Templates/MSBuild/FlagTables/v142_Link.json1323
-rw-r--r--Templates/Windows/ApplicationIcon.pngbin3392 -> 2335 bytes
-rw-r--r--Templates/Windows/Logo.pngbin801 -> 488 bytes
-rw-r--r--Templates/Windows/SmallLogo.pngbin329 -> 167 bytes
-rw-r--r--Templates/Windows/SmallLogo44x44.pngbin554 -> 265 bytes
-rw-r--r--Templates/Windows/SplashScreen.pngbin2146 -> 909 bytes
-rw-r--r--Templates/Windows/StoreLogo.pngbin429 -> 227 bytes
-rw-r--r--Tests/CMakeLists.txt37
-rw-r--r--Tests/CMakeTests/FileDownloadInput.pngbin358 -> 194 bytes
-rw-r--r--Tests/CMakeTests/FileDownloadTest.cmake.in16
-rw-r--r--Tests/CMakeTests/FileUploadTest.cmake.in4
-rw-r--r--Tests/CudaOnly/CMakeLists.txt11
-rw-r--r--Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt50
-rw-r--r--Tests/CudaOnly/DontResolveDeviceSymbols/file1.cu69
-rw-r--r--Tests/CudaOnly/DontResolveDeviceSymbols/main.cu7
-rw-r--r--Tests/CudaOnly/DontResolveDeviceSymbols/verify.cmake14
-rw-r--r--Tests/ExternalProjectLocal/CMakeLists.txt129
-rw-r--r--Tests/ExternalProjectLocal/Step5/CMakeLists.txt71
-rw-r--r--Tests/ExternalProjectLocal/Step5/MathFunctions/CMakeLists.txt17
-rw-r--r--Tests/ExternalProjectLocal/Step5/MathFunctions/MakeTable.cxx32
-rw-r--r--Tests/ExternalProjectLocal/Step5/MathFunctions/MathFunctions.h1
-rw-r--r--Tests/ExternalProjectLocal/Step5/MathFunctions/mysqrt.cxx40
-rw-r--r--Tests/ExternalProjectLocal/Step5/TutorialConfig.h.in8
-rw-r--r--Tests/ExternalProjectLocal/Step5/tutorial.cxx33
-rw-r--r--Tests/FindOctave/Test/CMakeLists.txt4
-rw-r--r--Tests/FindOctave/Test/interp_main.cpp26
-rw-r--r--Tests/Fortran/CMakeLists.txt5
-rw-r--r--Tests/InterfaceLibrary/CMakeLists.txt1
-rw-r--r--Tests/InterfaceLibrary/excluded/CMakeLists.txt1
-rw-r--r--Tests/QtAutogen/MocOsMacros/TestClass.cpp5
-rw-r--r--Tests/QtAutogen/MocOsMacros/TestClass.hpp5
-rw-r--r--Tests/QtAutogen/SameName/CMakeLists.txt4
-rw-r--r--Tests/QtAutogen/SameName/main.cpp13
-rw-r--r--Tests/QtAutogen/SameName/object.h13
-rw-r--r--Tests/QtAutogen/SameName/object.h++13
-rw-r--r--Tests/QtAutogen/SameName/object.hpp13
-rw-r--r--Tests/QtAutogen/SameName/object.hxx13
-rw-r--r--Tests/QtAutogen/Tests.cmake3
-rw-r--r--Tests/RunCMake/Autogen/QtInFunction.cmake13
-rw-r--r--Tests/RunCMake/Autogen/QtInFunctionNested-stderr.txt8
-rw-r--r--Tests/RunCMake/Autogen/QtInFunctionNested.cmake17
-rw-r--r--Tests/RunCMake/Autogen/QtInFunctionProperty.cmake21
-rw-r--r--Tests/RunCMake/Autogen/RunCMakeTest.cmake5
-rw-r--r--Tests/RunCMake/CMakeLists.txt11
-rw-r--r--Tests/RunCMake/CommandLine/E_compare_files-different-eol-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_compare_files-different-eol-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_compare_files-ignore-eol-nonexistent-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_compare_files-ignore-eol-nonexistent-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/CommandLine/compare_files/.gitattributes2
-rw-r--r--Tests/RunCMake/CommandLine/compare_files/crlf1
-rw-r--r--Tests/RunCMake/CommandLine/compare_files/empty10
-rw-r--r--Tests/RunCMake/CommandLine/compare_files/empty20
-rw-r--r--Tests/RunCMake/CommandLine/compare_files/lf1
-rw-r--r--Tests/RunCMake/FetchContent/MakeAvailable-stdout.txt2
-rw-r--r--Tests/RunCMake/FetchContent/MakeAvailable.cmake20
-rw-r--r--Tests/RunCMake/FetchContent/MakeAvailableTwice-stdout.txt4
-rw-r--r--Tests/RunCMake/FetchContent/MakeAvailableTwice.cmake12
-rw-r--r--Tests/RunCMake/FetchContent/MakeAvailableUndeclared-result.txt1
-rw-r--r--Tests/RunCMake/FetchContent/MakeAvailableUndeclared-stderr.txt1
-rw-r--r--Tests/RunCMake/FetchContent/MakeAvailableUndeclared.cmake3
-rw-r--r--Tests/RunCMake/FetchContent/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/FetchContent/WithProject/CMakeLists.txt5
-rw-r--r--Tests/RunCMake/FetchContent/WithoutProject/confirmMessage.cmake1
-rw-r--r--Tests/RunCMake/Framework/InstallBeforeFramework-stderr.txt7
-rw-r--r--Tests/RunCMake/Framework/InstallBeforeFramework.cmake5
-rw-r--r--Tests/RunCMake/Framework/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/GeneratorExpression/GENEX_EVAL-recursion2-stderr.txt6
-rw-r--r--Tests/RunCMake/GeneratorExpression/GENEX_EVAL.cmake3
-rw-r--r--Tests/RunCMake/GeneratorToolset/BadToolsetHostArchTwice-stderr.txt2
-rw-r--r--Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake8
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone-stdout.txt2
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone.cmake13
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x64-stdout.txt (renamed from Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly-stdout.txt)0
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x64.cmake (renamed from Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly.cmake)0
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x86-stdout.txt2
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x86.cmake2
-rw-r--r--Tests/RunCMake/Make/RunCMakeTest.cmake17
-rw-r--r--Tests/RunCMake/Make/VerboseBuild-build-stdout.txt1
-rw-r--r--Tests/RunCMake/Make/VerboseBuild-build-watcom-stdout.txt1
-rw-r--r--Tests/RunCMake/Make/VerboseBuild-nowork-gnu-stdout.txt1
-rw-r--r--Tests/RunCMake/Make/VerboseBuild.cmake8
-rw-r--r--Tests/RunCMake/Make/hello.c7
-rw-r--r--Tests/RunCMake/Ninja/RunCMakeTest.cmake9
-rw-r--r--Tests/RunCMake/Ninja/VerboseBuild-build-stdout.txt1
-rw-r--r--Tests/RunCMake/Ninja/VerboseBuild-nowork-stdout.txt1
-rw-r--r--Tests/RunCMake/Ninja/VerboseBuild.cmake3
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/ParseImplicitIncludeInfo.cmake24
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/README15
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-C-XL-13.1.3.input40
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-C-XL-13.1.3.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-CXX-XL-13.1.3.input44
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-CXX-XL-13.1.3.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-8.7.input52
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-8.7.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-GNU-7.3.0.input83
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-GNU-7.3.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Intel-18.0.2.20180210.input80
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Intel-18.0.2.20180210.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-C-AppleClang-8.0.0.8000042.input44
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-C-AppleClang-8.0.0.8000042.output0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-CXX-AppleClang-8.0.0.8000042.input44
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-CXX-AppleClang-8.0.0.8000042.output0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-Fortran-GNU-4.6.4.input78
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-Fortran-GNU-4.6.4.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-PGI-18.10.1.input36
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-PGI-18.10.1.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-12.1.0.input42
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-12.1.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-16.1.0.0.input40
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-16.1.0.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-PGI-18.10.1.input40
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-PGI-18.10.1.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-12.1.0.input42
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-12.1.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-16.1.0.0.input40
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-16.1.0.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-GNU-7.3.0.input76
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-GNU-7.3.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-PGI-18.10.1.input47
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-PGI-18.10.1.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-XL-14.1.0.input50
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-XL-14.1.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-PGI-18.10.1.input36
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-PGI-18.10.1.output0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-XL-12.1.0.input42
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-XL-12.1.0.output0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-PGI-18.10.1.input40
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-PGI-18.10.1.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-XL-12.1.0.input42
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-XL-12.1.0.output0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-Fortran-PGI-18.10.1.input47
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-Fortran-PGI-18.10.1.output0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-C-XL-12.1.0.input42
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-C-XL-12.1.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-CXX-XL-12.1.0.input42
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-CXX-XL-12.1.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_pgf77-Fortran-PGI-18.10.1.input35
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_pgf77-Fortran-PGI-18.10.1.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-C-GNU-4.8.5.input58
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-C-GNU-4.8.5.output0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-CXX-GNU-4.8.5.input58
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-CXX-GNU-4.8.5.output0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-C-SunPro-5.13.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-CXX-SunPro-5.13.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-Fortran-SunPro-8.8.0.input40
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-Fortran-SunPro-8.8.0.output1
-rw-r--r--Tests/RunCMake/VS10Project/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/VS10Project/VsCSharpCompilerOpts-check.cmake64
-rw-r--r--Tests/RunCMake/VS10Project/VsCSharpCompilerOpts.cmake14
-rw-r--r--Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy-check.cmake8
-rw-r--r--Tests/RunCMake/XcodeProject/DeploymentTarget.cmake13
-rw-r--r--Tests/RunCMake/XcodeProject/RunCMakeTest.cmake110
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeBundles.cmake23
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeIOSInstallCombined.cmake6
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedPrune.cmake6
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedSingleArch.cmake6
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeInstallIOS.cmake3
-rw-r--r--Tests/RunCMake/get_filename_component/KnownComponents.cmake4
-rw-r--r--Tests/RunCMake/install/TARGETS-OPTIONAL-stderr.txt1
-rw-r--r--Tests/RunCMake/set/ExtraEnvValue-stderr.txt6
-rw-r--r--Tests/RunCMake/set/ExtraEnvValue.cmake1
-rw-r--r--Tests/RunCMake/set/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/set/UnknownCacheType-stderr.txt5
-rw-r--r--Tests/RunCMake/set/UnknownCacheType.cmake1
-rw-r--r--Tests/SwiftOnly/CMakeLists.txt4
-rw-r--r--Tests/TryCompile/CMakeLists.txt29
-rw-r--r--Tests/TryCompile/check_a_b.c10
-rw-r--r--Tests/Tutorial/Complete/CMakeLists.txt116
-rw-r--r--Tests/Tutorial/Complete/Config.cmake.in4
-rw-r--r--Tests/Tutorial/Complete/License.txt (renamed from Tests/Tutorial/Step6/License.txt)2
-rw-r--r--Tests/Tutorial/Complete/MathFunctions/CMakeLists.txt68
-rw-r--r--Tests/Tutorial/Complete/MathFunctions/MakeTable.cxx25
-rw-r--r--Tests/Tutorial/Complete/MathFunctions/MathFunctions.cxx18
-rw-r--r--Tests/Tutorial/Complete/MathFunctions/MathFunctions.h14
-rw-r--r--Tests/Tutorial/Complete/MathFunctions/mysqrt.cxx45
-rw-r--r--Tests/Tutorial/Complete/MathFunctions/mysqrt.h6
-rw-r--r--Tests/Tutorial/Complete/TutorialConfig.h.in3
-rw-r--r--Tests/Tutorial/Complete/tutorial.cxx25
-rw-r--r--Tests/Tutorial/Consumer/CMakeLists.txt51
-rw-r--r--Tests/Tutorial/Consumer/Config.cmake.in14
-rw-r--r--Tests/Tutorial/Consumer/consumer.cxx11
-rw-r--r--Tests/Tutorial/Consumer/directions.txt6
-rw-r--r--Tests/Tutorial/MultiPackage/CMakeLists.txt109
-rw-r--r--Tests/Tutorial/MultiPackage/Config.cmake.in4
-rw-r--r--Tests/Tutorial/MultiPackage/License.txt2
-rw-r--r--Tests/Tutorial/MultiPackage/MathFunctions/CMakeLists.txt68
-rw-r--r--Tests/Tutorial/MultiPackage/MathFunctions/MakeTable.cxx25
-rw-r--r--Tests/Tutorial/MultiPackage/MathFunctions/MathFunctions.cxx18
-rw-r--r--Tests/Tutorial/MultiPackage/MathFunctions/MathFunctions.h14
-rw-r--r--Tests/Tutorial/MultiPackage/MathFunctions/mysqrt.cxx45
-rw-r--r--Tests/Tutorial/MultiPackage/MathFunctions/mysqrt.h6
-rw-r--r--Tests/Tutorial/MultiPackage/MultiCPackConfig.cmake7
-rw-r--r--Tests/Tutorial/MultiPackage/TutorialConfig.h.in3
-rw-r--r--Tests/Tutorial/MultiPackage/directions.txt34
-rw-r--r--Tests/Tutorial/MultiPackage/tutorial.cxx25
-rw-r--r--Tests/Tutorial/Readme.txt16
-rw-r--r--Tests/Tutorial/Step1/CMakeLists.txt19
-rw-r--r--Tests/Tutorial/Step1/directions.txt95
-rw-r--r--Tests/Tutorial/Step1/tutorial.cxx17
-rw-r--r--Tests/Tutorial/Step10/CMakeLists.txt77
-rw-r--r--Tests/Tutorial/Step10/License.txt2
-rw-r--r--Tests/Tutorial/Step10/MathFunctions/CMakeLists.txt61
-rw-r--r--Tests/Tutorial/Step10/MathFunctions/MakeTable.cxx25
-rw-r--r--Tests/Tutorial/Step10/MathFunctions/MathFunctions.cxx18
-rw-r--r--Tests/Tutorial/Step10/MathFunctions/MathFunctions.h14
-rw-r--r--Tests/Tutorial/Step10/MathFunctions/mysqrt.cxx45
-rw-r--r--Tests/Tutorial/Step10/MathFunctions/mysqrt.h6
-rw-r--r--Tests/Tutorial/Step10/TutorialConfig.h.in3
-rw-r--r--Tests/Tutorial/Step10/directions.txt38
-rw-r--r--Tests/Tutorial/Step10/tutorial.cxx25
-rw-r--r--Tests/Tutorial/Step11/CMakeLists.txt77
-rw-r--r--Tests/Tutorial/Step11/License.txt2
-rw-r--r--Tests/Tutorial/Step11/MathFunctions/CMakeLists.txt60
-rw-r--r--Tests/Tutorial/Step11/MathFunctions/MakeTable.cxx25
-rw-r--r--Tests/Tutorial/Step11/MathFunctions/MathFunctions.cxx18
-rw-r--r--Tests/Tutorial/Step11/MathFunctions/MathFunctions.h14
-rw-r--r--Tests/Tutorial/Step11/MathFunctions/mysqrt.cxx45
-rw-r--r--Tests/Tutorial/Step11/MathFunctions/mysqrt.h6
-rw-r--r--Tests/Tutorial/Step11/TutorialConfig.h.in3
-rw-r--r--Tests/Tutorial/Step11/directions.txt104
-rw-r--r--Tests/Tutorial/Step11/tutorial.cxx25
-rw-r--r--Tests/Tutorial/Step2/CMakeLists.txt34
-rw-r--r--Tests/Tutorial/Step2/MathFunctions/mysqrt.cxx13
-rw-r--r--Tests/Tutorial/Step2/TutorialConfig.h.in1
-rw-r--r--Tests/Tutorial/Step2/directions.txt102
-rw-r--r--Tests/Tutorial/Step2/tutorial.cxx32
-rw-r--r--Tests/Tutorial/Step3/CMakeLists.txt74
-rw-r--r--Tests/Tutorial/Step3/MathFunctions/CMakeLists.txt3
-rw-r--r--Tests/Tutorial/Step3/MathFunctions/mysqrt.cxx13
-rw-r--r--Tests/Tutorial/Step3/directions.txt26
-rw-r--r--Tests/Tutorial/Step3/tutorial.cxx25
-rw-r--r--Tests/Tutorial/Step4/CMakeLists.txt72
-rw-r--r--Tests/Tutorial/Step4/MathFunctions/CMakeLists.txt7
-rw-r--r--Tests/Tutorial/Step4/MathFunctions/mysqrt.cxx23
-rw-r--r--Tests/Tutorial/Step4/TutorialConfig.h.in4
-rw-r--r--Tests/Tutorial/Step4/directions.txt72
-rw-r--r--Tests/Tutorial/Step4/tutorial.cxx25
-rw-r--r--Tests/Tutorial/Step5/CMakeLists.txt86
-rw-r--r--Tests/Tutorial/Step5/MathFunctions/CMakeLists.txt23
-rw-r--r--Tests/Tutorial/Step5/MathFunctions/MakeTable.cxx35
-rw-r--r--Tests/Tutorial/Step5/MathFunctions/mysqrt.cxx27
-rw-r--r--Tests/Tutorial/Step5/TutorialConfig.h.in4
-rw-r--r--Tests/Tutorial/Step5/directions.txt69
-rw-r--r--Tests/Tutorial/Step5/tutorial.cxx25
-rw-r--r--Tests/Tutorial/Step6/CMakeLists.txt94
-rw-r--r--Tests/Tutorial/Step6/MathFunctions/CMakeLists.txt32
-rw-r--r--Tests/Tutorial/Step6/MathFunctions/MakeTable.cxx35
-rw-r--r--Tests/Tutorial/Step6/MathFunctions/mysqrt.cxx31
-rw-r--r--Tests/Tutorial/Step6/directions.txt104
-rw-r--r--Tests/Tutorial/Step6/tutorial.cxx25
-rw-r--r--Tests/Tutorial/Step7/CMakeLists.txt98
-rw-r--r--Tests/Tutorial/Step7/License.txt2
-rw-r--r--Tests/Tutorial/Step7/MathFunctions/CMakeLists.txt33
-rw-r--r--Tests/Tutorial/Step7/MathFunctions/MakeTable.cxx35
-rw-r--r--Tests/Tutorial/Step7/MathFunctions/mysqrt.cxx18
-rw-r--r--Tests/Tutorial/Step7/directions.txt40
-rw-r--r--Tests/Tutorial/Step7/tutorial.cxx25
-rw-r--r--Tests/Tutorial/Step8/CMakeLists.txt82
-rw-r--r--Tests/Tutorial/Step8/License.txt2
-rw-r--r--Tests/Tutorial/Step8/MathFunctions/CMakeLists.txt29
-rw-r--r--Tests/Tutorial/Step8/MathFunctions/MakeTable.cxx25
-rw-r--r--Tests/Tutorial/Step8/MathFunctions/MathFunctions.h1
-rw-r--r--Tests/Tutorial/Step8/MathFunctions/mysqrt.cxx42
-rw-r--r--Tests/Tutorial/Step8/TutorialConfig.h.in8
-rw-r--r--Tests/Tutorial/Step8/directions.txt38
-rw-r--r--Tests/Tutorial/Step8/tutorial.cxx32
-rw-r--r--Tests/Tutorial/Step9/CMakeLists.txt81
-rw-r--r--Tests/Tutorial/Step9/CTestConfig.cmake15
-rw-r--r--Tests/Tutorial/Step9/License.txt2
-rw-r--r--Tests/Tutorial/Step9/MathFunctions/CMakeLists.txt35
-rw-r--r--Tests/Tutorial/Step9/MathFunctions/MakeTable.cxx25
-rw-r--r--Tests/Tutorial/Step9/MathFunctions/MathFunctions.cxx18
-rw-r--r--Tests/Tutorial/Step9/MathFunctions/MathFunctions.h1
-rw-r--r--Tests/Tutorial/Step9/MathFunctions/mysqrt.cxx41
-rw-r--r--Tests/Tutorial/Step9/MathFunctions/mysqrt.h6
-rw-r--r--Tests/Tutorial/Step9/TutorialConfig.h.in3
-rw-r--r--Tests/Tutorial/Step9/directions.txt166
-rw-r--r--Tests/Tutorial/Step9/tutorial.cxx33
-rw-r--r--Tests/VSWinStorePhone/CMakeLists.txt11
-rw-r--r--Tests/VSWinStorePhone/Direct3DApp1/Assets/ApplicationIcon.pngbin3392 -> 2335 bytes
-rw-r--r--Tests/VSWinStorePhone/Direct3DApp1/Assets/Logo.pngbin801 -> 488 bytes
-rw-r--r--Tests/VSWinStorePhone/Direct3DApp1/Assets/SmallLogo.pngbin329 -> 167 bytes
-rw-r--r--Tests/VSWinStorePhone/Direct3DApp1/Assets/SmallLogo44x44.pngbin554 -> 265 bytes
-rw-r--r--Tests/VSWinStorePhone/Direct3DApp1/Assets/SplashScreen.pngbin2146 -> 909 bytes
-rw-r--r--Tests/VSWinStorePhone/Direct3DApp1/Assets/StoreLogo.pngbin429 -> 227 bytes
-rw-r--r--Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileLarge.pngbin9930 -> 2953 bytes
-rw-r--r--Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileMedium.pngbin9070 -> 2767 bytes
-rw-r--r--Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileSmall.pngbin3674 -> 1397 bytes
-rw-r--r--Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/IconicTileMediumLarge.pngbin4937 -> 893 bytes
-rw-r--r--Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/IconicTileSmall.pngbin3724 -> 516 bytes
-rw-r--r--Tests/VSWinStorePhone/Direct3DApp1/CubeRenderer.cpp4
-rw-r--r--Tests/VSWinStorePhone/WinRT/Batman.cpp14
-rw-r--r--Tests/VSWinStorePhone/WinRT/Batman.h12
-rw-r--r--Tests/VSWinStorePhone/WinRT/CMakeLists.txt13
-rw-r--r--Tests/VSXaml/Assets/Logo.scale-100.pngbin801 -> 488 bytes
-rw-r--r--Tests/VSXaml/Assets/SmallLogo.scale-100.pngbin329 -> 167 bytes
-rw-r--r--Tests/VSXaml/Assets/SplashScreen.scale-100.pngbin2146 -> 909 bytes
-rw-r--r--Tests/VSXaml/Assets/StoreLogo.scale-100.pngbin429 -> 227 bytes
-rw-r--r--Utilities/Release/upload_release.cmake2
-rw-r--r--Utilities/Sphinx/cmake.py5
-rw-r--r--Utilities/Sphinx/static/cmake-logo-16.pngbin893 -> 692 bytes
-rwxr-xr-xbootstrap1
776 files changed, 11714 insertions, 3635 deletions
diff --git a/.clang-tidy b/.clang-tidy
index 626c754daf..520b1a9e39 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -14,8 +14,6 @@ modernize-*,\
-modernize-raw-string-literal,\
-modernize-return-braced-init-list,\
-modernize-use-auto,\
--modernize-use-equals-default,\
--modernize-use-equals-delete,\
-modernize-use-noexcept,\
-modernize-use-transparent-functors,\
-modernize-use-using,\
@@ -35,4 +33,6 @@ HeaderFilterRegex: 'Source/cm[^/]*\.(h|hxx|cxx)$'
CheckOptions:
- key: modernize-use-default-member-init.UseAssignment
value: '1'
+ - key: modernize-use-equals-default.IgnoreMacros
+ value: '0'
...
diff --git a/.gitattributes b/.gitattributes
index d6fd5d6c92..24fd9c2014 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -21,6 +21,7 @@ configure eol=lf
*.pfx -text
*.png -text
+*.png.in -text
*.c our-c-style
*.cc our-c-style
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 75a0b522e7..bd130ec369 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -332,6 +332,9 @@ macro (CMAKE_BUILD_UTILITIES)
set(KWSYS_USE_ConsoleBuf 1)
set(KWSYS_HEADER_ROOT ${CMake_BINARY_DIR}/Source)
set(KWSYS_INSTALL_DOC_DIR "${CMAKE_DOC_DIR}")
+ if(CMake_NO_CXX_STANDARD)
+ set(KWSYS_CXX_STANDARD "")
+ endif()
add_subdirectory(Source/kwsys)
set(kwsys_folder "Utilities/KWSys")
CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE} "${kwsys_folder}")
diff --git a/Help/command/file.rst b/Help/command/file.rst
index db4d6fce7b..465e567439 100644
--- a/Help/command/file.rst
+++ b/Help/command/file.rst
@@ -26,8 +26,8 @@ Synopsis
file(`MAKE_DIRECTORY`_ [<dir>...])
file({`COPY`_ | `INSTALL`_} <file>... DESTINATION <dir> [...])
file(`SIZE`_ <filename> <out-var>)
- file(`READ_SYMLINK`_ <filename> <out-var>)
- file(`CREATE_LINK`_ <file> <new-file> [...])
+ file(`READ_SYMLINK`_ <linkname> <out-var>)
+ file(`CREATE_LINK`_ <original> <linkname> [...])
`Path Conversion`_
file(`RELATIVE_PATH`_ <out-var> <directory> <file>)
@@ -350,22 +350,22 @@ pointing to a file and is readable.
.. code-block:: cmake
- file(READ_SYMLINK <filename> <variable>)
+ file(READ_SYMLINK <linkname> <variable>)
-Read the symlink at ``<filename>`` and put the result in ``<variable>``.
-Requires that ``<filename>`` is a valid path pointing to a symlink. If
-``<filename>`` does not exist, or is not a symlink, an error is thrown.
+This subcommand queries the symlink ``<linkname>`` and stores the path it
+points to in the result ``<variable>``. If ``<linkname>`` does not exist or
+is not a symlink, CMake issues a fatal error.
Note that this command returns the raw symlink path and does not resolve
-relative symlinks. If you want to resolve the relative symlink yourself, you
-could do something like this:
+a relative path. The following is an example of how to ensure that an
+absolute path is obtained:
.. code-block:: cmake
- set(filename "/path/to/foo.sym")
- file(READ_SYMLINK "${filename}" result)
+ set(linkname "/path/to/foo.sym")
+ file(READ_SYMLINK "${linkname}" result)
if(NOT IS_ABSOLUTE "${result}")
- get_filename_component(dir "${filename}" DIRECTORY)
+ get_filename_component(dir "${linkname}" DIRECTORY)
set(result "${dir}/${result}")
endif()
@@ -373,23 +373,23 @@ could do something like this:
.. code-block:: cmake
- file(CREATE_LINK <file> <new-file>
+ file(CREATE_LINK <original> <linkname>
[RESULT <result>] [COPY_ON_ERROR] [SYMBOLIC])
-Create a link to ``<file>`` at ``<new-file>``.
+Create a link ``<linkname>`` that points to ``<original>``.
+It will be a hard link by default, but providing the ``SYMBOLIC`` option
+results in a symbolic link instead. Hard links require that ``original``
+exists and is a file, not a directory. If ``<linkname>`` already exists,
+it will be overwritten.
-It is a hard link by default. This can be changed to symbolic links by
-using ``SYMBOLIC``. The original file needs to exist for hard links.
-
-The ``<result>`` variable, if specified, gets the status of the operation.
-It is set to ``0`` in case of success. Otherwise, it contains the error
-generated. In case of failures, if ``RESULT`` is not specified, a fatal error
-is emitted.
+The ``<result>`` variable, if specified, receives the status of the operation.
+It is set to ``0`` upon success or an error message otherwise. If ``RESULT``
+is not specified and the operation fails, a fatal error is emitted.
Specifying ``COPY_ON_ERROR`` enables copying the file as a fallback if
-creating the link fails.
-
-Overwrites the ``<new-file>`` if it exists.
+creating the link fails. It can be useful for handling situations such as
+``<original>`` and ``<linkname>`` being on different drives or mount points,
+which would make them unable to support a hard link.
Path Conversion
^^^^^^^^^^^^^^^
diff --git a/Help/command/get_filename_component.rst b/Help/command/get_filename_component.rst
index 3e3c9c362e..9bbf87714b 100644
--- a/Help/command/get_filename_component.rst
+++ b/Help/command/get_filename_component.rst
@@ -15,12 +15,13 @@ Sets ``<var>`` to a component of ``<FileName>``, where ``<mode>`` is one of:
NAME = File name without directory
EXT = File name longest extension (.b.c from d/a.b.c)
NAME_WE = File name without directory or longest extension
+ LAST_EXT = File name last extension (.c from d/a.b.c)
+ NAME_WLE = File name without directory or last extension
PATH = Legacy alias for DIRECTORY (use for CMake <= 2.8.11)
Paths are returned with forward slashes and have no trailing slashes.
-The longest file extension is always considered. If the optional
-``CACHE`` argument is specified, the result variable is added to the
-cache.
+If the optional ``CACHE`` argument is specified, the result variable is
+added to the cache.
.. code-block:: cmake
diff --git a/Help/command/if.rst b/Help/command/if.rst
index a682c83b1a..a48a0faac6 100644
--- a/Help/command/if.rst
+++ b/Help/command/if.rst
@@ -23,7 +23,7 @@ Otherwise, optional ``elseif`` blocks are processed in the same way.
Finally, if no ``condition`` is true, ``commands`` in the optional ``else``
block are executed.
-Per legacy, the :command:`else` and :command:`elseif` commands admit
+Per legacy, the :command:`else` and :command:`endif` commands admit
an optional ``<condition>`` argument.
If used, it must be a verbatim
repeat of the argument of the opening
diff --git a/Help/command/set.rst b/Help/command/set.rst
index dd5ea133be..c0e02e2465 100644
--- a/Help/command/set.rst
+++ b/Help/command/set.rst
@@ -86,7 +86,7 @@ Set Environment Variable
.. code-block:: cmake
- set(ENV{<variable>} <value>...)
+ set(ENV{<variable>} [<value>])
Sets an :manual:`Environment Variable <cmake-env-variables(7)>`
to the given value.
@@ -95,3 +95,10 @@ Subsequent calls of ``$ENV{<variable>}`` will return this new value.
This command affects only the current CMake process, not the process
from which CMake was called, nor the system environment at large,
nor the environment of subsequent build or test processes.
+
+If no argument is given after ``ENV{<variable>}`` or if ``<value>`` is
+an empty string, then this command will clear any existing value of the
+environment variable.
+
+Arguments after ``<value>`` are ignored. If extra arguments are found,
+then an author warning is issued.
diff --git a/Help/command/try_compile.rst b/Help/command/try_compile.rst
index 77f42a1be5..ca8fc77fab 100644
--- a/Help/command/try_compile.rst
+++ b/Help/command/try_compile.rst
@@ -12,12 +12,12 @@ Try Compiling Whole Projects
.. code-block:: cmake
- try_compile(RESULT_VAR <bindir> <srcdir>
+ try_compile(<resultVar> <bindir> <srcdir>
<projectName> [<targetName>] [CMAKE_FLAGS <flags>...]
[OUTPUT_VARIABLE <var>])
Try building a project. The success or failure of the ``try_compile``,
-i.e. ``TRUE`` or ``FALSE`` respectively, is returned in ``RESULT_VAR``.
+i.e. ``TRUE`` or ``FALSE`` respectively, is returned in ``<resultVar>``.
In this form, ``<srcdir>`` should contain a complete CMake project with a
``CMakeLists.txt`` file and all sources. The ``<bindir>`` and ``<srcdir>``
@@ -30,7 +30,7 @@ Try Compiling Source Files
.. code-block:: cmake
- try_compile(RESULT_VAR <bindir> <srcfile|SOURCES srcfile...>
+ try_compile(<resultVar> <bindir> <srcfile|SOURCES srcfile...>
[CMAKE_FLAGS <flags>...]
[COMPILE_DEFINITIONS <defs>...]
[LINK_OPTIONS <options>...]
@@ -42,13 +42,19 @@ Try Compiling Source Files
[<LANG>_EXTENSIONS <bool>]
)
-Try building an executable from one or more source files. The success or
-failure of the ``try_compile``, i.e. ``TRUE`` or ``FALSE`` respectively, is
-returned in ``RESULT_VAR``.
+Try building an executable or static library from one or more source files
+(which one is determined by the :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE`
+variable). The success or failure of the ``try_compile``, i.e. ``TRUE`` or
+``FALSE`` respectively, is returned in ``<resultVar>``.
-In this form the user need only supply one or more source files that include a
-definition for ``main``. CMake will create a ``CMakeLists.txt`` file to build
-the source(s) as an executable that looks something like this:
+In this form, one or more source files must be provided. If
+:variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` is unset or is set to ``EXECUTABLE``,
+the sources must include a definition for ``main`` and CMake will create a
+``CMakeLists.txt`` file to build the source(s) as an executable.
+If :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` is set to ``STATIC_LIBRARY``,
+a static library will be built instead and no definition for ``main`` is
+required. For an executable, the generated ``CMakeLists.txt`` file would
+contain something like the following:
.. code-block:: cmake
@@ -73,7 +79,7 @@ The options are:
in the generated test project.
``COPY_FILE <fileName>``
- Copy the linked executable to the given ``<fileName>``.
+ Copy the built executable or static library to the given ``<fileName>``.
``COPY_FILE_ERROR <var>``
Use after ``COPY_FILE`` to capture into variable ``<var>`` any error
@@ -88,12 +94,12 @@ The options are:
given to the ``CMAKE_FLAGS`` option will be ignored.
``LINK_OPTIONS <options>...``
- Specify link step options to pass to :command:`target_link_options` or
- to :prop_tgt:`STATIC_LIBRARY_OPTIONS` target property in the generated
- project, depending of the :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` variable.
+ Specify link step options to pass to :command:`target_link_options` or to
+ set the :prop_tgt:`STATIC_LIBRARY_OPTIONS` target property in the generated
+ project, depending on the :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` variable.
``OUTPUT_VARIABLE <var>``
- Store the output from the build process the given variable.
+ Store the output from the build process in the given variable.
``<LANG>_STANDARD <std>``
Specify the :prop_tgt:`C_STANDARD`, :prop_tgt:`CXX_STANDARD`,
@@ -114,7 +120,7 @@ passed to ``cmake`` to avoid this clean. However, multiple sequential
``try_compile`` operations reuse this single output directory. If you use
``--debug-trycompile``, you can only debug one ``try_compile`` call at a time.
The recommended procedure is to protect all ``try_compile`` calls in your
-project by ``if(NOT DEFINED RESULT_VAR)`` logic, configure with cmake
+project by ``if(NOT DEFINED <resultVar>)`` logic, configure with cmake
all the way through once, then delete the cache entry associated with
the try_compile call of interest, and then re-run cmake again with
``--debug-trycompile``.
@@ -139,8 +145,8 @@ behavior at link time, the ``check_pie_supported()`` command from the
:module:`CheckPIESupported` module must be called before using the
:command:`try_compile` command.
-The current settings of :policy:`CMP0065` and :policy:`CMP0083` are set in the
-generated project.
+The current settings of :policy:`CMP0065` and :policy:`CMP0083` are propagated
+through to the generated test project.
Set the :variable:`CMAKE_TRY_COMPILE_CONFIGURATION` variable to choose
a build configuration.
@@ -150,7 +156,9 @@ the type of target used for the source file signature.
Set the :variable:`CMAKE_TRY_COMPILE_PLATFORM_VARIABLES` variable to specify
variables that must be propagated into the test project. This variable is
-meant for use only in toolchain files.
+meant for use only in toolchain files and is only honored by the
+``try_compile()`` command for the source files form, not when given a whole
+project.
If :policy:`CMP0067` is set to ``NEW``, or any of the ``<LANG>_STANDARD``,
``<LANG>_STANDARD_REQUIRED``, or ``<LANG>_EXTENSIONS`` options are used,
diff --git a/Help/command/try_run.rst b/Help/command/try_run.rst
index 137402f34b..d401ebe929 100644
--- a/Help/command/try_run.rst
+++ b/Help/command/try_run.rst
@@ -12,8 +12,8 @@ Try Compiling and Running Source Files
.. code-block:: cmake
- try_run(RUN_RESULT_VAR COMPILE_RESULT_VAR
- bindir srcfile [CMAKE_FLAGS <flags>...]
+ try_run(<runResultVar> <compileResultVar>
+ <bindir> <srcfile> [CMAKE_FLAGS <flags>...]
[COMPILE_DEFINITIONS <defs>...]
[LINK_OPTIONS <options>...]
[LINK_LIBRARIES <libs>...]
@@ -23,9 +23,9 @@ Try Compiling and Running Source Files
[ARGS <args>...])
Try compiling a ``<srcfile>``. Returns ``TRUE`` or ``FALSE`` for success
-or failure in ``COMPILE_RESULT_VAR``. If the compile succeeded, runs the
-executable and returns its exit code in ``RUN_RESULT_VAR``. If the
-executable was built, but failed to run, then ``RUN_RESULT_VAR`` will be
+or failure in ``<compileResultVar>``. If the compile succeeded, runs the
+executable and returns its exit code in ``<runResultVar>``. If the
+executable was built, but failed to run, then ``<runResultVar>`` will be
set to ``FAILED_TO_RUN``. See the :command:`try_compile` command for
information on how the test project is constructed to build the source file.
@@ -85,10 +85,10 @@ presetting them in some CMake script file to the values the executable
would have produced if it had been run on its actual target platform.
These cache entries are:
-``<RUN_RESULT_VAR>``
+``<runResultVar>``
Exit code if the executable were to be run on the target platform.
-``<RUN_RESULT_VAR>__TRYRUN_OUTPUT``
+``<runResultVar>__TRYRUN_OUTPUT``
Output from stdout and stderr if the executable were to be run on
the target platform. This is created only if the
``RUN_OUTPUT_VARIABLE`` or ``OUTPUT_VARIABLE`` option was used.
diff --git a/Help/dev/review.rst b/Help/dev/review.rst
index 0c4ededd61..1d664c4b82 100644
--- a/Help/dev/review.rst
+++ b/Help/dev/review.rst
@@ -238,12 +238,10 @@ Referencing Commits in Commit Messages
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The preferred form for references to other commits is
-``commit <commit> (<subject>, <date>)``, where:
+``commit <shorthash> (<subject>, <date>)``, where:
-* ``<commit>``:
- If available, a tag-relative name of the commit produced by
- ``git describe --contains <commit-ish>``. Otherwise, the first
- 8-10 characters of the commit ``<hash>``.
+* ``<shorthash>``:
+ The abbreviated hash of the commit.
* ``<subject>``:
The first line of the commit message.
@@ -252,6 +250,17 @@ The preferred form for references to other commits is
The author date of the commit, in its original time zone, formatted as
``CCYY-MM-DD``. ``git-log(1)`` shows the original time zone by default.
+This may be generated with
+``git show -s --date=short --pretty="format:%h (%s, %ad)" <commit>``.
+
+If the commit is a fix for the mentioned commit, consider using a ``Fixes:``
+trailer in the commit message with the specified format. This trailer should
+not be word-wrapped. Note that if there is also an issue for what is being
+fixed, it is preferrable to link to the issue instead.
+
+If relevant, add the first release tag of CMake containing the commit after
+the ``<date>``, i.e., ``commit <shorthash> (<subject>, <date>, <tag>)``.
+
Alternatively, the full commit ``<hash>`` may be used.
Revising Commit Messages
diff --git a/Help/dev/source.rst b/Help/dev/source.rst
index 6697d3814f..47baff42da 100644
--- a/Help/dev/source.rst
+++ b/Help/dev/source.rst
@@ -30,16 +30,6 @@ building on older toolchains some constructs need to be handled with care:
The ``std::auto_ptr`` template is deprecated in C++11. Use ``std::unique_ptr``.
-* Use ``CM_DISABLE_COPY(Class)`` to mark classes as non-copyable.
-
- The ``CM_DISABLE_COPY`` macro should be used in the private section of a
- class to make sure that attempts to copy or assign an instance of the class
- lead to compiler errors even if the compiler does not support *deleted*
- functions. As a guideline, all polymorphic classes should be made
- non-copyable in order to avoid slicing. Classes that are composed of or
- derived from non-copyable classes must also be made non-copyable explicitly
- with ``CM_DISABLE_COPY``.
-
Source Tree Layout
==================
diff --git a/Help/envvar/CMAKE_NO_VERBOSE.rst b/Help/envvar/CMAKE_NO_VERBOSE.rst
new file mode 100644
index 0000000000..149efbd6f4
--- /dev/null
+++ b/Help/envvar/CMAKE_NO_VERBOSE.rst
@@ -0,0 +1,8 @@
+CMAKE_NO_VERBOSE
+----------------
+
+Disables verbose output from CMake when :envvar:`VERBOSE` environment variable
+is set.
+
+Only your build tool of choice will still print verbose output when you start
+to actually build your project.
diff --git a/Help/envvar/VERBOSE.rst b/Help/envvar/VERBOSE.rst
new file mode 100644
index 0000000000..2d775a5bec
--- /dev/null
+++ b/Help/envvar/VERBOSE.rst
@@ -0,0 +1,10 @@
+VERBOSE
+-------
+
+Activates verbose output from CMake and your build tools of choice when
+you start to actually build your project.
+
+Note that any given value is ignored. It's just checked for existence.
+
+See also :ref:`Build Tool Mode <Build Tool Mode>` and
+:envvar:`CMAKE_NO_VERBOSE` environment variable
diff --git a/Help/generator/Green Hills MULTI.rst b/Help/generator/Green Hills MULTI.rst
index bfe671f503..e474682b66 100644
--- a/Help/generator/Green Hills MULTI.rst
+++ b/Help/generator/Green Hills MULTI.rst
@@ -59,6 +59,7 @@ Customizations are available through the following cache variables:
The following properties are available:
* :prop_tgt:`GHS_INTEGRITY_APP`
+* :prop_tgt:`GHS_NO_SOURCE_GROUP_FILE`
.. note::
This generator is deemed experimental as of CMake |release|
diff --git a/Help/generator/VS_TOOLSET_HOST_ARCH.txt b/Help/generator/VS_TOOLSET_HOST_ARCH.txt
index 5d13e7741e..4eb900f81f 100644
--- a/Help/generator/VS_TOOLSET_HOST_ARCH.txt
+++ b/Help/generator/VS_TOOLSET_HOST_ARCH.txt
@@ -1,6 +1,7 @@
For each toolset that comes with this version of Visual Studio, there are
variants that are themselves compiled for 32-bit (x86) and 64-bit (x64) hosts
-(independent of the architecture they target). By default Visual Studio
-chooses the 32-bit variant even on a 64-bit host. One may request use of the
-64-bit host tools by adding a ``host=x64`` option to the toolset specification.
+(independent of the architecture they target).
+|VS_TOOLSET_HOST_ARCH_DEFAULT|
+One may explicitly request use of either the 32-bit or 64-bit host tools
+by adding either ``host=x86`` or ``host=x64`` to the toolset specification.
See the :variable:`CMAKE_GENERATOR_TOOLSET` variable for details.
diff --git a/Help/generator/Visual Studio 12 2013.rst b/Help/generator/Visual Studio 12 2013.rst
index d342c5395d..fb8e021bc7 100644
--- a/Help/generator/Visual Studio 12 2013.rst
+++ b/Help/generator/Visual Studio 12 2013.rst
@@ -42,4 +42,7 @@ The ``v120`` toolset that comes with Visual Studio 12 2013 is selected by
default. The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
via the :manual:`cmake(1)` ``-T`` option, to specify another toolset.
+.. |VS_TOOLSET_HOST_ARCH_DEFAULT| replace::
+ By default this generator uses the 32-bit variant even on a 64-bit host.
+
.. include:: VS_TOOLSET_HOST_ARCH.txt
diff --git a/Help/generator/Visual Studio 14 2015.rst b/Help/generator/Visual Studio 14 2015.rst
index 106b7c5e92..7383f7a6f9 100644
--- a/Help/generator/Visual Studio 14 2015.rst
+++ b/Help/generator/Visual Studio 14 2015.rst
@@ -39,4 +39,7 @@ The ``v140`` toolset that comes with Visual Studio 14 2015 is selected by
default. The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
via the :manual:`cmake(1)` ``-T`` option, to specify another toolset.
+.. |VS_TOOLSET_HOST_ARCH_DEFAULT| replace::
+ By default this generator uses the 32-bit variant even on a 64-bit host.
+
.. include:: VS_TOOLSET_HOST_ARCH.txt
diff --git a/Help/generator/Visual Studio 15 2017.rst b/Help/generator/Visual Studio 15 2017.rst
index 52c1fa0236..7e6f0fb20f 100644
--- a/Help/generator/Visual Studio 15 2017.rst
+++ b/Help/generator/Visual Studio 15 2017.rst
@@ -56,4 +56,7 @@ The ``v141`` toolset that comes with Visual Studio 15 2017 is selected by
default. The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
via the :manual:`cmake(1)` ``-T`` option, to specify another toolset.
+.. |VS_TOOLSET_HOST_ARCH_DEFAULT| replace::
+ By default this generator uses the 32-bit variant even on a 64-bit host.
+
.. include:: VS_TOOLSET_HOST_ARCH.txt
diff --git a/Help/generator/Visual Studio 16 2019.rst b/Help/generator/Visual Studio 16 2019.rst
index 6f2bc56a50..b456554b92 100644
--- a/Help/generator/Visual Studio 16 2019.rst
+++ b/Help/generator/Visual Studio 16 2019.rst
@@ -46,4 +46,8 @@ The ``v142`` toolset that comes with Visual Studio 16 2019 is selected by
default. The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
via the :manual:`cmake(1)` ``-T`` option, to specify another toolset.
+.. |VS_TOOLSET_HOST_ARCH_DEFAULT| replace::
+ By default this generator uses the 64-bit variant on x64 hosts and
+ the 32-bit variant otherwise.
+
.. include:: VS_TOOLSET_HOST_ARCH.txt
diff --git a/Help/generator/Xcode.rst b/Help/generator/Xcode.rst
index 968c26a702..71430c7aa0 100644
--- a/Help/generator/Xcode.rst
+++ b/Help/generator/Xcode.rst
@@ -3,7 +3,9 @@ Xcode
Generate Xcode project files.
-This supports Xcode 3.0 and above.
+This supports Xcode 3.0 and above. Support for Xcode versions prior
+to Xcode 5 is deprecated and will be dropped in a future version of
+CMake.
Toolset Selection
^^^^^^^^^^^^^^^^^
diff --git a/Help/manual/cmake-env-variables.7.rst b/Help/manual/cmake-env-variables.7.rst
index edf80f4fee..c433412760 100644
--- a/Help/manual/cmake-env-variables.7.rst
+++ b/Help/manual/cmake-env-variables.7.rst
@@ -24,11 +24,13 @@ Environment Variables that Control the Build
/envvar/CMAKE_BUILD_PARALLEL_LEVEL
/envvar/CMAKE_CONFIG_TYPE
/envvar/CMAKE_MSVCIDE_RUN_PATH
+ /envvar/CMAKE_NO_VERBOSE
/envvar/CMAKE_OSX_ARCHITECTURES
/envvar/DESTDIR
/envvar/LDFLAGS
/envvar/MACOSX_DEPLOYMENT_TARGET
/envvar/PackageName_ROOT
+ /envvar/VERBOSE
Environment Variables for Languages
===================================
diff --git a/Help/manual/cmake-gui.1.rst b/Help/manual/cmake-gui.1.rst
index 9322e33cbb..856aa2fba2 100644
--- a/Help/manual/cmake-gui.1.rst
+++ b/Help/manual/cmake-gui.1.rst
@@ -10,6 +10,7 @@ Synopsis
cmake-gui [<options>]
cmake-gui [<options>] {<path-to-source> | <path-to-existing-build>}
+ cmake-gui [<options>] -S <path-to-source> -B <path-to-build>
Description
===========
@@ -27,6 +28,14 @@ native tool on their platform.
Options
=======
+``-S <path-to-source>``
+ Path to root directory of the CMake project to build.
+
+``-B <path-to-build>``
+ Path to directory which CMake will use as the root of build directory.
+
+ If the directory doesn't already exist CMake will make it.
+
.. include:: OPTIONS_HELP.txt
See Also
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index e1de134523..4366c0dc0a 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -195,6 +195,7 @@ Properties on Targets
/prop_tgt/FRAMEWORK_VERSION
/prop_tgt/GENERATOR_FILE_NAME
/prop_tgt/GHS_INTEGRITY_APP
+ /prop_tgt/GHS_NO_SOURCE_GROUP_FILE
/prop_tgt/GNUtoMS
/prop_tgt/HAS_CXX
/prop_tgt/IMPLICIT_DEPENDS_INCLUDE_TRANSFORM
diff --git a/Help/manual/cmake-toolchains.7.rst b/Help/manual/cmake-toolchains.7.rst
index 8554e87f90..d214e4afc2 100644
--- a/Help/manual/cmake-toolchains.7.rst
+++ b/Help/manual/cmake-toolchains.7.rst
@@ -522,3 +522,74 @@ See also target properties:
* :prop_tgt:`ANDROID_SECURE_PROPS_PATH`
* :prop_tgt:`ANDROID_SKIP_ANT_STEP`
* :prop_tgt:`ANDROID_STL_TYPE`
+
+.. _`Cross Compiling for iOS, tvOS, or watchOS`:
+
+Cross Compiling for iOS, tvOS, or watchOS
+-----------------------------------------
+
+For cross-compiling to iOS, tvOS, or watchOS, the :generator:`Xcode`
+generator is recommended. The :generator:`Unix Makefiles` or
+:generator:`Ninja` generators can also be used, but they require the
+project to handle more areas like target CPU selection and code signing.
+
+Any of the three systems can be targetted by setting the
+:variable:`CMAKE_SYSTEM_NAME` variable to a value from the table below.
+By default, the latest Device SDK is chosen. As for all Apple platforms,
+a different SDK (e.g. a simulator) can be selected by setting the
+:variable:`CMAKE_OSX_SYSROOT` variable, although this should rarely be
+necessary (see :ref:`Switching Between Device and Simulator` below).
+A list of available SDKs can be obtained by running ``xcodebuild -showsdks``.
+
+======= ================= ==================== ================
+OS CMAKE_SYSTEM_NAME Device SDK (default) Simulator SDK
+======= ================= ==================== ================
+iOS iOS iphoneos iphonesimulator
+tvOS tvOS appletvos appletvsimulator
+watchOS watchOS watchos watchsimulator
+======= ================= ==================== ================
+
+For example, to create a CMake configuration for iOS, the following
+command is sufficient:
+
+.. code-block:: console
+
+ cmake .. -GXcode -DCMAKE_SYSTEM_NAME=iOS
+
+Code Signing
+^^^^^^^^^^^^
+
+Some build artifacts for the embedded Apple platforms require mandatory
+code signing. If the :generator:`Xcode` generator is being used and
+code signing is required or desired, the developmemt team ID can be
+specified via the ``CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM`` CMake variable.
+This team ID will then be included in the generated Xcode project.
+By default, CMake avoids the need for code signing during the internal
+configuration phase (i.e compiler ID and feature detection).
+
+.. _`Switching Between Device and Simulator`:
+
+Switching Between Device and Simulator
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+When configuring for any of the embedded platforms, one can target either
+real devices or the simulator. Both have their own separate SDK, but CMake
+only supports specifying a single SDK for the configuration phase. This
+means the developer must select one or the other at configuration time.
+When using the :generator:`Xcode` generator, this is less of a limitation
+because Xcode still allows you to build for either a device or a simulator,
+even though configuration was only performed for one of the two. From
+within the Xcode IDE, builds are performed for the selected "destination"
+platform. When building from the command line, the desired sdk can be
+specified directly by passing a ``-sdk`` option to the underlying build
+tool (``xcodebuild``). For example:
+
+.. code-block:: console
+
+ $ cmake --build ... -- -sdk iphonesimulator
+
+Please note that checks made during configuration were performed against
+the configure-time SDK and might not hold true for other SDKs. Commands
+like :command:`find_package`, :command:`find_library`, etc. store and use
+details only for the configured SDK/platform, so they can be problematic
+if wanting to switch between device and simulator builds.
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index de4ce3debc..83c88a533c 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -55,7 +55,6 @@ Variables that Provide Information
/variable/CMAKE_GENERATOR_INSTANCE
/variable/CMAKE_GENERATOR_PLATFORM
/variable/CMAKE_GENERATOR_TOOLSET
- /variable/CMAKE_HOME_DIRECTORY
/variable/CMAKE_IMPORT_LIBRARY_PREFIX
/variable/CMAKE_IMPORT_LIBRARY_SUFFIX
/variable/CMAKE_JOB_POOL_COMPILE
@@ -103,7 +102,6 @@ Variables that Provide Information
/variable/CMAKE_VERBOSE_MAKEFILE
/variable/CMAKE_VERSION
/variable/CMAKE_VS_DEVENV_COMMAND
- /variable/CMAKE_VS_INTEL_Fortran_PROJECT_VERSION
/variable/CMAKE_VS_MSBUILD_COMMAND
/variable/CMAKE_VS_NsightTegra_VERSION
/variable/CMAKE_VS_PLATFORM_NAME
@@ -192,7 +190,6 @@ Variables that Change Behavior
/variable/CMAKE_MFC_FLAG
/variable/CMAKE_MAXIMUM_RECURSION_DEPTH
/variable/CMAKE_MODULE_PATH
- /variable/CMAKE_NOT_USING_CONFIG_FLAGS
/variable/CMAKE_POLICY_DEFAULT_CMPNNNN
/variable/CMAKE_POLICY_WARNING_CMPNNNN
/variable/CMAKE_PREFIX_PATH
@@ -276,6 +273,7 @@ Variables that Describe the System
/variable/MSVC_IDE
/variable/MSVC_TOOLSET_VERSION
/variable/MSVC_VERSION
+ /variable/MSYS
/variable/UNIX
/variable/WIN32
/variable/WINCE
@@ -347,6 +345,7 @@ Variables that Control the Build
/variable/CMAKE_FOLDER
/variable/CMAKE_Fortran_FORMAT
/variable/CMAKE_Fortran_MODULE_DIRECTORY
+ /variable/CMAKE_GHS_NO_SOURCE_GROUP_FILE
/variable/CMAKE_GLOBAL_AUTOGEN_TARGET
/variable/CMAKE_GLOBAL_AUTOGEN_TARGET_NAME
/variable/CMAKE_GLOBAL_AUTORCC_TARGET
@@ -451,7 +450,6 @@ Variables for Languages
/variable/CMAKE_Fortran_MODDIR_DEFAULT
/variable/CMAKE_Fortran_MODDIR_FLAG
/variable/CMAKE_Fortran_MODOUT_FLAG
- /variable/CMAKE_INTERNAL_PLATFORM_ABI
/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_MACHINE
/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_PREFIX
/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_SUFFIX
@@ -459,15 +457,12 @@ Variables for Languages
/variable/CMAKE_LANG_ARCHIVE_CREATE
/variable/CMAKE_LANG_ARCHIVE_FINISH
/variable/CMAKE_LANG_COMPILER
- /variable/CMAKE_LANG_COMPILER_ABI
- /variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID
/variable/CMAKE_LANG_COMPILER_EXTERNAL_TOOLCHAIN
/variable/CMAKE_LANG_COMPILER_ID
/variable/CMAKE_LANG_COMPILER_LOADED
/variable/CMAKE_LANG_COMPILER_PREDEFINES_COMMAND
/variable/CMAKE_LANG_COMPILER_TARGET
/variable/CMAKE_LANG_COMPILER_VERSION
- /variable/CMAKE_LANG_COMPILER_VERSION_INTERNAL
/variable/CMAKE_LANG_COMPILE_OBJECT
/variable/CMAKE_LANG_CREATE_SHARED_LIBRARY
/variable/CMAKE_LANG_CREATE_SHARED_MODULE
@@ -496,7 +491,6 @@ Variables for Languages
/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG_SEP
/variable/CMAKE_LANG_LINK_EXECUTABLE
/variable/CMAKE_LANG_OUTPUT_EXTENSION
- /variable/CMAKE_LANG_PLATFORM_ID
/variable/CMAKE_LANG_SIMULATE_ID
/variable/CMAKE_LANG_SIMULATE_VERSION
/variable/CMAKE_LANG_SIZEOF_DATA_PTR
@@ -608,3 +602,23 @@ Variable Expansion Operators
/variable/CACHE
/variable/ENV
+
+Internal Variables
+==================
+
+CMake has many internal variables. Most of them are undocumented.
+Some of them, however, were at some point described as normal
+variables, and therefore may be encountered in legacy code. They
+are subject to change, and not recommended for use in project code.
+
+.. toctree::
+ :maxdepth: 1
+
+ /variable/CMAKE_HOME_DIRECTORY
+ /variable/CMAKE_INTERNAL_PLATFORM_ABI
+ /variable/CMAKE_LANG_COMPILER_ABI
+ /variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID
+ /variable/CMAKE_LANG_COMPILER_VERSION_INTERNAL
+ /variable/CMAKE_LANG_PLATFORM_ID
+ /variable/CMAKE_NOT_USING_CONFIG_FLAGS
+ /variable/CMAKE_VS_INTEL_Fortran_PROJECT_VERSION
diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst
index 915e0d47de..f3b81ecb68 100644
--- a/Help/manual/cmake.1.rst
+++ b/Help/manual/cmake.1.rst
@@ -289,6 +289,14 @@ following options:
``--use-stderr``
Ignored. Behavior is default in CMake >= 3.0.
+``-v, --verbose``
+ Enable verbose output - if supported - including the build commands to be
+ executed.
+
+ This option can be omitted if :envvar:`VERBOSE` environment variable or
+ :variable:`CMAKE_VERBOSE_MAKEFILE` cached variable is set.
+
+
``--``
Pass remaining options to the native tool.
@@ -373,9 +381,10 @@ Available commands are:
``chdir <dir> <cmd> [<arg>...]``
Change the current working directory and run a command.
-``compare_files <file1> <file2>``
+``compare_files [--ignore-eol] <file1> <file2>``
Check if ``<file1>`` is same as ``<file2>``. If files are the same,
- then returns 0, if not it returns 1.
+ then returns 0, if not it returns 1. The ``--ignore-eol`` option
+ implies line-wise comparison and ignores LF/CRLF differences.
``copy <file>... <destination>``
Copy files to ``<destination>`` (either file or directory).
diff --git a/Help/policy/CMP0083.rst b/Help/policy/CMP0083.rst
index b26d6c8d96..32acf1f126 100644
--- a/Help/policy/CMP0083.rst
+++ b/Help/policy/CMP0083.rst
@@ -23,9 +23,10 @@ which it is used, it is the project's responsibility to use the
:prop_tgt:`POSITION_INDEPENDENT_CODE` target property for executables will be
honored at link time.
-This policy was introduced in CMake version 3.14. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+This policy was introduced in CMake version 3.14. Use the
+:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+Unlike most policies, CMake version |release| does not warn when this policy is
+not set and simply uses ``OLD`` behavior.
.. include:: DEPRECATED.txt
diff --git a/Help/prop_tgt/CUDA_RESOLVE_DEVICE_SYMBOLS.rst b/Help/prop_tgt/CUDA_RESOLVE_DEVICE_SYMBOLS.rst
index 127d79fb31..ef74ae26f0 100644
--- a/Help/prop_tgt/CUDA_RESOLVE_DEVICE_SYMBOLS.rst
+++ b/Help/prop_tgt/CUDA_RESOLVE_DEVICE_SYMBOLS.rst
@@ -1,12 +1,18 @@
CUDA_RESOLVE_DEVICE_SYMBOLS
---------------------------
-CUDA only: Enables device linking for the specific static library target
+CUDA only: Enables device linking for the specific library target
-If set this will enable device linking on this static library target. Normally
+If set this will enable device linking on the library target. Normally
device linking is deferred until a shared library or executable is generated,
allowing for multiple static libraries to resolve device symbols at the same
-time.
+time when they are used by a shared library or executable.
+
+By default static library targets have this property is disabled,
+while shared, module, and executable targets have this property enabled.
+
+Note that device linking is not supported for :ref:`Object Libraries`.
+
For instance:
diff --git a/Help/prop_tgt/EXCLUDE_FROM_ALL.rst b/Help/prop_tgt/EXCLUDE_FROM_ALL.rst
index e7457e1e29..0eee297921 100644
--- a/Help/prop_tgt/EXCLUDE_FROM_ALL.rst
+++ b/Help/prop_tgt/EXCLUDE_FROM_ALL.rst
@@ -6,8 +6,16 @@ Exclude the target from the all target.
A property on a target that indicates if the target is excluded from
the default build target. If it is not, then with a Makefile for
example typing make will cause this target to be built. The same
-concept applies to the default build of other generators. Installing
-a target with EXCLUDE_FROM_ALL set to true has undefined behavior.
+concept applies to the default build of other generators.
+
+With ``EXCLUDE_FROM_ALL`` set to false or not set at all, the target
+will be brought up to date as part of doing a ``make install`` or its
+equivalent for the CMake generator being used. If a target has
+``EXCLUDE_FROM_ALL`` set to true, then any attempt to install that
+target has undefined behavior. Note that such a target can still safely
+be listed in an :command:`install(TARGETS)` command as long as the install
+components the target belongs to are not part of the set of components
+that anything tries to install.
This property is enabled by default for targets that are created in
directories that have :prop_dir:`EXCLUDE_FROM_ALL` set to ``TRUE``.
diff --git a/Help/prop_tgt/GHS_NO_SOURCE_GROUP_FILE.rst b/Help/prop_tgt/GHS_NO_SOURCE_GROUP_FILE.rst
new file mode 100644
index 0000000000..11ce0b2238
--- /dev/null
+++ b/Help/prop_tgt/GHS_NO_SOURCE_GROUP_FILE.rst
@@ -0,0 +1,13 @@
+GHS_NO_SOURCE_GROUP_FILE
+------------------------
+
+``ON`` / ``OFF`` boolean to control if the project file for a target should
+be one single file or multiple files.
+
+The default behavior or when the property is ``OFF`` is to generate a project
+file for the target and then a sub-project file for each source group.
+
+When this property is ``ON`` or if :variable:`CMAKE_GHS_NO_SOURCE_GROUP_FILE`
+is ``ON`` then only a single project file is generated for the target.
+
+Supported on :generator:`Green Hills MULTI`.
diff --git a/Help/release/3.14.rst b/Help/release/3.14.rst
new file mode 100644
index 0000000000..0246071d62
--- /dev/null
+++ b/Help/release/3.14.rst
@@ -0,0 +1,381 @@
+CMake 3.14 Release Notes
+************************
+
+.. only:: html
+
+ .. contents::
+
+Changes made since CMake 3.13 include the following.
+
+New Features
+============
+
+Generators
+----------
+
+* The :generator:`Visual Studio 16 2019` generator was added. This is
+ experimental and based on "Visual Studio 2019 Preview 2" because this
+ version of VS has not been released.
+
+ The VS 2019 generator differs from generators for earlier versions
+ in that it does not provide variants that specify the target platform
+ in the generator name. Instead :variable:`CMAKE_GENERATOR_PLATFORM`
+ must be used, e.g. through the ``-A`` command-line option. Furthermore,
+ the default target platform (architecture) is now based on the *host*
+ platform. The VS host toolset selection is now based on the host
+ architecture as well.
+
+* The :generator:`Green Hills MULTI` generator has been updated:
+
+ * Now supports :ref:`Object Libraries`.
+
+ * Now warns on unsupported project types such as shared libraries.
+
+ * Now generates a top-level ``<PROJECT-NAME>.top.gpj`` for each directory
+ calling the :command:`project` command. The top-level project file
+ ``default.gpj`` is no longer created.
+
+ * Now honors target renaming and destination output control properties
+ such as :prop_tgt:`RUNTIME_OUTPUT_DIRECTORY` and :prop_tgt:`OUTPUT_NAME`.
+ This also fixes support for installation rules generated by
+ :command:`install`.
+
+ * Now honors source file properties :prop_sf:`INCLUDE_DIRECTORIES`,
+ :prop_sf:`COMPILE_DEFINITIONS`, and :prop_sf:`COMPILE_OPTIONS`.
+
+ * Now supports Dynamic Download Integrity Applications which did not include
+ Integrate Files via :prop_tgt:`GHS_INTEGRITY_APP` and setting a target
+ link flag of ``-dynamic``.
+
+ * The contents of project files now sorts sources groups and files by name.
+ Set the :prop_tgt:`GHS_NO_SOURCE_GROUP_FILE` target property to ``ON`` to
+ generate a single project file for the target instead of a project file for
+ each source group. Set the :variable:`CMAKE_GHS_NO_SOURCE_GROUP_FILE`
+ variable to enable this for all targets.
+
+File-Based API
+--------------
+
+* A file-based api for clients to get semantic buildsystem information
+ has been added. See the :manual:`cmake-file-api(7)` manual.
+ This is intended to replace the :manual:`cmake-server(7)` mode for IDEs.
+
+Platforms
+---------
+
+* CMake now supports :ref:`Cross Compiling for iOS, tvOS, or watchOS`
+ using simple toolchain files.
+
+Command-Line
+------------
+
+* The :manual:`cmake(1)` :ref:`Build Tool Mode <Build Tool Mode>`
+ (``cmake --build``) gained ``--verbose`` and ``-v`` options to
+ specify verbose build output. Some generators such as Xcode don't
+ support this option currently.
+
+* The :manual:`cmake(1)` ``-E compare_files`` command learned a new
+ ``--ignore-eol`` option to specify that end-of-line differences
+ (e.g. LF vs CRLF) should be ignored when comparing files.
+
+* The :manual:`cmake-gui(1)` dialog gained new ``-S`` and ``-B`` arguments to
+ explicitly specify source and build directories.
+
+Commands
+--------
+
+* The :command:`file` command learned a new sub-command, ``CREATE_LINK``,
+ which can be used to create hard or symbolic links.
+
+* The :command:`file` command learned a new sub-command, ``READ_SYMLINK``,
+ which can be used to determine the path that a symlink points to.
+
+* The :command:`file` command gained a ``SIZE`` mode to get the size
+ of a file on disk.
+
+* The :command:`find_package` command learned to optionally resolve
+ symbolic links in the paths to package configuration files.
+ See the :variable:`CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS` variable.
+
+* The :command:`get_filename_component` command gained new
+ ``LAST_EXT`` and ``NAME_WLE`` variants to work with the
+ extension after the last ``.`` in the name.
+
+* The :command:`if` command gained support for checking if cache variables
+ are defined with the ``DEFINED CACHE{VAR}`` syntax.
+
+* The :command:`install(CODE)` and :command:`install(SCRIPT)` commands
+ learned to support generator expressions. See policy :policy:`CMP0087`.
+
+* The :command:`install(TARGETS)` command learned how to install to an
+ appropriate default directory for a given target type, based on
+ variables from the :module:`GNUInstallDirs` module and built-in defaults,
+ in lieu of a ``DESTINATION`` argument.
+
+* The :command:`install(FILES)` and :command:`install(DIRECTORY)` commands
+ learned a new set of parameters for installing files as a file type,
+ setting the destination based on the appropriate variables from
+ :module:`GNUInstallDirs` and built-in defaults, in lieu of a
+ ``DESTINATION`` argument.
+
+* The :command:`list` operations ``REMOVE_ITEM``, ``REMOVE_DUPLICATES``,
+ ``SORT``, ``REVERSE``, and ``FILTER`` all now accept a non-existent variable
+ as the list since these operations on empty lists is also the empty list.
+
+* The :command:`list` operation ``REMOVE_AT`` now indicates that the given
+ indices are invalid for a non-existent variable or empty list.
+
+* The :command:`try_compile` and :command:`try_run` commands gained a new
+ ``LINK_OPTIONS`` option.
+
+Variables
+---------
+
+* A :variable:`CMAKE_BUILD_RPATH_USE_ORIGIN` variable and corresponding
+ :prop_tgt:`BUILD_RPATH_USE_ORIGIN` target property were added to
+ enable use of relative runtime paths (RPATHs). This helps achieving
+ relocatable and reproducible builds that are invariant of the build
+ directory.
+
+Properties
+----------
+
+* A :prop_gbl:`CMAKE_ROLE` global property was added to allow scripts to
+ determine whether they're running in project mode, script mode,
+ find-package mode, CTest, or CPack.
+
+* The :prop_tgt:`CUDA_RESOLVE_DEVICE_SYMBOLS` target property is now supported
+ on shared library, module library, and executable targets. Previously it was
+ only honored on static libraries.
+
+* The :prop_tgt:`EXCLUDE_FROM_ALL` target property was created to override
+ the setting of its directory. A target will now be built as part of "all"
+ if its :prop_tgt:`EXCLUDE_FROM_ALL` property is set to ``OFF``, even if its
+ containing directory is marked as :prop_dir:`EXCLUDE_FROM_ALL`.
+
+* :prop_tgt:`INTERFACE_POSITION_INDEPENDENT_CODE` target property gains the
+ support of :manual:`generator expressions <cmake-generator-expressions(7)>`.
+
+Modules
+-------
+
+* The family of modules to check capabilities (like
+ :module:`CheckCSourceCompiles`) gain capability to manage ``LINK_OPTIONS``.
+
+* A :module:`CheckFortranSourceRuns` module was added to provide a
+ :command:`check_fortran_source_runs` command to check if a Fortran
+ source snippet compiles and runs.
+
+* The :module:`CMakePackageConfigHelpers` module's
+ :command:`write_basic_package_version_file` command gained a new
+ ``ARCH_INDEPENDENT`` option for supporting architecture-independent
+ packages.
+
+* The :module:`ExternalProject` module :command:`ExternalProject_Add` command
+ gained ``LOG_DIR`` and ``LOG_MERGED_STDOUTERR`` options to control logging.
+
+* The :module:`ExternalProject` module :command:`ExternalProject_Add` command
+ gained ``LOG_PATCH`` to optionally log the patch step.
+
+* The :module:`ExternalProject` module :command:`ExternalProject_Add` command
+ learned to apply ``SOURCE_SUBDIR`` when ``BUILD_IN_SOURCE`` is also used.
+ The ``BUILD_COMMAND`` is run in the given ``SOURCE_SUBDIR`` of the
+ ``SOURCE_DIR``.
+
+* The :module:`FetchContent` module gained a new
+ :command:`FetchContent_MakeAvailable` command. It accepts a list of
+ dependency names, which it then iterates over, populating and adding
+ each one to the main build using the canonical pattern. This
+ significantly reduces the amount of boilerplate needed in a project.
+
+* The :module:`FindBISON` module's ``BISON_TARGET`` command now runs ``bison``
+ with :variable:`CMAKE_CURRENT_BINARY_DIR` as the working directory.
+ See policy :policy:`CMP0088`.
+
+* The :module:`FindCURL` module gained support for requesting
+ protocols as package components.
+
+* The :module:`FindFontconfig` module was added to find `fontconfig`_.
+
+* The :module:`FindGDAL` module now provides imported targets.
+
+* The :module:`FindGIF` module now provides imported targets.
+
+* The :module:`FindGit` module now provides an imported target for the
+ Git executable.
+
+* The :module:`FindIce` module learned to find ``slice2confluence``
+ and ``slice2matlab``.
+
+* The :module:`FindLibinput` module was added to find `libinput`_.
+
+* The :module:`FindLibLZMA` module now provides imported targets.
+
+* The :module:`FindMatlab` module gained new options ``R2017b`` and
+ ``R2018a`` to specify the MEX API version to use; these options
+ mirror the new options to the ``mex`` command in MATLAB R2018a.
+ The option ``MX_LIBRARY`` is no longer needed.
+
+* A :module:`FindOctave` module was added to find GNU octave.
+
+* The :module:`FindPostgreSQL` module now provides imported targets.
+
+* The :module:`FindPython`, :module:`FindPython2`, and :module:`FindPython3`
+ modules gained support for ``NumPy`` component.
+
+* The :module:`FindPython2`, :module:`FindPython3`, and :module:`FindPython`
+ modules now support running in script mode by skipping the creation of
+ imported targets and helper functions.
+
+* The :module:`FindSQLite3` module was added to find the SQLite v3.x library.
+
+* The :module:`FindX11` had the following variables renamed in order to match
+ their library names rather than header names. The old variables are provided
+ for compatibility:
+
+ - ``X11_Xxf86misc_INCLUDE_PATH`` instead of ``X11_xf86misc_INCLUDE_PATH``
+ - ``X11_Xxf86misc_LIB`` instead of ``X11_xf86misc_LIB``
+ - ``X11_Xxf86misc_FOUND`` instead of ``X11_xf86misc_FOUND``
+ - ``X11_Xxf86vm_INCLUDE_PATH`` instead of ``X11_xf86vmode_INCLUDE_PATH``
+ - ``X11_Xxf86vm_LIB`` instead of ``X11_xf86vmode_LIB``
+ - ``X11_Xxf86vm_FOUND`` instead of ``X11_xf86vmode_FOUND``
+ - ``X11_xkbfile_INCLUDE_PATH`` instead of ``X11_Xkbfile_INCLUDE_PATH``
+ - ``X11_xkbfile_LIB`` instead of ``X11_Xkbfile_LIB``
+ - ``X11_xkbfile_FOUND`` instead of ``X11_Xkbfile_FOUND``
+ - ``X11_Xtst_INCLUDE_PATH`` instead of ``X11_XTest_INCLUDE_PATH``
+ - ``X11_Xtst_LIB`` instead of ``X11_XTest_LIB``
+ - ``X11_Xtst_FOUND`` instead of ``X11_XTest_FOUND``
+ - ``X11_Xss_INCLUDE_PATH`` instead of ``X11_Xscreensaver_INCLUDE_PATH``
+ - ``X11_Xss_LIB`` instead of ``X11_Xscreensaver_LIB``
+ - ``X11_Xss_FOUND`` instead of ``X11_Xscreensaver_FOUND``
+
+ The following variables are deprecated completely since they were
+ essentially duplicates:
+
+ - ``X11_Xinput_INCLUDE_PATH`` (use ``X11_Xi_INCLUDE_PATH``)
+ - ``X11_Xinput_LIB`` (use ``X11_Xi_LIB``)
+ - ``X11_Xinput_FOUND`` (use ``X11_Xi_FOUND``)
+
+* The :module:`FindX11` now provides ``X11_Xext_INCLUDE_PATH``.
+
+* The :module:`FindX11` now provides imported targets.
+
+* The :module:`UseSWIG` module learned to pass ``-module <module_name>`` to
+ the ``SWIG`` compiler if the file property ``SWIG_MODULE_NAME`` is defined.
+ See policy :policy:`CMP0086`.
+
+* The :module:`UseSWIG` module gained an option to specify
+ ``SWIG`` source file extensions.
+
+.. _`fontconfig`: https://www.freedesktop.org/wiki/Software/fontconfig/
+.. _`libinput`: https://www.freedesktop.org/wiki/Software/libinput/
+
+Generator Expressions
+---------------------
+
+* The ``$<Fortran_COMPILER_ID:...>`` and ``$<Fortran_COMPILER_VERSION:...>``
+ :manual:`generator expressions <cmake-generator-expressions(7)>` were added.
+
+* The ``$<IN_LIST:...>`` generator expression now correctly handles an
+ empty argument. See :policy:`CMP0085` for details.
+
+Autogen
+-------
+
+* The :prop_tgt:`AUTOMOC_EXECUTABLE`, :prop_tgt:`AUTORCC_EXECUTABLE`, and
+ :prop_tgt:`AUTOUIC_EXECUTABLE` target properties were added. They all
+ take a path to an executable and force automoc/autorcc/autouic to use
+ this executable.
+
+ Setting these will also prevent the configure time testing for these
+ executables. This is mainly useful when you build these tools yourself.
+
+* The new variables :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET`,
+ :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET_NAME`,
+ :variable:`CMAKE_GLOBAL_AUTORCC_TARGET` and
+ :variable:`CMAKE_GLOBAL_AUTORCC_TARGET_NAME` control the generation
+ of global ``autogen`` and ``autorcc`` targets.
+
+* A new :variable:`CMAKE_AUTOGEN_ORIGIN_DEPENDS` variable and
+ :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS` target property may be set to enable or
+ disable forwarding of the origin target dependencies to the corresponding
+ ``_autogen`` target.
+
+CTest
+-----
+
+* :manual:`ctest(1)` gained a ``--show-only=json-v1`` option to show the
+ list of tests in a machine-readable JSON format.
+ See the :ref:`Show as JSON Object Model` section of the manual.
+
+* The :command:`ctest_submit` command learned a new ``Done`` part that can be used
+ to inform CDash that a build is complete and that no more parts will be uploaded.
+
+* CTest learned to accept the dashboard server submission URL from a single
+ variable. See the ``SubmitURL`` setting in :manual:`ctest(1)`,
+ the :variable:`CTEST_SUBMIT_URL` variable, and the ``SUBMIT_URL``
+ argument of the :command:`ctest_submit` command.
+
+Deprecated and Removed Features
+===============================
+
+* An explicit deprecation diagnostic was added for policies ``CMP0064``
+ and ``CMP0065`` (``CMP0063`` and below were already deprecated).
+ The :manual:`cmake-policies(7)` manual explains that the OLD behaviors
+ of all policies are deprecated and that projects should port to the
+ NEW behaviors.
+
+* The :generator:`Xcode` generator deprecated support for Xcode
+ versions prior to Xcode 5. Support for those will be dropped in a
+ future version of CMake.
+
+* The :module:`FindQt` module is no longer used by the :command:`find_package`
+ command as a find module. This allows the Qt Project upstream to optionally
+ provide its own ``QtConfig.cmake`` package configuration file and have
+ applications use it via ``find_package(Qt)`` rather than
+ ``find_package(Qt CONFIG)``. See policy :policy:`CMP0084`.
+
+* Support for running CMake on Windows XP and Windows Vista has been dropped.
+ The precompiled Windows binaries provided on ``cmake.org`` now require
+ Windows 7 or higher.
+
+* CTest no longer supports submissions via ``ftp``, ``scp``, ``cp``, and
+ ``xmlrpc``. CDash is the only maintained testing dashboard for CTest,
+ and it only supports submissions over ``http`` and ``https``.
+
+Other Changes
+=============
+
+* Object library linking has been fixed to propagate private link libraries
+ of object libraries to consuming targets.
+
+* Install rules under :command:`add_subdirectory` now interleave with those in
+ the calling directory. See policy :policy:`CMP0082` for details.
+
+* CMake now imposes a maximum recursion limit to prevent a stack overflow on
+ scripts that recurse infinitely. The limit can be adjusted at runtime with
+ :variable:`CMAKE_MAXIMUM_RECURSION_DEPTH`.
+
+* When using cppcheck via the :variable:`CMAKE_<LANG>_CPPCHECK` variable
+ or :prop_tgt:`<LANG>_CPPCHECK` property, the build will now fail if
+ ``cppcheck`` returns non-zero as configured by its command-line options.
+
+* Required link options to manage Position Independent Executable are now
+ added when :prop_tgt:`POSITION_INDEPENDENT_CODE` is set. The project is
+ responsible for using the :module:`CheckPIESupported` module to check for
+ ``PIE`` support to ensure that the :prop_tgt:`POSITION_INDEPENDENT_CODE`
+ target property will be honored at link time for executables. This behavior
+ is controlled by policy :policy:`CMP0083`.
+
+* :ref:`Visual Studio Generators` for VS 2010 and above learned
+ to support the ``VS_DEBUGGER_*`` properties on targets created
+ via :command:`add_custom_target`.
+
+* The :module:`CPack` module no longer defaults to the ``paxr`` value in the
+ :variable:`CPACK_DEBIAN_ARCHIVE_TYPE` variable, because ``dpkg`` has
+ never supported the PAX tar format. The ``paxr`` value will be mapped
+ to ``gnutar`` and a deprecation message emitted.
+
+* CMake no longer issues a warning if a target listed in an
+ :command:`install(TARGETS)` command has its :prop_tgt:`EXCLUDE_FROM_ALL`
+ property set to true.
diff --git a/Help/release/dev/0-sample-topic.rst b/Help/release/dev/0-sample-topic.rst
deleted file mode 100644
index e4cc01e23f..0000000000
--- a/Help/release/dev/0-sample-topic.rst
+++ /dev/null
@@ -1,7 +0,0 @@
-0-sample-topic
---------------
-
-* This is a sample release note for the change in a topic.
- Developers should add similar notes for each topic branch
- making a noteworthy change. Each document should be named
- and titled to match the topic name to avoid merge conflicts.
diff --git a/Help/release/dev/EXCLUDE_FROM_ALL.rst b/Help/release/dev/EXCLUDE_FROM_ALL.rst
deleted file mode 100644
index 519ac42e81..0000000000
--- a/Help/release/dev/EXCLUDE_FROM_ALL.rst
+++ /dev/null
@@ -1,7 +0,0 @@
-EXCLUDE_FROM_ALL
-----------------
-
-* A target's :prop_tgt:`EXCLUDE_FROM_ALL` property can now override the
- setting of its directory. A target will now be built as part of "all"
- if its :prop_tgt:`EXCLUDE_FROM_ALL` property is set to ``OFF``, even if its
- containing directory is marked as :prop_dir:`EXCLUDE_FROM_ALL`.
diff --git a/Help/release/dev/ExternalProject-log-options.rst b/Help/release/dev/ExternalProject-log-options.rst
deleted file mode 100644
index 88bc799bda..0000000000
--- a/Help/release/dev/ExternalProject-log-options.rst
+++ /dev/null
@@ -1,8 +0,0 @@
-ExternalProject-log-options
----------------------------
-
-* The :module:`ExternalProject` module :command:`ExternalProject_Add` command
- gained ``LOG_DIR`` and ``LOG_MERGED_STDOUTERR`` options to control logging.
-
-* The :module:`ExternalProject` module :command:`ExternalProject_Add` command
- gained ``LOG_PATCH`` to optionally log the patch step.
diff --git a/Help/release/dev/ExternalProject-non-cmake-source-subdir.rst b/Help/release/dev/ExternalProject-non-cmake-source-subdir.rst
deleted file mode 100644
index 29fe2ad5d5..0000000000
--- a/Help/release/dev/ExternalProject-non-cmake-source-subdir.rst
+++ /dev/null
@@ -1,7 +0,0 @@
-ExternalProject-non-cmake-source-subdir
----------------------------------------
-
-* The :module:`ExternalProject` module's ``ExternalProject_Add`` command
- learned to apply ``SOURCE_SUBDIR`` when ``BUILD_IN_SOURCE`` is also used.
- The ``BUILD_COMMAND`` is run in the given ``SOURCE_SUBDIR`` of the
- ``SOURCE_DIR``.
diff --git a/Help/release/dev/FindCURL-components.rst b/Help/release/dev/FindCURL-components.rst
deleted file mode 100644
index 9c50edeced..0000000000
--- a/Help/release/dev/FindCURL-components.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-FindCURL-components
--------------------
-
-* The :module:`FindCURL` module gained support for requesting
- protocols as package components.
diff --git a/Help/release/dev/FindGDAL-target.rst b/Help/release/dev/FindGDAL-target.rst
deleted file mode 100644
index b121a72099..0000000000
--- a/Help/release/dev/FindGDAL-target.rst
+++ /dev/null
@@ -1,4 +0,0 @@
-FindGDAL-target
----------------
-
-* The :module:`FindGDAL` module now provides an imported target.
diff --git a/Help/release/dev/FindGIF-modernize.rst b/Help/release/dev/FindGIF-modernize.rst
deleted file mode 100644
index 3bb4821113..0000000000
--- a/Help/release/dev/FindGIF-modernize.rst
+++ /dev/null
@@ -1,4 +0,0 @@
-FindGIF-modernize
------------------
-
-* The :module:`FindGIF` module now provides imported targets.
diff --git a/Help/release/dev/FindICE-more-exe.rst b/Help/release/dev/FindICE-more-exe.rst
deleted file mode 100644
index fa18a88051..0000000000
--- a/Help/release/dev/FindICE-more-exe.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-FindICE-more-exe
-----------------
-
-* The :module:`FindIce` module learned to find
- ``slice2confluence`` and ``slice2matlab``.
diff --git a/Help/release/dev/FindLibLZMA-target.rst b/Help/release/dev/FindLibLZMA-target.rst
deleted file mode 100644
index a13c45f9b6..0000000000
--- a/Help/release/dev/FindLibLZMA-target.rst
+++ /dev/null
@@ -1,4 +0,0 @@
-FindLibLZMA-target
-------------------
-
-* The :module:`FindLibLZMA` module now provides an imported target.
diff --git a/Help/release/dev/FindMatlab-2018a-API.rst b/Help/release/dev/FindMatlab-2018a-API.rst
deleted file mode 100644
index 1063411658..0000000000
--- a/Help/release/dev/FindMatlab-2018a-API.rst
+++ /dev/null
@@ -1,7 +0,0 @@
-FindMatlab-2018a-API
---------------------
-
-* The :module:`FindMatlab` module gained new options ``R2017b`` and
- ``R2018a`` to specify the MEX API version to use; these options
- mirror the new options to the ``mex`` command in MATLAB R2018a.
- The option ``MX_LIBRARY`` is no longer needed.
diff --git a/Help/release/dev/FindOctave.rst b/Help/release/dev/FindOctave.rst
deleted file mode 100644
index fe3b24219c..0000000000
--- a/Help/release/dev/FindOctave.rst
+++ /dev/null
@@ -1,4 +0,0 @@
-FindOctave
-----------
-
-* A :module:`FindOctave` module was added to find GNU octave.
diff --git a/Help/release/dev/FindPostgreSQL-target.rst b/Help/release/dev/FindPostgreSQL-target.rst
deleted file mode 100644
index 84f8d1a67d..0000000000
--- a/Help/release/dev/FindPostgreSQL-target.rst
+++ /dev/null
@@ -1,4 +0,0 @@
-FindPostgreSQL-target
----------------------
-
-* The :module:`FindPostgreSQL` module now provides an imported target.
diff --git a/Help/release/dev/FindPython-NumPy-component.rst b/Help/release/dev/FindPython-NumPy-component.rst
deleted file mode 100644
index 5ea6cfb6ca..0000000000
--- a/Help/release/dev/FindPython-NumPy-component.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-FindPython-NumPy-component
---------------------------
-
-* The :module:`FindPython`, :module:`FindPython2`, and :module:`FindPython3`
- modules gained support for ``NumPy`` component.
diff --git a/Help/release/dev/FindSQLite3-module.rst b/Help/release/dev/FindSQLite3-module.rst
deleted file mode 100644
index 733a4d3001..0000000000
--- a/Help/release/dev/FindSQLite3-module.rst
+++ /dev/null
@@ -1,4 +0,0 @@
-FindSQLite3-module
-------------------
-
-* The :module:`FindSQLite3` module was added to find the SQLite v3.x library.
diff --git a/Help/release/dev/FindX11-imported-targets.rst b/Help/release/dev/FindX11-imported-targets.rst
deleted file mode 100644
index 4df753d64b..0000000000
--- a/Help/release/dev/FindX11-imported-targets.rst
+++ /dev/null
@@ -1,32 +0,0 @@
-FindX11-imported-targets
-------------------------
-
-* The :module:`FindX11` had the following variables renamed in order to match
- their library names rather than header names. The old variables are provided
- for compatibility:
-
- - ``X11_Xxf86misc_INCLUDE_PATH`` instead of ``X11_xf86misc_INCLUDE_PATH``
- - ``X11_Xxf86misc_LIB`` instead of ``X11_xf86misc_LIB``
- - ``X11_Xxf86misc_FOUND`` instead of ``X11_xf86misc_FOUND``
- - ``X11_Xxf86vm_INCLUDE_PATH`` instead of ``X11_xf86vmode_INCLUDE_PATH``
- - ``X11_Xxf86vm_LIB`` instead of ``X11_xf86vmode_LIB``
- - ``X11_Xxf86vm_FOUND`` instead of ``X11_xf86vmode_FOUND``
- - ``X11_xkbfile_INCLUDE_PATH`` instead of ``X11_Xkbfile_INCLUDE_PATH``
- - ``X11_xkbfile_LIB`` instead of ``X11_Xkbfile_LIB``
- - ``X11_xkbfile_FOUND`` instead of ``X11_Xkbfile_FOUND``
- - ``X11_Xtst_INCLUDE_PATH`` instead of ``X11_XTest_INCLUDE_PATH``
- - ``X11_Xtst_LIB`` instead of ``X11_XTest_LIB``
- - ``X11_Xtst_FOUND`` instead of ``X11_XTest_FOUND``
- - ``X11_Xss_INCLUDE_PATH`` instead of ``X11_Xscreensaver_INCLUDE_PATH``
- - ``X11_Xss_LIB`` instead of ``X11_Xscreensaver_LIB``
- - ``X11_Xss_FOUND`` instead of ``X11_Xscreensaver_FOUND``
-
- The following variables are deprecated completely since they were
- essentially duplicates:
-
- - ``X11_Xinput_INCLUDE_PATH`` (use ``X11_Xi_INCLUDE_PATH``)
- - ``X11_Xinput_LIB`` (use ``X11_Xi_LIB``)
- - ``X11_Xinput_FOUND`` (use ``X11_Xi_FOUND``)
-
-* The :module:`FindX11` now provides ``X11_Xext_INCLUDE_PATH``.
-* The :module:`FindX11` now provides imported targets.
diff --git a/Help/release/dev/INTERFACE_POSITION_INDEPENDENT_CODE.rst b/Help/release/dev/INTERFACE_POSITION_INDEPENDENT_CODE.rst
deleted file mode 100644
index 7732ff6a26..0000000000
--- a/Help/release/dev/INTERFACE_POSITION_INDEPENDENT_CODE.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-INTERFACE_POSITION_INDEPENDENT_CODE
------------------------------------
-
-* :prop_tgt:`INTERFACE_POSITION_INDEPENDENT_CODE` target property gains the
- support of :manual:`generator expressions <cmake-generator-expressions(7)>`.
diff --git a/Help/release/dev/UseSWIG-CMP0086.rst b/Help/release/dev/UseSWIG-CMP0086.rst
deleted file mode 100644
index d6fd0d1cc6..0000000000
--- a/Help/release/dev/UseSWIG-CMP0086.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-UseSWIG-CMP0086
----------------
-
-* The :module:`UseSWIG` module passes option ``-module <module_name>`` to
- ``SWIG`` compiler if the file property ``SWIG_MODULE_NAME`` is defined.
- See policy :policy:`CMP0086`.
diff --git a/Help/release/dev/UseSWIG-source-file-ext.rst b/Help/release/dev/UseSWIG-source-file-ext.rst
deleted file mode 100644
index 5d11dc6707..0000000000
--- a/Help/release/dev/UseSWIG-source-file-ext.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-UseSWIG-source-file-ext
------------------------
-
-* The :module:`UseSWIG` module gains capability to specify
- ``SWIG`` source file extensions.
diff --git a/Help/release/dev/autogen-origin-depends.rst b/Help/release/dev/autogen-origin-depends.rst
deleted file mode 100644
index 7310487df9..0000000000
--- a/Help/release/dev/autogen-origin-depends.rst
+++ /dev/null
@@ -1,7 +0,0 @@
-autogen-origin-depends
-----------------------
-
-* A new :variable:`CMAKE_AUTOGEN_ORIGIN_DEPENDS` variable and
- :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS` target property may be set to enable or
- disable forwarding of the origin target dependencies to the corresponding
- ``_autogen`` target.
diff --git a/Help/release/dev/autogen_executables.rst b/Help/release/dev/autogen_executables.rst
deleted file mode 100644
index 5e967eadd3..0000000000
--- a/Help/release/dev/autogen_executables.rst
+++ /dev/null
@@ -1,9 +0,0 @@
-AUTO*_EXECUTABLE
-----------------
-
-* The :prop_tgt:`AUTOMOC_EXECUTABLE`, :prop_tgt:`AUTORCC_EXECUTABLE` and
- :prop_tgt:`AUTOUIC_EXECUTABLE` target properties all take a path to an
- executable and force automoc/autorcc/autouic to use this executable.
-
- Setting these will also prevent the configure time testing for these
- executables. This is mainly useful when you build these tools yourself.
diff --git a/Help/release/dev/autogen_global_target.rst b/Help/release/dev/autogen_global_target.rst
deleted file mode 100644
index d555395877..0000000000
--- a/Help/release/dev/autogen_global_target.rst
+++ /dev/null
@@ -1,8 +0,0 @@
-autogen_global_target
----------------------
-
-* The new variables :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET`,
- :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET_NAME`,
- :variable:`CMAKE_GLOBAL_AUTORCC_TARGET` and
- :variable:`CMAKE_GLOBAL_AUTORCC_TARGET_NAME` control the generation
- of global ``autogen`` and ``autorcc`` targets.
diff --git a/Help/release/dev/better-empty-list-behavior.rst b/Help/release/dev/better-empty-list-behavior.rst
deleted file mode 100644
index cd864f4ba1..0000000000
--- a/Help/release/dev/better-empty-list-behavior.rst
+++ /dev/null
@@ -1,9 +0,0 @@
-better-empty-list-behavior
---------------------------
-
-* The :command:`list` operations ``REMOVE_ITEM``, ``REMOVE_DUPLICATES``,
- ``SORT``, ``REVERSE``, and ``FILTER`` all now accept a non-existent variable
- as the list since these operations on empty lists is also the empty list.
-
-* The :command:`list` operation ``REMOVE_AT`` now indicates that the given
- indices are invalid for a non-existent variable or empty list.
diff --git a/Help/release/dev/bison_target_policy.rst b/Help/release/dev/bison_target_policy.rst
deleted file mode 100644
index 3240318518..0000000000
--- a/Help/release/dev/bison_target_policy.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-bison_target_policy
--------------------
-
-* The :module:`FindBISON` module's ``BISON_TARGET`` command now runs ``bison``
- with :variable:`CMAKE_CURRENT_BINARY_DIR` as the working directory.
- See policy :policy:`CMP0088`.
diff --git a/Help/release/dev/check-fortran-run.rst b/Help/release/dev/check-fortran-run.rst
deleted file mode 100644
index b5f6558d56..0000000000
--- a/Help/release/dev/check-fortran-run.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-check-fortran-run
------------------
-
-* A :module:`CheckFortranSourceRuns` module was added to provide a
- :command:`check_fortran_source_runs` command to check if a Fortran
- source snippet compiles and runs.
diff --git a/Help/release/dev/check-functions-LINK_OPTIONS.rst b/Help/release/dev/check-functions-LINK_OPTIONS.rst
deleted file mode 100644
index a6bfed2b6b..0000000000
--- a/Help/release/dev/check-functions-LINK_OPTIONS.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-check-functions-LINK_OPTIONS
-----------------------------
-
-* The family of modules to check capabilities (like
- :module:`CheckCSourceCompiles`) gain capability to manage ``LINK_OPTIONS``.
diff --git a/Help/release/dev/cmake_role-global-property.rst b/Help/release/dev/cmake_role-global-property.rst
deleted file mode 100644
index 7b1fa0bfb9..0000000000
--- a/Help/release/dev/cmake_role-global-property.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-cmake_role-global-property
---------------------------
-
-* A new global property, :prop_gbl:`CMAKE_ROLE`, was added to allow scripts to
- determine whether they're running in project mode, script mode, find-package
- mode, CTest, or CPack.
diff --git a/Help/release/dev/cpack-deb-tar-format.rst b/Help/release/dev/cpack-deb-tar-format.rst
deleted file mode 100644
index 9296ec65b4..0000000000
--- a/Help/release/dev/cpack-deb-tar-format.rst
+++ /dev/null
@@ -1,7 +0,0 @@
-cpack-deb-tar-format
---------------------
-
-* The :module:`CPack` module no longer defaults to the ``paxr`` value in the
- :variable:`CPACK_DEBIAN_ARCHIVE_TYPE` variable, because ``dpkg`` has
- never supported the PAX tar format. The ``paxr`` value will be mapped
- to ``gnutar`` and a deprecation message emitted.
diff --git a/Help/release/dev/cppcheck-exit-code.rst b/Help/release/dev/cppcheck-exit-code.rst
deleted file mode 100644
index d66c762fb2..0000000000
--- a/Help/release/dev/cppcheck-exit-code.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-cppcheck-exit-code
-------------------
-
-* When using cppcheck via the :variable:`CMAKE_<LANG>_CPPCHECK` variable
- or :prop_tgt:`<LANG>_CPPCHECK` property, the build will now fail if
- ``cppcheck`` returns non-zero as configured by its command-line options.
diff --git a/Help/release/dev/ctest-done.rst b/Help/release/dev/ctest-done.rst
deleted file mode 100644
index 9ec0e24eeb..0000000000
--- a/Help/release/dev/ctest-done.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-ctest-done
-----------
-
-* The :command:`ctest_submit` command learned a new ``Done`` part that can be used
- to inform CDash that a build is complete and that no more parts will be uploaded.
diff --git a/Help/release/dev/ctest-show-only-json-v1.rst b/Help/release/dev/ctest-show-only-json-v1.rst
deleted file mode 100644
index f593e7e795..0000000000
--- a/Help/release/dev/ctest-show-only-json-v1.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-ctest-show-only-json-v1
------------------------
-
-* :manual:`ctest(1)` gained a ``--show-only=json-v1`` option to show the
- list of tests in a machine-readable JSON format.
- See the :ref:`Show as JSON Object Model` section of the manual.
diff --git a/Help/release/dev/ctest-submit-url.rst b/Help/release/dev/ctest-submit-url.rst
deleted file mode 100644
index f848877fbf..0000000000
--- a/Help/release/dev/ctest-submit-url.rst
+++ /dev/null
@@ -1,7 +0,0 @@
-ctest-submit-url
-----------------
-
-* CTest learned to accept the dashboard server submission URL from a single
- variable. See the ``SubmitURL`` setting in :manual:`ctest(1)`,
- the :variable:`CTEST_SUBMIT_URL` variable, and the ``SUBMIT_URL``
- argument of the :command:`ctest_submit` command.
diff --git a/Help/release/dev/deprecate-findqt.rst b/Help/release/dev/deprecate-findqt.rst
deleted file mode 100644
index 4171c65d9c..0000000000
--- a/Help/release/dev/deprecate-findqt.rst
+++ /dev/null
@@ -1,8 +0,0 @@
-deprecate-findqt
-----------------
-
-* The :module:`FindQt` module is no longer used by the :command:`find_package`
- command as a find module. This allows the Qt Project upstream to optionally
- provide its own ``QtConfig.cmake`` package configuration file and have
- applications use it via ``find_package(Qt)`` rather than
- ``find_package(Qt CONFIG)``. See policy :policy:`CMP0084`.
diff --git a/Help/release/dev/deprecate-policy-old.rst b/Help/release/dev/deprecate-policy-old.rst
deleted file mode 100644
index 2c99780637..0000000000
--- a/Help/release/dev/deprecate-policy-old.rst
+++ /dev/null
@@ -1,8 +0,0 @@
-deprecate-policy-old
---------------------
-
-* An explicit deprecation diagnostic was added for policies ``CMP0064``
- and ``CMP0065`` (``CMP0063`` and below were already deprecated).
- The :manual:`cmake-policies(7)` manual explains that the OLD behaviors
- of all policies are deprecated and that projects should port to the
- NEW behaviors.
diff --git a/Help/release/dev/file-read_symlink.rst b/Help/release/dev/file-read_symlink.rst
deleted file mode 100644
index 718802effd..0000000000
--- a/Help/release/dev/file-read_symlink.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-file-read_symlink
------------------
-
-* The :command:`file` command learned a new sub-command, ``READ_SYMLINK``,
- which can be used to determine the path that a symlink points to.
diff --git a/Help/release/dev/file-size.rst b/Help/release/dev/file-size.rst
deleted file mode 100644
index 4f0e196a24..0000000000
--- a/Help/release/dev/file-size.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-file-size
----------
-
-* The :command:`file` command gained a ``SIZE`` mode to get the size
- of a file on disk.
diff --git a/Help/release/dev/fileapi.rst b/Help/release/dev/fileapi.rst
deleted file mode 100644
index c3f03efb90..0000000000
--- a/Help/release/dev/fileapi.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-fileapi
--------
-
-* A file-based api for clients to get semantic buildsystem information
- has been added. See the :manual:`cmake-file-api(7)` manual.
diff --git a/Help/release/dev/find-package-resolve-symlinks.rst b/Help/release/dev/find-package-resolve-symlinks.rst
deleted file mode 100644
index 7adb9fe622..0000000000
--- a/Help/release/dev/find-package-resolve-symlinks.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-find-package-resolve-symlinks
------------------------------
-
-* The :command:`find_package` command learned to optionally resolve
- symbolic links in the paths to package configuration files.
- See the :variable:`CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS` variable.
diff --git a/Help/release/dev/find_fontconfig.rst b/Help/release/dev/find_fontconfig.rst
deleted file mode 100644
index 4ae18c973c..0000000000
--- a/Help/release/dev/find_fontconfig.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-find_fontconfig
----------------
-
-* The :module:`FindFontconfig` module was added to find `fontconfig`_.
-
-.. _`fontconfig`: https://www.freedesktop.org/wiki/Software/fontconfig/
diff --git a/Help/release/dev/find_libinput.rst b/Help/release/dev/find_libinput.rst
deleted file mode 100644
index ebb9e7ae5d..0000000000
--- a/Help/release/dev/find_libinput.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-find_libinput
--------------
-
-* The :module:`FindLibinput` module was added to find `libinput`_.
-
-.. _`libinput`: https://www.freedesktop.org/wiki/Software/libinput/
diff --git a/Help/release/dev/findgit-imported-target.rst b/Help/release/dev/findgit-imported-target.rst
deleted file mode 100644
index cabbae5128..0000000000
--- a/Help/release/dev/findgit-imported-target.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-findgit-imported-target
------------------------
-
-* The :module:`FindGit` module now provides an ``IMPORTED`` target for the Git
- executable.
diff --git a/Help/release/dev/findpython-script.rst b/Help/release/dev/findpython-script.rst
deleted file mode 100644
index 5de1ebfd0f..0000000000
--- a/Help/release/dev/findpython-script.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-findpython-script
------------------
-
-* The :module:`FindPython2`, :module:`FindPython3`, and :module:`FindPython`
- modules now support running in script mode by skipping the creation of
- imported targets and helper functions.
diff --git a/Help/release/dev/fortran-compiler-id.rst b/Help/release/dev/fortran-compiler-id.rst
deleted file mode 100644
index 1ea3bf9a17..0000000000
--- a/Help/release/dev/fortran-compiler-id.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-Fortran_COMPILER_ID
--------------------
-
-* The ``$<Fortran_COMPILER_ID:...>`` and ``$<Fortran_COMPILER_VERSION:...>``
- :manual:`generator expressions <cmake-generator-expressions(7)>` were added.
diff --git a/Help/release/dev/genex-in_list-empty-args.rst b/Help/release/dev/genex-in_list-empty-args.rst
deleted file mode 100644
index ec1c6c0297..0000000000
--- a/Help/release/dev/genex-in_list-empty-args.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-genex-in_list-empty-args
-------------------------
-
-* The $<IN_LIST:...> generator expression now correctly handles an empty
- argument. See :policy:`CMP0085` for details.
diff --git a/Help/release/dev/if-supports-cache-defined.rst b/Help/release/dev/if-supports-cache-defined.rst
deleted file mode 100644
index 1e700c0bb4..0000000000
--- a/Help/release/dev/if-supports-cache-defined.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-if-supports-cache-defined
--------------------------
-
-* The :command:`if` command gained support for checking if cache variables
- are defined with the ``DEFINED CACHE{VAR}`` syntax.
diff --git a/Help/release/dev/install-code-script-genex.rst b/Help/release/dev/install-code-script-genex.rst
deleted file mode 100644
index a28a46667c..0000000000
--- a/Help/release/dev/install-code-script-genex.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-install-code-script-genex
--------------------------
-
-* The :command:`install(CODE)` and :command:`install(SCRIPT)` commands
- learned to support generator expressions. See policy :policy:`CMP0087`.
diff --git a/Help/release/dev/install-defaults.rst b/Help/release/dev/install-defaults.rst
deleted file mode 100644
index 4f31b7e057..0000000000
--- a/Help/release/dev/install-defaults.rst
+++ /dev/null
@@ -1,12 +0,0 @@
-install-defaults
-----------------
-
-* The ``TARGETS`` variant of the :command:`install` command learned how to
- install to an appropriate default directory for a given target type, based
- on variables from the :module:`GNUInstallDirs` module and built-in defaults,
- in lieu of a ``DESTINATION`` argument.
-* The ``FILES`` and ``DIRECTORY`` variants of the :command:`install` command
- learned a new set of parameters for installing files as a file type, setting
- the destination based on the appropriate variables from
- :module:`GNUInstallDirs` and built-in defaults, in lieu of a ``DESTINATION``
- argument.
diff --git a/Help/release/dev/install-subdirectory-order.rst b/Help/release/dev/install-subdirectory-order.rst
deleted file mode 100644
index c52e6176a3..0000000000
--- a/Help/release/dev/install-subdirectory-order.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-install-subdirectory-order
---------------------------
-
-* Install rules under :command:`add_subdirectory` now interleave with those in
- the calling directory. See policy :policy:`CMP0082` for details.
diff --git a/Help/release/dev/link-option-PIE.rst b/Help/release/dev/link-option-PIE.rst
deleted file mode 100644
index 872343ca84..0000000000
--- a/Help/release/dev/link-option-PIE.rst
+++ /dev/null
@@ -1,9 +0,0 @@
-link-option-PIE
----------------
-
-* Required link options to manage Position Independent Executable are now
- added when :prop_tgt:`POSITION_INDEPENDENT_CODE` is set. The project is
- responsible for using the :module:`CheckPIESupported` module to check for
- ``PIE`` support to ensure that the :prop_tgt:`POSITION_INDEPENDENT_CODE`
- target property will be honored at link time for executables. This behavior
- is controlled by policy :policy:`CMP0083`.
diff --git a/Help/release/dev/max-recursion-depth.rst b/Help/release/dev/max-recursion-depth.rst
deleted file mode 100644
index 3d9c781dcd..0000000000
--- a/Help/release/dev/max-recursion-depth.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-max-recursion-depth
--------------------
-
-* CMake now imposes a maximum recursion limit to prevent a stack overflow on
- scripts that recurse infinitely. The limit can be adjusted at runtime with
- :variable:`CMAKE_MAXIMUM_RECURSION_DEPTH`.
diff --git a/Help/release/dev/object-library-link.rst b/Help/release/dev/object-library-link.rst
deleted file mode 100644
index 990d9150c3..0000000000
--- a/Help/release/dev/object-library-link.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-object-library-link
--------------------
-
-* Object library linking has been fixed to propagate transitive link
- dependencies of object libraries to consuming targets.
diff --git a/Help/release/dev/rel-win7.rst b/Help/release/dev/rel-win7.rst
deleted file mode 100644
index f7a745c44b..0000000000
--- a/Help/release/dev/rel-win7.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-rel-win7
---------
-
-* Support for running CMake on Windows XP and Windows Vista has been dropped.
- The precompiled Windows binaries provided on ``cmake.org`` now require
- Windows 7 or higher.
diff --git a/Help/release/dev/relative-rpath.rst b/Help/release/dev/relative-rpath.rst
deleted file mode 100644
index 5c62b106c8..0000000000
--- a/Help/release/dev/relative-rpath.rst
+++ /dev/null
@@ -1,8 +0,0 @@
-relative-rpath
---------------
-
-* A :variable:`CMAKE_BUILD_RPATH_USE_ORIGIN` variable and corresponding
- :prop_tgt:`BUILD_RPATH_USE_ORIGIN` target property were added to
- enable use of relative runtime paths (RPATHs). This helps achieving
- relocatable and reproducible builds that are invariant of the build
- directory.
diff --git a/Help/release/dev/submit-method.rst b/Help/release/dev/submit-method.rst
deleted file mode 100644
index 38f0b9237a..0000000000
--- a/Help/release/dev/submit-method.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-submit-method
--------------
-
-* CTest no longer supports submissions via ``ftp``, ``scp``, ``cp``, and
- ``xmlrpc``. CDash is the only maintained testing dashboard for CTest,
- and it only supports submissions over ``http`` and ``https``.
diff --git a/Help/release/dev/try_compile-LINK_OPTIONS.rst b/Help/release/dev/try_compile-LINK_OPTIONS.rst
deleted file mode 100644
index 1db485bfa1..0000000000
--- a/Help/release/dev/try_compile-LINK_OPTIONS.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-try_compile-LINK_OPTIONS
-------------------------
-
-* The commands :command:`try_compile` and :command:`try_run` gain new
- option ``LINK_OPTIONS``.
diff --git a/Help/release/dev/vs-debug-utility-targets.rst b/Help/release/dev/vs-debug-utility-targets.rst
deleted file mode 100644
index 02e5262059..0000000000
--- a/Help/release/dev/vs-debug-utility-targets.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-vs-debug-utility-targets
-------------------------
-
-* :ref:`Visual Studio Generators` for VS 2010 and above learned
- to support the ``VS_DEBUGGER_*`` properties on targets created
- via :command:`add_custom_target`.
diff --git a/Help/release/dev/vs2019.rst b/Help/release/dev/vs2019.rst
deleted file mode 100644
index 1ffdeec2fd..0000000000
--- a/Help/release/dev/vs2019.rst
+++ /dev/null
@@ -1,13 +0,0 @@
-vs2019
-------
-
-* The :generator:`Visual Studio 16 2019` generator was added. This is
- experimental and based on "Visual Studio 2019 Preview 1.1" because this
- version of VS has not been released.
-
- The VS 2019 generator differs from generators for earlier versions
- in that it does not provide variants that specify the target platform
- in the generator name. Instead :variable:`CMAKE_GENERATOR_PLATFORM`
- must be used, e.g. through the ``-A`` command-line option. Furthermore,
- the default target platform (architecture) is now based on the *host*
- platform.
diff --git a/Help/release/index.rst b/Help/release/index.rst
index 7ef3a8ed73..4fcd4ca4fd 100644
--- a/Help/release/index.rst
+++ b/Help/release/index.rst
@@ -7,14 +7,13 @@ CMake Release Notes
This file should include the adjacent "dev.txt" file
in development versions but not in release versions.
-.. include:: dev.txt
-
Releases
========
.. toctree::
:maxdepth: 1
+ 3.14 <3.14>
3.13 <3.13>
3.12 <3.12>
3.11 <3.11>
diff --git a/Help/variable/CMAKE_GENERATOR_TOOLSET.rst b/Help/variable/CMAKE_GENERATOR_TOOLSET.rst
index e9bc28b9e5..e77f211dd3 100644
--- a/Help/variable/CMAKE_GENERATOR_TOOLSET.rst
+++ b/Help/variable/CMAKE_GENERATOR_TOOLSET.rst
@@ -44,8 +44,8 @@ Supported pairs are:
and above with the CUDA toolkit VS integration installed.
See the :variable:`CMAKE_VS_PLATFORM_TOOLSET_CUDA` variable.
-``host=x64``
- Request use of the native ``x64`` toolchain on ``x64`` hosts.
+``host=<arch>``
+ Specify the host tools architecture as ``x64`` or ``x86``.
Supported by VS 2013 and above.
See the :variable:`CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE`
variable.
diff --git a/Help/variable/CMAKE_GHS_NO_SOURCE_GROUP_FILE.rst b/Help/variable/CMAKE_GHS_NO_SOURCE_GROUP_FILE.rst
new file mode 100644
index 0000000000..b6768a131a
--- /dev/null
+++ b/Help/variable/CMAKE_GHS_NO_SOURCE_GROUP_FILE.rst
@@ -0,0 +1,6 @@
+CMAKE_GHS_NO_SOURCE_GROUP_FILE
+------------------------------
+
+``ON`` / ``OFF`` boolean to control if the project file for a target should
+be one single file or multiple files. Refer to
+:prop_tgt:`GHS_NO_SOURCE_GROUP_FILE` for further details.
diff --git a/Help/variable/CMAKE_HOME_DIRECTORY.rst b/Help/variable/CMAKE_HOME_DIRECTORY.rst
index fdc5d81901..b03d956186 100644
--- a/Help/variable/CMAKE_HOME_DIRECTORY.rst
+++ b/Help/variable/CMAKE_HOME_DIRECTORY.rst
@@ -1,6 +1,9 @@
CMAKE_HOME_DIRECTORY
--------------------
-Path to top of source tree.
+Path to top of source tree. Same as :variable:`CMAKE_SOURCE_DIR`.
-This is the path to the top level of the source tree.
+This is an internal cache entry used to locate the source directory
+when loading a ``CMakeCache.txt`` from a build tree. It should not
+be used in project code. The variable :variable:`CMAKE_SOURCE_DIR`
+has the same value and should be preferred.
diff --git a/Help/variable/CMAKE_LANG_COMPILER_ID.rst b/Help/variable/CMAKE_LANG_COMPILER_ID.rst
index 033e81cdb7..5323880d58 100644
--- a/Help/variable/CMAKE_LANG_COMPILER_ID.rst
+++ b/Help/variable/CMAKE_LANG_COMPILER_ID.rst
@@ -17,6 +17,7 @@ include:
Clang = LLVM Clang (clang.llvm.org)
Cray = Cray Compiler (cray.com)
Embarcadero, Borland = Embarcadero (embarcadero.com)
+ Flang = Flang LLVM Fortran Compiler
G95 = G95 Fortran (g95.org)
GNU = GNU Compiler Collection (gcc.gnu.org)
GHS = Green Hills Software (www.ghs.com)
@@ -28,7 +29,6 @@ include:
NVIDIA = NVIDIA CUDA Compiler (nvidia.com)
OpenWatcom = Open Watcom (openwatcom.org)
PGI = The Portland Group (pgroup.com)
- Flang = Flang Fortran Compiler
PathScale = PathScale (pathscale.com)
SDCC = Small Device C Compiler (sdcc.sourceforge.net)
SunPro = Oracle Solaris Studio (oracle.com)
diff --git a/Help/variable/CMAKE_LANG_CREATE_SHARED_LIBRARY.rst b/Help/variable/CMAKE_LANG_CREATE_SHARED_LIBRARY.rst
index be89f8529d..16fcc03447 100644
--- a/Help/variable/CMAKE_LANG_CREATE_SHARED_LIBRARY.rst
+++ b/Help/variable/CMAKE_LANG_CREATE_SHARED_LIBRARY.rst
@@ -4,4 +4,5 @@ CMAKE_<LANG>_CREATE_SHARED_LIBRARY
Rule variable to create a shared library.
This is a rule variable that tells CMake how to create a shared
-library for the language ``<LANG>``.
+library for the language ``<LANG>``. This rule variable is a ``;`` delimited
+list of commands to run to perform the linking step.
diff --git a/Help/variable/CMAKE_LANG_CREATE_SHARED_MODULE.rst b/Help/variable/CMAKE_LANG_CREATE_SHARED_MODULE.rst
index ae5f69d569..807229dec2 100644
--- a/Help/variable/CMAKE_LANG_CREATE_SHARED_MODULE.rst
+++ b/Help/variable/CMAKE_LANG_CREATE_SHARED_MODULE.rst
@@ -4,4 +4,5 @@ CMAKE_<LANG>_CREATE_SHARED_MODULE
Rule variable to create a shared module.
This is a rule variable that tells CMake how to create a shared
-library for the language ``<LANG>``.
+library for the language ``<LANG>``. This rule variable is a ``;`` delimited
+list of commands to run.
diff --git a/Help/variable/CMAKE_LANG_IMPLICIT_INCLUDE_DIRECTORIES.rst b/Help/variable/CMAKE_LANG_IMPLICIT_INCLUDE_DIRECTORIES.rst
index cc80851074..e361fd98e7 100644
--- a/Help/variable/CMAKE_LANG_IMPLICIT_INCLUDE_DIRECTORIES.rst
+++ b/Help/variable/CMAKE_LANG_IMPLICIT_INCLUDE_DIRECTORIES.rst
@@ -6,4 +6,9 @@ Directories implicitly searched by the compiler for header files.
CMake does not explicitly specify these directories on compiler
command lines for language ``<LANG>``. This prevents system include
directories from being treated as user include directories on some
-compilers.
+compilers, which is important for ``C``, ``CXX``, and ``CUDA`` to
+avoid overriding standard library headers.
+
+This value is not used for ``Fortran`` because it has no standard
+library headers and some compilers do not search their implicit
+include directories for module ``.mod`` files.
diff --git a/Help/variable/CMAKE_Swift_LANGUAGE_VERSION.rst b/Help/variable/CMAKE_Swift_LANGUAGE_VERSION.rst
index 50121e2862..b4a74eb036 100644
--- a/Help/variable/CMAKE_Swift_LANGUAGE_VERSION.rst
+++ b/Help/variable/CMAKE_Swift_LANGUAGE_VERSION.rst
@@ -1,5 +1,9 @@
CMAKE_Swift_LANGUAGE_VERSION
----------------------------
-Set to the Swift language version number. If not set, the legacy "2.3"
-version is assumed.
+Set to the Swift language version number. If not set, the oldest legacy
+version known to be available in the host Xcode version is assumed:
+
+* Swift ``4.0`` for Xcode 10.2 and above.
+* Swift ``3.0`` for Xcode 8.3 and above.
+* Swift ``2.3`` for Xcode 8.2 and below.
diff --git a/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE.rst b/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE.rst
index 9b59c52a64..99ac90ddc6 100644
--- a/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE.rst
+++ b/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE.rst
@@ -3,8 +3,8 @@ CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE
Visual Studio preferred tool architecture.
-The :ref:`Visual Studio Generators` for VS 2013 and above support optional
-selection of a 64-bit toolchain on 64-bit hosts by specifying a ``host=x64``
-value in the :variable:`CMAKE_GENERATOR_TOOLSET` option. CMake provides
-the selected toolchain architecture preference in this variable (either
-``x64`` or empty).
+The :ref:`Visual Studio Generators` for VS 2013 and above support using
+either the 32-bit or 64-bit host toolchains by specifying a ``host=x86``
+or ``host=x64`` value in the :variable:`CMAKE_GENERATOR_TOOLSET` option.
+CMake provides the selected toolchain architecture preference in this
+variable (``x86``, ``x64``, or empty).
diff --git a/Help/variable/MSYS.rst b/Help/variable/MSYS.rst
new file mode 100644
index 0000000000..25ddc7f739
--- /dev/null
+++ b/Help/variable/MSYS.rst
@@ -0,0 +1,4 @@
+MSYS
+----
+
+``True`` when using the :generator:`MSYS Makefiles` generator.
diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake
index 86928fa47d..b8c8c5d353 100644
--- a/Modules/CMakeDetermineASMCompiler.cmake
+++ b/Modules/CMakeDetermineASMCompiler.cmake
@@ -83,7 +83,7 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_XL "XL C")
list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS MSVC )
- set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_MSVC "/?")
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_MSVC "-?")
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_MSVC "Microsoft")
list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS TI )
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index 4f355f3535..d7f6f97d00 100644
--- a/Modules/CMakeDetermineCCompiler.cmake
+++ b/Modules/CMakeDetermineCCompiler.cmake
@@ -106,7 +106,7 @@ if(NOT CMAKE_C_COMPILER_ID_RUN)
# ...
# /path/to/cc ...CompilerIdC/...
# to extract the compiler front-end for the language.
- set(CMAKE_C_COMPILER_ID_TOOL_MATCH_REGEX "\nLd[^\n]*(\n[ \t]+[^\n]*)*\n[ \t]+([^ \t\r\n]+)[^\r\n]*-o[^\r\n]*CompilerIdC/(\\./)?(CompilerIdC.xctest/)?CompilerIdC[ \t\n\\\"]")
+ set(CMAKE_C_COMPILER_ID_TOOL_MATCH_REGEX "\nLd[^\n]*(\n[ \t]+[^\n]*)*\n[ \t]+([^ \t\r\n]+)[^\r\n]*-o[^\r\n]*CompilerIdC/(\\./)?(CompilerIdC.(framework|xctest)/)?CompilerIdC[ \t\n\\\"]")
set(CMAKE_C_COMPILER_ID_TOOL_MATCH_INDEX 2)
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake
index 96b420915a..bd878b2928 100644
--- a/Modules/CMakeDetermineCXXCompiler.cmake
+++ b/Modules/CMakeDetermineCXXCompiler.cmake
@@ -101,7 +101,7 @@ if(NOT CMAKE_CXX_COMPILER_ID_RUN)
# ...
# /path/to/cc ...CompilerIdCXX/...
# to extract the compiler front-end for the language.
- set(CMAKE_CXX_COMPILER_ID_TOOL_MATCH_REGEX "\nLd[^\n]*(\n[ \t]+[^\n]*)*\n[ \t]+([^ \t\r\n]+)[^\r\n]*-o[^\r\n]*CompilerIdCXX/(\\./)?(CompilerIdCXX.xctest/)?CompilerIdCXX[ \t\n\\\"]")
+ set(CMAKE_CXX_COMPILER_ID_TOOL_MATCH_REGEX "\nLd[^\n]*(\n[ \t]+[^\n]*)*\n[ \t]+([^ \t\r\n]+)[^\r\n]*-o[^\r\n]*CompilerIdCXX/(\\./)?(CompilerIdCXX.(framework|xctest)/)?CompilerIdCXX[ \t\n\\\"]")
set(CMAKE_CXX_COMPILER_ID_TOOL_MATCH_INDEX 2)
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake
index e55b83f04b..e0d2449223 100644
--- a/Modules/CMakeDetermineCompilerABI.cmake
+++ b/Modules/CMakeDetermineCompilerABI.cmake
@@ -89,16 +89,24 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src)
endif()
# Parse implicit include directory for this language, if available.
- set (implicit_incdirs "")
if(CMAKE_${lang}_VERBOSE_FLAG)
+ set (implicit_incdirs "")
cmake_parse_implicit_include_info("${OUTPUT}" "${lang}"
implicit_incdirs log rv)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Parsed ${lang} implicit include dir info from above output: rv=${rv}\n${log}\n\n")
- if("${rv}" STREQUAL "done") # update parent if parse completed ok
- set(CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES "${implicit_incdirs}" PARENT_SCOPE)
+ if("${rv}" STREQUAL "done")
+ # Entries that we have been told to explicitly pass as standard include
+ # directories will not be implicitly added by the compiler.
+ if(CMAKE_${lang}_STANDARD_INCLUDE_DIRECTORIES)
+ list(REMOVE_ITEM implicit_incdirs ${CMAKE_${lang}_STANDARD_INCLUDE_DIRECTORIES})
+ endif()
+
+ # We parsed implicit include directories, so override the default initializer.
+ set(_CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES_INIT "${implicit_incdirs}")
endif()
endif()
+ set(CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES "${_CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES_INIT}" PARENT_SCOPE)
# Parse implicit linker information for this language, if available.
set(implicit_dirs "")
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 2a0dbd3ca3..8ba4246a47 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -332,6 +332,8 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
if("${lang}" STREQUAL "Swift")
if(CMAKE_Swift_LANGUAGE_VERSION)
set(id_lang_version "SWIFT_VERSION = ${CMAKE_Swift_LANGUAGE_VERSION};")
+ elseif(XCODE_VERSION VERSION_GREATER_EQUAL 10.2)
+ set(id_lang_version "SWIFT_VERSION = 4.0;")
elseif(XCODE_VERSION VERSION_GREATER_EQUAL 8.3)
set(id_lang_version "SWIFT_VERSION = 3.0;")
else()
@@ -352,21 +354,20 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
if(CMAKE_OSX_SYSROOT MATCHES "(^|/)[Ii][Pp][Hh][Oo][Nn][Ee]" OR
CMAKE_OSX_SYSROOT MATCHES "(^|/)[Aa][Pp][Pp][Ll][Ee][Tt][Vv]")
set(id_product_type "com.apple.product-type.bundle.unit-test")
+ elseif(CMAKE_OSX_SYSROOT MATCHES "(^|/)[Ww][Aa][Tt][Cc][Hh]")
+ set(id_product_type "com.apple.product-type.framework")
endif()
else()
set(id_sdkroot "")
endif()
- if(CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM)
- set(id_development_team
- "DEVELOPMENT_TEAM = \"${CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM}\";")
- else()
- set(id_development_team "")
- endif()
- if(DEFINED CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY)
- set(id_code_sign_identity
- "CODE_SIGN_IDENTITY = \"${CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY}\";")
- else()
- set(id_code_sign_identity "")
+ set(id_clang_cxx_library "")
+ set(stdlib_regex "(^| )(-stdlib=)([^ ]+)( |$)")
+ string(REGEX MATCHALL "${stdlib_regex}" all_stdlib_matches "${CMAKE_CXX_FLAGS}")
+ if(all_stdlib_matches)
+ list(GET all_stdlib_matches "-1" last_stdlib_match)
+ if(last_stdlib_match MATCHES "${stdlib_regex}")
+ set(id_clang_cxx_library "CLANG_CXX_LIBRARY = \"${CMAKE_MATCH_3}\";")
+ endif()
endif()
configure_file(${CMAKE_ROOT}/Modules/CompilerId/Xcode-3.pbxproj.in
${id_dir}/CompilerId${lang}.xcodeproj/project.pbxproj @ONLY)
@@ -491,6 +492,9 @@ ${CMAKE_${lang}_COMPILER_ID_OUTPUT}
# com.apple.package-type.bundle.unit-test
${_glob_id_dir}/*.xctest/*
+
+ # com.apple.product-type.framework
+ ${_glob_id_dir}/*.framework/*
)
list(REMOVE_ITEM files "${src}")
set(COMPILER_${lang}_PRODUCED_FILES "")
@@ -820,7 +824,7 @@ function(CMAKE_DIAGNOSE_UNSUPPORTED_CLANG lang envvar)
endif()
# Test whether an MSVC-like command-line option works.
- execute_process(COMMAND "${CMAKE_${lang}_COMPILER}" /?
+ execute_process(COMMAND "${CMAKE_${lang}_COMPILER}" -?
RESULT_VARIABLE _clang_result
OUTPUT_VARIABLE _clang_stdout
ERROR_VARIABLE _clang_stderr)
diff --git a/Modules/CMakeDetermineVSServicePack.cmake b/Modules/CMakeDetermineVSServicePack.cmake
index 9edc309a04..a3c4d9cf1d 100644
--- a/Modules/CMakeDetermineVSServicePack.cmake
+++ b/Modules/CMakeDetermineVSServicePack.cmake
@@ -79,7 +79,7 @@ endfunction()
function(_DetermineVSServicePack_FastCheckVersionWithCompiler _SUCCESS_VAR _VERSION_VAR)
if(EXISTS ${CMAKE_CXX_COMPILER})
execute_process(
- COMMAND ${CMAKE_CXX_COMPILER} /?
+ COMMAND ${CMAKE_CXX_COMPILER} -?
ERROR_VARIABLE _output
OUTPUT_QUIET
)
diff --git a/Modules/CMakeFortranCompiler.cmake.in b/Modules/CMakeFortranCompiler.cmake.in
index 9b951fc4e2..ae7b73ac4a 100644
--- a/Modules/CMakeFortranCompiler.cmake.in
+++ b/Modules/CMakeFortranCompiler.cmake.in
@@ -61,6 +61,7 @@ endif()
@CMAKE_Fortran_SYSROOT_FLAG_CODE@
@CMAKE_Fortran_OSX_DEPLOYMENT_TARGET_FLAG_CODE@
+set(CMAKE_Fortran_IMPLICIT_INCLUDE_DIRECTORIES "@CMAKE_Fortran_IMPLICIT_INCLUDE_DIRECTORIES@")
set(CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES "@CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES@")
set(CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES "@CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES@")
set(CMAKE_Fortran_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_Fortran_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")
diff --git a/Modules/CMakeParseImplicitIncludeInfo.cmake b/Modules/CMakeParseImplicitIncludeInfo.cmake
index 9901fea48a..21e24b7fcd 100644
--- a/Modules/CMakeParseImplicitIncludeInfo.cmake
+++ b/Modules/CMakeParseImplicitIncludeInfo.cmake
@@ -11,9 +11,10 @@ function(cmake_parse_implicit_include_line line lang id_var log_var state_var)
unset(rv)
set(log "")
- # ccfe: cray compiler front end (PrgEnv-cray)
+ # Cray compiler (from cray wrapper, via PrgEnv-cray)
if("${CMAKE_${lang}_COMPILER_ID}" STREQUAL "Cray" AND
- "${line}" MATCHES "-isystem")
+ "${line}" MATCHES "^/" AND "${line}" MATCHES "/ccfe |/ftnfe " AND
+ "${line}" MATCHES " -isystem| -I")
string(REGEX MATCHALL " (-I ?|-isystem )([^ ]*)" incs "${line}")
foreach(inc IN LISTS incs)
string(REGEX REPLACE " (-I ?|-isystem )([^ ]*)" "\\2" idir "${inc}")
@@ -26,10 +27,129 @@ function(cmake_parse_implicit_include_line line lang id_var log_var state_var)
endif()
endif()
+ # PGI compiler
+ if("${CMAKE_${lang}_COMPILER_ID}" STREQUAL "PGI")
+ # pgc++ verbose output differs
+ if(("${lang}" STREQUAL "C" OR "${lang}" STREQUAL "Fortran") AND
+ "${line}" MATCHES "^/" AND
+ "${line}" MATCHES "/pgc |/pgf901 |/pgftnc " AND
+ "${line}" MATCHES " -cmdline ")
+ # cmdline has unparsed cmdline, remove it
+ string(REGEX REPLACE "-cmdline .*" "" line "${line}")
+ if("${line}" MATCHES " -nostdinc ")
+ set(rv "") # defined, but empty
+ else()
+ string(REGEX MATCHALL " -stdinc ([^ ]*)" incs "${line}")
+ foreach(inc IN LISTS incs)
+ string(REGEX REPLACE " -stdinc ([^ ]*)" "\\1" idir "${inc}")
+ string(REPLACE ":" ";" idir "${idir}")
+ list(APPEND rv ${idir})
+ endforeach()
+ endif()
+ if(DEFINED rv)
+ string(APPEND log " got implicit includes via PGI C/F parser!\n")
+ else()
+ string(APPEND log " warning: PGI C/F parse failed!\n")
+ endif()
+ elseif("${lang}" STREQUAL "CXX" AND "${line}" MATCHES "^/" AND
+ "${line}" MATCHES "/pggpp1 " AND "${line}" MATCHES " -I")
+ # oddly, -Mnostdinc does not get rid of system -I's, at least in
+ # PGI 18.10.1 ...
+ string(REGEX MATCHALL " (-I ?)([^ ]*)" incs "${line}")
+ foreach(inc IN LISTS incs)
+ string(REGEX REPLACE " (-I ?)([^ ]*)" "\\2" idir "${inc}")
+ if(NOT "${idir}" STREQUAL "-") # filter out "-I-"
+ list(APPEND rv "${idir}")
+ endif()
+ endforeach()
+ if(DEFINED rv)
+ string(APPEND log " got implicit includes via PGI CXX parser!\n")
+ else()
+ string(APPEND log " warning: PGI CXX parse failed!\n")
+ endif()
+ endif()
+ endif()
+
+ # SunPro compiler
+ if("${CMAKE_${lang}_COMPILER_ID}" STREQUAL "SunPro" AND
+ ("${line}" MATCHES "-D__SUNPRO_C" OR "${line}" MATCHES "-D__SUNPRO_F") )
+ string(REGEX MATCHALL " (-I ?)([^ ]*)" incs "${line}")
+ foreach(inc IN LISTS incs)
+ string(REGEX REPLACE " (-I ?)([^ ]*)" "\\2" idir "${inc}")
+ if(NOT "${idir}" STREQUAL "-xbuiltin")
+ list(APPEND rv "${idir}")
+ endif()
+ endforeach()
+ if(rv)
+ if ("${lang}" STREQUAL "C" OR "${lang}" STREQUAL "CXX")
+ # /usr/include appears to be hardwired in
+ list(APPEND rv "/usr/include")
+ endif()
+ string(APPEND log " got implicit includes via sunpro parser!\n")
+ else()
+ string(APPEND log " warning: sunpro parse failed!\n")
+ endif()
+ endif()
+
+ # XL compiler
+ if("${CMAKE_${lang}_COMPILER_ID}" STREQUAL "XL" AND "${line}" MATCHES "^/"
+ AND ( ("${lang}" STREQUAL "Fortran" AND
+ "${line}" MATCHES "/xl[fF]entry " AND
+ "${line}" MATCHES "OSVAR\\([^ ]+\\)")
+ OR
+ ( ("${lang}" STREQUAL "C" OR "${lang}" STREQUAL "CXX") AND
+ "${line}" MATCHES "/xl[cC]entry " AND
+ "${line}" MATCHES " -qosvar=")
+ ) )
+ # -qnostdinc cancels other stdinc flags, even if present
+ string(FIND "${line}" " -qnostdinc" nostd)
+ if(NOT ${nostd} EQUAL -1)
+ set(rv "") # defined but empty
+ string(APPEND log " got implicit includes via XL parser (nostdinc)\n")
+ else()
+ if("${lang}" STREQUAL "CXX")
+ string(REGEX MATCHALL " -qcpp_stdinc=([^ ]*)" std "${line}")
+ string(REGEX MATCHALL " -qgcc_cpp_stdinc=([^ ]*)" gcc_std "${line}")
+ else()
+ string(REGEX MATCHALL " -qc_stdinc=([^ ]*)" std "${line}")
+ string(REGEX MATCHALL " -qgcc_c_stdinc=([^ ]*)" gcc_std "${line}")
+ endif()
+ set(xlstd ${std} ${gcc_std})
+ foreach(inc IN LISTS xlstd)
+ string(REGEX REPLACE " -q(cpp|gcc_cpp|c|gcc_c)_stdinc=([^ ]*)" "\\2"
+ ipath "${inc}")
+ string(REPLACE ":" ";" ipath "${ipath}")
+ list(APPEND rv ${ipath})
+ endforeach()
+ endif()
+ # user can add -I flags via CMAKE_{C,CXX}_FLAGS, look for that too
+ string(REGEX MATCHALL " (-I ?)([^ ]*)" incs "${line}")
+ unset(urv)
+ foreach(inc IN LISTS incs)
+ string(REGEX REPLACE " (-I ?)([^ ]*)" "\\2" idir "${inc}")
+ list(APPEND urv "${idir}")
+ endforeach()
+ if(urv)
+ if ("${rv}" STREQUAL "")
+ set(rv ${urv})
+ else()
+ list(APPEND rv ${urv})
+ endif()
+ endif()
+
+ if(DEFINED rv)
+ string(APPEND log " got implicit includes via XL parser!\n")
+ else()
+ string(APPEND log " warning: XL parse failed!\n")
+ endif()
+ endif()
+
if(log)
set(${log_var} "${log}" PARENT_SCOPE)
+ else()
+ unset(${log_var} PARENT_SCOPE)
endif()
- if(rv)
+ if(DEFINED rv)
set(${id_var} "${rv}" PARENT_SCOPE)
set(${state_var} "done" PARENT_SCOPE)
endif()
@@ -48,10 +168,11 @@ function(cmake_parse_implicit_include_info text lang dir_var log_var state_var)
string(REGEX REPLACE "\r?\n" ";" output_lines "${text}")
foreach(line IN LISTS output_lines)
if(state STREQUAL start)
- string(FIND "${line}" "#include <...> search starts here:" rv)
+ string(FIND "${line}" "#include \"...\" search starts here:" rv)
if(rv GREATER -1)
set(state loading)
- string(APPEND log " found start of implicit include info\n")
+ set(preload 1) # looking for include <...> now
+ string(APPEND log " found start of include info\n")
else()
cmake_parse_implicit_include_line("${line}" "${lang}" implicit_dirs_tmp
linelog state)
@@ -68,15 +189,24 @@ function(cmake_parse_implicit_include_info text lang dir_var log_var state_var)
set(state done)
string(APPEND log " end of search list found\n")
break()
- else()
- string(STRIP "${line}" path) # remove leading/trailing spaces
- if ("${path}" MATCHES " \\(framework directory\\)$")
- continue() # frameworks are handled elsewhere, ignore them here
+ endif()
+ if(preload)
+ string(FIND "${line}" "#include <...> search starts here:" rv)
+ if(rv GREATER -1)
+ set(preload 0)
+ string(APPEND log " found start of implicit include info\n")
endif()
- string(REPLACE "\\" "/" path "${path}")
- list(APPEND implicit_dirs_tmp "${path}")
- string(APPEND log " add: [${path}]\n")
+ continue()
+ endif()
+ if("${line}" MATCHES "^ ")
+ string(SUBSTRING "${line}" 1 -1 line) # remove leading space
+ endif()
+ if ("${line}" MATCHES " \\(framework directory\\)$")
+ continue() # frameworks are handled elsewhere, ignore them here
endif()
+ string(REPLACE "\\" "/" path "${line}")
+ list(APPEND implicit_dirs_tmp "${path}")
+ string(APPEND log " add: [${path}]\n")
endif()
endforeach()
diff --git a/Modules/CMakeTestCCompiler.cmake b/Modules/CMakeTestCCompiler.cmake
index f74a1c64de..7bf6fde3b5 100644
--- a/Modules/CMakeTestCCompiler.cmake
+++ b/Modules/CMakeTestCCompiler.cmake
@@ -11,6 +11,12 @@ endif()
include(CMakeTestCompilerCommon)
+# work around enforced code signing and / or missing exectuable target type
+set(__CMAKE_SAVED_TRY_COMPILE_TARGET_TYPE ${CMAKE_TRY_COMPILE_TARGET_TYPE})
+if(_CMAKE_FEATURE_DETECTION_TARGET_TYPE)
+ set(CMAKE_TRY_COMPILE_TARGET_TYPE ${_CMAKE_FEATURE_DETECTION_TARGET_TYPE})
+endif()
+
# Remove any cached result from an older CMake version.
# We now store this in CMakeCCompiler.cmake.
unset(CMAKE_C_COMPILER_WORKS CACHE)
@@ -86,4 +92,6 @@ else()
endif()
endif()
+set(CMAKE_TRY_COMPILE_TARGET_TYPE ${__CMAKE_SAVED_TRY_COMPILE_TARGET_TYPE})
+unset(__CMAKE_SAVED_TRY_COMPILE_TARGET_TYPE)
unset(__CMAKE_C_COMPILER_OUTPUT)
diff --git a/Modules/CMakeTestCXXCompiler.cmake b/Modules/CMakeTestCXXCompiler.cmake
index fe6bd253f4..7e595b74f2 100644
--- a/Modules/CMakeTestCXXCompiler.cmake
+++ b/Modules/CMakeTestCXXCompiler.cmake
@@ -11,6 +11,12 @@ endif()
include(CMakeTestCompilerCommon)
+# work around enforced code signing and / or missing exectuable target type
+set(__CMAKE_SAVED_TRY_COMPILE_TARGET_TYPE ${CMAKE_TRY_COMPILE_TARGET_TYPE})
+if(_CMAKE_FEATURE_DETECTION_TARGET_TYPE)
+ set(CMAKE_TRY_COMPILE_TARGET_TYPE ${_CMAKE_FEATURE_DETECTION_TARGET_TYPE})
+endif()
+
# Remove any cached result from an older CMake version.
# We now store this in CMakeCXXCompiler.cmake.
unset(CMAKE_CXX_COMPILER_WORKS CACHE)
@@ -79,4 +85,6 @@ else()
endif()
endif()
+set(CMAKE_TRY_COMPILE_TARGET_TYPE ${__CMAKE_SAVED_TRY_COMPILE_TARGET_TYPE})
+unset(__CMAKE_SAVED_TRY_COMPILE_TARGET_TYPE)
unset(__CMAKE_CXX_COMPILER_OUTPUT)
diff --git a/Modules/CPack.background.png.in b/Modules/CPack.background.png.in
index 9339e7cad2..a32ab3762e 100644
--- a/Modules/CPack.background.png.in
+++ b/Modules/CPack.background.png.in
Binary files differ
diff --git a/Modules/CPackIFW.cmake b/Modules/CPackIFW.cmake
index 141e842549..83809778eb 100644
--- a/Modules/CPackIFW.cmake
+++ b/Modules/CPackIFW.cmake
@@ -518,7 +518,7 @@ macro(_cpack_ifw_resolve_script _variable)
get_filename_component(${_ifw_script_macro} ${_ifw_script_file} ABSOLUTE)
set(_ifw_script_file ${${_ifw_script_macro}})
if(NOT EXISTS ${_ifw_script_file})
- message(WARNING "CPack IFW: script file \"${_ifw_script_file}\" is not exists")
+ message(WARNING "CPack IFW: script file \"${_ifw_script_file}\" does not exist")
set(${_ifw_script_macro})
endif()
endif()
diff --git a/Modules/CheckCXXSourceRuns.cmake b/Modules/CheckCXXSourceRuns.cmake
index 7db976bce8..5e3f195817 100644
--- a/Modules/CheckCXXSourceRuns.cmake
+++ b/Modules/CheckCXXSourceRuns.cmake
@@ -103,7 +103,8 @@ macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
-DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH}
"${CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES}"
- COMPILE_OUTPUT_VARIABLE OUTPUT)
+ COMPILE_OUTPUT_VARIABLE OUTPUT
+ RUN_OUTPUT_VARIABLE RUN_OUTPUT)
# if it did not compile make the return value fail code of 1
if(NOT ${VAR}_COMPILED)
@@ -118,6 +119,8 @@ macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Performing C++ SOURCE FILE Test ${VAR} succeeded with the following output:\n"
"${OUTPUT}\n"
+ "...and run output:\n"
+ "${RUN_OUTPUT}\n"
"Return value: ${${VAR}}\n"
"Source file was:\n${SOURCE}\n")
else()
@@ -133,6 +136,8 @@ macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n"
"${OUTPUT}\n"
+ "...and run output:\n"
+ "${RUN_OUTPUT}\n"
"Return value: ${${VAR}_EXITCODE}\n"
"Source file was:\n${SOURCE}\n")
endif()
diff --git a/Modules/CheckFortranSourceRuns.cmake b/Modules/CheckFortranSourceRuns.cmake
index 13fdb0bedd..a80c13d007 100644
--- a/Modules/CheckFortranSourceRuns.cmake
+++ b/Modules/CheckFortranSourceRuns.cmake
@@ -133,7 +133,8 @@ macro(CHECK_Fortran_SOURCE_RUNS SOURCE VAR)
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
-DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH}
"${CHECK_Fortran_SOURCE_COMPILES_ADD_INCLUDES}"
- COMPILE_OUTPUT_VARIABLE OUTPUT)
+ COMPILE_OUTPUT_VARIABLE OUTPUT
+ RUN_OUTPUT_VARIABLE RUN_OUTPUT)
# if it did not compile make the return value fail code of 1
if(NOT ${VAR}_COMPILED)
@@ -148,6 +149,8 @@ macro(CHECK_Fortran_SOURCE_RUNS SOURCE VAR)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Performing Fortran SOURCE FILE Test ${VAR} succeeded with the following output:\n"
"${OUTPUT}\n"
+ "...and run output:\n"
+ "${RUN_OUTPUT}\n"
"Return value: ${${VAR}}\n"
"Source file was:\n${SOURCE}\n")
else()
@@ -163,6 +166,8 @@ macro(CHECK_Fortran_SOURCE_RUNS SOURCE VAR)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing Fortran SOURCE FILE Test ${VAR} failed with the following output:\n"
"${OUTPUT}\n"
+ "...and run output:\n"
+ "${RUN_OUTPUT}\n"
"Return value: ${${VAR}_EXITCODE}\n"
"Source file was:\n${SOURCE}\n")
endif()
diff --git a/Modules/Compiler/Cray-CXX.cmake b/Modules/Compiler/Cray-CXX.cmake
index ff97e92aab..85a316793e 100644
--- a/Modules/Compiler/Cray-CXX.cmake
+++ b/Modules/Compiler/Cray-CXX.cmake
@@ -2,7 +2,7 @@
# file Copyright.txt or https://cmake.org/licensing for details.
include(Compiler/Cray)
-__compiler_cray(C)
+__compiler_cray(CXX)
string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -DNDEBUG")
diff --git a/Modules/Compiler/CrayPrgEnv-C.cmake b/Modules/Compiler/CrayPrgEnv-C.cmake
index 6b461ce060..76aa93b95d 100644
--- a/Modules/Compiler/CrayPrgEnv-C.cmake
+++ b/Modules/Compiler/CrayPrgEnv-C.cmake
@@ -4,8 +4,4 @@ endif()
set(__craylinux_crayprgenv_c 1)
include(Compiler/CrayPrgEnv)
-macro(__CrayPrgEnv_setup_C compiler_cmd link_cmd)
- __CrayPrgEnv_setup(C
- ${CMAKE_ROOT}/Modules/CMakeCCompilerABI.c
- ${compiler_cmd} ${link_cmd})
-endmacro()
+__CrayPrgEnv_setup(C)
diff --git a/Modules/Compiler/CrayPrgEnv-CXX.cmake b/Modules/Compiler/CrayPrgEnv-CXX.cmake
index aad85b67e2..442370ecce 100644
--- a/Modules/Compiler/CrayPrgEnv-CXX.cmake
+++ b/Modules/Compiler/CrayPrgEnv-CXX.cmake
@@ -4,8 +4,4 @@ endif()
set(__craylinux_crayprgenv_cxx 1)
include(Compiler/CrayPrgEnv)
-macro(__CrayPrgEnv_setup_CXX compiler_cmd link_cmd)
- __CrayPrgEnv_setup(CXX
- ${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp
- ${compiler_cmd} ${link_cmd})
-endmacro()
+__CrayPrgEnv_setup(CXX)
diff --git a/Modules/Compiler/CrayPrgEnv-Cray-C.cmake b/Modules/Compiler/CrayPrgEnv-Cray-C.cmake
deleted file mode 100644
index 547a4b4d5d..0000000000
--- a/Modules/Compiler/CrayPrgEnv-Cray-C.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-if(__craylinux_crayprgenv_cray_c)
- return()
-endif()
-set(__craylinux_crayprgenv_cray_c 1)
-
-include(Compiler/CrayPrgEnv-C)
-__CrayPrgEnv_setup_C("/opt/cray/cce/.*/ccfe" "/opt/cray/cce/.*/ld")
diff --git a/Modules/Compiler/CrayPrgEnv-Cray-CXX.cmake b/Modules/Compiler/CrayPrgEnv-Cray-CXX.cmake
deleted file mode 100644
index df8452c15a..0000000000
--- a/Modules/Compiler/CrayPrgEnv-Cray-CXX.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-if(__craylinux_crayprgenv_cray_cxx)
- return()
-endif()
-set(__craylinux_crayprgenv_cray_cxx 1)
-
-include(Compiler/CrayPrgEnv-CXX)
-__CrayPrgEnv_setup_CXX("/opt/cray/cce/.*/ccfe" "/opt/cray/cce/.*/ld")
diff --git a/Modules/Compiler/CrayPrgEnv-Cray-Fortran.cmake b/Modules/Compiler/CrayPrgEnv-Cray-Fortran.cmake
deleted file mode 100644
index 9f46a04c89..0000000000
--- a/Modules/Compiler/CrayPrgEnv-Cray-Fortran.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-if(__craylinux_crayprgenv_cray_fortran)
- return()
-endif()
-set(__craylinux_crayprgenv_cray_fortran 1)
-
-include(Compiler/CrayPrgEnv-Fortran)
-__CrayPrgEnv_setup_Fortran("/opt/cray/cce/.*/ftnfe" "/opt/cray/cce/.*/ld")
diff --git a/Modules/Compiler/CrayPrgEnv-Fortran.cmake b/Modules/Compiler/CrayPrgEnv-Fortran.cmake
index 9c4d2694ae..85f82d3f7b 100644
--- a/Modules/Compiler/CrayPrgEnv-Fortran.cmake
+++ b/Modules/Compiler/CrayPrgEnv-Fortran.cmake
@@ -4,8 +4,4 @@ endif()
set(__craylinux_crayprgenv_fortran 1)
include(Compiler/CrayPrgEnv)
-macro(__CrayPrgEnv_setup_Fortran compiler_cmd link_cmd)
- __CrayPrgEnv_setup(Fortran
- ${CMAKE_ROOT}/Modules/CMakeFortranCompilerABI.F
- ${compiler_cmd} ${link_cmd})
-endmacro()
+__CrayPrgEnv_setup(Fortran)
diff --git a/Modules/Compiler/CrayPrgEnv-GNU-C.cmake b/Modules/Compiler/CrayPrgEnv-GNU-C.cmake
deleted file mode 100644
index 248081b872..0000000000
--- a/Modules/Compiler/CrayPrgEnv-GNU-C.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-if(__craylinux_crayprgenv_gnu_c)
- return()
-endif()
-set(__craylinux_crayprgenv_gnu_c 1)
-
-include(Compiler/CrayPrgEnv-C)
-__CrayPrgEnv_setup_C("/opt/gcc/.*/cc1" "/opt/gcc/.*/collect2")
diff --git a/Modules/Compiler/CrayPrgEnv-GNU-CXX.cmake b/Modules/Compiler/CrayPrgEnv-GNU-CXX.cmake
deleted file mode 100644
index be4eb6d544..0000000000
--- a/Modules/Compiler/CrayPrgEnv-GNU-CXX.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-if(__craylinux_crayprgenv_gnu_cxx)
- return()
-endif()
-set(__craylinux_crayprgenv_gnu_cxx 1)
-
-include(Compiler/CrayPrgEnv-CXX)
-__CrayPrgEnv_setup_CXX("/opt/gcc/.*/cc1plus" "/opt/gcc/.*/collect2")
diff --git a/Modules/Compiler/CrayPrgEnv-GNU-Fortran.cmake b/Modules/Compiler/CrayPrgEnv-GNU-Fortran.cmake
deleted file mode 100644
index 8bd23ff88f..0000000000
--- a/Modules/Compiler/CrayPrgEnv-GNU-Fortran.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-if(__craylinux_crayprgenv_gnu_fortran)
- return()
-endif()
-set(__craylinux_crayprgenv_gnu_fortran 1)
-
-include(Compiler/CrayPrgEnv-Fortran)
-__CrayPrgEnv_setup_Fortran("/opt/gcc/.*/f951" "/opt/gcc/.*/collect2")
diff --git a/Modules/Compiler/CrayPrgEnv-Intel-C.cmake b/Modules/Compiler/CrayPrgEnv-Intel-C.cmake
deleted file mode 100644
index 83c4e3801d..0000000000
--- a/Modules/Compiler/CrayPrgEnv-Intel-C.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-if(__craylinux_crayprgenv_intel_c)
- return()
-endif()
-set(__craylinux_crayprgenv_intel_c 1)
-
-include(Compiler/CrayPrgEnv-C)
-__CrayPrgEnv_setup_C("/opt/intel/.*/mcpcom" "^ld ")
diff --git a/Modules/Compiler/CrayPrgEnv-Intel-CXX.cmake b/Modules/Compiler/CrayPrgEnv-Intel-CXX.cmake
deleted file mode 100644
index 3c3c3e63fd..0000000000
--- a/Modules/Compiler/CrayPrgEnv-Intel-CXX.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-if(__craylinux_crayprgenv_intel_cxx)
- return()
-endif()
-set(__craylinux_crayprgenv_intel_cxx 1)
-
-include(Compiler/CrayPrgEnv-CXX)
-__CrayPrgEnv_setup_CXX("/opt/intel/.*/mcpcom" "^ld ")
diff --git a/Modules/Compiler/CrayPrgEnv-Intel-Fortran.cmake b/Modules/Compiler/CrayPrgEnv-Intel-Fortran.cmake
deleted file mode 100644
index 08a316d2c4..0000000000
--- a/Modules/Compiler/CrayPrgEnv-Intel-Fortran.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-if(__craylinux_crayprgenv_intel_fortran)
- return()
-endif()
-set(__craylinux_crayprgenv_intel_fortran 1)
-
-include(Compiler/CrayPrgEnv-Fortran)
-__CrayPrgEnv_setup_Fortran("/opt/intel/.*/fortcom" "^ld ")
diff --git a/Modules/Compiler/CrayPrgEnv-PGI-C.cmake b/Modules/Compiler/CrayPrgEnv-PGI-C.cmake
deleted file mode 100644
index f45767cafb..0000000000
--- a/Modules/Compiler/CrayPrgEnv-PGI-C.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-if(__craylinux_crayprgenv_pgi_c)
- return()
-endif()
-set(__craylinux_crayprgenv_pgi_c 1)
-
-include(Compiler/CrayPrgEnv-C)
-__CrayPrgEnv_setup_C("/opt/pgi/[^ ]*/pgc" "/usr/bin/ld")
diff --git a/Modules/Compiler/CrayPrgEnv-PGI-CXX.cmake b/Modules/Compiler/CrayPrgEnv-PGI-CXX.cmake
deleted file mode 100644
index a2a286f8c3..0000000000
--- a/Modules/Compiler/CrayPrgEnv-PGI-CXX.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-if(__craylinux_crayprgenv_pgi_cxx)
- return()
-endif()
-set(__craylinux_crayprgenv_pgi_cxx 1)
-
-include(Compiler/CrayPrgEnv-CXX)
-__CrayPrgEnv_setup_CXX("/opt/pgi/[^ ]*/pgcpp" "/usr/bin/ld")
diff --git a/Modules/Compiler/CrayPrgEnv-PGI-Fortran.cmake b/Modules/Compiler/CrayPrgEnv-PGI-Fortran.cmake
deleted file mode 100644
index f6ba7c0fa0..0000000000
--- a/Modules/Compiler/CrayPrgEnv-PGI-Fortran.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-if(__craylinux_crayprgenv_pgi_fortran)
- return()
-endif()
-set(__craylinux_crayprgenv_pgi_fortran 1)
-
-include(Compiler/CrayPrgEnv-Fortran)
-__CrayPrgEnv_setup_Fortran("/opt/pgi/[^ ]*/pgf" "/usr/bin/ld")
diff --git a/Modules/Compiler/CrayPrgEnv.cmake b/Modules/Compiler/CrayPrgEnv.cmake
index 05e3fc7634..6c1c770161 100644
--- a/Modules/Compiler/CrayPrgEnv.cmake
+++ b/Modules/Compiler/CrayPrgEnv.cmake
@@ -4,54 +4,7 @@ if(__craylinux_crayprgenv)
endif()
set(__craylinux_crayprgenv 1)
-macro(__cray_extract_args cmd tag_regex out_var make_absolute)
- string(REGEX MATCHALL "${tag_regex}" args "${cmd}")
- foreach(arg IN LISTS args)
- string(REGEX REPLACE "^${tag_regex}$" "\\2" param "${arg}")
- if(make_absolute)
- get_filename_component(param "${param}" ABSOLUTE)
- endif()
- list(APPEND ${out_var} ${param})
- endforeach()
-endmacro()
-
-function(__cray_extract_implicit src compiler_cmd link_cmd lang include_dirs_var link_dirs_var link_libs_var)
- set(BIN "${CMAKE_PLATFORM_INFO_DIR}/CrayExtractImplicit_${lang}.bin")
- execute_process(
- COMMAND ${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_VERBOSE_FLAG} -o ${BIN}
- RESULT_VARIABLE result
- OUTPUT_VARIABLE output
- ERROR_VARIABLE error
- )
- if(EXISTS "${BIN}")
- file(REMOVE "${BIN}")
- endif()
- set(include_dirs)
- set(link_dirs)
- set(link_libs)
- string(REGEX REPLACE "\r?\n" ";" output_lines "${output}\n${error}")
- foreach(line IN LISTS output_lines)
- if("${line}" MATCHES "${compiler_cmd}")
- __cray_extract_args("${line}" " -(I ?|isystem )([^ ]*)" include_dirs 1)
- set(processed_include 1)
- endif()
- if("${line}" MATCHES "${link_cmd}")
- __cray_extract_args("${line}" " -(L ?)([^ ]*)" link_dirs 1)
- __cray_extract_args("${line}" " -(l ?)([^ ]*)" link_libs 0)
- set(processed_link 1)
- endif()
- if(processed_include AND processed_link)
- break()
- endif()
- endforeach()
-
- set(${include_dirs_var} "${include_dirs}" PARENT_SCOPE)
- set(${link_dirs_var} "${link_dirs}" PARENT_SCOPE)
- set(${link_libs_var} "${link_libs}" PARENT_SCOPE)
- set(CRAY_${lang}_EXTRACTED_IMPLICIT 1 CACHE INTERNAL "" FORCE)
-endfunction()
-
-macro(__CrayPrgEnv_setup lang test_src compiler_cmd link_cmd)
+macro(__CrayPrgEnv_setup lang)
if(DEFINED ENV{CRAYPE_VERSION})
message(STATUS "Cray Programming Environment $ENV{CRAYPE_VERSION} ${lang}")
elseif(DEFINED ENV{ASYNCPE_VERSION})
@@ -81,12 +34,4 @@ macro(__CrayPrgEnv_setup lang test_src compiler_cmd link_cmd)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
set(CMAKE_LINK_SEARCH_START_STATIC TRUE)
endif()
- if(NOT CRAY_${lang}_EXTRACTED_IMPLICIT)
- __cray_extract_implicit(
- ${test_src} ${compiler_cmd} ${link_cmd} ${lang}
- CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES
- CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES
- CMAKE_${lang}_IMPLICIT_LINK_LIBRARIES
- )
- endif()
endmacro()
diff --git a/Modules/Compiler/Flang-Fortran.cmake b/Modules/Compiler/Flang-Fortran.cmake
index d522739478..f0e61d8248 100644
--- a/Modules/Compiler/Flang-Fortran.cmake
+++ b/Modules/Compiler/Flang-Fortran.cmake
@@ -1,6 +1,9 @@
include(Compiler/Clang)
__compiler_clang(Fortran)
+set(CMAKE_Fortran_SUBMODULE_SEP "-")
+set(CMAKE_Fortran_SUBMODULE_EXT ".mod")
+
set(CMAKE_Fortran_PREPROCESS_SOURCE
"<CMAKE_Fortran_COMPILER> -cpp <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
diff --git a/Modules/Compiler/GNU-Fortran.cmake b/Modules/Compiler/GNU-Fortran.cmake
index c333d500b4..6413769cfc 100644
--- a/Modules/Compiler/GNU-Fortran.cmake
+++ b/Modules/Compiler/GNU-Fortran.cmake
@@ -1,6 +1,9 @@
include(Compiler/GNU)
__compiler_gnu(Fortran)
+set(CMAKE_Fortran_SUBMODULE_SEP "@")
+set(CMAKE_Fortran_SUBMODULE_EXT ".smod")
+
set(CMAKE_Fortran_PREPROCESS_SOURCE
"<CMAKE_Fortran_COMPILER> -cpp <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> -o <PREPROCESSED_SOURCE>")
diff --git a/Modules/Compiler/Intel-CXX-FeatureTests.cmake b/Modules/Compiler/Intel-CXX-FeatureTests.cmake
index 0df6c0fe92..aa35b977e0 100644
--- a/Modules/Compiler/Intel-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/Intel-CXX-FeatureTests.cmake
@@ -24,7 +24,7 @@ set(DETECT_CXX14 "((__cplusplus >= 201300L) || ((__cplusplus == 201103L) && !def
unset(DETECT_BUGGY_ICC15)
set(Intel17_CXX14 "__INTEL_COMPILER >= 1700 && ${DETECT_CXX14}")
-set(_cmake_feature_test_cxx_relaxed_constexpr "__cpp_constexpr >= 201304 || (${Intel17_CXX14} && __INTEL_COMPILER != 1800 && !defined(_MSC_VER))")
+set(_cmake_feature_test_cxx_relaxed_constexpr "__cpp_constexpr >= 201304 || (${Intel17_CXX14} && !(__INTEL_COMPILER == 1800 && __INTEL_COMPILER_UPDATE < 5) && !defined(_MSC_VER))")
set(Intel16_CXX14 "__INTEL_COMPILER >= 1600 && ${DETECT_CXX14}")
set(_cmake_feature_test_cxx_aggregate_default_initializers "${Intel16_CXX14}")
diff --git a/Modules/Compiler/Intel-Fortran.cmake b/Modules/Compiler/Intel-Fortran.cmake
index a1320555af..5275ddf648 100644
--- a/Modules/Compiler/Intel-Fortran.cmake
+++ b/Modules/Compiler/Intel-Fortran.cmake
@@ -1,6 +1,9 @@
include(Compiler/Intel)
__compiler_intel(Fortran)
+set(CMAKE_Fortran_SUBMODULE_SEP "@")
+set(CMAKE_Fortran_SUBMODULE_EXT ".smod")
+
set(CMAKE_Fortran_MODDIR_FLAG "-module ")
set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-fixed")
set(CMAKE_Fortran_FORMAT_FREE_FLAG "-free")
diff --git a/Modules/Compiler/PGI-Fortran.cmake b/Modules/Compiler/PGI-Fortran.cmake
index a183c339bc..3daf7987e2 100644
--- a/Modules/Compiler/PGI-Fortran.cmake
+++ b/Modules/Compiler/PGI-Fortran.cmake
@@ -1,6 +1,9 @@
include(Compiler/PGI)
__compiler_pgi(Fortran)
+set(CMAKE_Fortran_SUBMODULE_SEP "-")
+set(CMAKE_Fortran_SUBMODULE_EXT ".mod")
+
set(CMAKE_Fortran_PREPROCESS_SOURCE
"<CMAKE_Fortran_COMPILER> -Mpreprocess <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
diff --git a/Modules/Compiler/XL-Fortran.cmake b/Modules/Compiler/XL-Fortran.cmake
index 6bab6f69e0..c4fb09712a 100644
--- a/Modules/Compiler/XL-Fortran.cmake
+++ b/Modules/Compiler/XL-Fortran.cmake
@@ -1,6 +1,9 @@
include(Compiler/XL)
__compiler_xl(Fortran)
+set(CMAKE_Fortran_SUBMODULE_SEP "_")
+set(CMAKE_Fortran_SUBMODULE_EXT ".smod")
+
set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-qfixed") # [=<right_margin>]
set(CMAKE_Fortran_FORMAT_FREE_FLAG "-qfree") # [=f90|ibm]
diff --git a/Modules/CompilerId/Xcode-3.pbxproj.in b/Modules/CompilerId/Xcode-3.pbxproj.in
index 4686b645bc..672044e135 100644
--- a/Modules/CompilerId/Xcode-3.pbxproj.in
+++ b/Modules/CompilerId/Xcode-3.pbxproj.in
@@ -72,8 +72,7 @@
1DEB928608733DD80010E9CD = {
isa = XCBuildConfiguration;
buildSettings = {
- @id_development_team@
- @id_code_sign_identity@
+ CODE_SIGN_IDENTITY = "";
PRODUCT_NAME = CompilerId@id_lang@;
};
name = Debug;
@@ -87,6 +86,7 @@
SYMROOT = .;
@id_toolset@
@id_lang_version@
+ @id_clang_cxx_library@
@id_deployment_target@
@id_sdkroot@
};
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index c5d6b4576f..e097894455 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -550,7 +550,8 @@ External Project Definition
When enabled, the output of the test step is logged to files.
``LOG_MERGED_STDOUTERR <bool>``
- When enabled, the output the step is not split by stdout and stderr.
+ When enabled, stdout and stderr will be merged for any step whose
+ output is being logged to files.
``LOG_OUTPUT_ON_FAILURE <bool>``
This option only has an effect if at least one of the other ``LOG_<step>``
diff --git a/Modules/FetchContent.cmake b/Modules/FetchContent.cmake
index c65ae9ed77..5716b0112f 100644
--- a/Modules/FetchContent.cmake
+++ b/Modules/FetchContent.cmake
@@ -20,9 +20,12 @@ configure step to use the content in commands like :command:`add_subdirectory`,
:command:`include` or :command:`file` operations.
Content population details would normally be defined separately from the
-command that performs the actual population. Projects should also
-check whether the content has already been populated somewhere else in the
-project hierarchy. Typical usage would look something like this:
+command that performs the actual population. This separation ensures that
+all of the dependency details are defined before anything may try to use those
+details to populate content. This is particularly important in more complex
+project hierarchies where dependencies may be shared between multiple projects.
+
+The following shows a typical example of declaring content details:
.. code-block:: cmake
@@ -32,21 +35,37 @@ project hierarchy. Typical usage would look something like this:
GIT_TAG release-1.8.0
)
+For most typical cases, populating the content can then be done with a single
+command like so:
+
+.. code-block:: cmake
+
+ FetchContent_MakeAvailable(googletest)
+
+The above command not only populates the content, it also adds it to the main
+build (if possible) so that the main build can use the populated project's
+targets, etc. In some cases, the main project may need to have more precise
+control over the population or may be required to explicitly define the
+population steps (e.g. if CMake versions earlier than 3.14 need to be
+supported). The typical pattern of such custom steps looks like this:
+
+.. code-block:: cmake
+
FetchContent_GetProperties(googletest)
if(NOT googletest_POPULATED)
FetchContent_Populate(googletest)
add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR})
endif()
-When using the above pattern with a hierarchical project arrangement,
-projects at higher levels in the hierarchy are able to define or override
-the population details of content specified anywhere lower in the project
-hierarchy. The ability to detect whether content has already been
-populated ensures that even if multiple child projects want certain content
-to be available, the first one to populate it wins. The other child project
-can simply make use of the already available content instead of repeating
-the population for itself. See the
-:ref:`Examples <fetch-content-examples>` section which demonstrates
+Regardless of which population method is used, when using the
+declare-populate pattern with a hierarchical project arrangement, projects at
+higher levels in the hierarchy are able to override the population details of
+content specified anywhere lower in the project hierarchy. The ability to
+detect whether content has already been populated ensures that even if
+multiple child projects want certain content to be available, the first one
+to populate it wins. The other child project can simply make use of the
+already available content instead of repeating the population for itself.
+See the :ref:`Examples <fetch-content-examples>` section which demonstrates
this scenario.
The ``FetchContent`` module also supports defining and populating
@@ -113,6 +132,38 @@ Declaring Content Details
Populating The Content
^^^^^^^^^^^^^^^^^^^^^^
+For most common scenarios, population means making content available to the
+main build according to previously declared details for that dependency.
+There are two main patterns for populating content, one based on calling
+:command:`FetchContent_GetProperties` and
+:command:`FetchContent_Populate` for more precise control and the other on
+calling :command:`FetchContent_MakeAvailable` for a simpler, more automated
+approach. The former generally follows this canonical pattern:
+
+.. _`fetch-content-canonical-pattern`:
+
+.. code-block:: cmake
+
+ # Check if population has already been performed
+ FetchContent_GetProperties(<name>)
+ string(TOLOWER "<name>" lcName)
+ if(NOT ${lcName}_POPULATED)
+ # Fetch the content using previously declared details
+ FetchContent_Populate(<name>)
+
+ # Set custom variables, policies, etc.
+ # ...
+
+ # Bring the populated content into the build
+ add_subdirectory(${${lcName}_SOURCE_DIR} ${${lcName}_BINARY_DIR})
+ endif()
+
+The above is such a common pattern that, where no custom steps are needed
+between the calls to :command:`FetchContent_Populate` and
+:command:`add_subdirectory`, equivalent logic can be obtained by calling
+:command:`FetchContent_MakeAvailable` instead (and should be preferred where
+it meets the needs of the project).
+
.. command:: FetchContent_Populate
.. code-block:: cmake
@@ -309,9 +360,6 @@ Populating The Content
on the command line invoking the script.
-Retrieve Population Properties
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
.. command:: FetchContent_GetProperties
When using saved content details, a call to :command:`FetchContent_Populate`
@@ -343,28 +391,65 @@ Retrieve Population Properties
FetchContent_GetProperties(foobar)
if(NOT foobar_POPULATED)
FetchContent_Populate(foobar)
-
- # Set any custom variables, etc. here, then
- # populate the content as part of this build
-
- add_subdirectory(${foobar_SOURCE_DIR} ${foobar_BINARY_DIR})
+ ...
endif()
The above pattern allows other parts of the overall project hierarchy to
re-use the same content and ensure that it is only populated once.
+.. command:: FetchContent_MakeAvailable
+
+ .. code-block:: cmake
+
+ FetchContent_MakeAvailable( <name1> [<name2>...] )
+
+ This command implements the common pattern typically needed for most
+ dependencies. It iterates over each of the named dependencies in turn
+ and for each one it loosely follows the same
+ :ref:`canonical pattern <fetch-content-canonical-pattern>` as
+ presented at the beginning of this section. One small difference to
+ that pattern is that it will only call :command:`add_subdirectory` on the
+ populated content if there is a ``CMakeLists.txt`` file in its top level
+ source directory. This allows the command to be used for dependencies
+ that make downloaded content available at a known location but which do
+ not need or support being added directly to the build.
+
+
.. _`fetch-content-examples`:
Examples
^^^^^^^^
-Consider a project hierarchy where ``projA`` is the top level project and it
-depends on projects ``projB`` and ``projC``. Both ``projB`` and ``projC``
-can be built standalone and they also both depend on another project
-``projD``. For simplicity, this example will assume that all four projects
-are available on a company git server. The ``CMakeLists.txt`` of each project
-might have sections like the following:
+This first fairly straightforward example ensures that some popular testing
+frameworks are available to the main build:
+
+.. code-block:: cmake
+
+ include(FetchContent)
+ FetchContent_Declare(
+ googletest
+ GIT_REPOSITORY https://github.com/google/googletest.git
+ GIT_TAG release-1.8.0
+ )
+ FetchContent_Declare(
+ Catch2
+ GIT_REPOSITORY https://github.com/catchorg/Catch2.git
+ GIT_TAG v2.5.0
+ )
+
+ # After the following call, the CMake targets defined by googletest and
+ # Catch2 will be defined and available to the rest of the build
+ FetchContent_MakeAvailable(googletest Catch2)
+
+
+In more complex project hierarchies, the dependency relationships can be more
+complicated. Consider a hierarchy where ``projA`` is the top level project and
+it depends directly on projects ``projB`` and ``projC``. Both ``projB`` and
+``projC`` can be built standalone and they also both depend on another project
+``projD``. ``projB`` additionally depends on ``projE``. This example assumes
+that all five projects are available on a company git server. The
+``CMakeLists.txt`` of each project might have sections like the following:
*projA*:
@@ -373,31 +458,27 @@ might have sections like the following:
include(FetchContent)
FetchContent_Declare(
projB
- GIT_REPOSITORY git@mycompany.com/git/projB.git
+ GIT_REPOSITORY git@mycompany.com:git/projB.git
GIT_TAG 4a89dc7e24ff212a7b5167bef7ab079d
)
FetchContent_Declare(
projC
- GIT_REPOSITORY git@mycompany.com/git/projC.git
+ GIT_REPOSITORY git@mycompany.com:git/projC.git
GIT_TAG 4ad4016bd1d8d5412d135cf8ceea1bb9
)
FetchContent_Declare(
projD
- GIT_REPOSITORY git@mycompany.com/git/projD.git
+ GIT_REPOSITORY git@mycompany.com:git/projD.git
GIT_TAG origin/integrationBranch
)
+ FetchContent_Declare(
+ projE
+ GIT_REPOSITORY git@mycompany.com:git/projE.git
+ GIT_TAG origin/release/2.3-rc1
+ )
- FetchContent_GetProperties(projB)
- if(NOT projb_POPULATED)
- FetchContent_Populate(projB)
- add_subdirectory(${projb_SOURCE_DIR} ${projb_BINARY_DIR})
- endif()
-
- FetchContent_GetProperties(projC)
- if(NOT projc_POPULATED)
- FetchContent_Populate(projC)
- add_subdirectory(${projc_SOURCE_DIR} ${projc_BINARY_DIR})
- endif()
+ # Order is important, see notes in the discussion further below
+ FetchContent_MakeAvailable(projD projB projC)
*projB*:
@@ -406,16 +487,16 @@ might have sections like the following:
include(FetchContent)
FetchContent_Declare(
projD
- GIT_REPOSITORY git@mycompany.com/git/projD.git
+ GIT_REPOSITORY git@mycompany.com:git/projD.git
GIT_TAG 20b415f9034bbd2a2e8216e9a5c9e632
)
+ FetchContent_Declare(
+ projE
+ GIT_REPOSITORY git@mycompany.com:git/projE.git
+ GIT_TAG 68e20f674a48be38d60e129f600faf7d
+ )
- FetchContent_GetProperties(projD)
- if(NOT projd_POPULATED)
- FetchContent_Populate(projD)
- add_subdirectory(${projd_SOURCE_DIR} ${projd_BINARY_DIR})
- endif()
-
+ FetchContent_MakeAvailable(projD projE)
*projC*:
@@ -424,48 +505,77 @@ might have sections like the following:
include(FetchContent)
FetchContent_Declare(
projD
- GIT_REPOSITORY git@mycompany.com/git/projD.git
+ GIT_REPOSITORY git@mycompany.com:git/projD.git
GIT_TAG 7d9a17ad2c962aa13e2fbb8043fb6b8a
)
+ # This particular version of projD requires workarounds
FetchContent_GetProperties(projD)
if(NOT projd_POPULATED)
FetchContent_Populate(projD)
+
+ # Copy an additional/replacement file into the populated source
+ file(COPY someFile.c DESTINATION ${projd_SOURCE_DIR}/src)
+
add_subdirectory(${projd_SOURCE_DIR} ${projd_BINARY_DIR})
endif()
A few key points should be noted in the above:
- ``projB`` and ``projC`` define different content details for ``projD``,
- but ``projA`` also defines a set of content details for ``projD`` and
- because ``projA`` will define them first, the details from ``projB`` and
+ but ``projA`` also defines a set of content details for ``projD``.
+ Because ``projA`` will define them first, the details from ``projB`` and
``projC`` will not be used. The override details defined by ``projA``
are not required to match either of those from ``projB`` or ``projC``, but
it is up to the higher level project to ensure that the details it does
define still make sense for the child projects.
-- While ``projA`` defined content details for ``projD``, it did not need
- to explicitly call ``FetchContent_Populate(projD)`` itself. Instead, it
- leaves that to a child project to do (in this case it will be ``projB``
- since it is added to the build ahead of ``projC``). If ``projA`` needed to
- customize how the ``projD`` content was brought into the build as well
- (e.g. define some CMake variables before calling
- :command:`add_subdirectory` after populating), it would do the call to
- ``FetchContent_Populate()``, etc. just as it did for the ``projB`` and
- ``projC`` content. For higher level projects, it is usually enough to
- just define the override content details and leave the actual population
- to the child projects. This saves repeating the same thing at each level
- of the project hierarchy unnecessarily.
-- Even though ``projA`` is the top level project in this example, it still
- checks whether ``projB`` and ``projC`` have already been populated before
- going ahead to do those populations. This makes ``projA`` able to be more
- easily incorporated as a child of some other higher level project in the
- future if required. Always protect a call to
- :command:`FetchContent_Populate` with a check to
- :command:`FetchContent_GetProperties`, even in what may be considered a top
- level project at the time.
-
-
-The following example demonstrates how one might download and unpack a
+- In the ``projA`` call to :command:`FetchContent_MakeAvailable`, ``projD``
+ is listed ahead of ``projB`` and ``projC`` to ensure that ``projA`` is in
+ control of how ``projD`` is populated.
+- While ``projA`` defines content details for ``projE``, it does not need
+ to explicitly call ``FetchContent_MakeAvailable(projE)`` or
+ ``FetchContent_Populate(projD)`` itself. Instead, it leaves that to the
+ child ``projB``. For higher level projects, it is often enough to just
+ define the override content details and leave the actual population to the
+ child projects. This saves repeating the same thing at each level of the
+ project hierarchy unnecessarily.
+
+
+Projects don't always need to add the populated content to the build.
+Sometimes the project just wants to make the downloaded content available at
+a predictable location. The next example ensures that a set of standard
+company toolchain files (and potentially even the toolchain binaries
+themselves) is available early enough to be used for that same build.
+
+.. code-block:: cmake
+
+ cmake_minimum_required(VERSION 3.14)
+
+ include(FetchContent)
+ FetchContent_Declare(
+ mycom_toolchains
+ URL https://intranet.mycompany.com//toolchains_1.3.2.tar.gz
+ )
+ FetchContent_MakeAvailable(mycom_toolchains)
+
+ project(CrossCompileExample)
+
+The project could be configured to use one of the downloaded toolchains like
+so:
+
+.. code-block:: shell
+
+ cmake -DCMAKE_TOOLCHAIN_FILE=_deps/mycom_toolchains-src/toolchain_arm.cmake /path/to/src
+
+When CMake processes the ``CMakeLists.txt`` file, it will download and unpack
+the tarball into ``_deps/mycompany_toolchains-src`` relative to the build
+directory. The :variable:`CMAKE_TOOLCHAIN_FILE` variable is not used until
+the :command:`project` command is reached, at which point CMake looks for the
+named toolchain file relative to the build directory. Because the tarball has
+already been downloaded and unpacked by then, the toolchain file will be in
+place, even the very first time that ``cmake`` is run in the build directory.
+
+Lastly, the following example demonstrates how one might download and unpack a
firmware tarball using CMake's :manual:`script mode <cmake(1)>`. The call to
:command:`FetchContent_Populate` specifies all the content details and the
unpacked firmware will be placed in a ``firmware`` directory below the
@@ -921,3 +1031,31 @@ function(FetchContent_Populate contentName)
set(${contentNameLower}_POPULATED True PARENT_SCOPE)
endfunction()
+
+# Arguments are assumed to be the names of dependencies that have been
+# declared previously and should be populated. It is not an error if
+# any of them have already been populated (they will just be skipped in
+# that case). The command is implemented as a macro so that the variables
+# defined by the FetchContent_GetProperties() and FetchContent_Populate()
+# calls will be available to the caller.
+macro(FetchContent_MakeAvailable)
+
+ foreach(contentName IN ITEMS ${ARGV})
+ string(TOLOWER ${contentName} contentNameLower)
+ FetchContent_GetProperties(${contentName})
+ if(NOT ${contentNameLower}_POPULATED)
+ FetchContent_Populate(${contentName})
+
+ # Only try to call add_subdirectory() if the populated content
+ # can be treated that way. Protecting the call with the check
+ # allows this function to be used for projects that just want
+ # to ensure the content exists, such as to provide content at
+ # a known location.
+ if(EXISTS ${${contentNameLower}_SOURCE_DIR}/CMakeLists.txt)
+ add_subdirectory(${${contentNameLower}_SOURCE_DIR}
+ ${${contentNameLower}_BINARY_DIR})
+ endif()
+ endif()
+ endforeach()
+
+endmacro()
diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake
index b6348fde3a..0aa4f5035b 100644
--- a/Modules/FindBLAS.cmake
+++ b/Modules/FindBLAS.cmake
@@ -13,62 +13,76 @@ list of libraries searched for is taken from the autoconf macro file,
acx_blas.m4 (distributed at
http://ac-archive.sourceforge.net/ac-archive/acx_blas.html).
-This module sets the following variables:
-
-::
-
- BLAS_FOUND - set to true if a library implementing the BLAS interface
- is found
- BLAS_LINKER_FLAGS - uncached list of required linker flags (excluding -l
- and -L).
- BLAS_LIBRARIES - uncached list of libraries (using full path name) to
- link against to use BLAS (may be empty if compiler implicitly links
- BLAS)
- BLAS95_LIBRARIES - uncached list of libraries (using full path name)
- to link against to use BLAS95 interface
- BLAS95_FOUND - set to true if a library implementing the BLAS f95 interface
- is found
-
-The following variables can be used to control this module:
-
-::
-
- BLA_STATIC if set on this determines what kind of linkage we do (static)
- BLA_VENDOR if set checks only the specified vendor, if not set checks
- all the possibilities
- BLA_F95 if set on tries to find the f95 interfaces for BLAS/LAPACK
- BLA_PREFER_PKGCONFIG if set pkg-config will be used to search for a BLAS
- library first and if one is found that is preferred
-
-List of vendors (BLA_VENDOR) valid in this module:
-
-* Goto
-* OpenBLAS
-* FLAME
-* ATLAS PhiPACK
-* CXML
-* DXML
-* SunPerf
-* SCSL
-* SGIMATH
-* IBMESSL
-* Intel10_32 (intel mkl v10 32 bit)
-* Intel10_64lp (intel mkl v10+ 64 bit, threaded code, lp64 model)
-* Intel10_64lp_seq (intel mkl v10+ 64 bit, sequential code, lp64 model)
-* Intel10_64ilp (intel mkl v10+ 64 bit, threaded code, ilp64 model)
-* Intel10_64ilp_seq (intel mkl v10+ 64 bit, sequential code, ilp64 model)
-* Intel (older versions of mkl 32 and 64 bit)
-* ACML
-* ACML_MP
-* ACML_GPU
-* Apple
-* NAS
-* Generic
+Input Variables
+^^^^^^^^^^^^^^^
+
+The following variables may be set to influence this module's behavior:
+
+``BLA_STATIC``
+ if ``ON`` use static linkage
+
+``BLA_VENDOR``
+ If set, checks only the specified vendor, if not set checks all the
+ possibilities. List of vendors valid in this module:
+
+ * Goto
+ * OpenBLAS
+ * FLAME
+ * ATLAS PhiPACK
+ * CXML
+ * DXML
+ * SunPerf
+ * SCSL
+ * SGIMATH
+ * IBMESSL
+ * Intel10_32 (intel mkl v10 32 bit)
+ * Intel10_64lp (intel mkl v10+ 64 bit, threaded code, lp64 model)
+ * Intel10_64lp_seq (intel mkl v10+ 64 bit, sequential code, lp64 model)
+ * Intel10_64ilp (intel mkl v10+ 64 bit, threaded code, ilp64 model)
+ * Intel10_64ilp_seq (intel mkl v10+ 64 bit, sequential code, ilp64 model)
+ * Intel (obsolete versions of mkl 32 and 64 bit)
+ * ACML
+ * ACML_MP
+ * ACML_GPU
+ * Apple
+ * NAS
+ * Generic
+
+``BLA_F95``
+ if ``ON`` tries to find the BLAS95 interfaces
+
+``BLA_PREFER_PKGCONFIG``
+ if set pkg-config will be used to search for a BLAS library first
+ and if one is found that is preferred
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``BLAS_FOUND``
+ library implementing the BLAS interface is found
+``BLAS_LINKER_FLAGS``
+ uncached list of required linker flags (excluding -l and -L).
+``BLAS_LIBRARIES``
+ uncached list of libraries (using full path name) to link against
+ to use BLAS (may be empty if compiler implicitly links BLAS)
+``BLAS95_LIBRARIES``
+ uncached list of libraries (using full path name) to link against
+ to use BLAS95 interface
+``BLAS95_FOUND``
+ library implementing the BLAS95 interface is found
.. note::
- C/CXX should be enabled to use Intel mkl
+ C or CXX must be enabled to use Intel MKL
+ For example, to use Intel MKL libraries and/or Intel compiler:
+
+ .. code-block:: cmake
+
+ set(BLA_VENDOR Intel10_64lp)
+ find_package(BLAS)
#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/CheckFunctionExists.cmake)
@@ -167,7 +181,6 @@ macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread)
check_function_exists("${_name}_" ${_prefix}${_combined_name}_WORKS)
endif()
set(CMAKE_REQUIRED_LIBRARIES)
- mark_as_advanced(${_prefix}${_combined_name}_WORKS)
set(_libraries_work ${${_prefix}${_combined_name}_WORKS})
endif()
if(_libraries_work)
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index 8c112d485e..7882c4bdf6 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -1807,10 +1807,12 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
foreach(compiler IN LISTS _boost_COMPILER)
list(APPEND _boost_RELEASE_NAMES
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_ARCHITECTURE_TAG}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG} )
endforeach()
list(APPEND _boost_RELEASE_NAMES
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_ARCHITECTURE_TAG}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component} )
@@ -1819,10 +1821,12 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
foreach(compiler IN LISTS _boost_COMPILER)
list(APPEND _boost_RELEASE_NAMES
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} )
endforeach()
list(APPEND _boost_RELEASE_NAMES
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} )
endif()
endforeach()
@@ -1860,10 +1864,12 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
foreach(compiler IN LISTS _boost_COMPILER)
list(APPEND _boost_DEBUG_NAMES
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}${_boost_ARCHITECTURE_TAG}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG} )
endforeach()
list(APPEND _boost_DEBUG_NAMES
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}${_boost_ARCHITECTURE_TAG}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component} )
@@ -1872,10 +1878,12 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
foreach(compiler IN LISTS _boost_COMPILER)
list(APPEND _boost_DEBUG_NAMES
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} )
endforeach()
list(APPEND _boost_DEBUG_NAMES
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} )
endif()
endforeach()
diff --git a/Modules/FindDoxygen.cmake b/Modules/FindDoxygen.cmake
index fdd3a9276c..32b4aa2c84 100644
--- a/Modules/FindDoxygen.cmake
+++ b/Modules/FindDoxygen.cmake
@@ -713,7 +713,9 @@ if(TARGET Doxygen::doxygen)
if(_line MATCHES "([A-Z][A-Z0-9_]+)( *=)(.*)")
set(_key "${CMAKE_MATCH_1}")
set(_eql "${CMAKE_MATCH_2}")
- string(REPLACE ";" "\\\n" _value "${CMAKE_MATCH_3}")
+ set(_value "${CMAKE_MATCH_3}")
+ string(REPLACE "\\" "\\\\" _value "${_value}")
+ string(REPLACE ";" "\\\n" _value "${_value}")
list(APPEND _Doxygen_tpl_params "${_key}${_eql}${_value}")
endif()
endforeach()
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index 2772b7de58..70bfc96f14 100644
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -8,7 +8,6 @@ FindHDF5
Find HDF5, a library for reading and writing self describing array data.
-
This module invokes the HDF5 wrapper compiler that should be installed
alongside HDF5. Depending upon the HDF5 Configuration, the wrapper
compiler is called either h5cc or h5pcc. If this succeeds, the module
@@ -45,54 +44,75 @@ an HDF5 client application, this module also makes an effort to find
tools that come with the HDF5 distribution that may be useful for
regression testing.
-This module will define the following variables:
-
-::
-
- HDF5_FOUND - true if HDF5 was found on the system
- HDF5_VERSION - HDF5 version in format Major.Minor.Release
- HDF5_INCLUDE_DIRS - Location of the hdf5 includes
- HDF5_INCLUDE_DIR - Location of the hdf5 includes (deprecated)
- HDF5_DEFINITIONS - Required compiler definitions for HDF5
- HDF5_LIBRARIES - Required libraries for all requested bindings
- HDF5_HL_LIBRARIES - Required libraries for the HDF5 high level API for all
- bindings, if the HL component is enabled
-
-Available components are: C CXX Fortran and HL. For each enabled language
-binding, a corresponding HDF5_${LANG}_LIBRARIES variable, and potentially
-HDF5_${LANG}_DEFINITIONS, will be defined.
-If the HL component is enabled, then an HDF5_${LANG}_HL_LIBRARIES will
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module will set the following variables in your project:
+
+``HDF5_FOUND``
+ HDF5 was found on the system
+``HDF5_VERSION``
+ HDF5 library version
+``HDF5_INCLUDE_DIRS``
+ Location of the HDF5 header files
+``HDF5_DEFINITIONS``
+ Required compiler definitions for HDF5
+``HDF5_LIBRARIES``
+ Required libraries for all requested bindings
+``HDF5_HL_LIBRARIES``
+ Required libraries for the HDF5 high level API for all bindings,
+ if the ``HL`` component is enabled
+
+Available components are: ``C`` ``CXX`` ``Fortran`` and ``HL``.
+For each enabled language binding, a corresponding ``HDF5_${LANG}_LIBRARIES``
+variable, and potentially ``HDF5_${LANG}_DEFINITIONS``, will be defined.
+If the ``HL`` component is enabled, then an ``HDF5_${LANG}_HL_LIBRARIES`` will
also be defined. With all components enabled, the following variables will be defined:
-::
-
- HDF5_C_DEFINITIONS -- Required compiler definitions for HDF5 C bindings
- HDF5_CXX_DEFINITIONS -- Required compiler definitions for HDF5 C++ bindings
- HDF5_Fortran_DEFINITIONS -- Required compiler definitions for HDF5 Fortran bindings
- HDF5_C_INCLUDE_DIRS -- Required include directories for HDF5 C bindings
- HDF5_CXX_INCLUDE_DIRS -- Required include directories for HDF5 C++ bindings
- HDF5_Fortran_INCLUDE_DIRS -- Required include directories for HDF5 Fortran bindings
- HDF5_C_LIBRARIES - Required libraries for the HDF5 C bindings
- HDF5_CXX_LIBRARIES - Required libraries for the HDF5 C++ bindings
- HDF5_Fortran_LIBRARIES - Required libraries for the HDF5 Fortran bindings
- HDF5_C_HL_LIBRARIES - Required libraries for the high level C bindings
- HDF5_CXX_HL_LIBRARIES - Required libraries for the high level C++ bindings
- HDF5_Fortran_HL_LIBRARIES - Required libraries for the high level Fortran
- bindings.
-
- HDF5_IS_PARALLEL - Whether or not HDF5 was found with parallel IO support
- HDF5_C_COMPILER_EXECUTABLE - the path to the HDF5 C wrapper compiler
- HDF5_CXX_COMPILER_EXECUTABLE - the path to the HDF5 C++ wrapper compiler
- HDF5_Fortran_COMPILER_EXECUTABLE - the path to the HDF5 Fortran wrapper compiler
- HDF5_C_COMPILER_EXECUTABLE_NO_INTERROGATE - path to the primary C compiler
- which is also the HDF5 wrapper
- HDF5_CXX_COMPILER_EXECUTABLE_NO_INTERROGATE - path to the primary C++
- compiler which is also
- the HDF5 wrapper
- HDF5_Fortran_COMPILER_EXECUTABLE_NO_INTERROGATE - path to the primary
- Fortran compiler which
- is also the HDF5 wrapper
- HDF5_DIFF_EXECUTABLE - the path to the HDF5 dataset comparison tool
+``HDF5_C_DEFINITIONS``
+ Required compiler definitions for HDF5 C bindings
+``HDF5_CXX_DEFINITIONS``
+ Required compiler definitions for HDF5 C++ bindings
+``HDF5_Fortran_DEFINITIONS``
+ Required compiler definitions for HDF5 Fortran bindings
+``HDF5_C_INCLUDE_DIRS``
+ Required include directories for HDF5 C bindings
+``HDF5_CXX_INCLUDE_DIRS``
+ Required include directories for HDF5 C++ bindings
+``HDF5_Fortran_INCLUDE_DIRS``
+ Required include directories for HDF5 Fortran bindings
+``HDF5_C_LIBRARIES``
+ Required libraries for the HDF5 C bindings
+``HDF5_CXX_LIBRARIES``
+ Required libraries for the HDF5 C++ bindings
+``HDF5_Fortran_LIBRARIES``
+ Required libraries for the HDF5 Fortran bindings
+``HDF5_C_HL_LIBRARIES``
+ Required libraries for the high level C bindings
+``HDF5_CXX_HL_LIBRARIES``
+ Required libraries for the high level C++ bindings
+``HDF5_Fortran_HL_LIBRARIES``
+ Required libraries for the high level Fortran bindings.
+
+``HDF5_IS_PARALLEL``
+ HDF5 library has parallel IO support
+``HDF5_C_COMPILER_EXECUTABLE``
+ path to the HDF5 C wrapper compiler
+``HDF5_CXX_COMPILER_EXECUTABLE``
+ path to the HDF5 C++ wrapper compiler
+``HDF5_Fortran_COMPILER_EXECUTABLE``
+ path to the HDF5 Fortran wrapper compiler
+``HDF5_C_COMPILER_EXECUTABLE_NO_INTERROGATE``
+ path to the primary C compiler which is also the HDF5 wrapper
+``HDF5_CXX_COMPILER_EXECUTABLE_NO_INTERROGATE``
+ path to the primary C++ compiler which is also the HDF5 wrapper
+``HDF5_Fortran_COMPILER_EXECUTABLE_NO_INTERROGATE``
+ path to the primary Fortran compiler which is also the HDF5 wrapper
+``HDF5_DIFF_EXECUTABLE``
+ path to the HDF5 dataset comparison tool
+
+Hints
+^^^^^
The following variable can be set to guide the search for HDF5 libraries and includes:
@@ -100,10 +120,10 @@ The following variable can be set to guide the search for HDF5 libraries and inc
Specify the path to the HDF5 installation to use.
``HDF5_FIND_DEBUG``
- Set to a true value to get some extra debugging output.
+ Set ``true`` to get extra debugging output.
``HDF5_NO_FIND_PACKAGE_CONFIG_FILE``
- Set to a true value to skip trying to find ``hdf5-config.cmake``.
+ Set ``true`` to skip trying to find ``hdf5-config.cmake``.
#]=======================================================================]
# This module is maintained by Will Dicharry <wdicharry@stellarscience.com>.
@@ -322,20 +342,22 @@ macro( _HDF5_invoke_compiler language output return_value version is_parallel)
elseif("${language}" STREQUAL "Fortran")
set(test_file ${scratch_dir}/cmake_hdf5_test.f90)
endif()
- exec_program( ${HDF5_${language}_COMPILER_EXECUTABLE}
- ARGS -show ${lib_type_args} ${test_file}
- OUTPUT_VARIABLE ${output}
- RETURN_VALUE ${return_value}
- )
+ execute_process(
+ COMMAND ${HDF5_${language}_COMPILER_EXECUTABLE} -show ${lib_type_args} ${test_file}
+ OUTPUT_VARIABLE ${output}
+ ERROR_VARIABLE ${output}
+ RESULT_VARIABLE ${return_value}
+ )
if(NOT ${${return_value}} EQUAL 0)
message(STATUS
"Unable to determine HDF5 ${language} flags from HDF5 wrapper.")
endif()
- exec_program( ${HDF5_${language}_COMPILER_EXECUTABLE}
- ARGS -showconfig
- OUTPUT_VARIABLE config_output
- RETURN_VALUE config_return
- )
+ execute_process(
+ COMMAND ${HDF5_${language}_COMPILER_EXECUTABLE} -showconfig
+ OUTPUT_VARIABLE config_output
+ ERROR_VARIABLE config_output
+ RESULT_VARIABLE config_return
+ )
if(NOT ${return_value} EQUAL 0)
message( STATUS
"Unable to determine HDF5 ${language} version from HDF5 wrapper.")
diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake
index 7619664d62..d6646eaacf 100644
--- a/Modules/FindLAPACK.cmake
+++ b/Modules/FindLAPACK.cmake
@@ -14,35 +14,62 @@ The approach follows that taken for the autoconf macro file,
acx_lapack.m4 (distributed at
http://ac-archive.sourceforge.net/ac-archive/acx_lapack.html).
-This module sets the following variables:
-
-::
-
- LAPACK_FOUND - set to true if a library implementing the LAPACK interface
- is found
- LAPACK_LINKER_FLAGS - uncached list of required linker flags (excluding -l
- and -L).
- LAPACK_LIBRARIES - uncached list of libraries (using full path name) to
- link against to use LAPACK
- LAPACK95_LIBRARIES - uncached list of libraries (using full path name) to
- link against to use LAPACK95
- LAPACK95_FOUND - set to true if a library implementing the LAPACK f95
- interface is found
- BLA_STATIC if set on this determines what kind of linkage we do (static)
- BLA_VENDOR if set checks only the specified vendor, if not set checks
- all the possibilities
- BLA_F95 if set on tries to find the f95 interfaces for BLAS/LAPACK
-
-List of vendors (BLA_VENDOR) valid in this module:
-
-* Intel(mkl)
-* OpenBLAS
-* FLAME
-* ACML
-* Apple
-* NAS
-* Generic
-
+Input Variables
+^^^^^^^^^^^^^^^
+
+The following variables may be set to influence this module's behavior:
+
+``BLA_STATIC``
+ if ``ON`` use static linkage
+
+``BLA_VENDOR``
+ If set, checks only the specified vendor, if not set checks all the
+ possibilities. List of vendors valid in this module:
+
+ * ``Intel10_32`` (intel mkl v10 32 bit)
+ * ``Intel10_64lp`` (intel mkl v10+ 64 bit, threaded code, lp64 model)
+ * ``Intel10_64lp_seq`` (intel mkl v10+ 64 bit, sequential code, lp64 model)
+ * ``Intel10_64ilp`` (intel mkl v10+ 64 bit, threaded code, ilp64 model)
+ * ``Intel10_64ilp_seq`` (intel mkl v10+ 64 bit, sequential code, ilp64 model)
+ * ``Intel`` (obsolete versions of mkl 32 and 64 bit)
+ * ``OpenBLAS``
+ * ``FLAME``
+ * ``ACML``
+ * ``Apple``
+ * ``NAS``
+ * ``Generic``
+
+``BLA_F95``
+ if ``ON`` tries to find BLAS95/LAPACK95
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``LAPACK_FOUND``
+ library implementing the LAPACK interface is found
+``LAPACK_LINKER_FLAGS``
+ uncached list of required linker flags (excluding -l and -L).
+``LAPACK_LIBRARIES``
+ uncached list of libraries (using full path name) to link against
+ to use LAPACK
+``LAPACK95_LIBRARIES``
+ uncached list of libraries (using full path name) to link against
+ to use LAPACK95
+``LAPACK95_FOUND``
+ library implementing the LAPACK95 interface is found
+
+.. note::
+
+ C or CXX must be enabled to use Intel MKL
+
+ For example, to use Intel MKL libraries and/or Intel compiler:
+
+ .. code-block:: cmake
+
+ set(BLA_VENDOR Intel10_64lp)
+ find_package(LAPACK)
#]=======================================================================]
set(_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
@@ -113,7 +140,7 @@ foreach(_library ${_list})
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
endif ()
else ()
- if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
# for ubuntu's libblas3gf and liblapack3gf packages
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf)
endif ()
@@ -142,7 +169,6 @@ if(_libraries_work)
check_fortran_function_exists(${_name} ${_prefix}${_combined_name}_WORKS)
endif ()
set(CMAKE_REQUIRED_LIBRARIES)
- mark_as_advanced(${_prefix}${_combined_name}_WORKS)
set(_libraries_work ${${_prefix}${_combined_name}_WORKS})
#message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}")
endif()
diff --git a/Modules/FindLibXml2.cmake b/Modules/FindLibXml2.cmake
index 1a2af16112..47c0e7907d 100644
--- a/Modules/FindLibXml2.cmake
+++ b/Modules/FindLibXml2.cmake
@@ -18,7 +18,7 @@ Result variables
This module will set the following variables in your project:
-``LIBXML2_FOUND``
+``LibXml2_FOUND``
true if libxml2 headers and libraries were found
``LIBXML2_INCLUDE_DIR``
the directory containing LibXml2 headers
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake
index 8544653e34..354764217a 100644
--- a/Modules/FindMatlab.cmake
+++ b/Modules/FindMatlab.cmake
@@ -725,7 +725,7 @@ function(matlab_get_version_from_matlab_run matlab_binary_program matlab_list_ve
file(REMOVE "${_matlab_temporary_folder}/matlabVersionLog.cmaketmp")
set(index -1)
- string(FIND ${_matlab_version_from_cmd} "ans" index)
+ string(FIND "${_matlab_version_from_cmd}" "ans" index)
if(index EQUAL -1)
if(MATLAB_FIND_DEBUG)
@@ -735,7 +735,7 @@ function(matlab_get_version_from_matlab_run matlab_binary_program matlab_list_ve
else()
set(matlab_list_of_all_versions_tmp)
- string(SUBSTRING ${_matlab_version_from_cmd} ${index} -1 substring_ans)
+ string(SUBSTRING "${_matlab_version_from_cmd}" ${index} -1 substring_ans)
string(
REGEX MATCHALL "ans[\r\n\t ]*=[\r\n\t ]*'?([0-9]+(\\.[0-9]+)?)"
matlab_versions_regex
diff --git a/Modules/FindOctave.cmake b/Modules/FindOctave.cmake
index 8ae6a470f3..8110ff1644 100644
--- a/Modules/FindOctave.cmake
+++ b/Modules/FindOctave.cmake
@@ -15,7 +15,10 @@ This module defines the following :prop_tgt:`IMPORTED` targets:
``Octave::Interpreter``
Octave interpreter (the main program)
``Octave::Octave``
- include directories and libraries
+ include directories and the octave library
+``Octave::Octinterp``
+ include directories and the octinterp library including the dependency on
+ Octave::Octave
If no ``COMPONENTS`` are specified, ``Interpreter`` is assumed.
@@ -144,6 +147,15 @@ if(Octave_Development_FOUND)
)
endif()
+ if(NOT TARGET Octave::Octinterp)
+ add_library(Octave::Octinterp UNKNOWN IMPORTED)
+ set_target_properties(Octave::Octinterp PROPERTIES
+ IMPORTED_LOCATION ${Octave_INTERP_LIBRARY}
+ INTERFACE_INCLUDE_DIRECTORIES ${Octave_INCLUDE_DIR})
+ target_link_libraries(Octave::Octinterp INTERFACE
+ Octave::Octave)
+ endif()
+
endif()
diff --git a/Modules/FindPythonInterp.cmake b/Modules/FindPythonInterp.cmake
index d1f7b31708..da33301af2 100644
--- a/Modules/FindPythonInterp.cmake
+++ b/Modules/FindPythonInterp.cmake
@@ -130,7 +130,9 @@ if(PYTHON_EXECUTABLE)
endif()
else()
# sys.version predates sys.version_info, so use that
- execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c "import sys; sys.stdout.write(sys.version)"
+ # sys.version was first documented for Python 1.5, so assume version 1.4
+ # if retrieving sys.version fails.
+ execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c "try: import sys; sys.stdout.write(sys.version)\nexcept: sys.stdout.write(\"1.4.0\")"
OUTPUT_VARIABLE _VERSION
RESULT_VARIABLE _PYTHON_VERSION_RESULT
ERROR_QUIET)
@@ -144,12 +146,10 @@ if(PYTHON_EXECUTABLE)
set(PYTHON_VERSION_PATCH "0")
endif()
else()
- # sys.version was first documented for Python 1.5, so assume
- # this is older.
- set(PYTHON_VERSION_STRING "1.4")
- set(PYTHON_VERSION_MAJOR "1")
- set(PYTHON_VERSION_MINOR "4")
- set(PYTHON_VERSION_PATCH "0")
+ unset(PYTHON_VERSION_STRING)
+ unset(PYTHON_VERSION_MAJOR)
+ unset(PYTHON_VERSION_MINOR)
+ unset(PYTHON_VERSION_PATCH)
endif()
endif()
unset(_PYTHON_VERSION_RESULT)
diff --git a/Modules/FindXalanC.cmake b/Modules/FindXalanC.cmake
index 0eba3d9e67..3adaa44d33 100644
--- a/Modules/FindXalanC.cmake
+++ b/Modules/FindXalanC.cmake
@@ -76,7 +76,7 @@ find_path(XalanC_INCLUDE_DIR
DOC "Xalan-C++ include directory")
mark_as_advanced(XalanC_INCLUDE_DIR)
-if(XalanC_INCLUDE_DIR)
+if(XalanC_INCLUDE_DIR AND EXISTS "${XalanC_INCLUDE_DIR}/xalanc/Include/XalanVersion.hpp")
_XalanC_GET_VERSION("${XalanC_INCLUDE_DIR}/xalanc/Include/XalanVersion.hpp")
endif()
diff --git a/Modules/FindXercesC.cmake b/Modules/FindXercesC.cmake
index 085fafcfc8..47bfd62886 100644
--- a/Modules/FindXercesC.cmake
+++ b/Modules/FindXercesC.cmake
@@ -74,7 +74,7 @@ find_path(XercesC_INCLUDE_DIR
DOC "Xerces-C++ include directory")
mark_as_advanced(XercesC_INCLUDE_DIR)
-if(XercesC_INCLUDE_DIR)
+if(XercesC_INCLUDE_DIR AND EXISTS "${XercesC_INCLUDE_DIR}/xercesc/util/XercesVersion.hpp")
_XercesC_GET_VERSION("${XercesC_INCLUDE_DIR}/xercesc/util/XercesVersion.hpp")
endif()
diff --git a/Modules/Platform/Darwin-Initialize.cmake b/Modules/Platform/Darwin-Initialize.cmake
index 3db77aacbb..2d797f68f6 100644
--- a/Modules/Platform/Darwin-Initialize.cmake
+++ b/Modules/Platform/Darwin-Initialize.cmake
@@ -34,7 +34,7 @@ string(REGEX REPLACE "^([0-9]+\\.[0-9]+).*$" "\\1"
# CMAKE_OSX_DEPLOYMENT_TARGET
# Set cache variable - end user may change this during ccmake or cmake-gui configure.
-if(_CURRENT_OSX_VERSION VERSION_GREATER 10.3)
+if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND _CURRENT_OSX_VERSION VERSION_GREATER 10.3)
set(CMAKE_OSX_DEPLOYMENT_TARGET "$ENV{MACOSX_DEPLOYMENT_TARGET}" CACHE STRING
"Minimum OS X version to target for deployment (at runtime); newer APIs weak linked. Set to empty string for default value.")
endif()
@@ -49,6 +49,12 @@ elseif(NOT "x$ENV{SDKROOT}" STREQUAL "x" AND
(NOT "x$ENV{SDKROOT}" MATCHES "/" OR IS_DIRECTORY "$ENV{SDKROOT}"))
# Use the value of SDKROOT from the environment.
set(_CMAKE_OSX_SYSROOT_DEFAULT "$ENV{SDKROOT}")
+elseif(CMAKE_SYSTEM_NAME STREQUAL iOS)
+ set(_CMAKE_OSX_SYSROOT_DEFAULT "iphoneos")
+elseif(CMAKE_SYSTEM_NAME STREQUAL tvOS)
+ set(_CMAKE_OSX_SYSROOT_DEFAULT "appletvos")
+elseif(CMAKE_SYSTEM_NAME STREQUAL watchOS)
+ set(_CMAKE_OSX_SYSROOT_DEFAULT "watchos")
elseif("${CMAKE_GENERATOR}" MATCHES Xcode
OR CMAKE_OSX_DEPLOYMENT_TARGET
OR CMAKE_OSX_ARCHITECTURES MATCHES "[^;]"
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake
index 727baa6e1a..5590433a3b 100644
--- a/Modules/Platform/Darwin.cmake
+++ b/Modules/Platform/Darwin.cmake
@@ -1,5 +1,13 @@
set(APPLE 1)
+if(CMAKE_SYSTEM_NAME STREQUAL "iOS" OR CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "watchOS")
+ set(CMAKE_MACOSX_BUNDLE ON)
+
+ set(CMAKE_FIND_ROOT_PATH "${_CMAKE_OSX_SYSROOT_PATH}")
+ set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+endif()
+
# Darwin versions:
# 6.x == Mac OSX 10.2 (Jaguar)
# 7.x == Mac OSX 10.3 (Panther)
@@ -206,7 +214,7 @@ include(Platform/UnixPaths)
if(_CMAKE_OSX_SYSROOT_PATH AND EXISTS ${_CMAKE_OSX_SYSROOT_PATH}/usr/include)
list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${_CMAKE_OSX_SYSROOT_PATH}/usr)
foreach(lang C CXX)
- list(APPEND CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES ${_CMAKE_OSX_SYSROOT_PATH}/usr/include)
+ list(APPEND _CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES_INIT ${_CMAKE_OSX_SYSROOT_PATH}/usr/include)
endforeach()
endif()
list(APPEND CMAKE_SYSTEM_PREFIX_PATH
diff --git a/Modules/Platform/UnixPaths.cmake b/Modules/Platform/UnixPaths.cmake
index fc22fce0ba..97f744d521 100644
--- a/Modules/Platform/UnixPaths.cmake
+++ b/Modules/Platform/UnixPaths.cmake
@@ -63,23 +63,29 @@ list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
/lib /lib32 /lib64 /usr/lib /usr/lib32 /usr/lib64
)
-# Platform-wide directories to avoid adding via -I<dir>.
-list(APPEND CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES
- /usr/include
- )
+if(CMAKE_SYSROOT_COMPILE)
+ set(_cmake_sysroot_compile "${CMAKE_SYSROOT_COMPILE}")
+else()
+ set(_cmake_sysroot_compile "${CMAKE_SYSROOT}")
+endif()
# Default per-language values. These may be later replaced after
-# parsing the implicit link directories from compiler output.
-list(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
- /usr/include
+# parsing the implicit directory information from compiler output.
+set(_CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES_INIT
+ ${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES}
+ "${_cmake_sysroot_compile}/usr/include"
)
-list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
- /usr/include
+set(_CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES_INIT
+ ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}
+ "${_cmake_sysroot_compile}/usr/include"
)
-list(APPEND CMAKE_CUDA_IMPLICIT_INCLUDE_DIRECTORIES
- /usr/include
+set(_CMAKE_CUDA_IMPLICIT_INCLUDE_DIRECTORIES_INIT
+ ${CMAKE_CUDA_IMPLICIT_INCLUDE_DIRECTORIES}
+ "${_cmake_sysroot_compile}/usr/include"
)
+unset(_cmake_sysroot_compile)
+
# Enable use of lib32 and lib64 search path variants by default.
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS TRUE)
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE)
diff --git a/Modules/Platform/Windows-Intel-C.cmake b/Modules/Platform/Windows-Intel-C.cmake
index 767fec541a..06d8f50ff9 100644
--- a/Modules/Platform/Windows-Intel-C.cmake
+++ b/Modules/Platform/Windows-Intel-C.cmake
@@ -1,2 +1,4 @@
include(Platform/Windows-Intel)
__windows_compiler_intel(C)
+set(CMAKE_NINJA_DEPTYPE_C intel) # special value handled by CMake
+set(CMAKE_DEPFILE_FLAGS_C "-QMMD -QMT <OBJECT> -QMF <DEPFILE>")
diff --git a/Modules/Platform/Windows-Intel-CXX.cmake b/Modules/Platform/Windows-Intel-CXX.cmake
index 84cd303ec6..666de6ee44 100644
--- a/Modules/Platform/Windows-Intel-CXX.cmake
+++ b/Modules/Platform/Windows-Intel-CXX.cmake
@@ -1,3 +1,5 @@
include(Platform/Windows-Intel)
set(_COMPILE_CXX " /TP")
__windows_compiler_intel(CXX)
+set(CMAKE_NINJA_DEPTYPE_CXX intel) # special value handled by CMake
+set(CMAKE_DEPFILE_FLAGS_CXX "-QMMD -QMT <OBJECT> -QMF <DEPFILE>")
diff --git a/Modules/Platform/iOS-Determine-CXX.cmake b/Modules/Platform/iOS-Determine-CXX.cmake
new file mode 100644
index 0000000000..ac80fa62d8
--- /dev/null
+++ b/Modules/Platform/iOS-Determine-CXX.cmake
@@ -0,0 +1 @@
+include(Platform/Darwin-Determine-CXX)
diff --git a/Modules/Platform/iOS-Initialize.cmake b/Modules/Platform/iOS-Initialize.cmake
new file mode 100644
index 0000000000..41399a30b4
--- /dev/null
+++ b/Modules/Platform/iOS-Initialize.cmake
@@ -0,0 +1,7 @@
+include(Platform/Darwin-Initialize)
+
+if(NOT _CMAKE_OSX_SYSROOT_PATH MATCHES "/iPhone(OS|Simulator)")
+ message(FATAL_ERROR "${CMAKE_OSX_SYSROOT} is not an iOS SDK")
+endif()
+
+set(_CMAKE_FEATURE_DETECTION_TARGET_TYPE STATIC_LIBRARY)
diff --git a/Modules/Platform/iOS.cmake b/Modules/Platform/iOS.cmake
new file mode 100644
index 0000000000..850ddc2416
--- /dev/null
+++ b/Modules/Platform/iOS.cmake
@@ -0,0 +1 @@
+include(Platform/Darwin)
diff --git a/Modules/Platform/tvOS-Determine-CXX.cmake b/Modules/Platform/tvOS-Determine-CXX.cmake
new file mode 100644
index 0000000000..ac80fa62d8
--- /dev/null
+++ b/Modules/Platform/tvOS-Determine-CXX.cmake
@@ -0,0 +1 @@
+include(Platform/Darwin-Determine-CXX)
diff --git a/Modules/Platform/tvOS-Initialize.cmake b/Modules/Platform/tvOS-Initialize.cmake
new file mode 100644
index 0000000000..6834c80311
--- /dev/null
+++ b/Modules/Platform/tvOS-Initialize.cmake
@@ -0,0 +1,7 @@
+include(Platform/Darwin-Initialize)
+
+if(NOT _CMAKE_OSX_SYSROOT_PATH MATCHES "/AppleTV(OS|Simulator)")
+ message(FATAL_ERROR "${CMAKE_OSX_SYSROOT} is not an tvOS SDK")
+endif()
+
+set(_CMAKE_FEATURE_DETECTION_TARGET_TYPE STATIC_LIBRARY)
diff --git a/Modules/Platform/tvOS.cmake b/Modules/Platform/tvOS.cmake
new file mode 100644
index 0000000000..850ddc2416
--- /dev/null
+++ b/Modules/Platform/tvOS.cmake
@@ -0,0 +1 @@
+include(Platform/Darwin)
diff --git a/Modules/Platform/watchOS-Determine-CXX.cmake b/Modules/Platform/watchOS-Determine-CXX.cmake
new file mode 100644
index 0000000000..ac80fa62d8
--- /dev/null
+++ b/Modules/Platform/watchOS-Determine-CXX.cmake
@@ -0,0 +1 @@
+include(Platform/Darwin-Determine-CXX)
diff --git a/Modules/Platform/watchOS-Initialize.cmake b/Modules/Platform/watchOS-Initialize.cmake
new file mode 100644
index 0000000000..2f396d394d
--- /dev/null
+++ b/Modules/Platform/watchOS-Initialize.cmake
@@ -0,0 +1,7 @@
+include(Platform/Darwin-Initialize)
+
+if(NOT _CMAKE_OSX_SYSROOT_PATH MATCHES "/Watch(OS|Simulator)")
+ message(FATAL_ERROR "${CMAKE_OSX_SYSROOT} is not an watchOS SDK")
+endif()
+
+set(_CMAKE_FEATURE_DETECTION_TARGET_TYPE STATIC_LIBRARY)
diff --git a/Modules/Platform/watchOS.cmake b/Modules/Platform/watchOS.cmake
new file mode 100644
index 0000000000..850ddc2416
--- /dev/null
+++ b/Modules/Platform/watchOS.cmake
@@ -0,0 +1 @@
+include(Platform/Darwin)
diff --git a/Modules/UseJava.cmake b/Modules/UseJava.cmake
index 2bcd28ea97..5600b4c1cd 100644
--- a/Modules/UseJava.cmake
+++ b/Modules/UseJava.cmake
@@ -446,7 +446,7 @@ function (__java_copy_file src dest comment)
endfunction ()
function(__java_lcat VAR)
- foreach(_line ${ARGN})
+ foreach(_line IN LISTS ARGN)
string(APPEND ${VAR} "${_line}\n")
endforeach()
@@ -568,7 +568,7 @@ function(add_jar _TARGET_NAME)
set(CMAKE_JAVA_INCLUDE_FLAG_SEP ":")
endif()
- foreach (JAVA_INCLUDE_DIR ${CMAKE_JAVA_INCLUDE_PATH})
+ foreach (JAVA_INCLUDE_DIR IN LISTS CMAKE_JAVA_INCLUDE_PATH)
string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${JAVA_INCLUDE_DIR}")
endforeach()
@@ -592,7 +592,7 @@ function(add_jar _TARGET_NAME)
set(_JAVA_COMPILE_DEPENDS)
set(_JAVA_RESOURCE_FILES)
set(_JAVA_RESOURCE_FILES_RELATIVE)
- foreach(_JAVA_SOURCE_FILE ${_JAVA_SOURCE_FILES})
+ foreach(_JAVA_SOURCE_FILE IN LISTS _JAVA_SOURCE_FILES)
get_filename_component(_JAVA_EXT ${_JAVA_SOURCE_FILE} EXT)
get_filename_component(_JAVA_FILE ${_JAVA_SOURCE_FILE} NAME_WE)
get_filename_component(_JAVA_PATH ${_JAVA_SOURCE_FILE} PATH)
@@ -607,7 +607,7 @@ function(add_jar _TARGET_NAME)
file(RELATIVE_PATH _JAVA_REL_SOURCE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${_JAVA_FULL})
string(LENGTH ${_JAVA_REL_BINARY_PATH} _BIN_LEN)
string(LENGTH ${_JAVA_REL_SOURCE_PATH} _SRC_LEN)
- if (${_BIN_LEN} LESS ${_SRC_LEN})
+ if (_BIN_LEN LESS _SRC_LEN)
set(_JAVA_REL_PATH ${_JAVA_REL_BINARY_PATH})
else ()
set(_JAVA_REL_PATH ${_JAVA_REL_SOURCE_PATH})
@@ -637,7 +637,7 @@ function(add_jar _TARGET_NAME)
endif ()
endforeach()
- foreach(_JAVA_INCLUDE_JAR ${_add_jar_INCLUDE_JARS})
+ foreach(_JAVA_INCLUDE_JAR IN LISTS _add_jar_INCLUDE_JARS)
if (TARGET ${_JAVA_INCLUDE_JAR})
get_target_property(_JAVA_JAR_PATH ${_JAVA_INCLUDE_JAR} JAR_FILE)
if (_JAVA_JAR_PATH)
@@ -705,7 +705,7 @@ function(add_jar _TARGET_NAME)
# create the jar file
set(_JAVA_JAR_OUTPUT_PATH
- ${_add_jar_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_NAME})
+ "${_add_jar_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_NAME}")
if (CMAKE_JNI_TARGET)
add_custom_command(
OUTPUT ${_JAVA_JAR_OUTPUT_PATH}
@@ -903,15 +903,15 @@ function (find_jar VARIABLE)
set(_state "name")
- foreach (arg ${ARGN})
- if (${_state} STREQUAL "name")
- if (${arg} STREQUAL "VERSIONS")
+ foreach (arg IN LISTS ARGN)
+ if (_state STREQUAL "name")
+ if (arg STREQUAL "VERSIONS")
set(_state "versions")
- elseif (${arg} STREQUAL "NAMES")
+ elseif (arg STREQUAL "NAMES")
set(_state "names")
- elseif (${arg} STREQUAL "PATHS")
+ elseif (arg STREQUAL "PATHS")
set(_state "paths")
- elseif (${arg} STREQUAL "DOC")
+ elseif (arg STREQUAL "DOC")
set(_state "doc")
else ()
set(_jar_names ${arg})
@@ -919,22 +919,22 @@ function (find_jar VARIABLE)
set(_jar_doc "Finding ${arg} jar")
endif ()
endif ()
- elseif (${_state} STREQUAL "versions")
- if (${arg} STREQUAL "NAMES")
+ elseif (_state STREQUAL "versions")
+ if (arg STREQUAL "NAMES")
set(_state "names")
- elseif (${arg} STREQUAL "PATHS")
+ elseif (arg STREQUAL "PATHS")
set(_state "paths")
- elseif (${arg} STREQUAL "DOC")
+ elseif (arg STREQUAL "DOC")
set(_state "doc")
else ()
set(_jar_versions ${_jar_versions} ${arg})
endif ()
- elseif (${_state} STREQUAL "names")
- if (${arg} STREQUAL "VERSIONS")
+ elseif (_state STREQUAL "names")
+ if (arg STREQUAL "VERSIONS")
set(_state "versions")
- elseif (${arg} STREQUAL "PATHS")
+ elseif (arg STREQUAL "PATHS")
set(_state "paths")
- elseif (${arg} STREQUAL "DOC")
+ elseif (arg STREQUAL "DOC")
set(_state "doc")
else ()
set(_jar_names ${_jar_names} ${arg})
@@ -942,22 +942,22 @@ function (find_jar VARIABLE)
set(_jar_doc "Finding ${arg} jar")
endif ()
endif ()
- elseif (${_state} STREQUAL "paths")
- if (${arg} STREQUAL "VERSIONS")
+ elseif (_state STREQUAL "paths")
+ if (arg STREQUAL "VERSIONS")
set(_state "versions")
- elseif (${arg} STREQUAL "NAMES")
+ elseif (arg STREQUAL "NAMES")
set(_state "names")
- elseif (${arg} STREQUAL "DOC")
+ elseif (arg STREQUAL "DOC")
set(_state "doc")
else ()
set(_jar_paths ${_jar_paths} ${arg})
endif ()
- elseif (${_state} STREQUAL "doc")
- if (${arg} STREQUAL "VERSIONS")
+ elseif (_state STREQUAL "doc")
+ if (arg STREQUAL "VERSIONS")
set(_state "versions")
- elseif (${arg} STREQUAL "NAMES")
+ elseif (arg STREQUAL "NAMES")
set(_state "names")
- elseif (${arg} STREQUAL "PATHS")
+ elseif (arg STREQUAL "PATHS")
set(_state "paths")
else ()
set(_jar_doc ${arg})
@@ -969,8 +969,8 @@ function (find_jar VARIABLE)
message(FATAL_ERROR "find_jar: No name to search for given")
endif ()
- foreach (jar_name ${_jar_names})
- foreach (version ${_jar_versions})
+ foreach (jar_name IN LISTS _jar_names)
+ foreach (version IN LISTS _jar_versions)
set(_jar_files ${_jar_files} ${jar_name}-${version}.jar)
endforeach ()
set(_jar_files ${_jar_files} ${jar_name}.jar)
@@ -997,252 +997,252 @@ function(create_javadoc _target)
set(_state "package")
- foreach (arg ${ARGN})
- if (${_state} STREQUAL "package")
- if (${arg} STREQUAL "PACKAGES")
+ foreach (arg IN LISTS ARGN)
+ if (_state STREQUAL "package")
+ if (arg STREQUAL "PACKAGES")
set(_state "packages")
- elseif (${arg} STREQUAL "FILES")
+ elseif (arg STREQUAL "FILES")
set(_state "files")
- elseif (${arg} STREQUAL "SOURCEPATH")
+ elseif (arg STREQUAL "SOURCEPATH")
set(_state "sourcepath")
- elseif (${arg} STREQUAL "CLASSPATH")
+ elseif (arg STREQUAL "CLASSPATH")
set(_state "classpath")
- elseif (${arg} STREQUAL "INSTALLPATH")
+ elseif (arg STREQUAL "INSTALLPATH")
set(_state "installpath")
- elseif (${arg} STREQUAL "DOCTITLE")
+ elseif (arg STREQUAL "DOCTITLE")
set(_state "doctitle")
- elseif (${arg} STREQUAL "WINDOWTITLE")
+ elseif (arg STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
- elseif (${arg} STREQUAL "AUTHOR")
+ elseif (arg STREQUAL "AUTHOR")
set(_state "author")
- elseif (${arg} STREQUAL "USE")
+ elseif (arg STREQUAL "USE")
set(_state "use")
- elseif (${arg} STREQUAL "VERSION")
+ elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
set(_javadoc_packages ${arg})
set(_state "packages")
endif ()
- elseif (${_state} STREQUAL "packages")
- if (${arg} STREQUAL "FILES")
+ elseif (_state STREQUAL "packages")
+ if (arg STREQUAL "FILES")
set(_state "files")
- elseif (${arg} STREQUAL "SOURCEPATH")
+ elseif (arg STREQUAL "SOURCEPATH")
set(_state "sourcepath")
- elseif (${arg} STREQUAL "CLASSPATH")
+ elseif (arg STREQUAL "CLASSPATH")
set(_state "classpath")
- elseif (${arg} STREQUAL "INSTALLPATH")
+ elseif (arg STREQUAL "INSTALLPATH")
set(_state "installpath")
- elseif (${arg} STREQUAL "DOCTITLE")
+ elseif (arg STREQUAL "DOCTITLE")
set(_state "doctitle")
- elseif (${arg} STREQUAL "WINDOWTITLE")
+ elseif (arg STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
- elseif (${arg} STREQUAL "AUTHOR")
+ elseif (arg STREQUAL "AUTHOR")
set(_state "author")
- elseif (${arg} STREQUAL "USE")
+ elseif (arg STREQUAL "USE")
set(_state "use")
- elseif (${arg} STREQUAL "VERSION")
+ elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
list(APPEND _javadoc_packages ${arg})
endif ()
- elseif (${_state} STREQUAL "files")
- if (${arg} STREQUAL "PACKAGES")
+ elseif (_state STREQUAL "files")
+ if (arg STREQUAL "PACKAGES")
set(_state "packages")
- elseif (${arg} STREQUAL "SOURCEPATH")
+ elseif (arg STREQUAL "SOURCEPATH")
set(_state "sourcepath")
- elseif (${arg} STREQUAL "CLASSPATH")
+ elseif (arg STREQUAL "CLASSPATH")
set(_state "classpath")
- elseif (${arg} STREQUAL "INSTALLPATH")
+ elseif (arg STREQUAL "INSTALLPATH")
set(_state "installpath")
- elseif (${arg} STREQUAL "DOCTITLE")
+ elseif (arg STREQUAL "DOCTITLE")
set(_state "doctitle")
- elseif (${arg} STREQUAL "WINDOWTITLE")
+ elseif (arg STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
- elseif (${arg} STREQUAL "AUTHOR")
+ elseif (arg STREQUAL "AUTHOR")
set(_state "author")
- elseif (${arg} STREQUAL "USE")
+ elseif (arg STREQUAL "USE")
set(_state "use")
- elseif (${arg} STREQUAL "VERSION")
+ elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
list(APPEND _javadoc_files ${arg})
endif ()
- elseif (${_state} STREQUAL "sourcepath")
- if (${arg} STREQUAL "PACKAGES")
+ elseif (_state STREQUAL "sourcepath")
+ if (arg STREQUAL "PACKAGES")
set(_state "packages")
- elseif (${arg} STREQUAL "FILES")
+ elseif (arg STREQUAL "FILES")
set(_state "files")
- elseif (${arg} STREQUAL "CLASSPATH")
+ elseif (arg STREQUAL "CLASSPATH")
set(_state "classpath")
- elseif (${arg} STREQUAL "INSTALLPATH")
+ elseif (arg STREQUAL "INSTALLPATH")
set(_state "installpath")
- elseif (${arg} STREQUAL "DOCTITLE")
+ elseif (arg STREQUAL "DOCTITLE")
set(_state "doctitle")
- elseif (${arg} STREQUAL "WINDOWTITLE")
+ elseif (arg STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
- elseif (${arg} STREQUAL "AUTHOR")
+ elseif (arg STREQUAL "AUTHOR")
set(_state "author")
- elseif (${arg} STREQUAL "USE")
+ elseif (arg STREQUAL "USE")
set(_state "use")
- elseif (${arg} STREQUAL "VERSION")
+ elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
list(APPEND _javadoc_sourcepath ${arg})
endif ()
- elseif (${_state} STREQUAL "classpath")
- if (${arg} STREQUAL "PACKAGES")
+ elseif (_state STREQUAL "classpath")
+ if (arg STREQUAL "PACKAGES")
set(_state "packages")
- elseif (${arg} STREQUAL "FILES")
+ elseif (arg STREQUAL "FILES")
set(_state "files")
- elseif (${arg} STREQUAL "SOURCEPATH")
+ elseif (arg STREQUAL "SOURCEPATH")
set(_state "sourcepath")
- elseif (${arg} STREQUAL "INSTALLPATH")
+ elseif (arg STREQUAL "INSTALLPATH")
set(_state "installpath")
- elseif (${arg} STREQUAL "DOCTITLE")
+ elseif (arg STREQUAL "DOCTITLE")
set(_state "doctitle")
- elseif (${arg} STREQUAL "WINDOWTITLE")
+ elseif (arg STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
- elseif (${arg} STREQUAL "AUTHOR")
+ elseif (arg STREQUAL "AUTHOR")
set(_state "author")
- elseif (${arg} STREQUAL "USE")
+ elseif (arg STREQUAL "USE")
set(_state "use")
- elseif (${arg} STREQUAL "VERSION")
+ elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
list(APPEND _javadoc_classpath ${arg})
endif ()
- elseif (${_state} STREQUAL "installpath")
- if (${arg} STREQUAL "PACKAGES")
+ elseif (_state STREQUAL "installpath")
+ if (arg STREQUAL "PACKAGES")
set(_state "packages")
- elseif (${arg} STREQUAL "FILES")
+ elseif (arg STREQUAL "FILES")
set(_state "files")
- elseif (${arg} STREQUAL "SOURCEPATH")
+ elseif (arg STREQUAL "SOURCEPATH")
set(_state "sourcepath")
- elseif (${arg} STREQUAL "DOCTITLE")
+ elseif (arg STREQUAL "DOCTITLE")
set(_state "doctitle")
- elseif (${arg} STREQUAL "WINDOWTITLE")
+ elseif (arg STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
- elseif (${arg} STREQUAL "AUTHOR")
+ elseif (arg STREQUAL "AUTHOR")
set(_state "author")
- elseif (${arg} STREQUAL "USE")
+ elseif (arg STREQUAL "USE")
set(_state "use")
- elseif (${arg} STREQUAL "VERSION")
+ elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
set(_javadoc_installpath ${arg})
endif ()
- elseif (${_state} STREQUAL "doctitle")
+ elseif (_state STREQUAL "doctitle")
if (${arg} STREQUAL "PACKAGES")
set(_state "packages")
- elseif (${arg} STREQUAL "FILES")
+ elseif (arg STREQUAL "FILES")
set(_state "files")
- elseif (${arg} STREQUAL "SOURCEPATH")
+ elseif (arg STREQUAL "SOURCEPATH")
set(_state "sourcepath")
- elseif (${arg} STREQUAL "INSTALLPATH")
+ elseif (arg STREQUAL "INSTALLPATH")
set(_state "installpath")
- elseif (${arg} STREQUAL "CLASSPATH")
+ elseif (arg STREQUAL "CLASSPATH")
set(_state "classpath")
- elseif (${arg} STREQUAL "WINDOWTITLE")
+ elseif (arg STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
- elseif (${arg} STREQUAL "AUTHOR")
+ elseif (arg STREQUAL "AUTHOR")
set(_state "author")
- elseif (${arg} STREQUAL "USE")
+ elseif (arg STREQUAL "USE")
set(_state "use")
- elseif (${arg} STREQUAL "VERSION")
+ elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
set(_javadoc_doctitle ${arg})
endif ()
- elseif (${_state} STREQUAL "windowtitle")
+ elseif (_state STREQUAL "windowtitle")
if (${arg} STREQUAL "PACKAGES")
set(_state "packages")
- elseif (${arg} STREQUAL "FILES")
+ elseif (arg STREQUAL "FILES")
set(_state "files")
- elseif (${arg} STREQUAL "SOURCEPATH")
+ elseif (arg STREQUAL "SOURCEPATH")
set(_state "sourcepath")
- elseif (${arg} STREQUAL "CLASSPATH")
+ elseif (arg STREQUAL "CLASSPATH")
set(_state "classpath")
- elseif (${arg} STREQUAL "INSTALLPATH")
+ elseif (arg STREQUAL "INSTALLPATH")
set(_state "installpath")
- elseif (${arg} STREQUAL "DOCTITLE")
+ elseif (arg STREQUAL "DOCTITLE")
set(_state "doctitle")
- elseif (${arg} STREQUAL "AUTHOR")
+ elseif (arg STREQUAL "AUTHOR")
set(_state "author")
- elseif (${arg} STREQUAL "USE")
+ elseif (arg STREQUAL "USE")
set(_state "use")
- elseif (${arg} STREQUAL "VERSION")
+ elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
set(_javadoc_windowtitle ${arg})
endif ()
- elseif (${_state} STREQUAL "author")
- if (${arg} STREQUAL "PACKAGES")
+ elseif (_state STREQUAL "author")
+ if (arg STREQUAL "PACKAGES")
set(_state "packages")
- elseif (${arg} STREQUAL "FILES")
+ elseif (arg STREQUAL "FILES")
set(_state "files")
- elseif (${arg} STREQUAL "SOURCEPATH")
+ elseif (arg STREQUAL "SOURCEPATH")
set(_state "sourcepath")
- elseif (${arg} STREQUAL "CLASSPATH")
+ elseif (arg STREQUAL "CLASSPATH")
set(_state "classpath")
- elseif (${arg} STREQUAL "INSTALLPATH")
+ elseif (arg STREQUAL "INSTALLPATH")
set(_state "installpath")
- elseif (${arg} STREQUAL "DOCTITLE")
+ elseif (arg STREQUAL "DOCTITLE")
set(_state "doctitle")
- elseif (${arg} STREQUAL "WINDOWTITLE")
+ elseif (arg STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
- elseif (${arg} STREQUAL "AUTHOR")
+ elseif (arg STREQUAL "AUTHOR")
set(_state "author")
- elseif (${arg} STREQUAL "USE")
+ elseif (arg STREQUAL "USE")
set(_state "use")
- elseif (${arg} STREQUAL "VERSION")
+ elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
set(_javadoc_author ${arg})
endif ()
- elseif (${_state} STREQUAL "use")
- if (${arg} STREQUAL "PACKAGES")
+ elseif (_state STREQUAL "use")
+ if (arg STREQUAL "PACKAGES")
set(_state "packages")
- elseif (${arg} STREQUAL "FILES")
+ elseif (arg STREQUAL "FILES")
set(_state "files")
- elseif (${arg} STREQUAL "SOURCEPATH")
+ elseif (arg STREQUAL "SOURCEPATH")
set(_state "sourcepath")
- elseif (${arg} STREQUAL "CLASSPATH")
+ elseif (arg STREQUAL "CLASSPATH")
set(_state "classpath")
- elseif (${arg} STREQUAL "INSTALLPATH")
+ elseif (arg STREQUAL "INSTALLPATH")
set(_state "installpath")
- elseif (${arg} STREQUAL "DOCTITLE")
+ elseif (arg STREQUAL "DOCTITLE")
set(_state "doctitle")
- elseif (${arg} STREQUAL "WINDOWTITLE")
+ elseif (arg STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
- elseif (${arg} STREQUAL "AUTHOR")
+ elseif (arg STREQUAL "AUTHOR")
set(_state "author")
- elseif (${arg} STREQUAL "USE")
+ elseif (arg STREQUAL "USE")
set(_state "use")
- elseif (${arg} STREQUAL "VERSION")
+ elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
set(_javadoc_use ${arg})
endif ()
- elseif (${_state} STREQUAL "version")
- if (${arg} STREQUAL "PACKAGES")
+ elseif (_state STREQUAL "version")
+ if (arg STREQUAL "PACKAGES")
set(_state "packages")
- elseif (${arg} STREQUAL "FILES")
+ elseif (arg STREQUAL "FILES")
set(_state "files")
- elseif (${arg} STREQUAL "SOURCEPATH")
+ elseif (arg STREQUAL "SOURCEPATH")
set(_state "sourcepath")
- elseif (${arg} STREQUAL "CLASSPATH")
+ elseif (arg STREQUAL "CLASSPATH")
set(_state "classpath")
- elseif (${arg} STREQUAL "INSTALLPATH")
+ elseif (arg STREQUAL "INSTALLPATH")
set(_state "installpath")
- elseif (${arg} STREQUAL "DOCTITLE")
+ elseif (arg STREQUAL "DOCTITLE")
set(_state "doctitle")
- elseif (${arg} STREQUAL "WINDOWTITLE")
+ elseif (arg STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
- elseif (${arg} STREQUAL "AUTHOR")
+ elseif (arg STREQUAL "AUTHOR")
set(_state "author")
- elseif (${arg} STREQUAL "USE")
+ elseif (arg STREQUAL "USE")
set(_state "use")
- elseif (${arg} STREQUAL "VERSION")
+ elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
set(_javadoc_version ${arg})
@@ -1255,7 +1255,7 @@ function(create_javadoc _target)
if (_javadoc_sourcepath)
set(_start TRUE)
- foreach(_path ${_javadoc_sourcepath})
+ foreach(_path IN LISTS _javadoc_sourcepath)
if (_start)
set(_sourcepath ${_path})
set(_start FALSE)
@@ -1268,7 +1268,7 @@ function(create_javadoc _target)
if (_javadoc_classpath)
set(_start TRUE)
- foreach(_path ${_javadoc_classpath})
+ foreach(_path IN LISTS _javadoc_classpath)
if (_start)
set(_classpath ${_path})
set(_start FALSE)
@@ -1435,7 +1435,7 @@ function(export_jars)
# Set content of generated exports file
string(REPLACE ";" " " __targets__ "${_export_jars_TARGETS}")
set(__targetdefs__ "")
- foreach(_target ${_export_jars_TARGETS})
+ foreach(_target IN LISTS _export_jars_TARGETS)
get_target_property(_jarpath ${_target} JAR_FILE)
get_filename_component(_jarpath ${_jarpath} PATH)
__java_export_jar(__targetdefs__ ${_target} "${_jarpath}")
@@ -1473,7 +1473,7 @@ function(install_jar_exports)
endif()
# Determine relative path from installed export file to install prefix
- if(IS_ABSOLUTE ${_install_jar_exports_DESTINATION})
+ if(IS_ABSOLUTE "${_install_jar_exports_DESTINATION}")
file(RELATIVE_PATH _relpath
${_install_jar_exports_DESTINATION}
${CMAKE_INSTALL_PREFIX}
@@ -1492,7 +1492,7 @@ function(install_jar_exports)
# Set content of generated exports file
string(REPLACE ";" " " __targets__ "${_install_jar_exports_TARGETS}")
set(__targetdefs__ "set(_prefix \${CMAKE_CURRENT_LIST_DIR}/${_relpath})\n\n")
- foreach(_target ${_install_jar_exports_TARGETS})
+ foreach(_target IN LISTS _install_jar_exports_TARGETS)
get_target_property(_dir ${_target} INSTALL_DESTINATION)
__java_export_jar(__targetdefs__ ${_target} "\${_prefix}/${_dir}")
endforeach()
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index c73c6dfd37..1c06052fd6 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -819,9 +819,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR MATCHES "sparc"
endif()
endif()
-# On Apple we need CoreFoundation
+# On Apple we need CoreFoundation and CoreServices
if(APPLE)
target_link_libraries(CMakeLib "-framework CoreFoundation")
+ target_link_libraries(CMakeLib "-framework CoreServices")
endif()
if(WIN32 AND NOT UNIX)
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 6dcb2fb6f6..88a4fa8fcf 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 13)
-set(CMake_VERSION_PATCH 20190127)
-#set(CMake_VERSION_RC 1)
+set(CMake_VERSION_MINOR 14)
+set(CMake_VERSION_PATCH 0)
+set(CMake_VERSION_RC 2)
diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx
index 180c92eeda..9102e3e20e 100644
--- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx
+++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx
@@ -21,9 +21,7 @@ cmCPackIFWGenerator::cmCPackIFWGenerator()
this->Generator = this;
}
-cmCPackIFWGenerator::~cmCPackIFWGenerator()
-{
-}
+cmCPackIFWGenerator::~cmCPackIFWGenerator() = default;
int cmCPackIFWGenerator::PackageFiles()
{
diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx
index 8f492afde9..01e3ea4a7e 100644
--- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx
+++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx
@@ -16,9 +16,7 @@
#include <stddef.h>
#include <utility>
-cmCPackIFWInstaller::cmCPackIFWInstaller()
-{
-}
+cmCPackIFWInstaller::cmCPackIFWInstaller() = default;
void cmCPackIFWInstaller::printSkippedOptionWarning(
const std::string& optionName, const std::string& optionValue)
@@ -288,8 +286,7 @@ protected:
content = cmSystemTools::TrimWhitespace(content);
std::string source = this->basePath + "/" + content;
std::string destination = this->path + "/" + content;
- if (!cmSystemTools::CopyFileIfDifferent(source.data(),
- destination.data())) {
+ if (!cmSystemTools::CopyFileIfDifferent(source, destination)) {
this->hasErrors = true;
}
}
diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx
index c96b5d41fc..a1a52b1852 100644
--- a/Source/CPack/IFW/cmCPackIFWPackage.cxx
+++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx
@@ -24,9 +24,7 @@ cmCPackIFWPackage::CompareStruct::CompareStruct()
}
//------------------------------------------------------- DependenceStruct ---
-cmCPackIFWPackage::DependenceStruct::DependenceStruct()
-{
-}
+cmCPackIFWPackage::DependenceStruct::DependenceStruct() = default;
cmCPackIFWPackage::DependenceStruct::DependenceStruct(
const std::string& dependence)
diff --git a/Source/CPack/cmCPack7zGenerator.cxx b/Source/CPack/cmCPack7zGenerator.cxx
index f0c41a2a1e..7413770120 100644
--- a/Source/CPack/cmCPack7zGenerator.cxx
+++ b/Source/CPack/cmCPack7zGenerator.cxx
@@ -10,6 +10,4 @@ cmCPack7zGenerator::cmCPack7zGenerator()
{
}
-cmCPack7zGenerator::~cmCPack7zGenerator()
-{
-}
+cmCPack7zGenerator::~cmCPack7zGenerator() = default;
diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx
index 175621879e..98fb29d14e 100644
--- a/Source/CPack/cmCPackArchiveGenerator.cxx
+++ b/Source/CPack/cmCPackArchiveGenerator.cxx
@@ -22,9 +22,7 @@ cmCPackArchiveGenerator::cmCPackArchiveGenerator(cmArchiveWrite::Compress t,
this->ArchiveFormat = format;
}
-cmCPackArchiveGenerator::~cmCPackArchiveGenerator()
-{
-}
+cmCPackArchiveGenerator::~cmCPackArchiveGenerator() = default;
std::string cmCPackArchiveGenerator::GetArchiveComponentFileName(
const std::string& component, bool isGroupName)
diff --git a/Source/CPack/cmCPackBundleGenerator.cxx b/Source/CPack/cmCPackBundleGenerator.cxx
index f8fd108d30..3a476f44b9 100644
--- a/Source/CPack/cmCPackBundleGenerator.cxx
+++ b/Source/CPack/cmCPackBundleGenerator.cxx
@@ -8,13 +8,9 @@
#include "cmCPackLog.h"
#include "cmSystemTools.h"
-cmCPackBundleGenerator::cmCPackBundleGenerator()
-{
-}
+cmCPackBundleGenerator::cmCPackBundleGenerator() = default;
-cmCPackBundleGenerator::~cmCPackBundleGenerator()
-{
-}
+cmCPackBundleGenerator::~cmCPackBundleGenerator() = default;
int cmCPackBundleGenerator::InitializeInternal()
{
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx
index 46a428faa1..635de490ac 100644
--- a/Source/CPack/cmCPackDebGenerator.cxx
+++ b/Source/CPack/cmCPackDebGenerator.cxx
@@ -432,13 +432,9 @@ bool DebGenerator::generateDeb() const
} // end anonymous namespace
-cmCPackDebGenerator::cmCPackDebGenerator()
-{
-}
+cmCPackDebGenerator::cmCPackDebGenerator() = default;
-cmCPackDebGenerator::~cmCPackDebGenerator()
-{
-}
+cmCPackDebGenerator::~cmCPackDebGenerator() = default;
int cmCPackDebGenerator::InitializeInternal()
{
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index be4a18e09d..013ad8163e 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -62,9 +62,7 @@ cmCPackDragNDropGenerator::cmCPackDragNDropGenerator()
this->componentPackageMethod = ONE_PACKAGE;
}
-cmCPackDragNDropGenerator::~cmCPackDragNDropGenerator()
-{
-}
+cmCPackDragNDropGenerator::~cmCPackDragNDropGenerator() = default;
int cmCPackDragNDropGenerator::InitializeInternal()
{
@@ -212,8 +210,7 @@ int cmCPackDragNDropGenerator::PackageFiles()
bool cmCPackDragNDropGenerator::CopyFile(std::ostringstream& source,
std::ostringstream& target)
{
- if (!cmSystemTools::CopyFileIfDifferent(source.str().c_str(),
- target.str().c_str())) {
+ if (!cmSystemTools::CopyFileIfDifferent(source.str(), target.str())) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error copying " << source.str() << " to " << target.str()
<< std::endl);
diff --git a/Source/CPack/cmCPackFreeBSDGenerator.cxx b/Source/CPack/cmCPackFreeBSDGenerator.cxx
index 0ff005457d..fcf8af1f8d 100644
--- a/Source/CPack/cmCPackFreeBSDGenerator.cxx
+++ b/Source/CPack/cmCPackFreeBSDGenerator.cxx
@@ -31,9 +31,7 @@ int cmCPackFreeBSDGenerator::InitializeInternal()
return this->Superclass::InitializeInternal();
}
-cmCPackFreeBSDGenerator::~cmCPackFreeBSDGenerator()
-{
-}
+cmCPackFreeBSDGenerator::~cmCPackFreeBSDGenerator() = default;
// This is a wrapper, for use only in stream-based output,
// that will output a string in UCL escaped fashion (in particular,
@@ -103,7 +101,7 @@ public:
{
}
- virtual ~ManifestKey() {}
+ virtual ~ManifestKey() = default;
// Output the value associated with this key to the stream @p s.
// Format is to be decided by subclasses.
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 4728f69577..57c054590f 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -43,12 +43,6 @@ cmCPackGenerator::~cmCPackGenerator()
this->MakefileMap = nullptr;
}
-void cmCPackGeneratorProgress(const char* msg, float prog, void* ptr)
-{
- cmCPackGenerator* self = static_cast<cmCPackGenerator*>(ptr);
- self->DisplayVerboseOutput(msg, prog);
-}
-
void cmCPackGenerator::DisplayVerboseOutput(const char* msg, float progress)
{
(void)progress;
@@ -392,8 +386,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
std::move(inFileRelative));
}
/* If it is not a symlink then do a plain copy */
- else if (!(cmSystemTools::CopyFileIfDifferent(inFile.c_str(),
- filePath.c_str()) &&
+ else if (!(cmSystemTools::CopyFileIfDifferent(inFile, filePath) &&
cmSystemTools::CopyFileTime(inFile.c_str(),
filePath.c_str()))) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
@@ -696,7 +689,9 @@ int cmCPackGenerator::InstallCMakeProject(
cm.SetHomeOutputDirectory("");
cm.GetCurrentSnapshot().SetDefaultDefinitions();
cm.AddCMakePaths();
- cm.SetProgressCallback(cmCPackGeneratorProgress, this);
+ cm.SetProgressCallback([this](const char* msg, float prog) {
+ this->DisplayVerboseOutput(msg, prog);
+ });
cm.SetTrace(this->Trace);
cm.SetTraceExpand(this->TraceExpand);
cmGlobalGenerator gg(&cm);
@@ -1077,8 +1072,7 @@ int cmCPackGenerator::DoPackage()
<< (tempPackageFileName ? tempPackageFileName : "(NULL)")
<< " to " << (packageFileName ? packageFileName : "(NULL)")
<< std::endl);
- if (!cmSystemTools::CopyFileIfDifferent(tempPackageFileName,
- packageFileName)) {
+ if (!cmSystemTools::CopyFileIfDifferent(pkgFileName, tmpPF)) {
cmCPackLogger(
cmCPackLog::LOG_ERROR,
"Problem copying the package: "
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index 4b865ca39d..37ea66e76a 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -30,9 +30,7 @@ cmCPackNSISGenerator::cmCPackNSISGenerator(bool nsis64)
Nsis64 = nsis64;
}
-cmCPackNSISGenerator::~cmCPackNSISGenerator()
-{
-}
+cmCPackNSISGenerator::~cmCPackNSISGenerator() = default;
int cmCPackNSISGenerator::PackageFiles()
{
diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx
index 1908c17a31..486633c905 100644
--- a/Source/CPack/cmCPackOSXX11Generator.cxx
+++ b/Source/CPack/cmCPackOSXX11Generator.cxx
@@ -11,13 +11,9 @@
#include "cmSystemTools.h"
#include "cm_sys_stat.h"
-cmCPackOSXX11Generator::cmCPackOSXX11Generator()
-{
-}
+cmCPackOSXX11Generator::cmCPackOSXX11Generator() = default;
-cmCPackOSXX11Generator::~cmCPackOSXX11Generator()
-{
-}
+cmCPackOSXX11Generator::~cmCPackOSXX11Generator() = default;
int cmCPackOSXX11Generator::PackageFiles()
{
diff --git a/Source/CPack/cmCPackPKGGenerator.cxx b/Source/CPack/cmCPackPKGGenerator.cxx
index 9401bca5ca..ae227aab11 100644
--- a/Source/CPack/cmCPackPKGGenerator.cxx
+++ b/Source/CPack/cmCPackPKGGenerator.cxx
@@ -15,9 +15,7 @@ cmCPackPKGGenerator::cmCPackPKGGenerator()
this->componentPackageMethod = ONE_PACKAGE;
}
-cmCPackPKGGenerator::~cmCPackPKGGenerator()
-{
-}
+cmCPackPKGGenerator::~cmCPackPKGGenerator() = default;
bool cmCPackPKGGenerator::SupportsComponentInstallation() const
{
diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx
index 28e0561cf2..246178d8f3 100644
--- a/Source/CPack/cmCPackPackageMakerGenerator.cxx
+++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx
@@ -30,9 +30,7 @@ cmCPackPackageMakerGenerator::cmCPackPackageMakerGenerator()
this->PackageCompatibilityVersion = getVersion(10, 4);
}
-cmCPackPackageMakerGenerator::~cmCPackPackageMakerGenerator()
-{
-}
+cmCPackPackageMakerGenerator::~cmCPackPackageMakerGenerator() = default;
bool cmCPackPackageMakerGenerator::SupportsComponentInstallation() const
{
diff --git a/Source/CPack/cmCPackProductBuildGenerator.cxx b/Source/CPack/cmCPackProductBuildGenerator.cxx
index e73d01f370..a556e0c520 100644
--- a/Source/CPack/cmCPackProductBuildGenerator.cxx
+++ b/Source/CPack/cmCPackProductBuildGenerator.cxx
@@ -17,9 +17,7 @@ cmCPackProductBuildGenerator::cmCPackProductBuildGenerator()
this->componentPackageMethod = ONE_PACKAGE;
}
-cmCPackProductBuildGenerator::~cmCPackProductBuildGenerator()
-{
-}
+cmCPackProductBuildGenerator::~cmCPackProductBuildGenerator() = default;
int cmCPackProductBuildGenerator::PackageFiles()
{
diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx
index 5834829c61..33ab62bdf1 100644
--- a/Source/CPack/cmCPackRPMGenerator.cxx
+++ b/Source/CPack/cmCPackRPMGenerator.cxx
@@ -14,13 +14,9 @@
#include "cmCPackLog.h"
#include "cmSystemTools.h"
-cmCPackRPMGenerator::cmCPackRPMGenerator()
-{
-}
+cmCPackRPMGenerator::cmCPackRPMGenerator() = default;
-cmCPackRPMGenerator::~cmCPackRPMGenerator()
-{
-}
+cmCPackRPMGenerator::~cmCPackRPMGenerator() = default;
int cmCPackRPMGenerator::InitializeInternal()
{
diff --git a/Source/CPack/cmCPackSTGZGenerator.cxx b/Source/CPack/cmCPackSTGZGenerator.cxx
index e55ea870d0..aba15d239c 100644
--- a/Source/CPack/cmCPackSTGZGenerator.cxx
+++ b/Source/CPack/cmCPackSTGZGenerator.cxx
@@ -13,13 +13,9 @@
#include "cmSystemTools.h"
#include "cm_sys_stat.h"
-cmCPackSTGZGenerator::cmCPackSTGZGenerator()
-{
-}
+cmCPackSTGZGenerator::cmCPackSTGZGenerator() = default;
-cmCPackSTGZGenerator::~cmCPackSTGZGenerator()
-{
-}
+cmCPackSTGZGenerator::~cmCPackSTGZGenerator() = default;
int cmCPackSTGZGenerator::InitializeInternal()
{
diff --git a/Source/CPack/cmCPackTGZGenerator.cxx b/Source/CPack/cmCPackTGZGenerator.cxx
index eaf8186fe1..6f4676ef91 100644
--- a/Source/CPack/cmCPackTGZGenerator.cxx
+++ b/Source/CPack/cmCPackTGZGenerator.cxx
@@ -10,6 +10,4 @@ cmCPackTGZGenerator::cmCPackTGZGenerator()
{
}
-cmCPackTGZGenerator::~cmCPackTGZGenerator()
-{
-}
+cmCPackTGZGenerator::~cmCPackTGZGenerator() = default;
diff --git a/Source/CPack/cmCPackTXZGenerator.cxx b/Source/CPack/cmCPackTXZGenerator.cxx
index e55e903e90..ccbccde955 100644
--- a/Source/CPack/cmCPackTXZGenerator.cxx
+++ b/Source/CPack/cmCPackTXZGenerator.cxx
@@ -10,6 +10,4 @@ cmCPackTXZGenerator::cmCPackTXZGenerator()
{
}
-cmCPackTXZGenerator::~cmCPackTXZGenerator()
-{
-}
+cmCPackTXZGenerator::~cmCPackTXZGenerator() = default;
diff --git a/Source/CPack/cmCPackTarBZip2Generator.cxx b/Source/CPack/cmCPackTarBZip2Generator.cxx
index c7a3dd429b..85abeb1ca2 100644
--- a/Source/CPack/cmCPackTarBZip2Generator.cxx
+++ b/Source/CPack/cmCPackTarBZip2Generator.cxx
@@ -10,6 +10,4 @@ cmCPackTarBZip2Generator::cmCPackTarBZip2Generator()
{
}
-cmCPackTarBZip2Generator::~cmCPackTarBZip2Generator()
-{
-}
+cmCPackTarBZip2Generator::~cmCPackTarBZip2Generator() = default;
diff --git a/Source/CPack/cmCPackTarCompressGenerator.cxx b/Source/CPack/cmCPackTarCompressGenerator.cxx
index 0a7cd978c5..55a6de53c4 100644
--- a/Source/CPack/cmCPackTarCompressGenerator.cxx
+++ b/Source/CPack/cmCPackTarCompressGenerator.cxx
@@ -10,6 +10,4 @@ cmCPackTarCompressGenerator::cmCPackTarCompressGenerator()
{
}
-cmCPackTarCompressGenerator::~cmCPackTarCompressGenerator()
-{
-}
+cmCPackTarCompressGenerator::~cmCPackTarCompressGenerator() = default;
diff --git a/Source/CPack/cmCPackZIPGenerator.cxx b/Source/CPack/cmCPackZIPGenerator.cxx
index 6b77c363d7..f06494c443 100644
--- a/Source/CPack/cmCPackZIPGenerator.cxx
+++ b/Source/CPack/cmCPackZIPGenerator.cxx
@@ -10,6 +10,4 @@ cmCPackZIPGenerator::cmCPackZIPGenerator()
{
}
-cmCPackZIPGenerator::~cmCPackZIPGenerator()
-{
-}
+cmCPackZIPGenerator::~cmCPackZIPGenerator() = default;
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index d4c867b7fd..0413422b2d 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -90,12 +90,8 @@ int cpackDefinitionArgument(const char* argument, const char* cValue,
return 1;
}
-static void cpackProgressCallback(const char* message, float progress,
- void* clientdata)
+static void cpackProgressCallback(const char* message, float /*unused*/)
{
- (void)progress;
- (void)clientdata;
-
std::cout << "-- " << message << std::endl;
}
@@ -212,7 +208,7 @@ int main(int argc, char const* const* argv)
cmake cminst(cmake::RoleScript, cmState::CPack);
cminst.SetHomeDirectory("");
cminst.SetHomeOutputDirectory("");
- cminst.SetProgressCallback(cpackProgressCallback, nullptr);
+ cminst.SetProgressCallback(cpackProgressCallback);
cminst.GetCurrentSnapshot().SetDefaultDefinitions();
cmGlobalGenerator cmgg(&cminst);
cmMakefile globalMF(&cmgg, cminst.GetCurrentSnapshot());
diff --git a/Source/CTest/cmCTestBZR.cxx b/Source/CTest/cmCTestBZR.cxx
index 365f267748..b154caf301 100644
--- a/Source/CTest/cmCTestBZR.cxx
+++ b/Source/CTest/cmCTestBZR.cxx
@@ -77,9 +77,7 @@ cmCTestBZR::cmCTestBZR(cmCTest* ct, std::ostream& log)
cmSystemTools::PutEnv("BZR_PROGRESS_BAR=none");
}
-cmCTestBZR::~cmCTestBZR()
-{
-}
+cmCTestBZR::~cmCTestBZR() = default;
class cmCTestBZR::InfoParser : public cmCTestVC::LineParser
{
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx
index 312d126da2..2fd4c7ab32 100644
--- a/Source/CTest/cmCTestBuildAndTestHandler.cxx
+++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx
@@ -109,27 +109,6 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring,
return 0;
}
-void CMakeMessageCallback(const char* m, const char* /*unused*/,
- bool& /*unused*/, void* s)
-{
- std::string* out = static_cast<std::string*>(s);
- *out += m;
- *out += "\n";
-}
-
-void CMakeProgressCallback(const char* msg, float /*unused*/, void* s)
-{
- std::string* out = static_cast<std::string*>(s);
- *out += msg;
- *out += "\n";
-}
-
-void CMakeOutputCallback(const char* m, size_t len, void* s)
-{
- std::string* out = static_cast<std::string*>(s);
- out->append(m, len);
-}
-
class cmCTestBuildAndTestCaptureRAII
{
cmake& CM;
@@ -138,17 +117,27 @@ public:
cmCTestBuildAndTestCaptureRAII(cmake& cm, std::string& s)
: CM(cm)
{
- cmSystemTools::SetMessageCallback(CMakeMessageCallback, &s);
- cmSystemTools::SetStdoutCallback(CMakeOutputCallback, &s);
- cmSystemTools::SetStderrCallback(CMakeOutputCallback, &s);
- this->CM.SetProgressCallback(CMakeProgressCallback, &s);
+ cmSystemTools::SetMessageCallback(
+ [&s](const char* msg, const char* /*unused*/) {
+ s += msg;
+ s += "\n";
+ });
+
+ cmSystemTools::SetStdoutCallback([&s](std::string const& m) { s += m; });
+ cmSystemTools::SetStderrCallback([&s](std::string const& m) { s += m; });
+
+ this->CM.SetProgressCallback([&s](const char* msg, float /*unused*/) {
+ s += msg;
+ s += "\n";
+ });
}
+
~cmCTestBuildAndTestCaptureRAII()
{
- this->CM.SetProgressCallback(nullptr, nullptr);
- cmSystemTools::SetStderrCallback(nullptr, nullptr);
- cmSystemTools::SetStdoutCallback(nullptr, nullptr);
- cmSystemTools::SetMessageCallback(nullptr, nullptr);
+ this->CM.SetProgressCallback(nullptr);
+ cmSystemTools::SetStderrCallback(nullptr);
+ cmSystemTools::SetStdoutCallback(nullptr);
+ cmSystemTools::SetMessageCallback(nullptr);
}
};
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index d07bd21264..d934c003cf 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -507,14 +507,13 @@ public:
: FTC(ftc)
{
}
- FragmentCompare() {}
+ FragmentCompare() = default;
bool operator()(std::string const& l, std::string const& r) const
{
// Order files by modification time. Use lexicographic order
// among files with the same time.
int result;
- if (this->FTC->FileTimeCompare(l.c_str(), r.c_str(), &result) &&
- result != 0) {
+ if (this->FTC->FileTimeCompare(l, r, &result) && result != 0) {
return result < 0;
}
return l < r;
diff --git a/Source/CTest/cmCTestCVS.cxx b/Source/CTest/cmCTestCVS.cxx
index 6e1ada1d3c..6e8f73f83c 100644
--- a/Source/CTest/cmCTestCVS.cxx
+++ b/Source/CTest/cmCTestCVS.cxx
@@ -16,9 +16,7 @@ cmCTestCVS::cmCTestCVS(cmCTest* ct, std::ostream& log)
{
}
-cmCTestCVS::~cmCTestCVS()
-{
-}
+cmCTestCVS::~cmCTestCVS() = default;
class cmCTestCVS::UpdateParser : public cmCTestVC::LineParser
{
diff --git a/Source/CTest/cmCTestConfigureHandler.cxx b/Source/CTest/cmCTestConfigureHandler.cxx
index 5967b7458a..6b7601b6e3 100644
--- a/Source/CTest/cmCTestConfigureHandler.cxx
+++ b/Source/CTest/cmCTestConfigureHandler.cxx
@@ -11,9 +11,7 @@
#include <ostream>
#include <string>
-cmCTestConfigureHandler::cmCTestConfigureHandler()
-{
-}
+cmCTestConfigureHandler::cmCTestConfigureHandler() = default;
void cmCTestConfigureHandler::Initialize()
{
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index e39e25a217..225383ce09 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -111,9 +111,7 @@ private:
cmDuration TimeOut;
};
-cmCTestCoverageHandler::cmCTestCoverageHandler()
-{
-}
+cmCTestCoverageHandler::cmCTestCoverageHandler() = default;
void cmCTestCoverageHandler::Initialize()
{
diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx
index 4ede3d4ee1..210abe55ba 100644
--- a/Source/CTest/cmCTestGIT.cxx
+++ b/Source/CTest/cmCTestGIT.cxx
@@ -31,9 +31,7 @@ cmCTestGIT::cmCTestGIT(cmCTest* ct, std::ostream& log)
this->CurrentGitVersion = 0;
}
-cmCTestGIT::~cmCTestGIT()
-{
-}
+cmCTestGIT::~cmCTestGIT() = default;
class cmCTestGIT::OneLineParser : public cmCTestVC::LineParser
{
@@ -477,7 +475,6 @@ private:
std::string EMail;
unsigned long Time = 0;
long TimeZone = 0;
- Person() {}
};
void ParsePerson(const char* str, Person& person)
diff --git a/Source/CTest/cmCTestGenericHandler.cxx b/Source/CTest/cmCTestGenericHandler.cxx
index dc1bba051d..d3020b5135 100644
--- a/Source/CTest/cmCTestGenericHandler.cxx
+++ b/Source/CTest/cmCTestGenericHandler.cxx
@@ -18,9 +18,7 @@ cmCTestGenericHandler::cmCTestGenericHandler()
this->TestLoad = 0;
}
-cmCTestGenericHandler::~cmCTestGenericHandler()
-{
-}
+cmCTestGenericHandler::~cmCTestGenericHandler() = default;
void cmCTestGenericHandler::SetOption(const std::string& op, const char* value)
{
diff --git a/Source/CTest/cmCTestGlobalVC.cxx b/Source/CTest/cmCTestGlobalVC.cxx
index d2714d90b4..a2d4d2c75a 100644
--- a/Source/CTest/cmCTestGlobalVC.cxx
+++ b/Source/CTest/cmCTestGlobalVC.cxx
@@ -15,9 +15,7 @@ cmCTestGlobalVC::cmCTestGlobalVC(cmCTest* ct, std::ostream& log)
this->PriorRev = this->Unknown;
}
-cmCTestGlobalVC::~cmCTestGlobalVC()
-{
-}
+cmCTestGlobalVC::~cmCTestGlobalVC() = default;
const char* cmCTestGlobalVC::LocalPath(std::string const& path)
{
diff --git a/Source/CTest/cmCTestHG.cxx b/Source/CTest/cmCTestHG.cxx
index 9c6a80dc79..6fb99d8642 100644
--- a/Source/CTest/cmCTestHG.cxx
+++ b/Source/CTest/cmCTestHG.cxx
@@ -18,9 +18,7 @@ cmCTestHG::cmCTestHG(cmCTest* ct, std::ostream& log)
this->PriorRev = this->Unknown;
}
-cmCTestHG::~cmCTestHG()
-{
-}
+cmCTestHG::~cmCTestHG() = default;
class cmCTestHG::IdentifyParser : public cmCTestVC::LineParser
{
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index d3aa2b4597..756ac6cf6f 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -44,7 +44,6 @@ public:
: Handler(handler)
{
}
- ~TestComparator() {}
// Sorts tests in descending order of cost
bool operator()(int index1, int index2) const
@@ -70,9 +69,7 @@ cmCTestMultiProcessHandler::cmCTestMultiProcessHandler()
this->SerialTestRunning = false;
}
-cmCTestMultiProcessHandler::~cmCTestMultiProcessHandler()
-{
-}
+cmCTestMultiProcessHandler::~cmCTestMultiProcessHandler() = default;
// Set the tests
void cmCTestMultiProcessHandler::SetTests(TestMap& tests,
diff --git a/Source/CTest/cmCTestP4.cxx b/Source/CTest/cmCTestP4.cxx
index c0bdc17f5d..435be97b6d 100644
--- a/Source/CTest/cmCTestP4.cxx
+++ b/Source/CTest/cmCTestP4.cxx
@@ -19,9 +19,7 @@ cmCTestP4::cmCTestP4(cmCTest* ct, std::ostream& log)
this->PriorRev = this->Unknown;
}
-cmCTestP4::~cmCTestP4()
-{
-}
+cmCTestP4::~cmCTestP4() = default;
class cmCTestP4::IdentifyParser : public cmCTestVC::LineParser
{
diff --git a/Source/CTest/cmCTestRunTest.h b/Source/CTest/cmCTestRunTest.h
index c78641319a..918d5fa58b 100644
--- a/Source/CTest/cmCTestRunTest.h
+++ b/Source/CTest/cmCTestRunTest.h
@@ -27,8 +27,6 @@ class cmCTestRunTest
public:
explicit cmCTestRunTest(cmCTestMultiProcessHandler& multiHandler);
- ~cmCTestRunTest() = default;
-
void SetNumberOfRuns(int n) { this->NumberOfRunsLeft = n; }
void SetRunUntilFailOn() { this->RunUntilFail = true; }
void SetTestProperties(cmCTestTestHandler::cmCTestTestProperties* prop)
diff --git a/Source/CTest/cmCTestSVN.cxx b/Source/CTest/cmCTestSVN.cxx
index afde61c92e..3bf66ca23f 100644
--- a/Source/CTest/cmCTestSVN.cxx
+++ b/Source/CTest/cmCTestSVN.cxx
@@ -26,9 +26,7 @@ cmCTestSVN::cmCTestSVN(cmCTest* ct, std::ostream& log)
this->PriorRev = this->Unknown;
}
-cmCTestSVN::~cmCTestSVN()
-{
-}
+cmCTestSVN::~cmCTestSVN() = default;
void cmCTestSVN::CleanupImpl()
{
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx
index b94902394a..33b8b4a4ca 100644
--- a/Source/CTest/cmCTestScriptHandler.cxx
+++ b/Source/CTest/cmCTestScriptHandler.cxx
@@ -53,8 +53,6 @@ struct cmListFileFunction;
class cmCTestScriptFunctionBlocker : public cmFunctionBlocker
{
public:
- cmCTestScriptFunctionBlocker() {}
- ~cmCTestScriptFunctionBlocker() override {}
bool IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile& mf,
cmExecutionStatus& /*status*/) override;
// virtual bool ShouldRemove(const cmListFileFunction& lff, cmMakefile &mf);
@@ -265,15 +263,6 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg)
return retVal;
}
-static void ctestScriptProgressCallback(const char* m, float /*unused*/,
- void* cd)
-{
- cmCTest* ctest = static_cast<cmCTest*>(cd);
- if (m && *m) {
- cmCTestLog(ctest, HANDLER_OUTPUT, "-- " << m << std::endl);
- }
-}
-
void cmCTestScriptHandler::CreateCMake()
{
// create a cmake instance to read the configuration script
@@ -299,7 +288,11 @@ void cmCTestScriptHandler::CreateCMake()
this->ParentMakefile->GetRecursionDepth());
}
- this->CMake->SetProgressCallback(ctestScriptProgressCallback, this->CTest);
+ this->CMake->SetProgressCallback([this](const char* m, float /*unused*/) {
+ if (m && *m) {
+ cmCTestLog(this->CTest, HANDLER_OUTPUT, "-- " << m << std::endl);
+ }
+ });
this->AddCTestCommand("ctest_build", new cmCTestBuildCommand);
this->AddCTestCommand("ctest_configure", new cmCTestConfigureCommand);
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index 5213bd315d..87112da9e0 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -30,10 +30,6 @@ typedef std::vector<char> cmCTestSubmitHandlerVectorOfChar;
class cmCTestSubmitHandler::ResponseParser : public cmXMLParser
{
public:
- ResponseParser() { this->Status = STATUS_OK; }
- ~ResponseParser() override {}
-
-public:
enum StatusType
{
STATUS_OK,
@@ -41,7 +37,7 @@ public:
STATUS_ERROR
};
- StatusType Status;
+ StatusType Status = STATUS_OK;
std::string Filename;
std::string MD5;
std::string Message;
diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx
index 57e40ce351..e3b7e9ef3d 100644
--- a/Source/CTest/cmCTestUpdateHandler.cxx
+++ b/Source/CTest/cmCTestUpdateHandler.cxx
@@ -34,9 +34,7 @@ static const char* cmCTestUpdateHandlerUpdateToString(int type)
return cmCTestUpdateHandlerUpdateStrings[type];
}
-cmCTestUpdateHandler::cmCTestUpdateHandler()
-{
-}
+cmCTestUpdateHandler::cmCTestUpdateHandler() = default;
void cmCTestUpdateHandler::Initialize()
{
diff --git a/Source/CTest/cmCTestVC.cxx b/Source/CTest/cmCTestVC.cxx
index 63bd0e67d6..374e73ffb9 100644
--- a/Source/CTest/cmCTestVC.cxx
+++ b/Source/CTest/cmCTestVC.cxx
@@ -24,9 +24,7 @@ cmCTestVC::cmCTestVC(cmCTest* ct, std::ostream& log)
this->Unknown.Rev = "Unknown";
}
-cmCTestVC::~cmCTestVC()
-{
-}
+cmCTestVC::~cmCTestVC() = default;
void cmCTestVC::SetCommandLineTool(std::string const& tool)
{
diff --git a/Source/CTest/cmParseBlanketJSCoverage.cxx b/Source/CTest/cmParseBlanketJSCoverage.cxx
index 308e6f7a35..63d6a15d8e 100644
--- a/Source/CTest/cmParseBlanketJSCoverage.cxx
+++ b/Source/CTest/cmParseBlanketJSCoverage.cxx
@@ -20,7 +20,7 @@ public:
{
}
- virtual ~JSONParser() {}
+ virtual ~JSONParser() = default;
std::string getValue(std::string const& line, int type)
{
diff --git a/Source/CTest/cmParseCoberturaCoverage.cxx b/Source/CTest/cmParseCoberturaCoverage.cxx
index 5bb64247ba..848a034c95 100644
--- a/Source/CTest/cmParseCoberturaCoverage.cxx
+++ b/Source/CTest/cmParseCoberturaCoverage.cxx
@@ -13,19 +13,12 @@ class cmParseCoberturaCoverage::XMLParser : public cmXMLParser
{
public:
XMLParser(cmCTest* ctest, cmCTestCoverageHandlerContainer& cont)
- : CTest(ctest)
+ : FilePaths{ cont.SourceDir, cont.BinaryDir }
+ , CTest(ctest)
, Coverage(cont)
{
- this->InSources = false;
- this->InSource = false;
- this->SkipThisClass = false;
- this->FilePaths.push_back(this->Coverage.SourceDir);
- this->FilePaths.push_back(this->Coverage.BinaryDir);
- this->CurFileName.clear();
}
- ~XMLParser() override {}
-
protected:
void EndElement(const std::string& name) override
{
@@ -144,9 +137,9 @@ protected:
}
private:
- bool InSources;
- bool InSource;
- bool SkipThisClass;
+ bool InSources = false;
+ bool InSource = false;
+ bool SkipThisClass = false;
std::vector<std::string> FilePaths;
typedef cmCTestCoverageHandlerContainer::SingleFileCoverageVector
FileLinesType;
diff --git a/Source/CTest/cmParseDelphiCoverage.cxx b/Source/CTest/cmParseDelphiCoverage.cxx
index d99de0656a..9eda6f8f3d 100644
--- a/Source/CTest/cmParseDelphiCoverage.cxx
+++ b/Source/CTest/cmParseDelphiCoverage.cxx
@@ -20,7 +20,7 @@ public:
{
}
- virtual ~HTMLParser() {}
+ virtual ~HTMLParser() = default;
bool initializeDelphiFile(
std::string const& filename,
diff --git a/Source/CTest/cmParseJacocoCoverage.cxx b/Source/CTest/cmParseJacocoCoverage.cxx
index 31e7cd4d45..61c5dcbbdb 100644
--- a/Source/CTest/cmParseJacocoCoverage.cxx
+++ b/Source/CTest/cmParseJacocoCoverage.cxx
@@ -18,13 +18,8 @@ public:
: CTest(ctest)
, Coverage(cont)
{
- this->FilePath.clear();
- this->PackagePath.clear();
- this->PackageName.clear();
}
- ~XMLParser() override {}
-
protected:
void EndElement(const std::string& /*name*/) override {}
diff --git a/Source/CTest/cmParseMumpsCoverage.cxx b/Source/CTest/cmParseMumpsCoverage.cxx
index 488d2378a8..4a81ee4f70 100644
--- a/Source/CTest/cmParseMumpsCoverage.cxx
+++ b/Source/CTest/cmParseMumpsCoverage.cxx
@@ -18,9 +18,7 @@ cmParseMumpsCoverage::cmParseMumpsCoverage(
{
}
-cmParseMumpsCoverage::~cmParseMumpsCoverage()
-{
-}
+cmParseMumpsCoverage::~cmParseMumpsCoverage() = default;
bool cmParseMumpsCoverage::ReadCoverageFile(const char* file)
{
diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx
index 7737f65ce8..70ef8dfcd0 100644
--- a/Source/CTest/cmProcess.cxx
+++ b/Source/CTest/cmProcess.cxx
@@ -69,9 +69,7 @@ cmProcess::cmProcess(cmCTestRunTest& runner)
this->StartTime = std::chrono::steady_clock::time_point();
}
-cmProcess::~cmProcess()
-{
-}
+cmProcess::~cmProcess() = default;
void cmProcess::SetCommand(const char* command)
{
diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx
index dbf4a28e3f..f2982a62ca 100644
--- a/Source/CursesDialog/ccmake.cxx
+++ b/Source/CursesDialog/ccmake.cxx
@@ -65,13 +65,6 @@ void onsig(int /*unused*/)
}
}
-void CMakeMessageHandler(const char* message, const char* title,
- bool& /*unused*/, void* clientData)
-{
- cmCursesForm* self = static_cast<cmCursesForm*>(clientData);
- self->AddError(message, title);
-}
-
int main(int argc, char const* const* argv)
{
cmsys::Encoding::CommandLineArguments encoding_args =
@@ -156,7 +149,10 @@ int main(int argc, char const* const* argv)
return 1;
}
- cmSystemTools::SetMessageCallback(CMakeMessageHandler, myform);
+ cmSystemTools::SetMessageCallback(
+ [myform](const char* message, const char* title) {
+ myform->AddError(message, title);
+ });
cmCursesForm::CurrentForm = myform;
diff --git a/Source/CursesDialog/cmCursesBoolWidget.h b/Source/CursesDialog/cmCursesBoolWidget.h
index cdb9478e16..8c96256356 100644
--- a/Source/CursesDialog/cmCursesBoolWidget.h
+++ b/Source/CursesDialog/cmCursesBoolWidget.h
@@ -12,11 +12,12 @@ class cmCursesMainForm;
class cmCursesBoolWidget : public cmCursesWidget
{
- CM_DISABLE_COPY(cmCursesBoolWidget)
-
public:
cmCursesBoolWidget(int width, int height, int left, int top);
+ cmCursesBoolWidget(cmCursesBoolWidget const&) = delete;
+ cmCursesBoolWidget& operator=(cmCursesBoolWidget const&) = delete;
+
// Description:
// Handle user input. Called by the container of this widget
// when this widget has focus. Returns true if the input was
diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.h b/Source/CursesDialog/cmCursesCacheEntryComposite.h
index 54b2f1fd14..0a69d3a9b6 100644
--- a/Source/CursesDialog/cmCursesCacheEntryComposite.h
+++ b/Source/CursesDialog/cmCursesCacheEntryComposite.h
@@ -13,14 +13,17 @@ class cmake;
class cmCursesCacheEntryComposite
{
- CM_DISABLE_COPY(cmCursesCacheEntryComposite)
-
public:
cmCursesCacheEntryComposite(const std::string& key, int labelwidth,
int entrywidth);
cmCursesCacheEntryComposite(const std::string& key, cmake* cm, bool isNew,
int labelwidth, int entrywidth);
~cmCursesCacheEntryComposite();
+
+ cmCursesCacheEntryComposite(cmCursesCacheEntryComposite const&) = delete;
+ cmCursesCacheEntryComposite& operator=(cmCursesCacheEntryComposite const&) =
+ delete;
+
const char* GetValue();
friend class cmCursesMainForm;
diff --git a/Source/CursesDialog/cmCursesDummyWidget.h b/Source/CursesDialog/cmCursesDummyWidget.h
index c509ae7731..07b7288abe 100644
--- a/Source/CursesDialog/cmCursesDummyWidget.h
+++ b/Source/CursesDialog/cmCursesDummyWidget.h
@@ -12,11 +12,12 @@ class cmCursesMainForm;
class cmCursesDummyWidget : public cmCursesWidget
{
- CM_DISABLE_COPY(cmCursesDummyWidget)
-
public:
cmCursesDummyWidget(int width, int height, int left, int top);
+ cmCursesDummyWidget(cmCursesDummyWidget const&) = delete;
+ cmCursesDummyWidget& operator=(cmCursesDummyWidget const&) = delete;
+
// Description:
// Handle user input. Called by the container of this widget
// when this widget has focus. Returns true if the input was
diff --git a/Source/CursesDialog/cmCursesFilePathWidget.h b/Source/CursesDialog/cmCursesFilePathWidget.h
index 0a304023e1..3f71259d5d 100644
--- a/Source/CursesDialog/cmCursesFilePathWidget.h
+++ b/Source/CursesDialog/cmCursesFilePathWidget.h
@@ -9,10 +9,11 @@
class cmCursesFilePathWidget : public cmCursesPathWidget
{
- CM_DISABLE_COPY(cmCursesFilePathWidget)
-
public:
cmCursesFilePathWidget(int width, int height, int left, int top);
+
+ cmCursesFilePathWidget(cmCursesFilePathWidget const&) = delete;
+ cmCursesFilePathWidget& operator=(cmCursesFilePathWidget const&) = delete;
};
#endif // cmCursesFilePathWidget_h
diff --git a/Source/CursesDialog/cmCursesForm.h b/Source/CursesDialog/cmCursesForm.h
index 249b349365..ddb67deeb3 100644
--- a/Source/CursesDialog/cmCursesForm.h
+++ b/Source/CursesDialog/cmCursesForm.h
@@ -11,12 +11,13 @@
class cmCursesForm
{
- CM_DISABLE_COPY(cmCursesForm)
-
public:
cmCursesForm();
virtual ~cmCursesForm();
+ cmCursesForm(cmCursesForm const&) = delete;
+ cmCursesForm& operator=(cmCursesForm const&) = delete;
+
// Description:
// Handle user input.
virtual void HandleInput() = 0;
diff --git a/Source/CursesDialog/cmCursesLabelWidget.cxx b/Source/CursesDialog/cmCursesLabelWidget.cxx
index 1dfd4ce47b..83aea5a2c6 100644
--- a/Source/CursesDialog/cmCursesLabelWidget.cxx
+++ b/Source/CursesDialog/cmCursesLabelWidget.cxx
@@ -14,9 +14,7 @@ cmCursesLabelWidget::cmCursesLabelWidget(int width, int height, int left,
this->SetValue(name);
}
-cmCursesLabelWidget::~cmCursesLabelWidget()
-{
-}
+cmCursesLabelWidget::~cmCursesLabelWidget() = default;
bool cmCursesLabelWidget::HandleInput(int& /*key*/, cmCursesMainForm* /*fm*/,
WINDOW* /*w*/)
diff --git a/Source/CursesDialog/cmCursesLabelWidget.h b/Source/CursesDialog/cmCursesLabelWidget.h
index aab559b161..2ee9cfca8a 100644
--- a/Source/CursesDialog/cmCursesLabelWidget.h
+++ b/Source/CursesDialog/cmCursesLabelWidget.h
@@ -14,13 +14,14 @@ class cmCursesMainForm;
class cmCursesLabelWidget : public cmCursesWidget
{
- CM_DISABLE_COPY(cmCursesLabelWidget)
-
public:
cmCursesLabelWidget(int width, int height, int left, int top,
const std::string& name);
~cmCursesLabelWidget() override;
+ cmCursesLabelWidget(cmCursesLabelWidget const&) = delete;
+ cmCursesLabelWidget& operator=(cmCursesLabelWidget const&) = delete;
+
// Description:
// Handle user input. Called by the container of this widget
// when this widget has focus. Returns true if the input was
diff --git a/Source/CursesDialog/cmCursesLongMessageForm.h b/Source/CursesDialog/cmCursesLongMessageForm.h
index 2bcc15a20f..466b4e1b09 100644
--- a/Source/CursesDialog/cmCursesLongMessageForm.h
+++ b/Source/CursesDialog/cmCursesLongMessageForm.h
@@ -13,13 +13,14 @@
class cmCursesLongMessageForm : public cmCursesForm
{
- CM_DISABLE_COPY(cmCursesLongMessageForm)
-
public:
cmCursesLongMessageForm(std::vector<std::string> const& messages,
const char* title);
~cmCursesLongMessageForm() override;
+ cmCursesLongMessageForm(cmCursesLongMessageForm const&) = delete;
+ cmCursesLongMessageForm& operator=(cmCursesLongMessageForm const&) = delete;
+
// Description:
// Handle user input.
void HandleInput() override;
diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx
index 188ad69a3a..8ca7802f1f 100644
--- a/Source/CursesDialog/cmCursesMainForm.cxx
+++ b/Source/CursesDialog/cmCursesMainForm.cxx
@@ -506,12 +506,8 @@ void cmCursesMainForm::UpdateStatusBar(const char* message)
pos_form_cursor(this->Form);
}
-void cmCursesMainForm::UpdateProgress(const char* msg, float prog, void* vp)
+void cmCursesMainForm::UpdateProgress(const char* msg, float prog)
{
- cmCursesMainForm* cm = static_cast<cmCursesMainForm*>(vp);
- if (!cm) {
- return;
- }
char tmp[1024];
const char* cmsg = tmp;
if (prog >= 0) {
@@ -519,8 +515,8 @@ void cmCursesMainForm::UpdateProgress(const char* msg, float prog, void* vp)
} else {
cmsg = msg;
}
- cm->UpdateStatusBar(cmsg);
- cm->PrintKeys(1);
+ this->UpdateStatusBar(cmsg);
+ this->PrintKeys(1);
curses_move(1, 1);
touchwin(stdscr);
refresh();
@@ -536,8 +532,8 @@ int cmCursesMainForm::Configure(int noconfigure)
this->PrintKeys(1);
touchwin(stdscr);
refresh();
- this->CMakeInstance->SetProgressCallback(cmCursesMainForm::UpdateProgress,
- this);
+ this->CMakeInstance->SetProgressCallback(
+ [this](const char* msg, float prog) { this->UpdateProgress(msg, prog); });
// always save the current gui values to disk
this->FillCacheManagerFromUI();
@@ -560,7 +556,7 @@ int cmCursesMainForm::Configure(int noconfigure)
} else {
retVal = this->CMakeInstance->Configure();
}
- this->CMakeInstance->SetProgressCallback(nullptr, nullptr);
+ this->CMakeInstance->SetProgressCallback(nullptr);
keypad(stdscr, true); /* Use key symbols as KEY_DOWN */
@@ -606,8 +602,8 @@ int cmCursesMainForm::Generate()
this->PrintKeys(1);
touchwin(stdscr);
refresh();
- this->CMakeInstance->SetProgressCallback(cmCursesMainForm::UpdateProgress,
- this);
+ this->CMakeInstance->SetProgressCallback(
+ [this](const char* msg, float prog) { this->UpdateProgress(msg, prog); });
// Get rid of previous errors
this->Errors = std::vector<std::string>();
@@ -615,7 +611,7 @@ int cmCursesMainForm::Generate()
// run the generate process
int retVal = this->CMakeInstance->Generate();
- this->CMakeInstance->SetProgressCallback(nullptr, nullptr);
+ this->CMakeInstance->SetProgressCallback(nullptr);
keypad(stdscr, true); /* Use key symbols as KEY_DOWN */
if (retVal != 0 || !this->Errors.empty()) {
diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h
index 824025bcd1..cc6482fd3a 100644
--- a/Source/CursesDialog/cmCursesMainForm.h
+++ b/Source/CursesDialog/cmCursesMainForm.h
@@ -23,12 +23,13 @@ class cmake;
*/
class cmCursesMainForm : public cmCursesForm
{
- CM_DISABLE_COPY(cmCursesMainForm)
-
public:
cmCursesMainForm(std::vector<std::string> args, int initwidth);
~cmCursesMainForm() override;
+ cmCursesMainForm(cmCursesMainForm const&) = delete;
+ cmCursesMainForm& operator=(cmCursesMainForm const&) = delete;
+
/**
* Set the widgets which represent the cache entries.
*/
@@ -101,8 +102,7 @@ public:
/**
* Progress callback
*/
- static void UpdateProgressOld(const char* msg, float prog, void*);
- static void UpdateProgress(const char* msg, float prog, void*);
+ void UpdateProgress(const char* msg, float prog);
protected:
// Copy the cache values from the user interface to the actual
diff --git a/Source/CursesDialog/cmCursesOptionsWidget.h b/Source/CursesDialog/cmCursesOptionsWidget.h
index 3e50e2d4ce..0128d6a42d 100644
--- a/Source/CursesDialog/cmCursesOptionsWidget.h
+++ b/Source/CursesDialog/cmCursesOptionsWidget.h
@@ -15,11 +15,12 @@ class cmCursesMainForm;
class cmCursesOptionsWidget : public cmCursesWidget
{
- CM_DISABLE_COPY(cmCursesOptionsWidget)
-
public:
cmCursesOptionsWidget(int width, int height, int left, int top);
+ cmCursesOptionsWidget(cmCursesOptionsWidget const&) = delete;
+ cmCursesOptionsWidget& operator=(cmCursesOptionsWidget const&) = delete;
+
// Description:
// Handle user input. Called by the container of this widget
// when this widget has focus. Returns true if the input was
diff --git a/Source/CursesDialog/cmCursesPathWidget.h b/Source/CursesDialog/cmCursesPathWidget.h
index bfa0ea3433..1eace03a6c 100644
--- a/Source/CursesDialog/cmCursesPathWidget.h
+++ b/Source/CursesDialog/cmCursesPathWidget.h
@@ -14,11 +14,12 @@ class cmCursesMainForm;
class cmCursesPathWidget : public cmCursesStringWidget
{
- CM_DISABLE_COPY(cmCursesPathWidget)
-
public:
cmCursesPathWidget(int width, int height, int left, int top);
+ cmCursesPathWidget(cmCursesPathWidget const&) = delete;
+ cmCursesPathWidget& operator=(cmCursesPathWidget const&) = delete;
+
/**
* This method is called when different keys are pressed. The
* subclass can have a special implementation handler for this.
diff --git a/Source/CursesDialog/cmCursesStringWidget.h b/Source/CursesDialog/cmCursesStringWidget.h
index 90310f6124..021515ba3d 100644
--- a/Source/CursesDialog/cmCursesStringWidget.h
+++ b/Source/CursesDialog/cmCursesStringWidget.h
@@ -20,11 +20,12 @@ class cmCursesMainForm;
class cmCursesStringWidget : public cmCursesWidget
{
- CM_DISABLE_COPY(cmCursesStringWidget)
-
public:
cmCursesStringWidget(int width, int height, int left, int top);
+ cmCursesStringWidget(cmCursesStringWidget const&) = delete;
+ cmCursesStringWidget& operator=(cmCursesStringWidget const&) = delete;
+
/**
* Handle user input. Called by the container of this widget
* when this widget has focus. Returns true if the input was
diff --git a/Source/CursesDialog/cmCursesWidget.h b/Source/CursesDialog/cmCursesWidget.h
index a44c5e6b6a..f761f6d8a1 100644
--- a/Source/CursesDialog/cmCursesWidget.h
+++ b/Source/CursesDialog/cmCursesWidget.h
@@ -14,12 +14,13 @@ class cmCursesMainForm;
class cmCursesWidget
{
- CM_DISABLE_COPY(cmCursesWidget)
-
public:
cmCursesWidget(int width, int height, int left, int top);
virtual ~cmCursesWidget();
+ cmCursesWidget(cmCursesWidget const&) = delete;
+ cmCursesWidget& operator=(cmCursesWidget const&) = delete;
+
/**
* Handle user input. Called by the container of this widget
* when this widget has focus. Returns true if the input was
diff --git a/Source/LexerParser/cmListFileLexer.c b/Source/LexerParser/cmListFileLexer.c
index c726415be8..15dcda04a0 100644
--- a/Source/LexerParser/cmListFileLexer.c
+++ b/Source/LexerParser/cmListFileLexer.c
@@ -766,7 +766,7 @@ Modify cmListFileLexer.c:
/* IWYU pragma: no_forward_declare yyguts_t */
-#ifdef WIN32
+#ifdef _WIN32
#include "cmsys/Encoding.h"
#endif
diff --git a/Source/LexerParser/cmListFileLexer.in.l b/Source/LexerParser/cmListFileLexer.in.l
index 6a6fb5f06f..fdf14d2d38 100644
--- a/Source/LexerParser/cmListFileLexer.in.l
+++ b/Source/LexerParser/cmListFileLexer.in.l
@@ -18,7 +18,7 @@ Modify cmListFileLexer.c:
/* IWYU pragma: no_forward_declare yyguts_t */
-#ifdef WIN32
+#ifdef _WIN32
#include "cmsys/Encoding.h"
#endif
diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx
index 9f4e48e89e..cd30ad5476 100644
--- a/Source/QtDialog/CMakeSetup.cxx
+++ b/Source/QtDialog/CMakeSetup.cxx
@@ -30,7 +30,8 @@ static const char* cmDocumentationUsage[][2] = {
{ nullptr,
" cmake-gui [options]\n"
" cmake-gui [options] <path-to-source>\n"
- " cmake-gui [options] <path-to-existing-build>" },
+ " cmake-gui [options] <path-to-existing-build>\n"
+ " cmake-gui [options] -S <path-to-source> -B <path-to-build>\n" },
{ nullptr, nullptr }
};
@@ -142,23 +143,53 @@ int main(int argc, char** argv)
CMakeSetupDialog dialog;
dialog.show();
- cmsys::CommandLineArguments arg;
- arg.Initialize(argc2, argv2);
+ QStringList args = QApplication::arguments();
std::string binaryDirectory;
std::string sourceDirectory;
- typedef cmsys::CommandLineArguments argT;
- arg.AddArgument("-B", argT::CONCAT_ARGUMENT, &binaryDirectory,
- "Binary Directory");
- arg.AddArgument("-S", argT::CONCAT_ARGUMENT, &sourceDirectory,
- "Source Directory");
- // do not complain about unknown options
- arg.StoreUnusedArguments(true);
- arg.Parse();
+ for (int i = 1; i < args.size(); ++i) {
+ const QString& arg = args[i];
+ if (arg.startsWith("-S")) {
+ QString path = arg.mid(2);
+ if (path.isEmpty()) {
+ ++i;
+ if (i >= args.size()) {
+ std::cerr << "No source directory specified for -S" << std::endl;
+ return 1;
+ }
+ path = args[i];
+ if (path[0] == '-') {
+ std::cerr << "No source directory specified for -S" << std::endl;
+ return 1;
+ }
+ }
+
+ sourceDirectory =
+ cmSystemTools::CollapseFullPath(path.toLocal8Bit().data());
+ cmSystemTools::ConvertToUnixSlashes(sourceDirectory);
+ } else if (arg.startsWith("-B")) {
+ QString path = arg.mid(2);
+ if (path.isEmpty()) {
+ ++i;
+ if (i >= args.size()) {
+ std::cerr << "No build directory specified for -B" << std::endl;
+ return 1;
+ }
+ path = args[i];
+ if (path[0] == '-') {
+ std::cerr << "No build directory specified for -B" << std::endl;
+ return 1;
+ }
+ }
+
+ binaryDirectory =
+ cmSystemTools::CollapseFullPath(path.toLocal8Bit().data());
+ cmSystemTools::ConvertToUnixSlashes(binaryDirectory);
+ }
+ }
if (!sourceDirectory.empty() && !binaryDirectory.empty()) {
dialog.setSourceDirectory(QString::fromLocal8Bit(sourceDirectory.c_str()));
dialog.setBinaryDirectory(QString::fromLocal8Bit(binaryDirectory.c_str()));
} else {
- QStringList args = QApplication::arguments();
if (args.count() == 2) {
std::string filePath =
cmSystemTools::CollapseFullPath(args[1].toLocal8Bit().data());
diff --git a/Source/QtDialog/CMakeSetup128.png b/Source/QtDialog/CMakeSetup128.png
index 728ef0269f..32984e104e 100644
--- a/Source/QtDialog/CMakeSetup128.png
+++ b/Source/QtDialog/CMakeSetup128.png
Binary files differ
diff --git a/Source/QtDialog/CMakeSetup32.png b/Source/QtDialog/CMakeSetup32.png
index 1c36b31d0b..78df82f15b 100644
--- a/Source/QtDialog/CMakeSetup32.png
+++ b/Source/QtDialog/CMakeSetup32.png
Binary files differ
diff --git a/Source/QtDialog/CMakeSetup64.png b/Source/QtDialog/CMakeSetup64.png
index 44eb17173f..5c2dbf552d 100644
--- a/Source/QtDialog/CMakeSetup64.png
+++ b/Source/QtDialog/CMakeSetup64.png
Binary files differ
diff --git a/Source/QtDialog/Delete16.png b/Source/QtDialog/Delete16.png
index 16989fee12..9d2f2b7ec7 100644
--- a/Source/QtDialog/Delete16.png
+++ b/Source/QtDialog/Delete16.png
Binary files differ
diff --git a/Source/QtDialog/FirstConfigure.cxx b/Source/QtDialog/FirstConfigure.cxx
index ae5179c050..f28e1a8215 100644
--- a/Source/QtDialog/FirstConfigure.cxx
+++ b/Source/QtDialog/FirstConfigure.cxx
@@ -86,9 +86,7 @@ QFrame* StartCompilerSetup::CreatePlatformWidgets()
return frame;
}
-StartCompilerSetup::~StartCompilerSetup()
-{
-}
+StartCompilerSetup::~StartCompilerSetup() = default;
void StartCompilerSetup::setGenerators(
std::vector<cmake::GeneratorInfo> const& gens)
@@ -237,9 +235,7 @@ NativeCompilerSetup::NativeCompilerSetup(QWidget* p)
this->setupUi(c);
}
-NativeCompilerSetup::~NativeCompilerSetup()
-{
-}
+NativeCompilerSetup::~NativeCompilerSetup() = default;
QString NativeCompilerSetup::getCCompiler() const
{
@@ -301,9 +297,7 @@ CrossCompilerSetup::CrossCompilerSetup(QWidget* p)
this->registerField("systemName*", this->systemName);
}
-CrossCompilerSetup::~CrossCompilerSetup()
-{
-}
+CrossCompilerSetup::~CrossCompilerSetup() = default;
QString CrossCompilerSetup::getCCompiler() const
{
@@ -414,9 +408,7 @@ ToolchainCompilerSetup::ToolchainCompilerSetup(QWidget* p)
l->addWidget(this->ToolchainFile);
}
-ToolchainCompilerSetup::~ToolchainCompilerSetup()
-{
-}
+ToolchainCompilerSetup::~ToolchainCompilerSetup() = default;
QString ToolchainCompilerSetup::toolchainFile() const
{
@@ -446,9 +438,7 @@ FirstConfigure::FirstConfigure()
this->setPage(ToolchainSetup, this->mToolchainCompilerSetupPage);
}
-FirstConfigure::~FirstConfigure()
-{
-}
+FirstConfigure::~FirstConfigure() = default;
void FirstConfigure::setGenerators(
std::vector<cmake::GeneratorInfo> const& gens)
diff --git a/Source/QtDialog/Plus16.png b/Source/QtDialog/Plus16.png
index 552f6f0045..1c33bc7637 100644
--- a/Source/QtDialog/Plus16.png
+++ b/Source/QtDialog/Plus16.png
Binary files differ
diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx
index 2eecce65b1..a073c3064a 100644
--- a/Source/QtDialog/QCMake.cxx
+++ b/Source/QtDialog/QCMake.cxx
@@ -23,16 +23,26 @@ QCMake::QCMake(QObject* p)
cmSystemTools::DisableRunCommandOutput();
cmSystemTools::SetRunCommandHideConsole(true);
- cmSystemTools::SetMessageCallback(QCMake::messageCallback, this);
- cmSystemTools::SetStdoutCallback(QCMake::stdoutCallback, this);
- cmSystemTools::SetStderrCallback(QCMake::stderrCallback, this);
+
+ cmSystemTools::SetMessageCallback(
+ [this](const char* msg, const char* title) {
+ this->messageCallback(msg, title);
+ });
+ cmSystemTools::SetStdoutCallback(
+ [this](std::string const& msg) { this->stdoutCallback(msg); });
+ cmSystemTools::SetStderrCallback(
+ [this](std::string const& msg) { this->stderrCallback(msg); });
this->CMakeInstance = new cmake(cmake::RoleProject, cmState::Project);
this->CMakeInstance->SetCMakeEditCommand(
cmSystemTools::GetCMakeGUICommand());
- this->CMakeInstance->SetProgressCallback(QCMake::progressCallback, this);
+ this->CMakeInstance->SetProgressCallback(
+ [this](const char* msg, float percent) {
+ this->progressCallback(msg, percent);
+ });
- cmSystemTools::SetInterruptCallback(QCMake::interruptCallback, this);
+ cmSystemTools::SetInterruptCallback(
+ [this] { return this->interruptCallback(); });
std::vector<cmake::GeneratorInfo> generators;
this->CMakeInstance->GetRegisteredGenerators(
@@ -330,46 +340,40 @@ void QCMake::interrupt()
this->InterruptFlag.ref();
}
-bool QCMake::interruptCallback(void* cd)
+bool QCMake::interruptCallback()
{
- QCMake* self = reinterpret_cast<QCMake*>(cd);
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- return self->InterruptFlag;
+ return this->InterruptFlag;
#else
- return self->InterruptFlag.load();
+ return this->InterruptFlag.load();
#endif
}
-void QCMake::progressCallback(const char* msg, float percent, void* cd)
+void QCMake::progressCallback(const char* msg, float percent)
{
- QCMake* self = reinterpret_cast<QCMake*>(cd);
if (percent >= 0) {
- emit self->progressChanged(QString::fromLocal8Bit(msg), percent);
+ emit this->progressChanged(QString::fromLocal8Bit(msg), percent);
} else {
- emit self->outputMessage(QString::fromLocal8Bit(msg));
+ emit this->outputMessage(QString::fromLocal8Bit(msg));
}
QCoreApplication::processEvents();
}
-void QCMake::messageCallback(const char* msg, const char* /*title*/,
- bool& /*stop*/, void* cd)
+void QCMake::messageCallback(const char* msg, const char* /*title*/)
{
- QCMake* self = reinterpret_cast<QCMake*>(cd);
- emit self->errorMessage(QString::fromLocal8Bit(msg));
+ emit this->errorMessage(QString::fromLocal8Bit(msg));
QCoreApplication::processEvents();
}
-void QCMake::stdoutCallback(const char* msg, size_t len, void* cd)
+void QCMake::stdoutCallback(std::string const& msg)
{
- QCMake* self = reinterpret_cast<QCMake*>(cd);
- emit self->outputMessage(QString::fromLocal8Bit(msg, int(len)));
+ emit this->outputMessage(QString::fromStdString(msg));
QCoreApplication::processEvents();
}
-void QCMake::stderrCallback(const char* msg, size_t len, void* cd)
+void QCMake::stderrCallback(std::string const& msg)
{
- QCMake* self = reinterpret_cast<QCMake*>(cd);
- emit self->outputMessage(QString::fromLocal8Bit(msg, int(len)));
+ emit this->outputMessage(QString::fromStdString(msg));
QCoreApplication::processEvents();
}
diff --git a/Source/QtDialog/QCMake.h b/Source/QtDialog/QCMake.h
index c84da58701..ef4d2a1a1e 100644
--- a/Source/QtDialog/QCMake.h
+++ b/Source/QtDialog/QCMake.h
@@ -167,12 +167,12 @@ signals:
protected:
cmake* CMakeInstance;
- static bool interruptCallback(void*);
- static void progressCallback(const char* msg, float percent, void* cd);
- static void messageCallback(const char* msg, const char* title, bool&,
- void* cd);
- static void stdoutCallback(const char* msg, size_t len, void* cd);
- static void stderrCallback(const char* msg, size_t len, void* cd);
+ bool interruptCallback();
+ void progressCallback(const char* msg, float percent);
+ void messageCallback(const char* msg, const char* title);
+ void stdoutCallback(std::string const& msg);
+ void stderrCallback(std::string const& msg);
+
bool WarnUninitializedMode;
bool WarnUnusedMode;
bool WarnUnusedAllMode;
diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx
index 821c3f4178..78a2710247 100644
--- a/Source/QtDialog/QCMakeCacheView.cxx
+++ b/Source/QtDialog/QCMakeCacheView.cxx
@@ -186,9 +186,7 @@ QCMakeCacheModel::QCMakeCacheModel(QObject* p)
this->setHorizontalHeaderLabels(labels);
}
-QCMakeCacheModel::~QCMakeCacheModel()
-{
-}
+QCMakeCacheModel::~QCMakeCacheModel() = default;
static uint qHash(const QCMakeProperty& p)
{
diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h
index 9e3efd30ae..d38b0d1251 100644
--- a/Source/cmAlgorithms.h
+++ b/Source/cmAlgorithms.h
@@ -336,6 +336,14 @@ std::reverse_iterator<Iter> cmMakeReverseIterator(Iter it)
return std::reverse_iterator<Iter>(it);
}
+inline bool cmHasPrefix(std::string const& str, std::string const& prefix)
+{
+ if (str.size() < prefix.size()) {
+ return false;
+ }
+ return str.compare(0, prefix.size(), prefix) == 0;
+}
+
inline bool cmHasSuffix(const std::string& str, const std::string& suffix)
{
if (str.size() < suffix.size()) {
diff --git a/Source/cmBase32.cxx b/Source/cmBase32.cxx
index 1dac212c2d..80ada47660 100644
--- a/Source/cmBase32.cxx
+++ b/Source/cmBase32.cxx
@@ -34,13 +34,9 @@ void Base32Encode5(const unsigned char src[5], char dst[8])
// -- Class methods
-cmBase32Encoder::cmBase32Encoder()
-{
-}
+cmBase32Encoder::cmBase32Encoder() = default;
-cmBase32Encoder::~cmBase32Encoder()
-{
-}
+cmBase32Encoder::~cmBase32Encoder() = default;
std::string cmBase32Encoder::encodeString(const unsigned char* input,
size_t len, bool padding)
diff --git a/Source/cmCLocaleEnvironmentScope.h b/Source/cmCLocaleEnvironmentScope.h
index ec81cb9f22..93032c12ed 100644
--- a/Source/cmCLocaleEnvironmentScope.h
+++ b/Source/cmCLocaleEnvironmentScope.h
@@ -10,12 +10,14 @@
class cmCLocaleEnvironmentScope
{
- CM_DISABLE_COPY(cmCLocaleEnvironmentScope)
-
public:
cmCLocaleEnvironmentScope();
~cmCLocaleEnvironmentScope();
+ cmCLocaleEnvironmentScope(cmCLocaleEnvironmentScope const&) = delete;
+ cmCLocaleEnvironmentScope& operator=(cmCLocaleEnvironmentScope const&) =
+ delete;
+
private:
std::string GetEnv(std::string const& key);
void SetEnv(std::string const& key, std::string const& value);
diff --git a/Source/cmCPackPropertiesGenerator.h b/Source/cmCPackPropertiesGenerator.h
index e580e044bb..ad943c588a 100644
--- a/Source/cmCPackPropertiesGenerator.h
+++ b/Source/cmCPackPropertiesGenerator.h
@@ -20,13 +20,15 @@ class cmLocalGenerator;
*/
class cmCPackPropertiesGenerator : public cmScriptGenerator
{
- CM_DISABLE_COPY(cmCPackPropertiesGenerator)
-
public:
cmCPackPropertiesGenerator(cmLocalGenerator* lg,
cmInstalledFile const& installedFile,
std::vector<std::string> const& configurations);
+ cmCPackPropertiesGenerator(cmCPackPropertiesGenerator const&) = delete;
+ cmCPackPropertiesGenerator& operator=(cmCPackPropertiesGenerator const&) =
+ delete;
+
protected:
void GenerateScriptForConfig(std::ostream& os, const std::string& config,
Indent indent) override;
diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx
index 811af56713..c0088ac5d4 100644
--- a/Source/cmCPluginAPI.cxx
+++ b/Source/cmCPluginAPI.cxx
@@ -474,7 +474,6 @@ int CCONV cmGetTotalArgumentSize(int argc, char** argv)
// API for source files.
struct cmCPluginAPISourceFile
{
- cmCPluginAPISourceFile() {}
cmSourceFile* RealSourceFile = nullptr;
std::string SourceName;
std::string SourceExtension;
diff --git a/Source/cmCTest.h b/Source/cmCTest.h
index a82f40095f..92a02c3169 100644
--- a/Source/cmCTest.h
+++ b/Source/cmCTest.h
@@ -57,8 +57,6 @@ public:
/** Representation of one part. */
struct PartInfo
{
- PartInfo() {}
-
void SetName(const std::string& name) { this->Name = name; }
const std::string& GetName() const { return this->Name; }
diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h
index b39856ee97..0c70ed27ff 100644
--- a/Source/cmCacheManager.h
+++ b/Source/cmCacheManager.h
@@ -42,7 +42,6 @@ private:
void AppendProperty(const std::string& property, const char* value,
bool asString = false);
bool Initialized = false;
- CacheEntry() {}
};
public:
diff --git a/Source/cmCallVisualStudioMacro.cxx b/Source/cmCallVisualStudioMacro.cxx
index ecfcfb9657..ee5feee763 100644
--- a/Source/cmCallVisualStudioMacro.cxx
+++ b/Source/cmCallVisualStudioMacro.cxx
@@ -46,7 +46,7 @@ static bool LogErrorsAsMessages;
<< std::endl; \
_hresult_oss.flags(std::ios::dec); \
_hresult_oss << __FILE__ << "(" << __LINE__ << ")"; \
- cmSystemTools::Message(_hresult_oss.str().c_str()); \
+ cmSystemTools::Message(_hresult_oss.str()); \
} \
}
@@ -446,7 +446,7 @@ int cmCallVisualStudioMacro::CallMacro(const std::string& slnFile,
if (err && LogErrorsAsMessages) {
std::ostringstream oss;
oss << "cmCallVisualStudioMacro::CallMacro failed, err = " << err;
- cmSystemTools::Message(oss.str().c_str());
+ cmSystemTools::Message(oss.str());
}
return 0;
diff --git a/Source/cmCommand.h b/Source/cmCommand.h
index dfc3e78f58..9ccd773f61 100644
--- a/Source/cmCommand.h
+++ b/Source/cmCommand.h
@@ -24,18 +24,19 @@ struct cmListFileArgument;
*/
class cmCommand
{
- CM_DISABLE_COPY(cmCommand)
-
public:
/**
* Construct the command. By default it has no makefile.
*/
- cmCommand() {}
+ cmCommand() = default;
/**
* Need virtual destructor to destroy real command type.
*/
- virtual ~cmCommand() {}
+ virtual ~cmCommand() = default;
+
+ cmCommand(cmCommand const&) = delete;
+ cmCommand& operator=(cmCommand const&) = delete;
/**
* Specify the makefile.
diff --git a/Source/cmCommandArgumentParserHelper.h b/Source/cmCommandArgumentParserHelper.h
index 4dc238e38e..25e689224f 100644
--- a/Source/cmCommandArgumentParserHelper.h
+++ b/Source/cmCommandArgumentParserHelper.h
@@ -12,8 +12,6 @@ class cmMakefile;
class cmCommandArgumentParserHelper
{
- CM_DISABLE_COPY(cmCommandArgumentParserHelper)
-
public:
struct ParserType
{
@@ -23,6 +21,10 @@ public:
cmCommandArgumentParserHelper();
~cmCommandArgumentParserHelper();
+ cmCommandArgumentParserHelper(cmCommandArgumentParserHelper const&) = delete;
+ cmCommandArgumentParserHelper& operator=(
+ cmCommandArgumentParserHelper const&) = delete;
+
int ParseString(const char* str, int verb);
// For the lexer:
diff --git a/Source/cmCommandArgumentsHelper.h b/Source/cmCommandArgumentsHelper.h
index c68e64c109..dc934bed6e 100644
--- a/Source/cmCommandArgumentsHelper.h
+++ b/Source/cmCommandArgumentsHelper.h
@@ -39,7 +39,7 @@ class cmCommandArgument
public:
cmCommandArgument(cmCommandArgumentsHelper* args, const char* key,
cmCommandArgumentGroup* group = nullptr);
- virtual ~cmCommandArgument() {}
+ virtual ~cmCommandArgument() = default;
/// this argument may follow after arg. 0 means it comes first.
void Follows(const cmCommandArgument* arg);
@@ -103,7 +103,6 @@ private:
std::vector<std::string> Vector;
unsigned int DataStart;
const char* Ignore;
- cmCAStringVector();
bool DoConsume(const std::string& arg, unsigned int index) override;
void DoReset() override;
};
@@ -125,7 +124,6 @@ private:
unsigned int DataStart;
bool DoConsume(const std::string& arg, unsigned int index) override;
void DoReset() override;
- cmCAString();
};
/** cmCAEnabler is to be used for options which are off by default and can be
@@ -143,7 +141,6 @@ private:
bool Enabled;
bool DoConsume(const std::string& arg, unsigned int index) override;
void DoReset() override;
- cmCAEnabler();
};
/** cmCADisable is to be used for options which are on by default and can be
@@ -161,7 +158,6 @@ private:
bool Enabled;
bool DoConsume(const std::string& arg, unsigned int index) override;
void DoReset() override;
- cmCADisabler();
};
/** Group of arguments, needed for ordering. E.g. WIN32, EXCLUDE_FROM_ALL and
@@ -172,8 +168,6 @@ class cmCommandArgumentGroup
friend class cmCommandArgument;
public:
- cmCommandArgumentGroup() {}
-
/// All members of this group may follow the given argument
void Follows(const cmCommandArgument* arg);
diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index a1df27107f..66250f3296 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -29,9 +29,7 @@ cmCommonTargetGenerator::cmCommonTargetGenerator(cmGeneratorTarget* gt)
{
}
-cmCommonTargetGenerator::~cmCommonTargetGenerator()
-{
-}
+cmCommonTargetGenerator::~cmCommonTargetGenerator() = default;
std::string const& cmCommonTargetGenerator::GetConfigName() const
{
@@ -198,7 +196,7 @@ std::string cmCommonTargetGenerator::GetManifests()
manifests.reserve(manifest_srcs.size());
for (cmSourceFile const* manifest_src : manifest_srcs) {
manifests.push_back(this->LocalCommonGenerator->ConvertToOutputFormat(
- this->LocalCommonGenerator->ConvertToRelativePath(
+ this->LocalCommonGenerator->MaybeConvertToRelativePath(
this->LocalCommonGenerator->GetWorkingDirectory(),
manifest_src->GetFullPath()),
cmOutputConverter::SHELL));
diff --git a/Source/cmComputeComponentGraph.cxx b/Source/cmComputeComponentGraph.cxx
index 5820df6f09..113463f634 100644
--- a/Source/cmComputeComponentGraph.cxx
+++ b/Source/cmComputeComponentGraph.cxx
@@ -18,9 +18,7 @@ cmComputeComponentGraph::cmComputeComponentGraph(Graph const& input)
this->TransferEdges();
}
-cmComputeComponentGraph::~cmComputeComponentGraph()
-{
-}
+cmComputeComponentGraph::~cmComputeComponentGraph() = default;
void cmComputeComponentGraph::Tarjan()
{
diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h
index 32a2a628ac..252f8748ce 100644
--- a/Source/cmComputeLinkDepends.h
+++ b/Source/cmComputeLinkDepends.h
@@ -38,14 +38,6 @@ public:
cmGeneratorTarget const* Target = nullptr;
bool IsSharedDep = false;
bool IsFlag = false;
- LinkEntry() {}
- LinkEntry(LinkEntry const& r)
- : Item(r.Item)
- , Target(r.Target)
- , IsSharedDep(r.IsSharedDep)
- , IsFlag(r.IsFlag)
- {
- }
};
typedef std::vector<LinkEntry> EntryVector;
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index c68bb219b4..3d61665fd3 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -1282,7 +1282,7 @@ void cmComputeLinkInformation::DropDirectoryItem(std::string const& item)
<< "\" requests linking to directory \"" << item << "\". "
<< "Targets may link only to libraries. "
<< "CMake is dropping the item.";
- cmSystemTools::Message(e.str().c_str());
+ cmSystemTools::Message(e.str());
}
void cmComputeLinkInformation::ComputeFrameworkInfo()
diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h
index 61fcf035e8..863639c6ab 100644
--- a/Source/cmComputeLinkInformation.h
+++ b/Source/cmComputeLinkInformation.h
@@ -31,7 +31,7 @@ public:
struct Item
{
- Item() {}
+ Item() = default;
Item(std::string v, bool p, cmGeneratorTarget const* target = nullptr)
: Value(std::move(v))
, IsPath(p)
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index 1d20cff3a1..9b7b02f53d 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -103,9 +103,7 @@ cmComputeTargetDepends::cmComputeTargetDepends(cmGlobalGenerator* gg)
cm->GetState()->GetGlobalPropertyAsBool("GLOBAL_DEPENDS_NO_CYCLES");
}
-cmComputeTargetDepends::~cmComputeTargetDepends()
-{
-}
+cmComputeTargetDepends::~cmComputeTargetDepends() = default;
bool cmComputeTargetDepends::Compute()
{
diff --git a/Source/cmConfigure.cmake.h.in b/Source/cmConfigure.cmake.h.in
index 9d00c21196..19b1cd4e3b 100644
--- a/Source/cmConfigure.cmake.h.in
+++ b/Source/cmConfigure.cmake.h.in
@@ -26,8 +26,4 @@
#define CM_FALLTHROUGH cmsys_FALLTHROUGH
-#define CM_DISABLE_COPY(Class) \
- Class(Class const&) = delete; \
- Class& operator=(Class const&) = delete;
-
#endif
diff --git a/Source/cmConnection.cxx b/Source/cmConnection.cxx
index 50e193668c..166426bfc6 100644
--- a/Source/cmConnection.cxx
+++ b/Source/cmConnection.cxx
@@ -127,9 +127,7 @@ void cmEventBasedConnection::OnDisconnect(int onerror)
}
}
-cmConnection::~cmConnection()
-{
-}
+cmConnection::~cmConnection() = default;
bool cmConnection::OnConnectionShuttingDown()
{
diff --git a/Source/cmConnection.h b/Source/cmConnection.h
index ce2d2dc2aa..092b91302c 100644
--- a/Source/cmConnection.h
+++ b/Source/cmConnection.h
@@ -60,10 +60,11 @@ public:
class cmConnection
{
- CM_DISABLE_COPY(cmConnection)
-
public:
- cmConnection() {}
+ cmConnection() = default;
+
+ cmConnection(cmConnection const&) = delete;
+ cmConnection& operator=(cmConnection const&) = delete;
virtual void WriteData(const std::string& data) = 0;
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index bd110ecc58..eb5289507f 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -226,7 +226,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
} else if (doing == DoingCMakeFlags) {
cmakeFlags.push_back(argv[i]);
} else if (doing == DoingCompileDefinitions) {
- compileDefs.push_back(argv[i]);
+ cmSystemTools::ExpandListArgument(argv[i], compileDefs);
} else if (doing == DoingLinkOptions) {
linkOptions.push_back(argv[i]);
} else if (doing == DoingLinkLibraries) {
diff --git a/Source/cmCryptoHash.h b/Source/cmCryptoHash.h
index 1f2a1b52c2..b712f09da3 100644
--- a/Source/cmCryptoHash.h
+++ b/Source/cmCryptoHash.h
@@ -15,8 +15,6 @@
*/
class cmCryptoHash
{
- CM_DISABLE_COPY(cmCryptoHash)
-
public:
enum Algo
{
@@ -35,6 +33,9 @@ public:
cmCryptoHash(Algo algo);
~cmCryptoHash();
+ cmCryptoHash(cmCryptoHash const&) = delete;
+ cmCryptoHash& operator=(cmCryptoHash const&) = delete;
+
/// @brief Returns a new hash generator of the requested type
/// @arg algo Hash type name. Supported hash types are
/// MD5, SHA1, SHA224, SHA256, SHA384, SHA512,
diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h
index b2794fa9b7..6c252bee53 100644
--- a/Source/cmDefinitions.h
+++ b/Source/cmDefinitions.h
@@ -47,7 +47,7 @@ private:
typedef std::string std_string;
public:
- Def() {}
+ Def() = default;
Def(const char* v)
: std_string(v ? v : "")
, Exists(v ? true : false)
diff --git a/Source/cmDepends.cxx b/Source/cmDepends.cxx
index 976ba5701f..7d1d316249 100644
--- a/Source/cmDepends.cxx
+++ b/Source/cmDepends.cxx
@@ -156,8 +156,8 @@ bool cmDepends::CheckDependencies(
// * if the depender does not exist, but the dependee is newer than the
// depends file
bool regenerate = false;
- const char* dependee = this->Dependee + 1;
- const char* depender = this->Depender;
+ const std::string dependee(this->Dependee + 1);
+ const std::string depender(this->Depender);
if (currentDependencies != nullptr) {
currentDependencies->push_back(dependee);
}
@@ -195,8 +195,8 @@ bool cmDepends::CheckDependencies(
// The dependee exists, but the depender doesn't. Regenerate if the
// internalDepends file is older than the dependee.
int result = 0;
- if ((!this->FileComparison->FileTimeCompare(
- internalDependsFileName.c_str(), dependee, &result) ||
+ if ((!this->FileComparison->FileTimeCompare(internalDependsFileName,
+ dependee, &result) ||
result < 0)) {
// The depends-file is older than the dependee.
regenerate = true;
diff --git a/Source/cmDepends.h b/Source/cmDepends.h
index c5e1d5bd9f..20c91ca57b 100644
--- a/Source/cmDepends.h
+++ b/Source/cmDepends.h
@@ -24,13 +24,14 @@ class cmLocalGenerator;
*/
class cmDepends
{
- CM_DISABLE_COPY(cmDepends)
-
public:
/** Instances need to know the build directory name and the relative
path from the build directory to the target file. */
cmDepends(cmLocalGenerator* lg = nullptr, std::string targetDir = "");
+ cmDepends(cmDepends const&) = delete;
+ cmDepends& operator=(cmDepends const&) = delete;
+
/** Set the local generator for the directory in which we are
scanning dependencies. This is not a full local generator; it
has been setup to do relative path conversions for the current
diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx
index f6ac4f2dc2..b1630f9ae5 100644
--- a/Source/cmDependsC.cxx
+++ b/Source/cmDependsC.cxx
@@ -19,9 +19,7 @@
#define INCLUDE_REGEX_COMPLAIN_MARKER "#IncludeRegexComplain: "
#define INCLUDE_REGEX_TRANSFORM_MARKER "#IncludeRegexTransform: "
-cmDependsC::cmDependsC()
-{
-}
+cmDependsC::cmDependsC() = default;
cmDependsC::cmDependsC(
cmLocalGenerator* lg, const std::string& targetDir, const std::string& lang,
@@ -100,7 +98,8 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
// Compute a path to the object file to write to the internal depend file.
// Any existing content of the internal depend file has already been
// loaded in ValidDeps with this path as a key.
- std::string obj_i = this->LocalGenerator->ConvertToRelativePath(binDir, obj);
+ std::string obj_i =
+ this->LocalGenerator->MaybeConvertToRelativePath(binDir, obj);
if (this->ValidDeps != nullptr) {
std::map<std::string, DependencyVector>::const_iterator tmpIt =
@@ -234,7 +233,8 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
for (std::string const& dep : dependencies) {
makeDepends << obj_m << ": "
<< cmSystemTools::ConvertToOutputPath(
- this->LocalGenerator->ConvertToRelativePath(binDir, dep))
+ this->LocalGenerator->MaybeConvertToRelativePath(binDir,
+ dep))
<< std::endl;
internalDepends << " " << dep << std::endl;
}
@@ -268,8 +268,7 @@ void cmDependsC::ReadCacheFile()
haveFileName = true;
int newer = 0;
cmFileTimeComparison comp;
- bool res = comp.FileTimeCompare(this->CacheFileName.c_str(),
- line.c_str(), &newer);
+ bool res = comp.FileTimeCompare(this->CacheFileName, line, &newer);
if (res && newer == 1) // cache is newer than the parsed file
{
diff --git a/Source/cmDependsC.h b/Source/cmDependsC.h
index af2b06e19a..eee5ae15cd 100644
--- a/Source/cmDependsC.h
+++ b/Source/cmDependsC.h
@@ -22,8 +22,6 @@ class cmLocalGenerator;
*/
class cmDependsC : public cmDepends
{
- CM_DISABLE_COPY(cmDependsC)
-
public:
/** Checking instances need to know the build directory name and the
relative path from the build directory to the target file. */
@@ -35,6 +33,9 @@ public:
/** Virtual destructor to cleanup subclasses properly. */
~cmDependsC() override;
+ cmDependsC(cmDependsC const&) = delete;
+ cmDependsC& operator=(cmDependsC const&) = delete;
+
protected:
// Implement writing/checking methods required by superclass.
bool WriteDependencies(const std::set<std::string>& sources,
@@ -75,7 +76,6 @@ public:
struct cmIncludeLines
{
- cmIncludeLines() {}
std::vector<UnscannedEntry> UnscannedEntries;
bool Used = false;
};
diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx
index 6c5f64771f..3f036a9de9 100644
--- a/Source/cmDependsFortran.cxx
+++ b/Source/cmDependsFortran.cxx
@@ -68,9 +68,7 @@ public:
}
};
-cmDependsFortran::cmDependsFortran()
-{
-}
+cmDependsFortran::cmDependsFortran() = default;
cmDependsFortran::cmDependsFortran(cmLocalGenerator* lg)
: cmDepends(lg)
@@ -96,6 +94,10 @@ cmDependsFortran::cmDependsFortran(cmLocalGenerator* lg)
}
this->PPDefinitions.insert(def);
}
+
+ this->CompilerId = mf->GetSafeDefinition("CMAKE_Fortran_COMPILER_ID");
+ this->SModSep = mf->GetSafeDefinition("CMAKE_Fortran_SUBMODULE_SEP");
+ this->SModExt = mf->GetSafeDefinition("CMAKE_Fortran_SUBMODULE_EXT");
}
cmDependsFortran::~cmDependsFortran()
@@ -118,6 +120,11 @@ bool cmDependsFortran::WriteDependencies(const std::set<std::string>& sources,
return false;
}
+ cmFortranCompiler fc;
+ fc.Id = this->CompilerId;
+ fc.SModSep = this->SModSep;
+ fc.SModExt = this->SModExt;
+
bool okay = true;
for (std::string const& src : sources) {
// Get the information object for this source.
@@ -125,7 +132,7 @@ bool cmDependsFortran::WriteDependencies(const std::set<std::string>& sources,
// Create the parser object. The constructor takes info by reference,
// so we may look into the resulting objects later.
- cmFortranParser parser(this->IncludePath, this->PPDefinitions, info);
+ cmFortranParser parser(fc, this->IncludePath, this->PPDefinitions, info);
// Push on the starting file.
cmFortranParser_FilePush(&parser, src.c_str());
diff --git a/Source/cmDependsFortran.h b/Source/cmDependsFortran.h
index f5f5be2d23..04851152ef 100644
--- a/Source/cmDependsFortran.h
+++ b/Source/cmDependsFortran.h
@@ -21,8 +21,6 @@ class cmLocalGenerator;
*/
class cmDependsFortran : public cmDepends
{
- CM_DISABLE_COPY(cmDependsFortran)
-
public:
/** Checking instances need to know the build directory name and the
relative path from the build directory to the target file. */
@@ -37,6 +35,9 @@ public:
/** Virtual destructor to cleanup subclasses properly. */
~cmDependsFortran() override;
+ cmDependsFortran(cmDependsFortran const&) = delete;
+ cmDependsFortran& operator=(cmDependsFortran const&) = delete;
+
/** Callback from build system after a .mod file has been generated
by a Fortran90 compiler to copy the .mod file to the
corresponding stamp file. */
@@ -76,6 +77,10 @@ protected:
// The source file from which to start scanning.
std::string SourceFile;
+ std::string CompilerId;
+ std::string SModSep;
+ std::string SModExt;
+
std::set<std::string> PPDefinitions;
// Internal implementation details.
diff --git a/Source/cmDependsJava.cxx b/Source/cmDependsJava.cxx
index b44b3a286b..2485e15fd7 100644
--- a/Source/cmDependsJava.cxx
+++ b/Source/cmDependsJava.cxx
@@ -4,13 +4,9 @@
#include "cmSystemTools.h"
-cmDependsJava::cmDependsJava()
-{
-}
+cmDependsJava::cmDependsJava() = default;
-cmDependsJava::~cmDependsJava()
-{
-}
+cmDependsJava::~cmDependsJava() = default;
bool cmDependsJava::WriteDependencies(const std::set<std::string>& sources,
const std::string& /*obj*/,
diff --git a/Source/cmDependsJava.h b/Source/cmDependsJava.h
index 1928c512bc..109ef13d16 100644
--- a/Source/cmDependsJava.h
+++ b/Source/cmDependsJava.h
@@ -17,8 +17,6 @@
*/
class cmDependsJava : public cmDepends
{
- CM_DISABLE_COPY(cmDependsJava)
-
public:
/** Checking instances need to know the build directory name and the
relative path from the build directory to the target file. */
@@ -27,6 +25,9 @@ public:
/** Virtual destructor to cleanup subclasses properly. */
~cmDependsJava() override;
+ cmDependsJava(cmDependsJava const&) = delete;
+ cmDependsJava& operator=(cmDependsJava const&) = delete;
+
protected:
// Implement writing/checking methods required by superclass.
bool WriteDependencies(const std::set<std::string>& sources,
diff --git a/Source/cmDocumentation.h b/Source/cmDocumentation.h
index b2ff01a52e..cf74b800d1 100644
--- a/Source/cmDocumentation.h
+++ b/Source/cmDocumentation.h
@@ -115,7 +115,6 @@ private:
struct RequestedHelpItem
{
- RequestedHelpItem() {}
cmDocumentationEnums::Type HelpType = None;
std::string Filename;
std::string Argument;
diff --git a/Source/cmDocumentationEntry.h b/Source/cmDocumentationEntry.h
index ca323cc8d0..afbca5e4bb 100644
--- a/Source/cmDocumentationEntry.h
+++ b/Source/cmDocumentationEntry.h
@@ -13,7 +13,7 @@ struct cmDocumentationEntry
std::string Name;
std::string Brief;
char CustomNamePrefix = ' ';
- cmDocumentationEntry() {}
+ cmDocumentationEntry() = default;
cmDocumentationEntry(const char* doc[2])
{
if (doc[0]) {
diff --git a/Source/cmDocumentationFormatter.cxx b/Source/cmDocumentationFormatter.cxx
index e573c04615..3e7f9897eb 100644
--- a/Source/cmDocumentationFormatter.cxx
+++ b/Source/cmDocumentationFormatter.cxx
@@ -11,13 +11,9 @@
#include <string>
#include <vector>
-cmDocumentationFormatter::cmDocumentationFormatter()
-{
-}
+cmDocumentationFormatter::cmDocumentationFormatter() = default;
-cmDocumentationFormatter::~cmDocumentationFormatter()
-{
-}
+cmDocumentationFormatter::~cmDocumentationFormatter() = default;
void cmDocumentationFormatter::PrintFormatted(std::ostream& os,
const char* text)
diff --git a/Source/cmDynamicLoader.cxx b/Source/cmDynamicLoader.cxx
index 7da6ff54b7..0549cf916d 100644
--- a/Source/cmDynamicLoader.cxx
+++ b/Source/cmDynamicLoader.cxx
@@ -24,9 +24,7 @@ private:
cmDynamicLoaderCache* cmDynamicLoaderCache::Instance = nullptr;
-cmDynamicLoaderCache::~cmDynamicLoaderCache()
-{
-}
+cmDynamicLoaderCache::~cmDynamicLoaderCache() = default;
void cmDynamicLoaderCache::CacheFile(const char* path,
cmsys::DynamicLoader::LibraryHandle p)
diff --git a/Source/cmDynamicLoader.h b/Source/cmDynamicLoader.h
index 61d3b468bb..4b89388e24 100644
--- a/Source/cmDynamicLoader.h
+++ b/Source/cmDynamicLoader.h
@@ -14,8 +14,6 @@
class cmDynamicLoader
{
- CM_DISABLE_COPY(cmDynamicLoader)
-
public:
// Description:
// Load a dynamic library into the current process.
@@ -28,8 +26,8 @@ public:
static void FlushCache();
protected:
- cmDynamicLoader() {}
- ~cmDynamicLoader() {}
+ cmDynamicLoader() = default;
+ ~cmDynamicLoader() = default;
};
#endif
diff --git a/Source/cmExecutionStatus.h b/Source/cmExecutionStatus.h
index 19462313d5..56199dd935 100644
--- a/Source/cmExecutionStatus.h
+++ b/Source/cmExecutionStatus.h
@@ -11,8 +11,6 @@
class cmExecutionStatus
{
public:
- cmExecutionStatus() {}
-
void Clear()
{
this->ReturnInvoked = false;
diff --git a/Source/cmExpandedCommandArgument.cxx b/Source/cmExpandedCommandArgument.cxx
index 00848a6cc7..43f648bc3a 100644
--- a/Source/cmExpandedCommandArgument.cxx
+++ b/Source/cmExpandedCommandArgument.cxx
@@ -4,9 +4,7 @@
#include <utility>
-cmExpandedCommandArgument::cmExpandedCommandArgument()
-{
-}
+cmExpandedCommandArgument::cmExpandedCommandArgument() = default;
cmExpandedCommandArgument::cmExpandedCommandArgument(std::string value,
bool quoted)
diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h
index 41c6538d17..747503e6d0 100644
--- a/Source/cmExportFileGenerator.h
+++ b/Source/cmExportFileGenerator.h
@@ -42,7 +42,7 @@ class cmExportFileGenerator
{
public:
cmExportFileGenerator();
- virtual ~cmExportFileGenerator() {}
+ virtual ~cmExportFileGenerator() = default;
/** Set the full path to the export file to generate. */
void SetExportFile(const char* mainFile);
diff --git a/Source/cmExprParserHelper.cxx b/Source/cmExprParserHelper.cxx
index 8d3dad73e1..80c78a38c8 100644
--- a/Source/cmExprParserHelper.cxx
+++ b/Source/cmExprParserHelper.cxx
@@ -18,9 +18,7 @@ cmExprParserHelper::cmExprParserHelper()
this->Result = 0;
}
-cmExprParserHelper::~cmExprParserHelper()
-{
-}
+cmExprParserHelper::~cmExprParserHelper() = default;
int cmExprParserHelper::ParseString(const char* str, int verb)
{
diff --git a/Source/cmExternalMakefileProjectGenerator.cxx b/Source/cmExternalMakefileProjectGenerator.cxx
index 150995fb24..ac548112a9 100644
--- a/Source/cmExternalMakefileProjectGenerator.cxx
+++ b/Source/cmExternalMakefileProjectGenerator.cxx
@@ -41,9 +41,7 @@ cmExternalMakefileProjectGeneratorFactory::
}
cmExternalMakefileProjectGeneratorFactory::
- ~cmExternalMakefileProjectGeneratorFactory()
-{
-}
+ ~cmExternalMakefileProjectGeneratorFactory() = default;
std::string cmExternalMakefileProjectGeneratorFactory::GetName() const
{
diff --git a/Source/cmExternalMakefileProjectGenerator.h b/Source/cmExternalMakefileProjectGenerator.h
index 492987dcd4..4438f2803b 100644
--- a/Source/cmExternalMakefileProjectGenerator.h
+++ b/Source/cmExternalMakefileProjectGenerator.h
@@ -26,7 +26,7 @@ class cmMakefile;
class cmExternalMakefileProjectGenerator
{
public:
- virtual ~cmExternalMakefileProjectGenerator() {}
+ virtual ~cmExternalMakefileProjectGenerator() = default;
virtual void EnableLanguage(std::vector<std::string> const& languages,
cmMakefile*, bool optional);
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index d70352f24b..e408de3848 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -32,9 +32,7 @@ Discussion:
http://forums.codeblocks.org/index.php/topic,6789.0.html
*/
-cmExtraCodeBlocksGenerator::cmExtraCodeBlocksGenerator()
-{
-}
+cmExtraCodeBlocksGenerator::cmExtraCodeBlocksGenerator() = default;
cmExternalMakefileProjectGeneratorFactory*
cmExtraCodeBlocksGenerator::GetFactory()
@@ -364,7 +362,7 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile(
// don't add source files from UTILITY target which have the
// GENERATED property set:
if (gt->GetType() == cmStateEnums::UTILITY &&
- s->GetPropertyAsBool("GENERATED")) {
+ s->GetIsGenerated()) {
continue;
}
diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx
index 2fa593cbfc..0773edcbda 100644
--- a/Source/cmExtraCodeLiteGenerator.cxx
+++ b/Source/cmExtraCodeLiteGenerator.cxx
@@ -223,7 +223,7 @@ std::string cmExtraCodeLiteGenerator::CollectSourceFiles(
for (cmSourceFile* s : sources) {
// 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().c_str())) {
+ switch (cmSystemTools::GetFileFormat(s->GetExtension())) {
case cmSystemTools::C_FILE_FORMAT:
case cmSystemTools::CXX_FILE_FORMAT:
case cmSystemTools::CUDA_FILE_FORMAT:
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 5833631052..30067b75b6 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -899,7 +899,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
for (cmLocalGenerator* lgen : this->GlobalGenerator->GetLocalGenerators()) {
const std::vector<cmGeneratorTarget*>& targets =
lgen->GetGeneratorTargets();
- std::string subdir = lgen->ConvertToRelativePath(
+ std::string subdir = lgen->MaybeConvertToRelativePath(
this->HomeOutputDirectory, lgen->GetCurrentBinaryDirectory());
if (subdir == ".") {
subdir.clear();
diff --git a/Source/cmExtraKateGenerator.cxx b/Source/cmExtraKateGenerator.cxx
index a9ed7fe49a..23ba6b77f1 100644
--- a/Source/cmExtraKateGenerator.cxx
+++ b/Source/cmExtraKateGenerator.cxx
@@ -16,9 +16,7 @@
#include <string.h>
#include <vector>
-cmExtraKateGenerator::cmExtraKateGenerator()
-{
-}
+cmExtraKateGenerator::cmExtraKateGenerator() = default;
cmExternalMakefileProjectGeneratorFactory* cmExtraKateGenerator::GetFactory()
{
@@ -258,7 +256,7 @@ std::string cmExtraKateGenerator::GenerateFilesString(
const std::vector<cmSourceFile*>& sources = makefile->GetSourceFiles();
for (cmSourceFile* sf : sources) {
- if (sf->GetPropertyAsBool("GENERATED")) {
+ if (sf->GetIsGenerated()) {
continue;
}
diff --git a/Source/cmFLTKWrapUICommand.cxx b/Source/cmFLTKWrapUICommand.cxx
index effb4460a9..4b14d26d07 100644
--- a/Source/cmFLTKWrapUICommand.cxx
+++ b/Source/cmFLTKWrapUICommand.cxx
@@ -117,7 +117,7 @@ void cmFLTKWrapUICommand::FinalPass()
msg += ". The problem was found while processing the source directory: ";
msg += this->Makefile->GetCurrentSourceDirectory();
msg += ". This FLTK_WRAP_UI call will be ignored.";
- cmSystemTools::Message(msg.c_str(), "Warning");
+ cmSystemTools::Message(msg, "Warning");
return;
}
}
diff --git a/Source/cmFileAPICodemodel.cxx b/Source/cmFileAPICodemodel.cxx
index 3363c9b35f..45e8303182 100644
--- a/Source/cmFileAPICodemodel.cxx
+++ b/Source/cmFileAPICodemodel.cxx
@@ -727,7 +727,7 @@ void Target::ProcessLanguage(std::string const& lang)
lg->GetTargetDefines(this->GT, this->Config, lang);
cd.SetDefines(defines);
std::vector<BT<std::string>> includePathList =
- lg->GetIncludeDirectories(this->GT, lang, this->Config, true);
+ lg->GetIncludeDirectories(this->GT, lang, this->Config);
for (BT<std::string> const& i : includePathList) {
cd.Includes.emplace_back(
i, this->GT->IsSystemIncludeDirectory(i.Value, this->Config, lang));
@@ -882,7 +882,7 @@ Json::Value Target::DumpSource(cmGeneratorTarget::SourceAndKind const& sk,
std::string const path = sk.Source.Value->GetFullPath();
source["path"] = RelativeIfUnder(this->TopSource, path);
- if (sk.Source.Value->GetPropertyAsBool("GENERATED")) {
+ if (sk.Source.Value->GetIsGenerated()) {
source["isGenerated"] = true;
}
this->AddBacktrace(source, sk.Source.Backtrace);
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index afb0b2a908..0f911c1700 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -1079,7 +1079,7 @@ struct cmFileCopier
, Doing(DoingNone)
{
}
- virtual ~cmFileCopier() {}
+ virtual ~cmFileCopier() = default;
bool Run(std::vector<std::string> const& args);
@@ -1102,7 +1102,6 @@ protected:
{
bool Exclude = false;
mode_t Permissions = 0;
- MatchProperties() {}
};
struct MatchRule
{
@@ -3759,8 +3758,7 @@ bool cmFileCommand::HandleCreateLinkCommand(
// Check if copy-on-error is enabled in the arguments.
if (!completed && copyOnErrorArg.IsEnabled()) {
- completed =
- cmSystemTools::cmCopyFile(fileName.c_str(), newFileName.c_str());
+ completed = cmSystemTools::cmCopyFile(fileName, newFileName);
if (!completed) {
result = "Copy failed: " + cmSystemTools::GetLastSystemError();
}
diff --git a/Source/cmFileLock.h b/Source/cmFileLock.h
index 491a40b84d..2130d65dbe 100644
--- a/Source/cmFileLock.h
+++ b/Source/cmFileLock.h
@@ -21,12 +21,13 @@ class cmFileLockResult;
*/
class cmFileLock
{
- CM_DISABLE_COPY(cmFileLock)
-
public:
cmFileLock();
~cmFileLock();
+ cmFileLock(cmFileLock const&) = delete;
+ cmFileLock& operator=(cmFileLock const&) = delete;
+
/**
* @brief Lock the file.
* @param timeoutSec Lock timeout. If -1 try until success or fatal error.
diff --git a/Source/cmFileLockPool.cxx b/Source/cmFileLockPool.cxx
index 5dc9243a11..d700a79c37 100644
--- a/Source/cmFileLockPool.cxx
+++ b/Source/cmFileLockPool.cxx
@@ -8,9 +8,7 @@
#include "cmFileLock.h"
#include "cmFileLockResult.h"
-cmFileLockPool::cmFileLockPool()
-{
-}
+cmFileLockPool::cmFileLockPool() = default;
cmFileLockPool::~cmFileLockPool()
{
@@ -111,9 +109,7 @@ bool cmFileLockPool::IsAlreadyLocked(const std::string& filename) const
return this->ProcessScope.IsAlreadyLocked(filename);
}
-cmFileLockPool::ScopePool::ScopePool()
-{
-}
+cmFileLockPool::ScopePool::ScopePool() = default;
cmFileLockPool::ScopePool::~ScopePool()
{
diff --git a/Source/cmFileLockPool.h b/Source/cmFileLockPool.h
index 0197354c31..41203baac9 100644
--- a/Source/cmFileLockPool.h
+++ b/Source/cmFileLockPool.h
@@ -13,12 +13,13 @@ class cmFileLockResult;
class cmFileLockPool
{
- CM_DISABLE_COPY(cmFileLockPool)
-
public:
cmFileLockPool();
~cmFileLockPool();
+ cmFileLockPool(cmFileLockPool const&) = delete;
+ cmFileLockPool& operator=(cmFileLockPool const&) = delete;
+
//@{
/**
* @brief Function scope control.
@@ -58,12 +59,13 @@ private:
class ScopePool
{
- CM_DISABLE_COPY(ScopePool)
-
public:
ScopePool();
~ScopePool();
+ ScopePool(ScopePool const&) = delete;
+ ScopePool& operator=(ScopePool const&) = delete;
+
cmFileLockResult Lock(const std::string& filename,
unsigned long timeoutSec);
cmFileLockResult Release(const std::string& filename);
diff --git a/Source/cmFileLockUnix.cxx b/Source/cmFileLockUnix.cxx
index 9b653e8076..1bf5013add 100644
--- a/Source/cmFileLockUnix.cxx
+++ b/Source/cmFileLockUnix.cxx
@@ -8,9 +8,7 @@
#include <stdio.h> // SEEK_SET
#include <unistd.h>
-cmFileLock::cmFileLock()
-{
-}
+cmFileLock::cmFileLock() = default;
cmFileLockResult cmFileLock::Release()
{
diff --git a/Source/cmFileMonitor.cxx b/Source/cmFileMonitor.cxx
index b36ac7805a..56ee739b06 100644
--- a/Source/cmFileMonitor.cxx
+++ b/Source/cmFileMonitor.cxx
@@ -19,7 +19,6 @@ void on_fs_close(uv_handle_t* handle);
class cmIBaseWatcher
{
public:
- cmIBaseWatcher() = default;
virtual ~cmIBaseWatcher() = default;
virtual void Trigger(const std::string& pathSegment, int events,
@@ -150,11 +149,6 @@ public:
p->AddChildWatcher(ps, this);
}
- ~cmRealDirectoryWatcher() override
- {
- // Handle is freed via uv_handle_close callback!
- }
-
void StartWatching() final
{
if (!this->Handle) {
diff --git a/Source/cmFileMonitor.h b/Source/cmFileMonitor.h
index 632e7514f2..7ffc9294ef 100644
--- a/Source/cmFileMonitor.h
+++ b/Source/cmFileMonitor.h
@@ -14,12 +14,14 @@ class cmRootWatcher;
class cmFileMonitor
{
- CM_DISABLE_COPY(cmFileMonitor)
public:
cmFileMonitor(uv_loop_t* l);
~cmFileMonitor();
+ cmFileMonitor(cmFileMonitor const&) = delete;
+ cmFileMonitor& operator=(cmFileMonitor const&) = delete;
+
using Callback = std::function<void(const std::string&, int, int)>;
void MonitorPaths(const std::vector<std::string>& paths, Callback const& cb);
void StopMonitoring();
diff --git a/Source/cmFilePathChecksum.cxx b/Source/cmFilePathChecksum.cxx
index f84360e7f7..2cffa7c5b3 100644
--- a/Source/cmFilePathChecksum.cxx
+++ b/Source/cmFilePathChecksum.cxx
@@ -9,9 +9,7 @@
#include <vector>
-cmFilePathChecksum::cmFilePathChecksum()
-{
-}
+cmFilePathChecksum::cmFilePathChecksum() = default;
cmFilePathChecksum::cmFilePathChecksum(std::string const& currentSrcDir,
std::string const& currentBinDir,
diff --git a/Source/cmFileTimeComparison.cxx b/Source/cmFileTimeComparison.cxx
index 8f6993d1eb..8b3911e4b7 100644
--- a/Source/cmFileTimeComparison.cxx
+++ b/Source/cmFileTimeComparison.cxx
@@ -21,9 +21,10 @@ class cmFileTimeComparisonInternal
{
public:
// Internal comparison method.
- inline bool FileTimeCompare(const char* f1, const char* f2, int* result);
+ inline bool FileTimeCompare(const std::string& f1, const std::string& f2,
+ int* result);
- bool FileTimesDiffer(const char* f1, const char* f2);
+ bool FileTimesDiffer(const std::string& f1, const std::string& f2);
private:
typedef std::unordered_map<std::string, cmFileTimeComparison_Type>
@@ -31,14 +32,14 @@ private:
FileStatsMap Files;
// Internal methods to lookup and compare modification times.
- inline bool Stat(const char* fname, cmFileTimeComparison_Type* st);
+ inline bool Stat(const std::string& fname, cmFileTimeComparison_Type* st);
inline int Compare(cmFileTimeComparison_Type* st1,
cmFileTimeComparison_Type* st2);
inline bool TimesDiffer(cmFileTimeComparison_Type* st1,
cmFileTimeComparison_Type* st2);
};
-bool cmFileTimeComparisonInternal::Stat(const char* fname,
+bool cmFileTimeComparisonInternal::Stat(const std::string& fname,
cmFileTimeComparison_Type* st)
{
// Use the stored time if available.
@@ -51,7 +52,7 @@ bool cmFileTimeComparisonInternal::Stat(const char* fname,
#if !defined(_WIN32) || defined(__CYGWIN__)
// POSIX version. Use the stat function.
- int res = ::stat(fname, st);
+ int res = ::stat(fname.c_str(), st);
if (res != 0) {
return false;
}
@@ -83,13 +84,14 @@ cmFileTimeComparison::~cmFileTimeComparison()
delete this->Internals;
}
-bool cmFileTimeComparison::FileTimeCompare(const char* f1, const char* f2,
- int* result)
+bool cmFileTimeComparison::FileTimeCompare(const std::string& f1,
+ const std::string& f2, int* result)
{
return this->Internals->FileTimeCompare(f1, f2, result);
}
-bool cmFileTimeComparison::FileTimesDiffer(const char* f1, const char* f2)
+bool cmFileTimeComparison::FileTimesDiffer(const std::string& f1,
+ const std::string& f2)
{
return this->Internals->FileTimesDiffer(f1, f2);
}
@@ -199,8 +201,9 @@ bool cmFileTimeComparisonInternal::TimesDiffer(cmFileTimeComparison_Type* s1,
#endif
}
-bool cmFileTimeComparisonInternal::FileTimeCompare(const char* f1,
- const char* f2, int* result)
+bool cmFileTimeComparisonInternal::FileTimeCompare(const std::string& f1,
+ const std::string& f2,
+ int* result)
{
// Get the modification time for each file.
cmFileTimeComparison_Type s1;
@@ -215,8 +218,8 @@ bool cmFileTimeComparisonInternal::FileTimeCompare(const char* f1,
return false;
}
-bool cmFileTimeComparisonInternal::FileTimesDiffer(const char* f1,
- const char* f2)
+bool cmFileTimeComparisonInternal::FileTimesDiffer(const std::string& f1,
+ const std::string& f2)
{
// Get the modification time for each file.
cmFileTimeComparison_Type s1;
diff --git a/Source/cmFileTimeComparison.h b/Source/cmFileTimeComparison.h
index 114989b51d..5f74e34990 100644
--- a/Source/cmFileTimeComparison.h
+++ b/Source/cmFileTimeComparison.h
@@ -5,6 +5,8 @@
#include "cmConfigure.h" // IWYU pragma: keep
+#include <string>
+
class cmFileTimeComparisonInternal;
/** \class cmFileTimeComparison
@@ -24,13 +26,14 @@ public:
* When true is returned, result has -1, 0, +1 for
* f1 older, same, or newer than f2.
*/
- bool FileTimeCompare(const char* f1, const char* f2, int* result);
+ bool FileTimeCompare(const std::string& f1, const std::string& f2,
+ int* result);
/**
* Compare file modification times. Return true unless both files
* exist and have modification times less than 1 second apart.
*/
- bool FileTimesDiffer(const char* f1, const char* f2);
+ bool FileTimesDiffer(const std::string& f1, const std::string& f2);
protected:
cmFileTimeComparisonInternal* Internals;
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx
index 39051b9d4d..78be64e09a 100644
--- a/Source/cmFindCommon.cxx
+++ b/Source/cmFindCommon.cxx
@@ -48,9 +48,7 @@ cmFindCommon::cmFindCommon()
this->InitializeSearchPathGroups();
}
-cmFindCommon::~cmFindCommon()
-{
-}
+cmFindCommon::~cmFindCommon() = default;
void cmFindCommon::InitializeSearchPathGroups()
{
diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx
index bcf876d776..73d602de71 100644
--- a/Source/cmFindLibraryCommand.cxx
+++ b/Source/cmFindLibraryCommand.cxx
@@ -202,7 +202,6 @@ struct cmFindLibraryHelper
bool TryRaw = false;
std::string Raw;
cmsys::RegularExpression Regex;
- Name() {}
};
std::vector<Name> Names;
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index bec2af9700..c2e0712ffd 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -693,7 +693,7 @@ bool cmFindPackageCommand::FindModule(bool& found)
std::string var = this->Name;
var += "_FIND_MODULE";
this->Makefile->AddDefinition(var, "1");
- bool result = this->ReadListFile(mfile.c_str(), DoPolicyScope);
+ bool result = this->ReadListFile(mfile, DoPolicyScope);
this->Makefile->RemoveDefinition(var);
return result;
}
@@ -776,7 +776,7 @@ bool cmFindPackageCommand::HandlePackageMode()
this->StoreVersionFound();
// Parse the configuration file.
- if (this->ReadListFile(this->FileFound.c_str(), DoPolicyScope)) {
+ if (this->ReadListFile(this->FileFound, DoPolicyScope)) {
// The package has been found.
found = true;
@@ -1036,7 +1036,8 @@ bool cmFindPackageCommand::FindAppBundleConfig()
return false;
}
-bool cmFindPackageCommand::ReadListFile(const char* f, PolicyScopeRule psr)
+bool cmFindPackageCommand::ReadListFile(const std::string& f,
+ PolicyScopeRule psr)
{
const bool noPolicyScope = !this->PolicyScope || psr == NoPolicyScope;
if (this->Makefile->ReadDependentFile(f, noPolicyScope)) {
@@ -1590,7 +1591,7 @@ bool cmFindPackageCommand::CheckVersionFile(std::string const& version_file,
// Load the version check file. Pass NoPolicyScope because we do
// our own policy push/pop independent of CMP0011.
bool suitable = false;
- if (this->ReadListFile(version_file.c_str(), NoPolicyScope)) {
+ if (this->ReadListFile(version_file, NoPolicyScope)) {
// Check the output variables.
bool okay = this->Makefile->IsOn("PACKAGE_VERSION_EXACT");
bool unsuitable = this->Makefile->IsOn("PACKAGE_VERSION_UNSUITABLE");
@@ -1671,7 +1672,7 @@ void cmFindPackageCommand::StoreVersionFound()
class cmFileListGeneratorBase
{
public:
- virtual ~cmFileListGeneratorBase() {}
+ virtual ~cmFileListGeneratorBase() = default;
protected:
bool Consider(std::string const& fullPath, cmFileList& listing);
@@ -1688,8 +1689,7 @@ private:
class cmFileList
{
public:
- cmFileList() {}
- virtual ~cmFileList() {}
+ virtual ~cmFileList() = default;
cmFileList& operator/(cmFileListGeneratorBase const& rhs)
{
if (this->Last) {
diff --git a/Source/cmFindPackageCommand.h b/Source/cmFindPackageCommand.h
index 83d8431860..a11d253048 100644
--- a/Source/cmFindPackageCommand.h
+++ b/Source/cmFindPackageCommand.h
@@ -110,7 +110,7 @@ private:
NoPolicyScope,
DoPolicyScope
};
- bool ReadListFile(const char* f, PolicyScopeRule psr);
+ bool ReadListFile(const std::string& f, PolicyScopeRule psr);
void StoreVersionFound();
void ComputePrefixes();
diff --git a/Source/cmFortranParser.h b/Source/cmFortranParser.h
index 8d4c90b7d9..076234035b 100644
--- a/Source/cmFortranParser.h
+++ b/Source/cmFortranParser.h
@@ -128,15 +128,29 @@ struct cmFortranFile
bool LastCharWasNewline;
};
+struct cmFortranCompiler
+{
+ std::string Id;
+ std::string SModSep;
+ std::string SModExt;
+};
+
struct cmFortranParser_s
{
- cmFortranParser_s(std::vector<std::string> includes,
+ cmFortranParser_s(cmFortranCompiler fc, std::vector<std::string> includes,
std::set<std::string> defines, cmFortranSourceInfo& info);
~cmFortranParser_s();
bool FindIncludeFile(const char* dir, const char* includeName,
std::string& fileName);
+ std::string ModName(std::string const& mod_name) const;
+ std::string SModName(std::string const& mod_name,
+ std::string const& sub_name) const;
+
+ // What compiler.
+ cmFortranCompiler Compiler;
+
// The include file search path.
std::vector<std::string> IncludePath;
diff --git a/Source/cmFortranParserImpl.cxx b/Source/cmFortranParserImpl.cxx
index 45481a4136..18e3c107d5 100644
--- a/Source/cmFortranParserImpl.cxx
+++ b/Source/cmFortranParserImpl.cxx
@@ -43,10 +43,12 @@ bool cmFortranParser_s::FindIncludeFile(const char* dir,
return false;
}
-cmFortranParser_s::cmFortranParser_s(std::vector<std::string> includes,
+cmFortranParser_s::cmFortranParser_s(cmFortranCompiler fc,
+ std::vector<std::string> includes,
std::set<std::string> defines,
cmFortranSourceInfo& info)
- : IncludePath(std::move(includes))
+ : Compiler(std::move(fc))
+ , IncludePath(std::move(includes))
, PPDefinitions(std::move(defines))
, Info(info)
{
@@ -69,6 +71,17 @@ cmFortranParser_s::~cmFortranParser_s()
cmFortran_yylex_destroy(this->Scanner);
}
+std::string cmFortranParser_s::ModName(std::string const& mod_name) const
+{
+ return mod_name + ".mod";
+}
+
+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;
+}
+
bool cmFortranParser_FilePush(cmFortranParser* parser, const char* fname)
{
// Open the new file and push it onto the stack. Save the old
@@ -178,7 +191,7 @@ void cmFortranParser_RuleUse(cmFortranParser* parser, const char* module_name)
// syntax: "use module_name"
// requires: "module_name.mod"
std::string const& mod_name = cmSystemTools::LowerCase(module_name);
- parser->Info.Requires.insert(mod_name + ".mod");
+ parser->Info.Requires.insert(parser->ModName(mod_name));
}
void cmFortranParser_RuleLineDirective(cmFortranParser* parser,
@@ -242,7 +255,7 @@ void cmFortranParser_RuleModule(cmFortranParser* parser,
// syntax: "module module_name"
// provides: "module_name.mod"
std::string const& mod_name = cmSystemTools::LowerCase(module_name);
- parser->Info.Provides.insert(mod_name + ".mod");
+ parser->Info.Provides.insert(parser->ModName(mod_name));
}
}
@@ -265,8 +278,8 @@ void cmFortranParser_RuleSubmodule(cmFortranParser* parser,
std::string const& mod_name = cmSystemTools::LowerCase(module_name);
std::string const& sub_name = cmSystemTools::LowerCase(submodule_name);
- parser->Info.Requires.insert(mod_name + ".mod");
- parser->Info.Provides.insert(mod_name + "@" + sub_name + ".smod");
+ parser->Info.Requires.insert(parser->ModName(mod_name));
+ parser->Info.Provides.insert(parser->SModName(mod_name, sub_name));
}
void cmFortranParser_RuleSubmoduleNested(cmFortranParser* parser,
@@ -286,8 +299,8 @@ void cmFortranParser_RuleSubmoduleNested(cmFortranParser* parser,
std::string const& sub_name = cmSystemTools::LowerCase(submodule_name);
std::string const& nest_name =
cmSystemTools::LowerCase(nested_submodule_name);
- parser->Info.Requires.insert(mod_name + "@" + sub_name + ".smod");
- parser->Info.Provides.insert(mod_name + "@" + nest_name + ".smod");
+ parser->Info.Requires.insert(parser->SModName(mod_name, sub_name));
+ parser->Info.Provides.insert(parser->SModName(mod_name, nest_name));
}
void cmFortranParser_RuleDefine(cmFortranParser* parser, const char* macro)
diff --git a/Source/cmFunctionBlocker.h b/Source/cmFunctionBlocker.h
index b3450b3f27..cd6b05db47 100644
--- a/Source/cmFunctionBlocker.h
+++ b/Source/cmFunctionBlocker.h
@@ -26,7 +26,7 @@ public:
return false;
}
- virtual ~cmFunctionBlocker() {}
+ virtual ~cmFunctionBlocker() = default;
/** Set/Get the context in which this blocker is created. */
void SetStartingContext(cmListFileContext const& lfc)
diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx
index 67c9e9a5de..264a3385cb 100644
--- a/Source/cmFunctionCommand.cxx
+++ b/Source/cmFunctionCommand.cxx
@@ -14,11 +14,6 @@
class cmFunctionHelperCommand : public cmCommand
{
public:
- cmFunctionHelperCommand() {}
-
- ///! clean up any memory allocated by the function
- ~cmFunctionHelperCommand() override {}
-
/**
* This is a virtual constructor for the command.
*/
diff --git a/Source/cmFunctionCommand.h b/Source/cmFunctionCommand.h
index 3352b9235c..8b37df032b 100644
--- a/Source/cmFunctionCommand.h
+++ b/Source/cmFunctionCommand.h
@@ -18,15 +18,13 @@ class cmMakefile;
class cmFunctionFunctionBlocker : public cmFunctionBlocker
{
public:
- cmFunctionFunctionBlocker() { this->Depth = 0; }
- ~cmFunctionFunctionBlocker() override {}
bool IsFunctionBlocked(const cmListFileFunction&, cmMakefile& mf,
cmExecutionStatus&) override;
bool ShouldRemove(const cmListFileFunction&, cmMakefile& mf) override;
std::vector<std::string> Args;
std::vector<cmListFileFunction> Functions;
- int Depth;
+ int Depth = 0;
};
/// Starts function() ... endfunction() block
diff --git a/Source/cmGeneratedFileStream.cxx b/Source/cmGeneratedFileStream.cxx
index eef5dc0659..4fe15874d3 100644
--- a/Source/cmGeneratedFileStream.cxx
+++ b/Source/cmGeneratedFileStream.cxx
@@ -102,9 +102,7 @@ void cmGeneratedFileStream::SetCompressionExtraExtension(bool ext)
this->CompressExtraExtension = ext;
}
-cmGeneratedFileStreamBase::cmGeneratedFileStreamBase()
-{
-}
+cmGeneratedFileStreamBase::cmGeneratedFileStreamBase() = default;
cmGeneratedFileStreamBase::cmGeneratedFileStreamBase(std::string const& name)
{
diff --git a/Source/cmGeneratedFileStream.h b/Source/cmGeneratedFileStream.h
index fd118894c2..5b1eb51531 100644
--- a/Source/cmGeneratedFileStream.h
+++ b/Source/cmGeneratedFileStream.h
@@ -97,6 +97,8 @@ public:
*/
~cmGeneratedFileStream() override;
+ cmGeneratedFileStream(cmGeneratedFileStream const&) = delete;
+
/**
* Open an output file by name. This should be used only with a
* non-open stream. It automatically generates a name for the
@@ -134,9 +136,6 @@ public:
* the output file to be changed during the use of cmGeneratedFileStream.
*/
void SetName(const std::string& fname);
-
-private:
- cmGeneratedFileStream(cmGeneratedFileStream const&); // not implemented
};
#endif
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index f3f9771167..175a26d2e8 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -33,9 +33,7 @@ std::unique_ptr<cmCompiledGeneratorExpression> cmGeneratorExpression::Parse(
return this->Parse(std::string(input ? input : ""));
}
-cmGeneratorExpression::~cmGeneratorExpression()
-{
-}
+cmGeneratorExpression::~cmGeneratorExpression() = default;
const std::string& cmCompiledGeneratorExpression::Evaluate(
cmLocalGenerator* lg, const std::string& config, bool quiet,
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index e5463a7e81..fd36c4bcb0 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -32,13 +32,14 @@ struct cmGeneratorExpressionEvaluator;
*/
class cmGeneratorExpression
{
- CM_DISABLE_COPY(cmGeneratorExpression)
-
public:
/** Construct. */
cmGeneratorExpression(cmListFileBacktrace backtrace = cmListFileBacktrace());
~cmGeneratorExpression();
+ cmGeneratorExpression(cmGeneratorExpression const&) = delete;
+ cmGeneratorExpression& operator=(cmGeneratorExpression const&) = delete;
+
std::unique_ptr<cmCompiledGeneratorExpression> Parse(
std::string const& input);
std::unique_ptr<cmCompiledGeneratorExpression> Parse(const char* input);
@@ -78,9 +79,13 @@ private:
class cmCompiledGeneratorExpression
{
- CM_DISABLE_COPY(cmCompiledGeneratorExpression)
-
public:
+ ~cmCompiledGeneratorExpression();
+
+ cmCompiledGeneratorExpression(cmCompiledGeneratorExpression const&) = delete;
+ cmCompiledGeneratorExpression& operator=(
+ cmCompiledGeneratorExpression const&) = delete;
+
const std::string& Evaluate(
cmLocalGenerator* lg, const std::string& config, bool quiet = false,
cmGeneratorTarget const* headTarget = nullptr,
@@ -109,8 +114,6 @@ public:
return this->AllTargetsSeen;
}
- ~cmCompiledGeneratorExpression();
-
std::string const& GetInput() const { return this->Input; }
cmListFileBacktrace GetBacktrace() const { return this->Backtrace; }
@@ -165,8 +168,6 @@ private:
class cmGeneratorExpressionInterpreter
{
- CM_DISABLE_COPY(cmGeneratorExpressionInterpreter)
-
public:
cmGeneratorExpressionInterpreter(cmLocalGenerator* localGenerator,
std::string config,
@@ -179,6 +180,11 @@ public:
{
}
+ cmGeneratorExpressionInterpreter(cmGeneratorExpressionInterpreter const&) =
+ delete;
+ cmGeneratorExpressionInterpreter& operator=(
+ cmGeneratorExpressionInterpreter const&) = delete;
+
const std::string& Evaluate(const char* expression,
const std::string& property);
const std::string& Evaluate(const std::string& expression,
diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx
index 0f26e70cad..728f2a4fd6 100644
--- a/Source/cmGeneratorExpressionDAGChecker.cxx
+++ b/Source/cmGeneratorExpressionDAGChecker.cxx
@@ -157,14 +157,8 @@ bool cmGeneratorExpressionDAGChecker::GetTransitivePropertiesOnly()
bool cmGeneratorExpressionDAGChecker::EvaluatingGenexExpression()
{
- const cmGeneratorExpressionDAGChecker* top = this;
- const cmGeneratorExpressionDAGChecker* parent = this->Parent;
- while (parent) {
- top = parent;
- parent = parent->Parent;
- }
-
- return top->Property == "TARGET_GENEX_EVAL" || top->Property == "GENEX_EVAL";
+ return this->Property.find("TARGET_GENEX_EVAL:") == 0 ||
+ this->Property.find("GENEX_EVAL:", 0) == 0;
}
bool cmGeneratorExpressionDAGChecker::EvaluatingPICExpression()
diff --git a/Source/cmGeneratorExpressionEvaluator.h b/Source/cmGeneratorExpressionEvaluator.h
index 0561799504..453015262d 100644
--- a/Source/cmGeneratorExpressionEvaluator.h
+++ b/Source/cmGeneratorExpressionEvaluator.h
@@ -16,8 +16,13 @@ struct cmGeneratorExpressionNode;
struct cmGeneratorExpressionEvaluator
{
- cmGeneratorExpressionEvaluator() {}
- virtual ~cmGeneratorExpressionEvaluator() {}
+ cmGeneratorExpressionEvaluator() = default;
+ virtual ~cmGeneratorExpressionEvaluator() = default;
+
+ cmGeneratorExpressionEvaluator(cmGeneratorExpressionEvaluator const&) =
+ delete;
+ cmGeneratorExpressionEvaluator& operator=(
+ cmGeneratorExpressionEvaluator const&) = delete;
enum Type
{
@@ -29,9 +34,6 @@ struct cmGeneratorExpressionEvaluator
virtual std::string Evaluate(cmGeneratorExpressionContext* context,
cmGeneratorExpressionDAGChecker*) const = 0;
-
-private:
- CM_DISABLE_COPY(cmGeneratorExpressionEvaluator)
};
struct TextContent : public cmGeneratorExpressionEvaluator
diff --git a/Source/cmGeneratorExpressionLexer.cxx b/Source/cmGeneratorExpressionLexer.cxx
index dd1e243769..a7f090ac7e 100644
--- a/Source/cmGeneratorExpressionLexer.cxx
+++ b/Source/cmGeneratorExpressionLexer.cxx
@@ -2,9 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmGeneratorExpressionLexer.h"
-cmGeneratorExpressionLexer::cmGeneratorExpressionLexer()
-{
-}
+cmGeneratorExpressionLexer::cmGeneratorExpressionLexer() = default;
static void InsertText(const char* upto, const char* c,
std::vector<cmGeneratorExpressionToken>& result)
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index 6a3f73d9ac..70c80c90d7 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -56,7 +56,7 @@ std::string cmGeneratorExpressionNode::EvaluateDependentExpression(
static const struct ZeroNode : public cmGeneratorExpressionNode
{
- ZeroNode() {}
+ ZeroNode() {} // NOLINT(modernize-use-equals-default)
bool GeneratesContent() const override { return false; }
@@ -74,7 +74,7 @@ static const struct ZeroNode : public cmGeneratorExpressionNode
static const struct OneNode : public cmGeneratorExpressionNode
{
- OneNode() {}
+ OneNode() {} // NOLINT(modernize-use-equals-default)
bool AcceptsArbitraryContentParameter() const override { return true; }
@@ -95,7 +95,7 @@ static const struct ZeroNode installInterfaceNode;
#define BOOLEAN_OP_NODE(OPNAME, OP, SUCCESS_VALUE, FAILURE_VALUE) \
static const struct OP##Node : public cmGeneratorExpressionNode \
{ \
- OP##Node() {} \
+ OP##Node() {} /* NOLINT(modernize-use-equals-default) */ \
virtual int NumExpectedParameters() const { return OneOrMoreParameters; } \
\
std::string Evaluate(const std::vector<std::string>& parameters, \
@@ -127,7 +127,7 @@ BOOLEAN_OP_NODE(orNode, OR, 0, 1)
static const struct NotNode : public cmGeneratorExpressionNode
{
- NotNode() {}
+ NotNode() {} // NOLINT(modernize-use-equals-default)
std::string Evaluate(
const std::vector<std::string>& parameters,
@@ -147,7 +147,7 @@ static const struct NotNode : public cmGeneratorExpressionNode
static const struct BoolNode : public cmGeneratorExpressionNode
{
- BoolNode() {}
+ BoolNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 1; }
@@ -163,7 +163,7 @@ static const struct BoolNode : public cmGeneratorExpressionNode
static const struct IfNode : public cmGeneratorExpressionNode
{
- IfNode() {}
+ IfNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 3; }
@@ -184,7 +184,7 @@ static const struct IfNode : public cmGeneratorExpressionNode
static const struct StrEqualNode : public cmGeneratorExpressionNode
{
- StrEqualNode() {}
+ StrEqualNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 2; }
@@ -200,7 +200,7 @@ static const struct StrEqualNode : public cmGeneratorExpressionNode
static const struct EqualNode : public cmGeneratorExpressionNode
{
- EqualNode() {}
+ EqualNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 2; }
@@ -278,7 +278,7 @@ static const struct EqualNode : public cmGeneratorExpressionNode
static const struct InListNode : public cmGeneratorExpressionNode
{
- InListNode() {}
+ InListNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 2; }
@@ -328,7 +328,7 @@ static const struct InListNode : public cmGeneratorExpressionNode
static const struct TargetExistsNode : public cmGeneratorExpressionNode
{
- TargetExistsNode() {}
+ TargetExistsNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 1; }
@@ -359,7 +359,7 @@ static const struct TargetExistsNode : public cmGeneratorExpressionNode
static const struct TargetNameIfExistsNode : public cmGeneratorExpressionNode
{
- TargetNameIfExistsNode() {}
+ TargetNameIfExistsNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 1; }
@@ -393,7 +393,7 @@ static const struct TargetNameIfExistsNode : public cmGeneratorExpressionNode
struct GenexEvaluator : public cmGeneratorExpressionNode
{
- GenexEvaluator() {}
+ GenexEvaluator() {} // NOLINT(modernize-use-equals-default)
protected:
std::string EvaluateExpression(
@@ -404,8 +404,8 @@ protected:
{
if (context->HeadTarget) {
cmGeneratorExpressionDAGChecker dagChecker(
- context->Backtrace, context->HeadTarget, genexOperator, content,
- dagCheckerParent);
+ context->Backtrace, context->HeadTarget,
+ genexOperator + ":" + expression, content, dagCheckerParent);
switch (dagChecker.Check()) {
case cmGeneratorExpressionDAGChecker::SELF_REFERENCE:
case cmGeneratorExpressionDAGChecker::CYCLIC_REFERENCE: {
@@ -430,7 +430,7 @@ protected:
static const struct TargetGenexEvalNode : public GenexEvaluator
{
- TargetGenexEvalNode() {}
+ TargetGenexEvalNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 2; }
@@ -476,7 +476,7 @@ static const struct TargetGenexEvalNode : public GenexEvaluator
static const struct GenexEvalNode : public GenexEvaluator
{
- GenexEvalNode() {}
+ GenexEvalNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 1; }
@@ -500,7 +500,7 @@ static const struct GenexEvalNode : public GenexEvaluator
static const struct LowerCaseNode : public cmGeneratorExpressionNode
{
- LowerCaseNode() {}
+ LowerCaseNode() {} // NOLINT(modernize-use-equals-default)
bool AcceptsArbitraryContentParameter() const override { return true; }
@@ -516,7 +516,7 @@ static const struct LowerCaseNode : public cmGeneratorExpressionNode
static const struct UpperCaseNode : public cmGeneratorExpressionNode
{
- UpperCaseNode() {}
+ UpperCaseNode() {} // NOLINT(modernize-use-equals-default)
bool AcceptsArbitraryContentParameter() const override { return true; }
@@ -532,7 +532,7 @@ static const struct UpperCaseNode : public cmGeneratorExpressionNode
static const struct MakeCIdentifierNode : public cmGeneratorExpressionNode
{
- MakeCIdentifierNode() {}
+ MakeCIdentifierNode() {} // NOLINT(modernize-use-equals-default)
bool AcceptsArbitraryContentParameter() const override { return true; }
@@ -548,7 +548,7 @@ static const struct MakeCIdentifierNode : public cmGeneratorExpressionNode
static const struct Angle_RNode : public cmGeneratorExpressionNode
{
- Angle_RNode() {}
+ Angle_RNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 0; }
@@ -564,7 +564,7 @@ static const struct Angle_RNode : public cmGeneratorExpressionNode
static const struct CommaNode : public cmGeneratorExpressionNode
{
- CommaNode() {}
+ CommaNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 0; }
@@ -580,7 +580,7 @@ static const struct CommaNode : public cmGeneratorExpressionNode
static const struct SemicolonNode : public cmGeneratorExpressionNode
{
- SemicolonNode() {}
+ SemicolonNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 0; }
@@ -596,7 +596,7 @@ static const struct SemicolonNode : public cmGeneratorExpressionNode
struct CompilerIdNode : public cmGeneratorExpressionNode
{
- CompilerIdNode() {}
+ CompilerIdNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return OneOrZeroParameters; }
@@ -650,7 +650,7 @@ struct CompilerIdNode : public cmGeneratorExpressionNode
static const struct CCompilerIdNode : public CompilerIdNode
{
- CCompilerIdNode() {}
+ CCompilerIdNode() {} // NOLINT(modernize-use-equals-default)
std::string Evaluate(
const std::vector<std::string>& parameters,
@@ -672,7 +672,7 @@ static const struct CCompilerIdNode : public CompilerIdNode
static const struct CXXCompilerIdNode : public CompilerIdNode
{
- CXXCompilerIdNode() {}
+ CXXCompilerIdNode() {} // NOLINT(modernize-use-equals-default)
std::string Evaluate(
const std::vector<std::string>& parameters,
@@ -694,7 +694,7 @@ static const struct CXXCompilerIdNode : public CompilerIdNode
static const struct FortranCompilerIdNode : public CompilerIdNode
{
- FortranCompilerIdNode() {}
+ FortranCompilerIdNode() {} // NOLINT(modernize-use-equals-default)
std::string Evaluate(
const std::vector<std::string>& parameters,
@@ -716,7 +716,7 @@ static const struct FortranCompilerIdNode : public CompilerIdNode
struct CompilerVersionNode : public cmGeneratorExpressionNode
{
- CompilerVersionNode() {}
+ CompilerVersionNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return OneOrZeroParameters; }
@@ -753,7 +753,7 @@ struct CompilerVersionNode : public cmGeneratorExpressionNode
static const struct CCompilerVersionNode : public CompilerVersionNode
{
- CCompilerVersionNode() {}
+ CCompilerVersionNode() {} // NOLINT(modernize-use-equals-default)
std::string Evaluate(
const std::vector<std::string>& parameters,
@@ -775,7 +775,7 @@ static const struct CCompilerVersionNode : public CompilerVersionNode
static const struct CxxCompilerVersionNode : public CompilerVersionNode
{
- CxxCompilerVersionNode() {}
+ CxxCompilerVersionNode() {} // NOLINT(modernize-use-equals-default)
std::string Evaluate(
const std::vector<std::string>& parameters,
@@ -797,7 +797,7 @@ static const struct CxxCompilerVersionNode : public CompilerVersionNode
static const struct FortranCompilerVersionNode : public CompilerVersionNode
{
- FortranCompilerVersionNode() {}
+ FortranCompilerVersionNode() {} // NOLINT(modernize-use-equals-default)
std::string Evaluate(
const std::vector<std::string>& parameters,
@@ -819,7 +819,7 @@ static const struct FortranCompilerVersionNode : public CompilerVersionNode
struct PlatformIdNode : public cmGeneratorExpressionNode
{
- PlatformIdNode() {}
+ PlatformIdNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return OneOrZeroParameters; }
@@ -848,7 +848,7 @@ struct PlatformIdNode : public cmGeneratorExpressionNode
static const struct VersionGreaterNode : public cmGeneratorExpressionNode
{
- VersionGreaterNode() {}
+ VersionGreaterNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 2; }
@@ -868,7 +868,7 @@ static const struct VersionGreaterNode : public cmGeneratorExpressionNode
static const struct VersionGreaterEqNode : public cmGeneratorExpressionNode
{
- VersionGreaterEqNode() {}
+ VersionGreaterEqNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 2; }
@@ -888,7 +888,7 @@ static const struct VersionGreaterEqNode : public cmGeneratorExpressionNode
static const struct VersionLessNode : public cmGeneratorExpressionNode
{
- VersionLessNode() {}
+ VersionLessNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 2; }
@@ -908,7 +908,7 @@ static const struct VersionLessNode : public cmGeneratorExpressionNode
static const struct VersionLessEqNode : public cmGeneratorExpressionNode
{
- VersionLessEqNode() {}
+ VersionLessEqNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 2; }
@@ -928,7 +928,7 @@ static const struct VersionLessEqNode : public cmGeneratorExpressionNode
static const struct VersionEqualNode : public cmGeneratorExpressionNode
{
- VersionEqualNode() {}
+ VersionEqualNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 2; }
@@ -948,7 +948,7 @@ static const struct VersionEqualNode : public cmGeneratorExpressionNode
static const struct LinkOnlyNode : public cmGeneratorExpressionNode
{
- LinkOnlyNode() {}
+ LinkOnlyNode() {} // NOLINT(modernize-use-equals-default)
std::string Evaluate(
const std::vector<std::string>& parameters,
@@ -970,7 +970,7 @@ static const struct LinkOnlyNode : public cmGeneratorExpressionNode
static const struct ConfigurationNode : public cmGeneratorExpressionNode
{
- ConfigurationNode() {}
+ ConfigurationNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 0; }
@@ -987,7 +987,7 @@ static const struct ConfigurationNode : public cmGeneratorExpressionNode
static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
{
- ConfigurationTestNode() {}
+ ConfigurationTestNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return OneOrZeroParameters; }
@@ -1046,7 +1046,7 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
static const struct JoinNode : public cmGeneratorExpressionNode
{
- JoinNode() {}
+ JoinNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 2; }
@@ -1066,7 +1066,7 @@ static const struct JoinNode : public cmGeneratorExpressionNode
static const struct CompileLanguageNode : public cmGeneratorExpressionNode
{
- CompileLanguageNode() {}
+ CompileLanguageNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return OneOrZeroParameters; }
@@ -1146,7 +1146,7 @@ std::string getLinkedTargetsContent(
static const struct TargetPropertyNode : public cmGeneratorExpressionNode
{
- TargetPropertyNode() {}
+ TargetPropertyNode() {} // NOLINT(modernize-use-equals-default)
// This node handles errors on parameter count itself.
int NumExpectedParameters() const override { return OneOrMoreParameters; }
@@ -1442,7 +1442,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
static const struct TargetNameNode : public cmGeneratorExpressionNode
{
- TargetNameNode() {}
+ TargetNameNode() {} // NOLINT(modernize-use-equals-default)
bool GeneratesContent() const override { return true; }
@@ -1464,7 +1464,7 @@ static const struct TargetNameNode : public cmGeneratorExpressionNode
static const struct TargetObjectsNode : public cmGeneratorExpressionNode
{
- TargetObjectsNode() {}
+ TargetObjectsNode() {} // NOLINT(modernize-use-equals-default)
std::string Evaluate(
const std::vector<std::string>& parameters,
@@ -1546,7 +1546,7 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode
static const struct CompileFeaturesNode : public cmGeneratorExpressionNode
{
- CompileFeaturesNode() {}
+ CompileFeaturesNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return OneOrMoreParameters; }
@@ -1671,7 +1671,7 @@ cmPolicies::PolicyID policyForString(const char* policy_id)
static const struct TargetPolicyNode : public cmGeneratorExpressionNode
{
- TargetPolicyNode() {}
+ TargetPolicyNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 1; }
@@ -1732,7 +1732,7 @@ static const struct TargetPolicyNode : public cmGeneratorExpressionNode
static const struct InstallPrefixNode : public cmGeneratorExpressionNode
{
- InstallPrefixNode() {}
+ InstallPrefixNode() {} // NOLINT(modernize-use-equals-default)
bool GeneratesContent() const override { return true; }
int NumExpectedParameters() const override { return 0; }
@@ -1953,7 +1953,7 @@ struct TargetFilesystemArtifactResultGetter<ArtifactPathTag>
template <typename ArtifactT, typename ComponentT>
struct TargetFilesystemArtifact : public cmGeneratorExpressionNode
{
- TargetFilesystemArtifact() {}
+ TargetFilesystemArtifact() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 1; }
@@ -2009,7 +2009,9 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode
template <typename ArtifactT>
struct TargetFilesystemArtifactNodeGroup
{
- TargetFilesystemArtifactNodeGroup() {}
+ TargetFilesystemArtifactNodeGroup() // NOLINT(modernize-use-equals-default)
+ {
+ }
TargetFilesystemArtifact<ArtifactT, ArtifactPathTag> File;
TargetFilesystemArtifact<ArtifactT, ArtifactNameTag> FileName;
@@ -2037,7 +2039,7 @@ static const TargetFilesystemArtifact<ArtifactBundleContentDirTag,
static const struct ShellPathNode : public cmGeneratorExpressionNode
{
- ShellPathNode() {}
+ ShellPathNode() {} // NOLINT(modernize-use-equals-default)
std::string Evaluate(
const std::vector<std::string>& parameters,
diff --git a/Source/cmGeneratorExpressionNode.h b/Source/cmGeneratorExpressionNode.h
index ece1c113ce..3dbfc6e5e5 100644
--- a/Source/cmGeneratorExpressionNode.h
+++ b/Source/cmGeneratorExpressionNode.h
@@ -22,7 +22,7 @@ struct cmGeneratorExpressionNode
OneOrMoreParameters = -1,
OneOrZeroParameters = -2
};
- virtual ~cmGeneratorExpressionNode() {}
+ virtual ~cmGeneratorExpressionNode() = default;
virtual bool GeneratesContent() const { return true; }
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 86f10dcf86..25349d42e2 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -510,21 +510,10 @@ const char* cmGeneratorTarget::GetLinkPIEProperty(
return nullptr;
}
- switch (this->GetPolicyStatusCMP0083()) {
- case cmPolicies::WARN: {
- std::ostringstream e;
- e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0083);
- this->LocalGenerator->IssueMessage(MessageType::AUTHOR_WARNING, e.str());
- CM_FALLTHROUGH;
- }
- case cmPolicies::OLD:
- return nullptr;
- default:
- // nothing to do
- break;
- }
-
- return PICValue.c_str();
+ auto status = this->GetPolicyStatusCMP0083();
+ return (status != cmPolicies::WARN && status != cmPolicies::OLD)
+ ? PICValue.c_str()
+ : nullptr;
}
bool cmGeneratorTarget::IsIPOEnabled(std::string const& lang,
@@ -3859,6 +3848,13 @@ std::string cmGeneratorTarget::GetObjectDirectory(
// find and replace $(PROJECT_NAME) xcode placeholder
const std::string projectName = this->LocalGenerator->GetProjectName();
cmSystemTools::ReplaceString(obj_dir, "$(PROJECT_NAME)", projectName);
+ // Replace Xcode's placeholder for the object file directory since
+ // installation and export scripts need to know the real directory.
+ // Xcode has build-time settings (e.g. for sanitizers) that affect this,
+ // but we use the default here. Users that want to enable sanitizers
+ // will do so at the cost of object library installation and export.
+ cmSystemTools::ReplaceString(obj_dir, "$(OBJECT_FILE_DIR_normal:base)",
+ "Objects-normal");
#endif
return obj_dir;
}
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index d9221f0361..59d38afd7d 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -27,12 +27,13 @@ class cmTarget;
class cmGeneratorTarget
{
- CM_DISABLE_COPY(cmGeneratorTarget)
-
public:
cmGeneratorTarget(cmTarget*, cmLocalGenerator* lg);
~cmGeneratorTarget();
+ cmGeneratorTarget(cmGeneratorTarget const&) = delete;
+ cmGeneratorTarget& operator=(cmGeneratorTarget const&) = delete;
+
cmLocalGenerator* GetLocalGenerator() const;
cmGlobalGenerator* GetGlobalGenerator() const;
@@ -111,7 +112,6 @@ public:
std::set<std::string> ExpectedXamlHeaders;
std::set<std::string> ExpectedXamlSources;
bool Initialized = false;
- KindedSources() {}
};
/** Get all sources needed for a configuration with kinds assigned. */
@@ -562,7 +562,6 @@ public:
};
struct SourceFileFlags
{
- SourceFileFlags() {}
SourceFileType Type = SourceFileTypeNormal;
const char* MacFolder = nullptr; // location inside Mac content folders
};
@@ -750,7 +749,6 @@ private:
struct CompatibleInterfaces : public CompatibleInterfacesBase
{
- CompatibleInterfaces() {}
bool Done = false;
};
mutable std::map<std::string, CompatibleInterfaces> CompatibleInterfacesMap;
@@ -764,7 +762,6 @@ private:
struct LinkImplClosure : public std::vector<cmGeneratorTarget const*>
{
- LinkImplClosure() {}
bool Done = false;
};
mutable std::map<std::string, LinkImplClosure> LinkImplClosureMap;
@@ -784,7 +781,6 @@ private:
// Cache import information from properties for each configuration.
struct ImportInfo
{
- ImportInfo() {}
bool NoSOName = false;
ManagedType Managed = Native;
unsigned int Multiplicity = 0;
diff --git a/Source/cmGetFilenameComponentCommand.cxx b/Source/cmGetFilenameComponentCommand.cxx
index ffb895e535..163b4c8abc 100644
--- a/Source/cmGetFilenameComponentCommand.cxx
+++ b/Source/cmGetFilenameComponentCommand.cxx
@@ -88,6 +88,10 @@ bool cmGetFilenameComponentCommand::InitialPass(
result = cmSystemTools::GetFilenameExtension(filename);
} else if (args[2] == "NAME_WE") {
result = cmSystemTools::GetFilenameWithoutExtension(filename);
+ } else if (args[2] == "LAST_EXT") {
+ result = cmSystemTools::GetFilenameLastExtension(filename);
+ } else if (args[2] == "NAME_WLE") {
+ result = cmSystemTools::GetFilenameWithoutLastExtension(filename);
} else if (args[2] == "ABSOLUTE" || args[2] == "REALPATH") {
// If the path given is relative, evaluate it relative to the
// current source directory unless the user passes a different
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 19605e4c97..5fe350c10b 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -67,7 +67,7 @@ void cmGhsMultiTargetGenerator::Generate()
case cmStateEnums::SHARED_LIBRARY: {
std::string msg = "add_library(<name> SHARED ...) not supported: ";
msg += this->Name;
- cmSystemTools::Message(msg.c_str());
+ cmSystemTools::Message(msg);
return;
}
case cmStateEnums::OBJECT_LIBRARY: {
@@ -84,13 +84,13 @@ void cmGhsMultiTargetGenerator::Generate()
case cmStateEnums::MODULE_LIBRARY: {
std::string msg = "add_library(<name> MODULE ...) not supported: ";
msg += this->Name;
- cmSystemTools::Message(msg.c_str());
+ cmSystemTools::Message(msg);
return;
}
case cmStateEnums::UTILITY: {
std::string msg = "add_custom_target(<name> ...) not supported: ";
msg += this->Name;
- cmSystemTools::Message(msg.c_str());
+ cmSystemTools::Message(msg);
return;
}
default:
@@ -150,7 +150,8 @@ void cmGhsMultiTargetGenerator::WriteTargetSpecifics(std::ostream& fout,
if (this->TagType != GhsMultiGpj::SUBPROJECT) {
// set target binary file destination
outpath = this->GeneratorTarget->GetDirectory(config);
- outpath = this->LocalGenerator->ConvertToRelativePath(rootpath, outpath);
+ outpath =
+ this->LocalGenerator->MaybeConvertToRelativePath(rootpath, outpath);
fout << " :binDirRelative=\"" << outpath << "\"" << std::endl;
fout << " -o \"" << this->TargetNameReal << "\"" << std::endl;
}
@@ -453,7 +454,7 @@ void cmGhsMultiTargetGenerator::WriteSources(std::ostream& fout_proj)
cmSystemTools::IsOn(
this->GeneratorTarget->GetProperty("GHS_NO_SOURCE_GROUP_FILE")) ||
cmSystemTools::IsOn(
- this->Makefile->GetDefinition("GHS_NO_SOURCE_GROUP_FILE"));
+ this->Makefile->GetDefinition("CMAKE_GHS_NO_SOURCE_GROUP_FILE"));
if (useProjectFile || sg.empty()) {
fout = &fout_proj;
} else {
@@ -550,7 +551,7 @@ void cmGhsMultiTargetGenerator::WriteReferences(std::ostream& fout)
std::string tpath = t->LocalGenerator->GetCurrentBinaryDirectory();
std::string rootpath = this->LocalGenerator->GetCurrentBinaryDirectory();
std::string outpath =
- this->LocalGenerator->ConvertToRelativePath(rootpath, tpath) + "/" +
+ this->LocalGenerator->MaybeConvertToRelativePath(rootpath, tpath) + "/" +
tname + "REF" + cmGlobalGhsMultiGenerator::FILE_EXTENSION;
fout << outpath;
diff --git a/Source/cmGlobVerificationManager.h b/Source/cmGlobVerificationManager.h
index c293a764dd..f7146bec09 100644
--- a/Source/cmGlobVerificationManager.h
+++ b/Source/cmGlobVerificationManager.h
@@ -21,9 +21,6 @@
*/
class cmGlobVerificationManager
{
-public:
- cmGlobVerificationManager() {}
-
protected:
///! Save verification script for given makefile.
///! Saves to output <path>/<CMakeFilesDirectory>/VerifyGlobs.cmake
@@ -73,7 +70,6 @@ private:
bool Initialized = false;
std::vector<std::string> Files;
std::vector<std::pair<std::string, cmListFileBacktrace>> Backtraces;
- CacheEntryValue() {}
};
typedef std::map<CacheEntryKey, CacheEntryValue> CacheEntryMap;
diff --git a/Source/cmGlobalBorlandMakefileGenerator.cxx b/Source/cmGlobalBorlandMakefileGenerator.cxx
index 56714b1501..c2eb583a93 100644
--- a/Source/cmGlobalBorlandMakefileGenerator.cxx
+++ b/Source/cmGlobalBorlandMakefileGenerator.cxx
@@ -54,7 +54,7 @@ void cmGlobalBorlandMakefileGenerator::GetDocumentation(
}
void cmGlobalBorlandMakefileGenerator::GenerateBuildCommand(
- std::vector<std::string>& makeCommand, const std::string& makeProgram,
+ GeneratedMakeCommand& makeCommand, const std::string& makeProgram,
const std::string& projectName, const std::string& projectDir,
const std::string& targetName, const std::string& config, bool fast,
int /*jobs*/, bool verbose, std::vector<std::string> const& makeOptions)
diff --git a/Source/cmGlobalBorlandMakefileGenerator.h b/Source/cmGlobalBorlandMakefileGenerator.h
index 27de6cc6c8..ca04b7b739 100644
--- a/Source/cmGlobalBorlandMakefileGenerator.h
+++ b/Source/cmGlobalBorlandMakefileGenerator.h
@@ -46,7 +46,7 @@ public:
bool AllowDeleteOnError() const override { return false; }
protected:
- void GenerateBuildCommand(std::vector<std::string>& makeCommand,
+ void GenerateBuildCommand(GeneratedMakeCommand& makeCommand,
const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
diff --git a/Source/cmGlobalCommonGenerator.cxx b/Source/cmGlobalCommonGenerator.cxx
index 3b7de4b9c4..bf992b48be 100644
--- a/Source/cmGlobalCommonGenerator.cxx
+++ b/Source/cmGlobalCommonGenerator.cxx
@@ -9,6 +9,4 @@ cmGlobalCommonGenerator::cmGlobalCommonGenerator(cmake* cm)
{
}
-cmGlobalCommonGenerator::~cmGlobalCommonGenerator()
-{
-}
+cmGlobalCommonGenerator::~cmGlobalCommonGenerator() = default;
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 04af0138e5..386a3f716c 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -33,7 +33,6 @@
#include "cmMSVC60LinkLineComputer.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
-#include "cmOutputConverter.h"
#include "cmPolicies.h"
#include "cmSourceFile.h"
#include "cmState.h"
@@ -568,11 +567,6 @@ void cmGlobalGenerator::EnableLanguage(
return;
}
- // Find the native build tool for this generator.
- if (!this->FindMakeProgram(mf)) {
- return;
- }
-
// Tell the generator about the target system.
std::string system = mf->GetSafeDefinition("CMAKE_SYSTEM_NAME");
if (!this->SetSystemName(system, mf)) {
@@ -593,6 +587,11 @@ void cmGlobalGenerator::EnableLanguage(
cmSystemTools::SetFatalErrorOccured();
return;
}
+
+ // Find the native build tool for this generator.
+ if (!this->FindMakeProgram(mf)) {
+ return;
+ }
}
// Check that the languages are supported by the generator and its
@@ -1060,7 +1059,7 @@ void cmGlobalGenerator::SetLanguageEnabledMaps(const std::string& l,
if (preference < 0) {
std::string msg = linkerPrefVar;
msg += " is negative, adjusting it to 0";
- cmSystemTools::Message(msg.c_str(), "Warning");
+ cmSystemTools::Message(msg, "Warning");
preference = 0;
}
@@ -1754,14 +1753,13 @@ int cmGlobalGenerator::TryCompile(int jobs, const std::string& srcdir,
}
void cmGlobalGenerator::GenerateBuildCommand(
- std::vector<std::string>& makeCommand, const std::string& /*unused*/,
+ GeneratedMakeCommand& makeCommand, const std::string& /*unused*/,
const std::string& /*unused*/, const std::string& /*unused*/,
const std::string& /*unused*/, const std::string& /*unused*/,
bool /*unused*/, int /*unused*/, bool /*unused*/,
std::vector<std::string> const& /*unused*/)
{
- makeCommand.emplace_back(
- "cmGlobalGenerator::GenerateBuildCommand not implemented");
+ makeCommand.add("cmGlobalGenerator::GenerateBuildCommand not implemented");
}
void cmGlobalGenerator::PrintBuildCommandAdvice(std::ostream& /*os*/,
@@ -1805,31 +1803,29 @@ int cmGlobalGenerator::Build(int jobs, const std::string& /*unused*/,
std::string outputBuffer;
std::string* outputPtr = &outputBuffer;
- std::vector<std::string> makeCommand;
+ GeneratedMakeCommand makeCommand;
this->GenerateBuildCommand(makeCommand, makeCommandCSTR, projectName, bindir,
target, config, fast, jobs, verbose,
nativeOptions);
- // Workaround to convince VCExpress.exe to produce output.
+ // Workaround to convince some commands to produce output.
if (outputflag == cmSystemTools::OUTPUT_PASSTHROUGH &&
- !makeCommand.empty() &&
- cmSystemTools::LowerCase(
- cmSystemTools::GetFilenameName(makeCommand[0])) == "vcexpress.exe") {
+ makeCommand.RequiresOutputForward) {
outputflag = cmSystemTools::OUTPUT_FORWARD;
}
// should we do a clean first?
if (clean) {
- std::vector<std::string> cleanCommand;
+ GeneratedMakeCommand cleanCommand;
this->GenerateBuildCommand(cleanCommand, makeCommandCSTR, projectName,
bindir, "clean", config, fast, jobs, verbose);
output += "\nRun Clean Command:";
- output += cmSystemTools::PrintSingleCommand(cleanCommand);
+ output += cleanCommand.printable();
output += "\n";
- if (!cmSystemTools::RunSingleCommand(cleanCommand, outputPtr, outputPtr,
- &retVal, nullptr, outputflag,
- timeout)) {
+ if (!cmSystemTools::RunSingleCommand(cleanCommand.PrimaryCommand,
+ outputPtr, outputPtr, &retVal,
+ nullptr, outputflag, timeout)) {
cmSystemTools::SetRunCommandHideConsole(hideconsole);
cmSystemTools::Error("Generator: execution of make clean failed.");
output += *outputPtr;
@@ -1841,13 +1837,13 @@ int cmGlobalGenerator::Build(int jobs, const std::string& /*unused*/,
}
// now build
- std::string makeCommandStr = cmSystemTools::PrintSingleCommand(makeCommand);
- output += "\nRun Build Command:";
+ std::string makeCommandStr = makeCommand.printable();
+ output += "\nRun Build Command(s):";
output += makeCommandStr;
output += "\n";
- if (!cmSystemTools::RunSingleCommand(makeCommand, outputPtr, outputPtr,
- &retVal, nullptr, outputflag,
+ if (!cmSystemTools::RunSingleCommand(makeCommand.PrimaryCommand, outputPtr,
+ outputPtr, &retVal, nullptr, outputflag,
timeout)) {
cmSystemTools::SetRunCommandHideConsole(hideconsole);
cmSystemTools::Error(
@@ -2794,8 +2790,9 @@ void cmGlobalGenerator::AddRuleHash(const std::vector<std::string>& outputs,
}
// Shorten the output name (in expected use case).
- cmOutputConverter converter(this->GetMakefiles()[0]->GetStateSnapshot());
- std::string fname = converter.ConvertToRelativePath(
+ cmStateDirectory cmDir =
+ this->GetMakefiles()[0]->GetStateSnapshot().GetDirectory();
+ std::string fname = cmDir.ConvertToRelPathIfNotContained(
this->GetMakefiles()[0]->GetState()->GetBinaryDirectory(), outputs[0]);
// Associate the hash with this output.
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 84ec7a9d1f..ac013268ce 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -41,6 +41,54 @@ class cmSourceFile;
class cmStateDirectory;
class cmake;
+namespace detail {
+inline void AppendStrs(std::vector<std::string>&)
+{
+}
+template <typename T, typename... Ts>
+inline void AppendStrs(std::vector<std::string>& command, T&& s, Ts&&... ts)
+{
+ command.emplace_back(std::forward<T>(s));
+ AppendStrs(command, std::forward<Ts>(ts)...);
+}
+
+struct GeneratedMakeCommand
+{
+ // Add each argument as a separate element to the vector
+ template <typename... T>
+ void add(T&&... args)
+ {
+ // iterate the args and append each one
+ AppendStrs(PrimaryCommand, std::forward<T>(args)...);
+ }
+
+ // Add each value in the iterators as a separate element to the vector
+ void add(std::vector<std::string>::const_iterator start,
+ std::vector<std::string>::const_iterator end)
+ {
+ PrimaryCommand.insert(PrimaryCommand.end(), start, end);
+ }
+
+ std::string printable() const
+ {
+ std::size_t size = PrimaryCommand.size();
+ for (auto&& i : PrimaryCommand) {
+ size += i.size();
+ }
+ std::string buffer;
+ buffer.reserve(size);
+ for (auto&& i : PrimaryCommand) {
+ buffer.append(i);
+ buffer.append(1, ' ');
+ }
+ return buffer;
+ }
+
+ std::vector<std::string> PrimaryCommand;
+ bool RequiresOutputForward = false;
+};
+}
+
/** \class cmGlobalGenerator
* \brief Responsible for overseeing the generation process for the entire tree
*
@@ -182,8 +230,12 @@ public:
virtual bool Open(const std::string& bindir, const std::string& projectName,
bool dryRun);
+ struct GeneratedMakeCommand final : public detail::GeneratedMakeCommand
+ {
+ };
+
virtual void GenerateBuildCommand(
- std::vector<std::string>& makeCommand, const std::string& makeProgram,
+ GeneratedMakeCommand& makeCommand, const std::string& makeProgram,
const std::string& projectName, const std::string& projectDir,
const std::string& targetName, const std::string& config, bool fast,
int jobs, bool verbose,
@@ -481,7 +533,6 @@ protected:
std::vector<std::string> Depends;
std::string WorkingDir;
bool UsesTerminal = false;
- GlobalTargetInfo() {}
};
void CreateDefaultGlobalTargets(std::vector<GlobalTargetInfo>& targets);
@@ -610,7 +661,6 @@ private:
long LastDiskTime = -1;
std::set<std::string> All;
std::set<std::string> Generated;
- DirectoryContent() {}
};
std::map<std::string, DirectoryContent> DirectoryContentMap;
diff --git a/Source/cmGlobalGeneratorFactory.h b/Source/cmGlobalGeneratorFactory.h
index d4f772b245..bb5f74cca3 100644
--- a/Source/cmGlobalGeneratorFactory.h
+++ b/Source/cmGlobalGeneratorFactory.h
@@ -20,7 +20,7 @@ struct cmDocumentationEntry;
class cmGlobalGeneratorFactory
{
public:
- virtual ~cmGlobalGeneratorFactory() {}
+ virtual ~cmGlobalGeneratorFactory() = default;
/** Create a GlobalGenerator */
virtual cmGlobalGenerator* CreateGlobalGenerator(const std::string& n,
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index 7963c8a7ed..45fa0529fa 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -70,7 +70,7 @@ bool cmGlobalGhsMultiGenerator::SetGeneratorToolset(std::string const& ts,
"Green Hills MULTI: -T <toolset> not specified; defaulting to \"";
message += tsp;
message += "\"";
- cmSystemTools::Message(message.c_str());
+ cmSystemTools::Message(message);
/* store the full toolset for later use
* -- already done if -T<toolset> was specified
@@ -297,7 +297,7 @@ void cmGlobalGhsMultiGenerator::WriteSubProjects(
if (projName && projType) {
cmLocalGenerator* lg = target->GetLocalGenerator();
std::string dir = lg->GetCurrentBinaryDirectory();
- dir = root->ConvertToRelativePath(rootBinaryDir, dir.c_str());
+ dir = root->MaybeConvertToRelativePath(rootBinaryDir, dir.c_str());
if (dir == ".") {
dir.clear();
} else {
@@ -370,25 +370,23 @@ void cmGlobalGhsMultiGenerator::OutputTopLevelProject(
}
void cmGlobalGhsMultiGenerator::GenerateBuildCommand(
- std::vector<std::string>& makeCommand, const std::string& makeProgram,
+ GeneratedMakeCommand& makeCommand, const std::string& makeProgram,
const std::string& projectName, const std::string& projectDir,
const std::string& targetName, const std::string& /*config*/, bool /*fast*/,
int jobs, bool /*verbose*/, std::vector<std::string> const& makeOptions)
{
const char* gbuild =
this->CMakeInstance->GetCacheDefinition("CMAKE_MAKE_PROGRAM");
- makeCommand.push_back(
- this->SelectMakeProgram(makeProgram, (std::string)gbuild));
+ makeCommand.add(this->SelectMakeProgram(makeProgram, (std::string)gbuild));
if (jobs != cmake::NO_BUILD_PARALLEL_LEVEL) {
- makeCommand.push_back("-parallel");
+ makeCommand.add("-parallel");
if (jobs != cmake::DEFAULT_BUILD_PARALLEL_LEVEL) {
- makeCommand.push_back(std::to_string(jobs));
+ makeCommand.add(std::to_string(jobs));
}
}
- makeCommand.insert(makeCommand.end(), makeOptions.begin(),
- makeOptions.end());
+ makeCommand.add(makeOptions.begin(), makeOptions.end());
/* determine which top-project file to use */
std::string proj = projectName + ".top" + FILE_EXTENSION;
@@ -401,16 +399,15 @@ void cmGlobalGhsMultiGenerator::GenerateBuildCommand(
}
}
- makeCommand.push_back("-top");
- makeCommand.push_back(proj);
+ makeCommand.add("-top", proj);
if (!targetName.empty()) {
if (targetName == "clean") {
- makeCommand.push_back("-clean");
+ makeCommand.add("-clean");
} else {
if (targetName.compare(targetName.size() - 4, 4, ".gpj") == 0) {
- makeCommand.push_back(targetName);
+ makeCommand.add(targetName);
} else {
- makeCommand.push_back(targetName + ".gpj");
+ makeCommand.add(targetName + ".gpj");
}
}
}
diff --git a/Source/cmGlobalGhsMultiGenerator.h b/Source/cmGlobalGhsMultiGenerator.h
index 9332567064..bc2b199a00 100644
--- a/Source/cmGlobalGhsMultiGenerator.h
+++ b/Source/cmGlobalGhsMultiGenerator.h
@@ -88,7 +88,7 @@ public:
protected:
void Generate() override;
- void GenerateBuildCommand(std::vector<std::string>& makeCommand,
+ void GenerateBuildCommand(GeneratedMakeCommand& makeCommand,
const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
diff --git a/Source/cmGlobalJOMMakefileGenerator.cxx b/Source/cmGlobalJOMMakefileGenerator.cxx
index 9c805a8381..2b7f486955 100644
--- a/Source/cmGlobalJOMMakefileGenerator.cxx
+++ b/Source/cmGlobalJOMMakefileGenerator.cxx
@@ -55,7 +55,7 @@ void cmGlobalJOMMakefileGenerator::PrintCompilerAdvice(
}
void cmGlobalJOMMakefileGenerator::GenerateBuildCommand(
- std::vector<std::string>& makeCommand, const std::string& makeProgram,
+ GeneratedMakeCommand& makeCommand, const std::string& makeProgram,
const std::string& projectName, const std::string& projectDir,
const std::string& targetName, const std::string& config, bool fast,
int jobs, bool verbose, std::vector<std::string> const& makeOptions)
diff --git a/Source/cmGlobalJOMMakefileGenerator.h b/Source/cmGlobalJOMMakefileGenerator.h
index bcf46d0316..aa8b5fbb02 100644
--- a/Source/cmGlobalJOMMakefileGenerator.h
+++ b/Source/cmGlobalJOMMakefileGenerator.h
@@ -40,7 +40,7 @@ public:
bool optional) override;
protected:
- void GenerateBuildCommand(std::vector<std::string>& makeCommand,
+ void GenerateBuildCommand(GeneratedMakeCommand& makeCommand,
const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
diff --git a/Source/cmGlobalNMakeMakefileGenerator.cxx b/Source/cmGlobalNMakeMakefileGenerator.cxx
index 5235be732b..ffe95f905c 100644
--- a/Source/cmGlobalNMakeMakefileGenerator.cxx
+++ b/Source/cmGlobalNMakeMakefileGenerator.cxx
@@ -55,7 +55,7 @@ void cmGlobalNMakeMakefileGenerator::PrintCompilerAdvice(
}
void cmGlobalNMakeMakefileGenerator::GenerateBuildCommand(
- std::vector<std::string>& makeCommand, const std::string& makeProgram,
+ GeneratedMakeCommand& makeCommand, const std::string& makeProgram,
const std::string& projectName, const std::string& projectDir,
const std::string& targetName, const std::string& config, bool fast,
int /*jobs*/, bool verbose, std::vector<std::string> const& makeOptions)
diff --git a/Source/cmGlobalNMakeMakefileGenerator.h b/Source/cmGlobalNMakeMakefileGenerator.h
index 62dea6ebc1..06c48e22ba 100644
--- a/Source/cmGlobalNMakeMakefileGenerator.h
+++ b/Source/cmGlobalNMakeMakefileGenerator.h
@@ -45,7 +45,7 @@ public:
bool optional) override;
protected:
- void GenerateBuildCommand(std::vector<std::string>& makeCommand,
+ void GenerateBuildCommand(GeneratedMakeCommand& makeCommand,
const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 23dbd76b2a..920f6393c9 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -454,6 +454,7 @@ cmGlobalNinjaGenerator::cmGlobalNinjaGenerator(cmake* cm)
, NinjaSupportsConsolePool(false)
, NinjaSupportsImplicitOuts(false)
, NinjaSupportsManifestRestat(false)
+ , NinjaSupportsMultilineDepfile(false)
, NinjaSupportsDyndeps(0)
{
#ifdef _WIN32
@@ -581,6 +582,9 @@ void cmGlobalNinjaGenerator::CheckNinjaFeatures()
this->NinjaSupportsManifestRestat = !cmSystemTools::VersionCompare(
cmSystemTools::OP_LESS, this->NinjaVersion.c_str(),
RequiredNinjaVersionForManifestRestat().c_str());
+ this->NinjaSupportsMultilineDepfile = !cmSystemTools::VersionCompare(
+ cmSystemTools::OP_LESS, this->NinjaVersion.c_str(),
+ RequiredNinjaVersionForMultilineDepfile().c_str());
{
// Our ninja branch adds ".dyndep-#" to its version number,
// where '#' is a feature-specific version number. Extract it.
@@ -673,31 +677,28 @@ void cmGlobalNinjaGenerator::EnableLanguage(
// Called by:
// cmGlobalGenerator::Build()
void cmGlobalNinjaGenerator::GenerateBuildCommand(
- std::vector<std::string>& makeCommand, const std::string& makeProgram,
+ GeneratedMakeCommand& makeCommand, const std::string& makeProgram,
const std::string& /*projectName*/, const std::string& /*projectDir*/,
const std::string& targetName, const std::string& /*config*/, bool /*fast*/,
int jobs, bool verbose, std::vector<std::string> const& makeOptions)
{
- makeCommand.push_back(this->SelectMakeProgram(makeProgram));
+ makeCommand.add(this->SelectMakeProgram(makeProgram));
if (verbose) {
- makeCommand.emplace_back("-v");
+ makeCommand.add("-v");
}
if ((jobs != cmake::NO_BUILD_PARALLEL_LEVEL) &&
(jobs != cmake::DEFAULT_BUILD_PARALLEL_LEVEL)) {
- makeCommand.emplace_back("-j");
- makeCommand.push_back(std::to_string(jobs));
+ makeCommand.add("-j", std::to_string(jobs));
}
- makeCommand.insert(makeCommand.end(), makeOptions.begin(),
- makeOptions.end());
+ makeCommand.add(makeOptions.begin(), makeOptions.end());
if (!targetName.empty()) {
if (targetName == "clean") {
- makeCommand.emplace_back("-t");
- makeCommand.emplace_back("clean");
+ makeCommand.add("-t", "clean");
} else {
- makeCommand.push_back(targetName);
+ makeCommand.add(targetName);
}
}
}
@@ -861,7 +862,7 @@ std::string const& cmGlobalNinjaGenerator::ConvertToNinjaPath(
cmLocalNinjaGenerator* ng =
static_cast<cmLocalNinjaGenerator*>(this->LocalGenerators[0]);
std::string const& bin_dir = ng->GetState()->GetBinaryDirectory();
- std::string convPath = ng->ConvertToRelativePath(bin_dir, path);
+ std::string convPath = ng->MaybeConvertToRelativePath(bin_dir, path);
convPath = this->NinjaOutputPath(convPath);
#ifdef _WIN32
std::replace(convPath.begin(), convPath.end(), '/', '\\');
@@ -1481,6 +1482,11 @@ bool cmGlobalNinjaGenerator::SupportsManifestRestat() const
return this->NinjaSupportsManifestRestat;
}
+bool cmGlobalNinjaGenerator::SupportsMultilineDepfile() const
+{
+ return this->NinjaSupportsMultilineDepfile;
+}
+
void cmGlobalNinjaGenerator::WriteTargetClean(std::ostream& os)
{
WriteRule(*this->RulesFileStream, "CLEAN", ninjaCmd() + " -t clean",
@@ -1673,6 +1679,7 @@ int cmcmd_cmake_ninja_depends(std::vector<std::string>::const_iterator argBeg,
return 1;
}
+ cmFortranCompiler fc;
std::vector<std::string> includes;
{
Json::Value tdio;
@@ -1694,11 +1701,20 @@ int cmcmd_cmake_ninja_depends(std::vector<std::string>::const_iterator argBeg,
includes.push_back(tdi_include_dir.asString());
}
}
+
+ Json::Value const& tdi_compiler_id = tdi["compiler-id"];
+ fc.Id = tdi_compiler_id.asString();
+
+ Json::Value const& tdi_submodule_sep = tdi["submodule-sep"];
+ fc.SModSep = tdi_submodule_sep.asString();
+
+ Json::Value const& tdi_submodule_ext = tdi["submodule-ext"];
+ fc.SModExt = tdi_submodule_ext.asString();
}
cmFortranSourceInfo info;
std::set<std::string> defines;
- cmFortranParser parser(includes, defines, info);
+ cmFortranParser parser(fc, includes, defines, info);
if (!cmFortranParser_FilePush(&parser, arg_pp.c_str())) {
cmSystemTools::Error("-E cmake_ninja_depends failed to open ",
arg_pp.c_str());
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index f1ab8522b1..c619e672f6 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -183,8 +183,6 @@ public:
return new cmGlobalGeneratorSimpleFactory<cmGlobalNinjaGenerator>();
}
- ~cmGlobalNinjaGenerator() override {}
-
cmLocalGenerator* CreateLocalGenerator(cmMakefile* mf) override;
std::string GetName() const override
@@ -202,7 +200,7 @@ public:
void EnableLanguage(std::vector<std::string> const& languages,
cmMakefile* mf, bool optional) override;
- void GenerateBuildCommand(std::vector<std::string>& makeCommand,
+ void GenerateBuildCommand(GeneratedMakeCommand& makeCommand,
const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
@@ -347,9 +345,14 @@ public:
static std::string RequiredNinjaVersionForConsolePool() { return "1.5"; }
static std::string RequiredNinjaVersionForImplicitOuts() { return "1.7"; }
static std::string RequiredNinjaVersionForManifestRestat() { return "1.8"; }
+ static std::string RequiredNinjaVersionForMultilineDepfile()
+ {
+ return "1.9";
+ }
bool SupportsConsolePool() const;
bool SupportsImplicitOuts() const;
bool SupportsManifestRestat() const;
+ bool SupportsMultilineDepfile() const;
std::string NinjaOutputPath(std::string const& path) const;
bool HasOutputPathPrefix() const { return !this->OutputPathPrefix.empty(); }
@@ -463,6 +466,7 @@ private:
bool NinjaSupportsConsolePool;
bool NinjaSupportsImplicitOuts;
bool NinjaSupportsManifestRestat;
+ bool NinjaSupportsMultilineDepfile;
unsigned long NinjaSupportsDyndeps;
private:
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 792adc0071..dac6ea606f 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -325,7 +325,8 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
<< "set(CMAKE_MAKEFILE_DEPENDS\n"
<< " \"CMakeCache.txt\"\n";
for (std::string const& f : lfiles) {
- cmakefileStream << " \"" << lg->ConvertToRelativePath(currentBinDir, f)
+ cmakefileStream << " \""
+ << lg->MaybeConvertToRelativePath(currentBinDir, f)
<< "\"\n";
}
cmakefileStream << " )\n\n";
@@ -339,9 +340,11 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
cmakefileStream << "# The corresponding makefile is:\n"
<< "set(CMAKE_MAKEFILE_OUTPUTS\n"
<< " \""
- << lg->ConvertToRelativePath(currentBinDir, makefileName)
+ << lg->MaybeConvertToRelativePath(currentBinDir,
+ makefileName)
<< "\"\n"
- << " \"" << lg->ConvertToRelativePath(currentBinDir, check)
+ << " \""
+ << lg->MaybeConvertToRelativePath(currentBinDir, check)
<< "\"\n";
cmakefileStream << " )\n\n";
@@ -354,7 +357,8 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
const std::vector<std::string>& outfiles =
lg->GetMakefile()->GetOutputFiles();
for (std::string const& outfile : outfiles) {
- cmakefileStream << " \"" << lg->ConvertToRelativePath(binDir, outfile)
+ cmakefileStream << " \""
+ << lg->MaybeConvertToRelativePath(binDir, outfile)
<< "\"\n";
}
@@ -365,7 +369,8 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
tmpStr = lg->GetCurrentBinaryDirectory();
tmpStr += "/CMakeFiles";
tmpStr += "/CMakeDirectoryInformation.cmake";
- cmakefileStream << " \"" << lg->ConvertToRelativePath(binDir, tmpStr)
+ cmakefileStream << " \""
+ << lg->MaybeConvertToRelativePath(binDir, tmpStr)
<< "\"\n";
}
cmakefileStream << " )\n\n";
@@ -474,7 +479,7 @@ void cmGlobalUnixMakefileGenerator3::WriteDirectoryRules2(
// Begin the directory-level rules section.
std::string dir =
- cmSystemTools::ConvertToOutputPath(lg->ConvertToRelativePath(
+ cmSystemTools::ConvertToOutputPath(lg->MaybeConvertToRelativePath(
lg->GetBinaryDirectory(), lg->GetCurrentBinaryDirectory()));
lg->WriteDivider(ruleFileStream);
ruleFileStream << "# Directory level rules for directory " << dir << "\n\n";
@@ -490,10 +495,10 @@ void cmGlobalUnixMakefileGenerator3::WriteDirectoryRules2(
}
void cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
- std::vector<std::string>& makeCommand, const std::string& makeProgram,
+ GeneratedMakeCommand& makeCommand, const std::string& makeProgram,
const std::string& /*projectName*/, const std::string& /*projectDir*/,
const std::string& targetName, const std::string& /*config*/, bool fast,
- int jobs, bool /*verbose*/, std::vector<std::string> const& makeOptions)
+ int jobs, bool verbose, std::vector<std::string> const& makeOptions)
{
std::unique_ptr<cmMakefile> mfu;
cmMakefile* mf;
@@ -510,27 +515,33 @@ void cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
mf = mfu.get();
}
- makeCommand.push_back(this->SelectMakeProgram(makeProgram));
+ // Make it possible to set verbosity also from command line
+ if (verbose) {
+ makeCommand.add(cmSystemTools::GetCMakeCommand());
+ makeCommand.add("-E");
+ makeCommand.add("env");
+ makeCommand.add("VERBOSE=1");
+ }
+ makeCommand.add(this->SelectMakeProgram(makeProgram));
if (jobs != cmake::NO_BUILD_PARALLEL_LEVEL) {
- makeCommand.emplace_back("-j");
+ makeCommand.add("-j");
if (jobs != cmake::DEFAULT_BUILD_PARALLEL_LEVEL) {
- makeCommand.push_back(std::to_string(jobs));
+ makeCommand.add(std::to_string(jobs));
}
}
- makeCommand.insert(makeCommand.end(), makeOptions.begin(),
- makeOptions.end());
+ makeCommand.add(makeOptions.begin(), makeOptions.end());
if (!targetName.empty()) {
std::string tname = targetName;
if (fast) {
tname += "/fast";
}
- cmOutputConverter conv(mf->GetStateSnapshot());
tname =
- conv.ConvertToRelativePath(mf->GetState()->GetBinaryDirectory(), tname);
+ mf->GetStateSnapshot().GetDirectory().ConvertToRelPathIfNotContained(
+ mf->GetState()->GetBinaryDirectory(), tname);
cmSystemTools::ConvertToOutputSlashes(tname);
- makeCommand.push_back(std::move(tname));
+ makeCommand.add(std::move(tname));
}
}
diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h
index 6199586476..8a80acc057 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.h
+++ b/Source/cmGlobalUnixMakefileGenerator3.h
@@ -127,7 +127,7 @@ public:
std::string GetEmptyRuleHackDepends() { return this->EmptyRuleHackDepends; }
// change the build command for speed
- void GenerateBuildCommand(std::vector<std::string>& makeCommand,
+ void GenerateBuildCommand(GeneratedMakeCommand& makeCommand,
const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
@@ -217,7 +217,6 @@ protected:
// Store per-target progress counters.
struct TargetProgress
{
- TargetProgress() {}
unsigned long NumberOfActions = 0;
std::string VariableFile;
std::vector<unsigned long> Marks;
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 9a8014cc13..d8b2e892cb 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -607,10 +607,26 @@ cmGlobalVisualStudio10Generator::GetPlatformToolsetVersionString() const
const char*
cmGlobalVisualStudio10Generator::GetPlatformToolsetHostArchitecture() const
{
+ std::string const& hostArch =
+ this->GetPlatformToolsetHostArchitectureString();
+ if (hostArch.empty()) {
+ return nullptr;
+ }
+ return hostArch.c_str();
+}
+
+std::string const&
+cmGlobalVisualStudio10Generator::GetPlatformToolsetHostArchitectureString()
+ const
+{
if (!this->GeneratorToolsetHostArchitecture.empty()) {
- return this->GeneratorToolsetHostArchitecture.c_str();
+ return this->GeneratorToolsetHostArchitecture;
}
- return nullptr;
+ if (!this->DefaultPlatformToolsetHostArchitecture.empty()) {
+ return this->DefaultPlatformToolsetHostArchitecture;
+ }
+ static std::string const empty;
+ return empty;
}
const char* cmGlobalVisualStudio10Generator::GetPlatformToolsetCuda() const
@@ -786,10 +802,9 @@ bool cmGlobalVisualStudio10Generator::FindVCTargetsPath(cmMakefile* mf)
}
cmXMLElement(eprj, "Import")
.Attribute("Project", "$(VCTargetsPath)\\Microsoft.Cpp.Default.props");
- if (!this->GeneratorToolsetHostArchitecture.empty()) {
+ if (const char* hostArch = this->GetPlatformToolsetHostArchitecture()) {
cmXMLElement epg(eprj, "PropertyGroup");
- cmXMLElement(epg, "PreferredToolArchitecture")
- .Content(this->GeneratorToolsetHostArchitecture);
+ cmXMLElement(epg, "PreferredToolArchitecture").Content(hostArch);
}
{
cmXMLElement epg(eprj, "PropertyGroup");
@@ -864,7 +879,7 @@ bool cmGlobalVisualStudio10Generator::FindVCTargetsPath(cmMakefile* mf)
}
void cmGlobalVisualStudio10Generator::GenerateBuildCommand(
- std::vector<std::string>& makeCommand, const std::string& makeProgram,
+ GeneratedMakeCommand& makeCommand, const std::string& makeProgram,
const std::string& projectName, const std::string& projectDir,
const std::string& targetName, const std::string& config, bool fast,
int jobs, bool verbose, std::vector<std::string> const& makeOptions)
@@ -879,6 +894,10 @@ void cmGlobalVisualStudio10Generator::GenerateBuildCommand(
bool useDevEnv = (makeProgramLower.find("devenv") != std::string::npos ||
makeProgramLower.find("vcexpress") != std::string::npos);
+ // Workaround to convince VCExpress.exe to produce output.
+ makeCommand.RequiresOutputForward =
+ (makeProgramLower.find("vcexpress") != std::string::npos);
+
// MSBuild is preferred (and required for VS Express), but if the .sln has
// an Intel Fortran .vfproj then we have to use devenv. Parse it to find out.
cmSlnData slnData;
@@ -912,7 +931,7 @@ void cmGlobalVisualStudio10Generator::GenerateBuildCommand(
return;
}
- makeCommand.push_back(makeProgramSelected);
+ makeCommand.add(makeProgramSelected);
std::string realTarget = targetName;
// msbuild.exe CxxOnly.sln /t:Build /p:Configuration=Debug /target:ALL_BUILD
@@ -921,8 +940,8 @@ void cmGlobalVisualStudio10Generator::GenerateBuildCommand(
realTarget = "ALL_BUILD";
}
if (realTarget == "clean") {
- makeCommand.push_back(std::string(projectName) + ".sln");
- makeCommand.push_back("/t:Clean");
+ makeCommand.add(std::string(projectName) + ".sln");
+ makeCommand.add("/t:Clean");
} else {
std::string targetProject(realTarget);
targetProject += ".vcxproj";
@@ -934,7 +953,7 @@ void cmGlobalVisualStudio10Generator::GenerateBuildCommand(
cmSystemTools::ConvertToUnixSlashes(targetProject);
}
}
- makeCommand.push_back(targetProject);
+ makeCommand.add(std::move(targetProject));
}
std::string configArg = "/p:Configuration=";
if (!config.empty()) {
@@ -942,23 +961,26 @@ void cmGlobalVisualStudio10Generator::GenerateBuildCommand(
} else {
configArg += "Debug";
}
- makeCommand.push_back(configArg);
- makeCommand.push_back("/p:Platform=" + this->GetPlatformName());
- makeCommand.push_back(std::string("/p:VisualStudioVersion=") +
- this->GetIDEVersion());
+ makeCommand.add(configArg);
+ makeCommand.add(std::string("/p:Platform=") + this->GetPlatformName());
+ makeCommand.add(std::string("/p:VisualStudioVersion=") +
+ this->GetIDEVersion());
if (jobs != cmake::NO_BUILD_PARALLEL_LEVEL) {
if (jobs == cmake::DEFAULT_BUILD_PARALLEL_LEVEL) {
- makeCommand.push_back("/m");
+ makeCommand.add("/m");
} else {
- makeCommand.push_back(std::string("/m:") + std::to_string(jobs));
+ makeCommand.add(std::string("/m:") + std::to_string(jobs));
}
// Having msbuild.exe and cl.exe using multiple jobs is discouraged
- makeCommand.push_back("/p:CL_MPCount=1");
+ makeCommand.add("/p:CL_MPCount=1");
}
- makeCommand.insert(makeCommand.end(), makeOptions.begin(),
- makeOptions.end());
+ // Respect the verbosity: 'n' normal will show build commands
+ // 'm' minimal only the build step's title
+ makeCommand.add(std::string("/v:") + ((verbose) ? "n" : "m"));
+
+ makeCommand.add(makeOptions.begin(), makeOptions.end());
}
bool cmGlobalVisualStudio10Generator::Find64BitTools(cmMakefile* mf)
@@ -1114,6 +1136,8 @@ static unsigned int cmLoadFlagTableSpecial(Json::Value entry,
value |= cmIDEFlagTable::CaseInsensitive;
} else if (s == "SpaceAppendable") {
value |= cmIDEFlagTable::SpaceAppendable;
+ } else if (s == "CommaAppendable") {
+ value |= cmIDEFlagTable::CommaAppendable;
}
}
}
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index 7c8918ac98..3ef7abfd05 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -22,7 +22,7 @@ public:
bool SetGeneratorPlatform(std::string const& p, cmMakefile* mf) override;
bool SetGeneratorToolset(std::string const& ts, cmMakefile* mf) override;
- void GenerateBuildCommand(std::vector<std::string>& makeCommand,
+ void GenerateBuildCommand(GeneratedMakeCommand& makeCommand,
const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
@@ -58,6 +58,7 @@ public:
/** The toolset host architecture name (e.g. x64 for 64-bit host tools). */
const char* GetPlatformToolsetHostArchitecture() const;
+ std::string const& GetPlatformToolsetHostArchitectureString() const;
/** The cuda toolset version. */
const char* GetPlatformToolsetCuda() const;
@@ -152,6 +153,7 @@ protected:
std::string GeneratorToolsetHostArchitecture;
std::string GeneratorToolsetCuda;
std::string DefaultPlatformToolset;
+ std::string DefaultPlatformToolsetHostArchitecture;
std::string WindowsTargetPlatformVersion;
std::string SystemName;
std::string SystemVersion;
diff --git a/Source/cmGlobalVisualStudio12Generator.cxx b/Source/cmGlobalVisualStudio12Generator.cxx
index 8b50684cde..d9702c9eed 100644
--- a/Source/cmGlobalVisualStudio12Generator.cxx
+++ b/Source/cmGlobalVisualStudio12Generator.cxx
@@ -126,8 +126,8 @@ bool cmGlobalVisualStudio12Generator::MatchesGeneratorName(
bool cmGlobalVisualStudio12Generator::ProcessGeneratorToolsetField(
std::string const& key, std::string const& value)
{
- if (key == "host" && value == "x64") {
- this->GeneratorToolsetHostArchitecture = "x64";
+ if (key == "host" && (value == "x64" || value == "x86")) {
+ this->GeneratorToolsetHostArchitecture = value;
return true;
}
return this->cmGlobalVisualStudio11Generator::ProcessGeneratorToolsetField(
diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx
index a0a955861c..20258678a9 100644
--- a/Source/cmGlobalVisualStudio14Generator.cxx
+++ b/Source/cmGlobalVisualStudio14Generator.cxx
@@ -158,14 +158,22 @@ bool cmGlobalVisualStudio14Generator::SelectWindows10SDK(cmMakefile* mf,
bool required)
{
// Find the default version of the Windows 10 SDK.
- this->WindowsTargetPlatformVersion = this->GetWindows10SDKVersion();
- if (required && this->WindowsTargetPlatformVersion.empty()) {
+ std::string const version = this->GetWindows10SDKVersion();
+ if (required && version.empty()) {
std::ostringstream e;
e << "Could not find an appropriate version of the Windows 10 SDK"
<< " installed on this machine";
mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
return false;
}
+ this->SetWindowsTargetPlatformVersion(version, mf);
+ return true;
+}
+
+void cmGlobalVisualStudio14Generator::SetWindowsTargetPlatformVersion(
+ std::string const& version, cmMakefile* mf)
+{
+ this->WindowsTargetPlatformVersion = version;
if (!cmSystemTools::VersionCompareEqual(this->WindowsTargetPlatformVersion,
this->SystemVersion)) {
std::ostringstream e;
@@ -175,7 +183,6 @@ bool cmGlobalVisualStudio14Generator::SelectWindows10SDK(cmMakefile* mf,
}
mf->AddDefinition("CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION",
this->WindowsTargetPlatformVersion.c_str());
- return true;
}
bool cmGlobalVisualStudio14Generator::SelectWindowsStoreToolset(
diff --git a/Source/cmGlobalVisualStudio14Generator.h b/Source/cmGlobalVisualStudio14Generator.h
index 32008b096b..6e12d3e2c2 100644
--- a/Source/cmGlobalVisualStudio14Generator.h
+++ b/Source/cmGlobalVisualStudio14Generator.h
@@ -40,6 +40,9 @@ protected:
virtual bool SelectWindows10SDK(cmMakefile* mf, bool required);
+ void SetWindowsTargetPlatformVersion(std::string const& version,
+ cmMakefile* mf);
+
// Used to verify that the Desktop toolset for the current generator is
// installed on the machine.
bool IsWindowsDesktopToolsetInstalled() const override;
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index cae46e1d8c..d457f60d1e 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -191,7 +191,7 @@ const char* cmGlobalVisualStudio7Generator::ExternalProjectType(
return "8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942";
}
void cmGlobalVisualStudio7Generator::GenerateBuildCommand(
- std::vector<std::string>& makeCommand, const std::string& makeProgram,
+ GeneratedMakeCommand& makeCommand, const std::string& makeProgram,
const std::string& projectName, const std::string& /*projectDir*/,
const std::string& targetName, const std::string& config, bool /*fast*/,
int /*jobs*/, bool /*verbose*/, std::vector<std::string> const& makeOptions)
@@ -209,35 +209,25 @@ void cmGlobalVisualStudio7Generator::GenerateBuildCommand(
makeProgramSelected = this->GetDevEnvCommand();
}
- makeCommand.push_back(makeProgramSelected);
+ // Workaround to convince VCExpress.exe to produce output.
+ makeCommand.RequiresOutputForward =
+ (makeProgramLower.find("vcexpress") != std::string::npos);
- makeCommand.push_back(std::string(projectName) + ".sln");
+ makeCommand.add(makeProgramSelected);
+
+ makeCommand.add(std::string(projectName) + ".sln");
std::string realTarget = targetName;
bool clean = false;
if (realTarget == "clean") {
clean = true;
realTarget = "ALL_BUILD";
}
- if (clean) {
- makeCommand.push_back("/clean");
- } else {
- makeCommand.push_back("/build");
- }
-
- if (!config.empty()) {
- makeCommand.push_back(config);
- } else {
- makeCommand.push_back("Debug");
- }
- makeCommand.push_back("/project");
- if (!realTarget.empty()) {
- makeCommand.push_back(realTarget);
- } else {
- makeCommand.push_back("ALL_BUILD");
- }
- makeCommand.insert(makeCommand.end(), makeOptions.begin(),
- makeOptions.end());
+ makeCommand.add((clean ? "/clean" : "/build"));
+ makeCommand.add((config.empty() ? "Debug" : config));
+ makeCommand.add("/project");
+ makeCommand.add((realTarget.empty() ? "ALL_BUILD" : realTarget));
+ makeCommand.add(makeOptions.begin(), makeOptions.end());
}
///! Create a local generator appropriate to this Global Generator
@@ -367,7 +357,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
if (vcprojName) {
cmLocalGenerator* lg = target->GetLocalGenerator();
std::string dir = lg->GetCurrentBinaryDirectory();
- dir = root->ConvertToRelativePath(rootBinaryDir, dir.c_str());
+ dir = root->MaybeConvertToRelativePath(rootBinaryDir, dir.c_str());
if (dir == ".") {
dir.clear(); // msbuild cannot handle ".\" prefix
}
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index d2a2a38d2f..3f1c1732d1 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -52,7 +52,7 @@ public:
* Try running cmake and building a file. This is used for dynamically
* loaded commands, not as part of the usual build process.
*/
- void GenerateBuildCommand(std::vector<std::string>& makeCommand,
+ void GenerateBuildCommand(GeneratedMakeCommand& makeCommand,
const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index cbea3dda42..1922906b39 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -262,13 +262,12 @@ void cmGlobalVisualStudioGenerator::ConfigureCMakeVisualStudioMacros()
// purposes but newer versions distributed with CMake will replace
// older versions in user directories.
int res;
- if (!cmSystemTools::FileTimeCompare(src.c_str(), dst.c_str(), &res) ||
- res > 0) {
- if (!cmSystemTools::CopyFileAlways(src.c_str(), dst.c_str())) {
+ if (!cmSystemTools::FileTimeCompare(src, dst, &res) || res > 0) {
+ if (!cmSystemTools::CopyFileAlways(src, dst)) {
std::ostringstream oss;
oss << "Could not copy from: " << src << std::endl;
oss << " to: " << dst << std::endl;
- cmSystemTools::Message(oss.str().c_str(), "Warning");
+ cmSystemTools::Message(oss.str(), "Warning");
}
}
@@ -783,7 +782,7 @@ void RegisterVisualStudioMacros(const std::string& macrosFile,
<< "CMake needs to register Visual Studio macros when its macros"
<< " file is updated or when it detects that its current macros file"
<< " is no longer registered with Visual Studio." << std::endl;
- cmSystemTools::Message(oss.str().c_str(), "Warning");
+ cmSystemTools::Message(oss.str(), "Warning");
// Count them again now that the warning is over. In the case of a GUI
// warning, the user may have gone to close Visual Studio and then come
@@ -814,7 +813,6 @@ bool cmGlobalVisualStudioGenerator::TargetIsFortranOnly(
cmGeneratorTarget const* gt)
{
// check to see if this is a fortran build
- std::set<std::string> languages;
{
// Issue diagnostic if the source files depend on the config.
std::vector<cmSourceFile*> sources;
@@ -822,27 +820,21 @@ bool cmGlobalVisualStudioGenerator::TargetIsFortranOnly(
return false;
}
}
+
// If there's only one source language, Fortran has to be used
// in order for the sources to compile.
- // Note: Via linker propagation, LINKER_LANGUAGE could become CXX in
- // this situation and mismatch from the actual language of the linker.
+ std::set<std::string> languages;
gt->GetLanguages(languages, "");
- if (languages.size() == 1) {
- if (*languages.begin() == "Fortran") {
- return true;
- }
- }
-
- // In the case of mixed object files or sources mixed with objects,
- // decide the language based on the value of LINKER_LANGUAGE.
- // This will not make it possible to mix source files of different
- // languages, but object libraries will be linked together in the
- // same fashion as other generators do.
- if (gt->GetLinkerLanguage("") == "Fortran") {
- return true;
- }
-
- return false;
+ // Consider an explicit linker language property, but *not* the
+ // computed linker language that may depend on linked targets.
+ // This allows the project to control the language choice in
+ // a target with none of its own sources, e.g. when also using
+ // object libraries.
+ const char* linkLang = gt->GetProperty("LINKER_LANGUAGE");
+ if (linkLang && *linkLang) {
+ languages.insert(linkLang);
+ }
+ return languages.size() == 1 && *languages.begin() == "Fortran";
}
bool cmGlobalVisualStudioGenerator::TargetCompare::operator()(
diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
index 31f585c710..2f9eb3fbd0 100644
--- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx
+++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
@@ -10,11 +10,14 @@
#include "cmake.h"
#if defined(_M_ARM64)
-# define HOST_PLATFORM_NAME "ARM64";
+# define HOST_PLATFORM_NAME "ARM64"
+# define HOST_TOOLS_ARCH ""
#elif defined(_M_ARM)
-# define HOST_PLATFORM_NAME "ARM";
+# define HOST_PLATFORM_NAME "ARM"
+# define HOST_TOOLS_ARCH ""
#elif defined(_M_IA64)
-# define HOST_PLATFORM_NAME "Itanium";
+# define HOST_PLATFORM_NAME "Itanium"
+# define HOST_TOOLS_ARCH ""
#else
# include "cmsys/SystemInformation.hxx"
#endif
@@ -33,6 +36,20 @@ static std::string VSHostPlatformName()
#endif
}
+static std::string VSHostArchitecture()
+{
+#ifdef HOST_TOOLS_ARCH
+ return HOST_TOOLS_ARCH;
+#else
+ cmsys::SystemInformation info;
+ if (info.Is64Bits()) {
+ return "x64";
+ } else {
+ return "x86";
+ }
+#endif
+}
+
static unsigned int VSVersionToMajor(
cmGlobalVisualStudioGenerator::VSVersion v)
{
@@ -72,8 +89,7 @@ static const char* VSVersionToToolset(
case cmGlobalVisualStudioGenerator::VS15:
return "v141";
case cmGlobalVisualStudioGenerator::VS16:
- // FIXME: VS 2019 Preview 1.1 uses v141 but preview 2 will use v142.
- return "v141";
+ return "v142";
}
return "";
}
@@ -263,6 +279,7 @@ cmGlobalVisualStudioVersionedGenerator::cmGlobalVisualStudioVersionedGenerator(
this->DefaultLinkFlagTableName = VSVersionToToolset(this->Version);
if (this->Version >= cmGlobalVisualStudioGenerator::VS16) {
this->DefaultPlatformName = VSHostPlatformName();
+ this->DefaultPlatformToolsetHostArchitecture = VSHostArchitecture();
}
}
@@ -384,6 +401,12 @@ bool cmGlobalVisualStudioVersionedGenerator::InitializeWindows(cmMakefile* mf)
// If the Win 8.1 SDK is installed then we can select a SDK matching
// the target Windows version.
if (this->IsWin81SDKInstalled()) {
+ // VS 2019 does not default to 8.1 so specify it explicitly when needed.
+ if (this->Version >= cmGlobalVisualStudioGenerator::VS16 &&
+ !cmSystemTools::VersionCompareGreater(this->SystemVersion, "8.1")) {
+ this->SetWindowsTargetPlatformVersion("8.1", mf);
+ return true;
+ }
return cmGlobalVisualStudio14Generator::InitializeWindows(mf);
}
// Otherwise we must choose a Win 10 SDK even if we are not targeting
@@ -436,7 +459,8 @@ bool cmGlobalVisualStudioVersionedGenerator::IsWin81SDKInstalled() const
"HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\"
"Windows Kits\\Installed Roots;KitsRoot81",
win81Root, cmSystemTools::KeyWOW64_32)) {
- return cmSystemTools::FileExists(win81Root + "/um/windows.h", true);
+ return cmSystemTools::FileExists(win81Root + "/include/um/windows.h",
+ true);
}
return false;
}
@@ -454,6 +478,18 @@ std::string cmGlobalVisualStudioVersionedGenerator::FindMSBuildCommand()
// Ask Visual Studio Installer tool.
std::string vs;
if (vsSetupAPIHelper.GetVSInstanceInfo(vs)) {
+ std::string const& hostArch =
+ this->GetPlatformToolsetHostArchitectureString();
+ if (hostArch == "x64") {
+ msbuild = vs + "/MSBuild/Current/Bin/amd64/MSBuild.exe";
+ if (cmSystemTools::FileExists(msbuild)) {
+ return msbuild;
+ }
+ msbuild = vs + "/MSBuild/15.0/Bin/amd64/MSBuild.exe";
+ if (cmSystemTools::FileExists(msbuild)) {
+ return msbuild;
+ }
+ }
msbuild = vs + "/MSBuild/Current/Bin/MSBuild.exe";
if (cmSystemTools::FileExists(msbuild)) {
return msbuild;
diff --git a/Source/cmGlobalWatcomWMakeGenerator.cxx b/Source/cmGlobalWatcomWMakeGenerator.cxx
index 558ef15859..c02c4711aa 100644
--- a/Source/cmGlobalWatcomWMakeGenerator.cxx
+++ b/Source/cmGlobalWatcomWMakeGenerator.cxx
@@ -51,7 +51,7 @@ void cmGlobalWatcomWMakeGenerator::GetDocumentation(
}
void cmGlobalWatcomWMakeGenerator::GenerateBuildCommand(
- std::vector<std::string>& makeCommand, const std::string& makeProgram,
+ GeneratedMakeCommand& makeCommand, const std::string& makeProgram,
const std::string& projectName, const std::string& projectDir,
const std::string& targetName, const std::string& config, bool fast,
int /*jobs*/, bool verbose, std::vector<std::string> const& makeOptions)
diff --git a/Source/cmGlobalWatcomWMakeGenerator.h b/Source/cmGlobalWatcomWMakeGenerator.h
index 0d10d58f4e..6680b193f0 100644
--- a/Source/cmGlobalWatcomWMakeGenerator.h
+++ b/Source/cmGlobalWatcomWMakeGenerator.h
@@ -50,7 +50,7 @@ public:
bool AllowDeleteOnError() const override { return false; }
protected:
- void GenerateBuildCommand(std::vector<std::string>& makeCommand,
+ void GenerateBuildCommand(GeneratedMakeCommand& makeCommand,
const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 0d70a0e78a..51c001e753 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -339,20 +339,22 @@ bool cmGlobalXCodeGenerator::Open(const std::string& bindir,
}
void cmGlobalXCodeGenerator::GenerateBuildCommand(
- std::vector<std::string>& makeCommand, const std::string& makeProgram,
+ GeneratedMakeCommand& makeCommand, const std::string& makeProgram,
const std::string& projectName, const std::string& /*projectDir*/,
const std::string& targetName, const std::string& config, bool /*fast*/,
int jobs, bool /*verbose*/, std::vector<std::string> const& makeOptions)
{
// now build the test
- makeCommand.emplace_back(
+ makeCommand.add(
this->SelectMakeProgram(makeProgram, this->GetXcodeBuildCommand()));
- makeCommand.emplace_back("-project");
- std::string projectArg = projectName;
- projectArg += ".xcode";
- projectArg += "proj";
- makeCommand.emplace_back(projectArg);
+ if (!projectName.empty()) {
+ makeCommand.add("-project");
+ std::string projectArg = projectName;
+ projectArg += ".xcode";
+ projectArg += "proj";
+ makeCommand.add(projectArg);
+ }
bool clean = false;
std::string realTarget = targetName;
@@ -360,29 +362,22 @@ void cmGlobalXCodeGenerator::GenerateBuildCommand(
clean = true;
realTarget = "ALL_BUILD";
}
- if (clean) {
- makeCommand.emplace_back("clean");
- } else {
- makeCommand.emplace_back("build");
- }
- makeCommand.emplace_back("-target");
- if (!realTarget.empty()) {
- makeCommand.emplace_back(realTarget);
- } else {
- makeCommand.emplace_back("ALL_BUILD");
- }
- makeCommand.emplace_back("-configuration");
- makeCommand.emplace_back(!config.empty() ? config : "Debug");
+
+ makeCommand.add((clean ? "clean" : "build"));
+ makeCommand.add("-target", (realTarget.empty() ? "ALL_BUILD" : realTarget));
+ makeCommand.add("-configuration", (config.empty() ? "Debug" : config));
if (jobs != cmake::NO_BUILD_PARALLEL_LEVEL) {
- makeCommand.emplace_back("-jobs");
+ makeCommand.add("-jobs");
if (jobs != cmake::DEFAULT_BUILD_PARALLEL_LEVEL) {
- makeCommand.emplace_back(std::to_string(jobs));
+ makeCommand.add(std::to_string(jobs));
}
}
- makeCommand.insert(makeCommand.end(), makeOptions.begin(),
- makeOptions.end());
+ if (this->XcodeVersion >= 70) {
+ makeCommand.add("-hideShellScriptEnvironment");
+ }
+ makeCommand.add(makeOptions.begin(), makeOptions.end());
}
///! Create a local generator appropriate to this Global Generator
@@ -490,6 +485,7 @@ std::string cmGlobalXCodeGenerator::PostBuildMakeTarget(
}
#define CMAKE_CHECK_BUILD_SYSTEM_TARGET "ZERO_CHECK"
+#define OBJECT_LIBRARY_ARTIFACT_DIR std::string()
void cmGlobalXCodeGenerator::AddExtraTargets(
cmLocalGenerator* root, std::vector<cmLocalGenerator*>& gens)
@@ -514,6 +510,7 @@ void cmGlobalXCodeGenerator::AddExtraTargets(
makeHelper.push_back(dir);
makeHelper.push_back("-f");
makeHelper.push_back(this->CurrentXCodeHackMakefile);
+ makeHelper.push_back("OBJDIR=$(OBJDIR)");
makeHelper.push_back(""); // placeholder, see below
// Add ZERO_CHECK
@@ -757,8 +754,6 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeSourceFileFromPath(
class XCodeGeneratorExpressionInterpreter
: public cmGeneratorExpressionInterpreter
{
- CM_DISABLE_COPY(XCodeGeneratorExpressionInterpreter)
-
public:
XCodeGeneratorExpressionInterpreter(cmSourceFile* sourceFile,
cmLocalGenerator* localGenerator,
@@ -770,6 +765,11 @@ public:
{
}
+ XCodeGeneratorExpressionInterpreter(
+ XCodeGeneratorExpressionInterpreter const&) = delete;
+ XCodeGeneratorExpressionInterpreter& operator=(
+ XCodeGeneratorExpressionInterpreter const&) = delete;
+
using cmGeneratorExpressionInterpreter::Evaluate;
const std::string& Evaluate(const char* expression,
@@ -1666,6 +1666,7 @@ void cmGlobalXCodeGenerator::AddCommandsToBuildPhase(
makecmd += cdir;
makecmd += " -f ";
makecmd += this->ConvertToRelativeForMake((makefile + "$CONFIGURATION"));
+ makecmd += " OBJDIR=$(basename \"$OBJECT_FILE_DIR_normal\")";
makecmd += " all";
buildphase->AddAttribute("shellScript", this->CreateString(makecmd));
buildphase->AddAttribute("showEnvVarsInLog", this->CreateString("0"));
@@ -1973,8 +1974,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
pnbase = gtgt->GetName();
pnsuffix = ".a";
- std::string pncdir =
- this->GetObjectsNormalDirectory(this->CurrentProject, configName, gtgt);
+ std::string pncdir = this->GetObjectsDirectory(
+ this->CurrentProject, configName, gtgt, OBJECT_LIBRARY_ARTIFACT_DIR);
buildSettings->AddAttribute("CONFIGURATION_BUILD_DIR",
this->CreateString(pncdir));
}
@@ -2253,6 +2254,22 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
debugStr = "NO";
}
+ // extract C++ stdlib
+ for (auto const& language : languages) {
+ if (language != "CXX") {
+ continue;
+ }
+ std::string& flags = cflags[language];
+
+ auto stdlib =
+ this->ExtractFlagRegex("(^| )(-stdlib=[^ ]+)( |$)", 2, flags);
+ if (stdlib.size() > 8) {
+ const auto cxxLibrary = stdlib.substr(8);
+ buildSettings->AddAttribute("CLANG_CXX_LIBRARY",
+ this->CreateString(cxxLibrary));
+ }
+ }
+
buildSettings->AddAttribute("COMBINE_HIDPI_IMAGES",
this->CreateString("YES"));
buildSettings->AddAttribute("GCC_GENERATE_DEBUGGING_SYMBOLS",
@@ -2459,7 +2476,7 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateUtilityTarget(
this->AddXCodeProjBuildRule(gtgt, sources);
for (auto sourceFile : sources) {
- if (!sourceFile->GetPropertyAsBool("GENERATED")) {
+ if (!sourceFile->GetIsGenerated()) {
this->CreateXCodeFileReference(sourceFile, gtgt);
}
}
@@ -3141,6 +3158,8 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
if (const char* vers = this->CurrentMakefile->GetDefinition(
"CMAKE_Swift_LANGUAGE_VERSION")) {
swiftVersion = vers;
+ } else if (this->XcodeVersion >= 102) {
+ swiftVersion = "4.0";
} else if (this->XcodeVersion >= 83) {
swiftVersion = "3.0";
} else {
@@ -3204,9 +3223,9 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
return true;
}
-std::string cmGlobalXCodeGenerator::GetObjectsNormalDirectory(
+std::string cmGlobalXCodeGenerator::GetObjectsDirectory(
const std::string& projName, const std::string& configName,
- const cmGeneratorTarget* t) const
+ const cmGeneratorTarget* t, const std::string& variant) const
{
std::string dir = t->GetLocalGenerator()->GetCurrentBinaryDirectory();
dir += "/";
@@ -3215,8 +3234,8 @@ std::string cmGlobalXCodeGenerator::GetObjectsNormalDirectory(
dir += configName;
dir += "/";
dir += t->GetName();
- dir += ".build/Objects-normal/";
-
+ dir += ".build/";
+ dir += variant;
return dir;
}
@@ -3343,8 +3362,9 @@ void cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
for (auto objLib : objlibs) {
const std::string objLibName = objLib->GetName();
- std::string d = this->GetObjectsNormalDirectory(this->CurrentProject,
- configName, objLib);
+ std::string d =
+ this->GetObjectsDirectory(this->CurrentProject, configName, objLib,
+ OBJECT_LIBRARY_ARTIFACT_DIR);
d += "lib";
d += objLibName;
d += ".a";
@@ -3361,8 +3381,8 @@ void cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
// if building for more than one architecture
// then remove those executables as well
if (this->Architectures.size() > 1) {
- std::string universal = this->GetObjectsNormalDirectory(
- this->CurrentProject, configName, gt);
+ std::string universal = this->GetObjectsDirectory(
+ this->CurrentProject, configName, gt, "$(OBJDIR)/");
for (const auto& architecture : this->Architectures) {
std::string universalFile = universal;
universalFile += architecture;
@@ -3581,7 +3601,7 @@ std::string cmGlobalXCodeGenerator::RelativeToSource(const char* p)
std::string cmGlobalXCodeGenerator::RelativeToBinary(const char* p)
{
- return this->CurrentLocalGenerator->ConvertToRelativePath(
+ return this->CurrentLocalGenerator->MaybeConvertToRelativePath(
cmSystemTools::JoinPath(this->ProjectOutputDirectoryComponents), p);
}
@@ -3766,8 +3786,8 @@ void cmGlobalXCodeGenerator::ComputeTargetObjectDirectory(
cmGeneratorTarget* gt) const
{
std::string configName = this->GetCMakeCFGIntDir();
- std::string dir =
- this->GetObjectsNormalDirectory("$(PROJECT_NAME)", configName, gt);
+ std::string dir = this->GetObjectsDirectory(
+ "$(PROJECT_NAME)", configName, gt, "$(OBJECT_FILE_DIR_normal:base)/");
dir += this->ObjectDirArch;
dir += "/";
gt->ObjectDirectory = dir;
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index 9b0d4fef9c..e1e412dca5 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -66,7 +66,7 @@ public:
* Try running cmake and building a file. This is used for dynalically
* loaded commands, not as part of the usual build process.
*/
- void GenerateBuildCommand(std::vector<std::string>& makeCommand,
+ void GenerateBuildCommand(GeneratedMakeCommand& makeCommand,
const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
@@ -264,9 +264,10 @@ private:
{
}
- std::string GetObjectsNormalDirectory(const std::string& projName,
- const std::string& configName,
- const cmGeneratorTarget* t) const;
+ std::string GetObjectsDirectory(const std::string& projName,
+ const std::string& configName,
+ const cmGeneratorTarget* t,
+ const std::string& variant) const;
static std::string GetDeploymentPlatform(const cmMakefile* mf);
diff --git a/Source/cmIDEFlagTable.h b/Source/cmIDEFlagTable.h
index 28d5d53ec5..ff93432cb0 100644
--- a/Source/cmIDEFlagTable.h
+++ b/Source/cmIDEFlagTable.h
@@ -29,6 +29,9 @@ struct cmIDEFlagTable
SpaceAppendable = (1 << 7), // a flag that if specified multiple times
// should have its value appended to the
// old value with spaces
+ CommaAppendable = (1 << 8), // a flag that if specified multiple times
+ // should have its value appended to the
+ // old value with commas (e.g. C# /nowarn
UserValueIgnored = UserValue | UserIgnored,
UserValueRequired = UserValue | UserRequired
diff --git a/Source/cmIDEOptions.cxx b/Source/cmIDEOptions.cxx
index ee0c782b53..ea67d45fa5 100644
--- a/Source/cmIDEOptions.cxx
+++ b/Source/cmIDEOptions.cxx
@@ -148,6 +148,8 @@ void cmIDEOptions::FlagMapUpdate(cmIDEFlagTable const* entry,
this->FlagMap[entry->IDEName].push_back(new_value);
} else if (entry->special & cmIDEFlagTable::SpaceAppendable) {
this->FlagMap[entry->IDEName].append_with_space(new_value);
+ } else if (entry->special & cmIDEFlagTable::CommaAppendable) {
+ this->FlagMap[entry->IDEName].append_with_comma(new_value);
} else {
// Use the user-specified value.
this->FlagMap[entry->IDEName] = new_value;
diff --git a/Source/cmIDEOptions.h b/Source/cmIDEOptions.h
index a4e5757808..4a430732fd 100644
--- a/Source/cmIDEOptions.h
+++ b/Source/cmIDEOptions.h
@@ -65,12 +65,22 @@ protected:
this->derived::operator=(r);
return *this;
}
+ FlagValue& append_with_comma(std::string const& r)
+ {
+ return append_with_separator(r, ',');
+ }
FlagValue& append_with_space(std::string const& r)
{
+ return append_with_separator(r, ' ');
+ }
+
+ private:
+ FlagValue& append_with_separator(std::string const& r, char separator)
+ {
this->resize(1);
std::string& l = this->operator[](0);
if (!l.empty()) {
- l += " ";
+ l += separator;
}
l += r;
return *this;
diff --git a/Source/cmIfCommand.h b/Source/cmIfCommand.h
index e3d30ddbd3..d34ed02c8b 100644
--- a/Source/cmIfCommand.h
+++ b/Source/cmIfCommand.h
@@ -19,13 +19,6 @@ class cmMakefile;
class cmIfFunctionBlocker : public cmFunctionBlocker
{
public:
- cmIfFunctionBlocker()
- {
- this->HasRun = false;
- this->ElseSeen = false;
- this->ScopeDepth = 0;
- }
- ~cmIfFunctionBlocker() override {}
bool IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile& mf,
cmExecutionStatus&) override;
bool ShouldRemove(const cmListFileFunction& lff, cmMakefile& mf) override;
@@ -33,9 +26,9 @@ public:
std::vector<cmListFileArgument> Args;
std::vector<cmListFileFunction> Functions;
bool IsBlocking;
- bool HasRun;
- bool ElseSeen;
- unsigned int ScopeDepth;
+ bool HasRun = false;
+ bool ElseSeen = false;
+ unsigned int ScopeDepth = 0;
};
/// Starts an if block
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index c6f40641ed..8ef644141b 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -712,7 +712,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
std::ostringstream e;
e << "INSTALL TARGETS - target " << target.GetName() << " has "
<< "RESOURCE files but no RESOURCE DESTINATION.";
- cmSystemTools::Message(e.str().c_str(), "Warning");
+ cmSystemTools::Message(e.str(), "Warning");
}
}
}
diff --git a/Source/cmInstallCommandArguments.cxx b/Source/cmInstallCommandArguments.cxx
index 4f872f4dbf..155f0559b9 100644
--- a/Source/cmInstallCommandArguments.cxx
+++ b/Source/cmInstallCommandArguments.cxx
@@ -206,9 +206,7 @@ bool cmInstallCommandArguments::CheckPermissions(
return false;
}
-cmInstallCommandIncludesArgument::cmInstallCommandIncludesArgument()
-{
-}
+cmInstallCommandIncludesArgument::cmInstallCommandIncludesArgument() = default;
const std::vector<std::string>&
cmInstallCommandIncludesArgument::GetIncludeDirs() const
diff --git a/Source/cmInstallCommandArguments.h b/Source/cmInstallCommandArguments.h
index 8e974af6e7..9c0d41763a 100644
--- a/Source/cmInstallCommandArguments.h
+++ b/Source/cmInstallCommandArguments.h
@@ -45,7 +45,6 @@ public:
cmCommandArgumentGroup ArgumentGroup;
private:
- cmInstallCommandArguments(); // disabled
cmCAString Destination;
cmCAString Component;
cmCAString NamelinkComponent;
diff --git a/Source/cmInstallDirectoryGenerator.cxx b/Source/cmInstallDirectoryGenerator.cxx
index c9b50a3b62..a88c7af3b9 100644
--- a/Source/cmInstallDirectoryGenerator.cxx
+++ b/Source/cmInstallDirectoryGenerator.cxx
@@ -39,9 +39,7 @@ cmInstallDirectoryGenerator::cmInstallDirectoryGenerator(
}
}
-cmInstallDirectoryGenerator::~cmInstallDirectoryGenerator()
-{
-}
+cmInstallDirectoryGenerator::~cmInstallDirectoryGenerator() = default;
void cmInstallDirectoryGenerator::Compute(cmLocalGenerator* lg)
{
diff --git a/Source/cmInstallFilesGenerator.cxx b/Source/cmInstallFilesGenerator.cxx
index 68e3f86d1b..07094cb686 100644
--- a/Source/cmInstallFilesGenerator.cxx
+++ b/Source/cmInstallFilesGenerator.cxx
@@ -38,9 +38,7 @@ cmInstallFilesGenerator::cmInstallFilesGenerator(
}
}
-cmInstallFilesGenerator::~cmInstallFilesGenerator()
-{
-}
+cmInstallFilesGenerator::~cmInstallFilesGenerator() = default;
void cmInstallFilesGenerator::Compute(cmLocalGenerator* lg)
{
diff --git a/Source/cmInstallGenerator.cxx b/Source/cmInstallGenerator.cxx
index 2b236584a4..d139190a4f 100644
--- a/Source/cmInstallGenerator.cxx
+++ b/Source/cmInstallGenerator.cxx
@@ -18,9 +18,7 @@ cmInstallGenerator::cmInstallGenerator(
{
}
-cmInstallGenerator::~cmInstallGenerator()
-{
-}
+cmInstallGenerator::~cmInstallGenerator() = default;
bool cmInstallGenerator::HaveInstall()
{
diff --git a/Source/cmInstallGenerator.h b/Source/cmInstallGenerator.h
index e5b88c3858..9bd7ac318b 100644
--- a/Source/cmInstallGenerator.h
+++ b/Source/cmInstallGenerator.h
@@ -21,8 +21,6 @@ class cmMakefile;
*/
class cmInstallGenerator : public cmScriptGenerator
{
- CM_DISABLE_COPY(cmInstallGenerator)
-
public:
enum MessageLevel
{
@@ -38,6 +36,9 @@ public:
bool exclude_from_all);
~cmInstallGenerator() override;
+ cmInstallGenerator(cmInstallGenerator const&) = delete;
+ cmInstallGenerator& operator=(cmInstallGenerator const&) = delete;
+
virtual bool HaveInstall();
virtual void CheckCMP0082(bool& haveSubdirectoryInstall,
bool& haveInstallAfterSubdirectory);
diff --git a/Source/cmInstallScriptGenerator.cxx b/Source/cmInstallScriptGenerator.cxx
index 12e87c765d..a513958edf 100644
--- a/Source/cmInstallScriptGenerator.cxx
+++ b/Source/cmInstallScriptGenerator.cxx
@@ -27,9 +27,7 @@ cmInstallScriptGenerator::cmInstallScriptGenerator(const char* script,
}
}
-cmInstallScriptGenerator::~cmInstallScriptGenerator()
-{
-}
+cmInstallScriptGenerator::~cmInstallScriptGenerator() = default;
void cmInstallScriptGenerator::Compute(cmLocalGenerator* lg)
{
diff --git a/Source/cmInstallSubdirectoryGenerator.cxx b/Source/cmInstallSubdirectoryGenerator.cxx
index ca9f13454c..ad7121f2ec 100644
--- a/Source/cmInstallSubdirectoryGenerator.cxx
+++ b/Source/cmInstallSubdirectoryGenerator.cxx
@@ -20,9 +20,7 @@ cmInstallSubdirectoryGenerator::cmInstallSubdirectoryGenerator(
{
}
-cmInstallSubdirectoryGenerator::~cmInstallSubdirectoryGenerator()
-{
-}
+cmInstallSubdirectoryGenerator::~cmInstallSubdirectoryGenerator() = default;
bool cmInstallSubdirectoryGenerator::HaveInstall()
{
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index d1d431653f..9d3a6bb60e 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -19,6 +19,7 @@
#include "cmStateTypes.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
+#include "cmake.h"
cmInstallTargetGenerator::cmInstallTargetGenerator(
std::string targetName, const char* dest, bool implib,
@@ -38,25 +39,7 @@ cmInstallTargetGenerator::cmInstallTargetGenerator(
this->NamelinkMode = NamelinkModeNone;
}
-cmInstallTargetGenerator::~cmInstallTargetGenerator()
-{
-}
-
-void cmInstallTargetGenerator::GenerateScript(std::ostream& os)
-{
- // Warn if installing an exclude-from-all target.
- if (this->Target->GetPropertyAsBool("EXCLUDE_FROM_ALL")) {
- std::ostringstream msg;
- msg << "WARNING: Target \"" << this->Target->GetName()
- << "\" has EXCLUDE_FROM_ALL set and will not be built by default "
- << "but an install rule has been provided for it. CMake does "
- << "not define behavior for this case.";
- cmSystemTools::Message(msg.str().c_str(), "Warning");
- }
-
- // Perform the main install script generation.
- this->cmInstallGenerator::GenerateScript(os);
-}
+cmInstallTargetGenerator::~cmInstallTargetGenerator() = default;
void cmInstallTargetGenerator::GenerateScriptForConfig(
std::ostream& os, const std::string& config, Indent indent)
@@ -211,8 +194,34 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(
// An import library looks like a static library.
type = cmInstallType_STATIC_LIBRARY;
} else if (this->Target->IsFrameworkOnApple()) {
- // There is a bug in cmInstallCommand if this fails.
- assert(this->NamelinkMode == NamelinkModeNone);
+ // FIXME: In principle we should be able to
+ // assert(this->NamelinkMode == NamelinkModeNone);
+ // but since the current install() command implementation checks
+ // the FRAMEWORK property immediately instead of delaying until
+ // generate time, it is possible for project code to set the
+ // property after calling install(). In such a case, the install()
+ // command will use the LIBRARY code path and create two install
+ // generators, one for the namelink component (NamelinkModeOnly)
+ // and one for the primary artifact component (NamelinkModeSkip).
+ // Historically this was not diagnosed and resulted in silent
+ // installation of a framework to the LIBRARY destination.
+ // Retain that behavior and warn about the case.
+ switch (this->NamelinkMode) {
+ case NamelinkModeNone:
+ // Normal case.
+ break;
+ case NamelinkModeOnly:
+ // Assume the NamelinkModeSkip instance will warn and install.
+ return;
+ case NamelinkModeSkip: {
+ std::string e = "Target '" + this->Target->GetName() +
+ "' was changed to a FRAMEWORK sometime after install(). "
+ "This may result in the wrong install DESTINATION. "
+ "Set the FRAMEWORK property earlier.";
+ this->Target->GetGlobalGenerator()->GetCMakeInstance()->IssueMessage(
+ MessageType::AUTHOR_WARNING, e, this->GetBacktrace());
+ } break;
+ }
// Install the whole framework directory.
type = cmInstallType_DIRECTORY;
@@ -767,10 +776,22 @@ void cmInstallTargetGenerator::AddStripRule(std::ostream& os, Indent indent,
return;
}
+ std::string stripArgs;
+
+ // macOS 'strip' is picky, executables need '-u -r' and dylibs need '-x'.
+ if (this->Target->Target->GetMakefile()->IsOn("APPLE")) {
+ if (this->Target->GetType() == cmStateEnums::SHARED_LIBRARY ||
+ this->Target->GetType() == cmStateEnums::MODULE_LIBRARY) {
+ stripArgs = "-x ";
+ } else if (this->Target->GetType() == cmStateEnums::EXECUTABLE) {
+ stripArgs = "-u -r ";
+ }
+ }
+
os << indent << "if(CMAKE_INSTALL_DO_STRIP)\n";
os << indent << " execute_process(COMMAND \""
<< this->Target->Target->GetMakefile()->GetDefinition("CMAKE_STRIP")
- << "\" \"" << toDestDirPath << "\")\n";
+ << "\" " << stripArgs << "\"" << toDestDirPath << "\")\n";
os << indent << "endif()\n";
}
diff --git a/Source/cmInstallTargetGenerator.h b/Source/cmInstallTargetGenerator.h
index 715b4ae69f..6df5b1a50a 100644
--- a/Source/cmInstallTargetGenerator.h
+++ b/Source/cmInstallTargetGenerator.h
@@ -69,7 +69,6 @@ public:
cmListFileBacktrace const& GetBacktrace() const { return this->Backtrace; }
protected:
- void GenerateScript(std::ostream& os) override;
void GenerateScriptForConfig(std::ostream& os, const std::string& config,
Indent indent) override;
void GenerateScriptForConfigObjectLibrary(std::ostream& os,
diff --git a/Source/cmInstalledFile.cxx b/Source/cmInstalledFile.cxx
index 9f61e5b707..537b4ecec6 100644
--- a/Source/cmInstalledFile.cxx
+++ b/Source/cmInstalledFile.cxx
@@ -9,18 +9,14 @@
#include <utility>
-cmInstalledFile::cmInstalledFile()
-{
-}
+cmInstalledFile::cmInstalledFile() = default;
cmInstalledFile::~cmInstalledFile()
{
delete NameExpression;
}
-cmInstalledFile::Property::Property()
-{
-}
+cmInstalledFile::Property::Property() = default;
cmInstalledFile::Property::~Property()
{
diff --git a/Source/cmJsonObjects.cxx b/Source/cmJsonObjects.cxx
index 135fd25b36..d723cedb53 100644
--- a/Source/cmJsonObjects.cxx
+++ b/Source/cmJsonObjects.cxx
@@ -323,7 +323,7 @@ static Json::Value DumpSourceFilesList(
fileData.SetDefines(defines);
}
- fileData.IsGenerated = file->GetPropertyAsBool("GENERATED");
+ fileData.IsGenerated = file->GetIsGenerated();
std::vector<std::string>& groupFileList = fileGroups[fileData];
groupFileList.push_back(file->GetFullPath());
}
@@ -578,7 +578,7 @@ static Json::Value DumpTarget(cmGeneratorTarget* target,
lg->GetTargetDefines(target, config, lang, defines);
ld.SetDefines(defines);
std::vector<std::string> includePathList;
- lg->GetIncludeDirectories(includePathList, target, lang, config, true);
+ lg->GetIncludeDirectories(includePathList, target, lang, config);
for (std::string const& i : includePathList) {
ld.IncludePathList.emplace_back(
i, target->IsSystemIncludeDirectory(i, config, lang));
diff --git a/Source/cmLinkItem.cxx b/Source/cmLinkItem.cxx
index b035c8c713..9b03ad011e 100644
--- a/Source/cmLinkItem.cxx
+++ b/Source/cmLinkItem.cxx
@@ -6,9 +6,7 @@
#include <utility> // IWYU pragma: keep
-cmLinkItem::cmLinkItem()
-{
-}
+cmLinkItem::cmLinkItem() = default;
cmLinkItem::cmLinkItem(std::string n, cmListFileBacktrace bt)
: String(std::move(n))
diff --git a/Source/cmLinkItem.h b/Source/cmLinkItem.h
index d2459db6cb..5b635b5b31 100644
--- a/Source/cmLinkItem.h
+++ b/Source/cmLinkItem.h
@@ -77,13 +77,10 @@ struct cmLinkInterface : public cmLinkInterfaceLibraries
std::vector<cmLinkItem> WrongConfigLibraries;
bool ImplementationIsInterface = false;
-
- cmLinkInterface() {}
};
struct cmOptionalLinkInterface : public cmLinkInterface
{
- cmOptionalLinkInterface() {}
bool LibrariesDone = false;
bool AllDone = false;
bool Exists = false;
@@ -105,7 +102,6 @@ struct cmLinkImplementation : public cmLinkImplementationLibraries
// Cache link implementation computation from each configuration.
struct cmOptionalLinkImplementation : public cmLinkImplementation
{
- cmOptionalLinkImplementation() {}
bool LibrariesDone = false;
bool LanguagesDone = false;
bool HadHeadSensitiveCondition = false;
diff --git a/Source/cmLinkLineComputer.cxx b/Source/cmLinkLineComputer.cxx
index 6643990ac6..2a8bee6e5a 100644
--- a/Source/cmLinkLineComputer.cxx
+++ b/Source/cmLinkLineComputer.cxx
@@ -23,9 +23,7 @@ cmLinkLineComputer::cmLinkLineComputer(cmOutputConverter* outputConverter,
{
}
-cmLinkLineComputer::~cmLinkLineComputer()
-{
-}
+cmLinkLineComputer::~cmLinkLineComputer() = default;
void cmLinkLineComputer::SetUseWatcomQuote(bool useWatcomQuote)
{
diff --git a/Source/cmLinkLineComputer.h b/Source/cmLinkLineComputer.h
index a016358fa9..2355c32702 100644
--- a/Source/cmLinkLineComputer.h
+++ b/Source/cmLinkLineComputer.h
@@ -16,13 +16,14 @@ class cmOutputConverter;
class cmLinkLineComputer
{
- CM_DISABLE_COPY(cmLinkLineComputer)
-
public:
cmLinkLineComputer(cmOutputConverter* outputConverter,
cmStateDirectory const& stateDir);
virtual ~cmLinkLineComputer();
+ cmLinkLineComputer(cmLinkLineComputer const&) = delete;
+ cmLinkLineComputer& operator=(cmLinkLineComputer const&) = delete;
+
void SetUseWatcomQuote(bool useWatcomQuote);
void SetForResponse(bool forResponse);
void SetRelink(bool relink);
diff --git a/Source/cmLinkLineDeviceComputer.cxx b/Source/cmLinkLineDeviceComputer.cxx
index a93ec1271d..a403dc9282 100644
--- a/Source/cmLinkLineDeviceComputer.cxx
+++ b/Source/cmLinkLineDeviceComputer.cxx
@@ -21,9 +21,7 @@ cmLinkLineDeviceComputer::cmLinkLineDeviceComputer(
{
}
-cmLinkLineDeviceComputer::~cmLinkLineDeviceComputer()
-{
-}
+cmLinkLineDeviceComputer::~cmLinkLineDeviceComputer() = default;
static bool cmLinkItemValidForDevice(std::string const& item)
{
diff --git a/Source/cmLinkLineDeviceComputer.h b/Source/cmLinkLineDeviceComputer.h
index 81b48b3d4f..cf66f64757 100644
--- a/Source/cmLinkLineDeviceComputer.h
+++ b/Source/cmLinkLineDeviceComputer.h
@@ -18,13 +18,15 @@ class cmStateDirectory;
class cmLinkLineDeviceComputer : public cmLinkLineComputer
{
- CM_DISABLE_COPY(cmLinkLineDeviceComputer)
-
public:
cmLinkLineDeviceComputer(cmOutputConverter* outputConverter,
cmStateDirectory const& stateDir);
~cmLinkLineDeviceComputer() override;
+ cmLinkLineDeviceComputer(cmLinkLineDeviceComputer const&) = delete;
+ cmLinkLineDeviceComputer& operator=(cmLinkLineDeviceComputer const&) =
+ delete;
+
std::string ComputeLinkLibraries(cmComputeLinkInformation& cli,
std::string const& stdLibString) override;
@@ -34,13 +36,15 @@ public:
class cmNinjaLinkLineDeviceComputer : public cmLinkLineDeviceComputer
{
- CM_DISABLE_COPY(cmNinjaLinkLineDeviceComputer)
-
public:
cmNinjaLinkLineDeviceComputer(cmOutputConverter* outputConverter,
cmStateDirectory const& stateDir,
cmGlobalNinjaGenerator const* gg);
+ cmNinjaLinkLineDeviceComputer(cmNinjaLinkLineDeviceComputer const&) = delete;
+ cmNinjaLinkLineDeviceComputer& operator=(
+ cmNinjaLinkLineDeviceComputer const&) = delete;
+
std::string ConvertToLinkReference(std::string const& input) const override;
private:
diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx
index b24c5ba96d..297babfd8e 100644
--- a/Source/cmListCommand.cxx
+++ b/Source/cmListCommand.cxx
@@ -426,7 +426,7 @@ public:
class TransformSelector
{
public:
- virtual ~TransformSelector() {}
+ virtual ~TransformSelector() = default;
std::string Tag;
@@ -580,7 +580,7 @@ private:
class TransformAction
{
public:
- virtual ~TransformAction() {}
+ virtual ~TransformAction() = default;
virtual std::string Transform(const std::string& input) = 0;
};
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index cc2c09fb82..f85511964a 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -5,8 +5,8 @@
#include "cmListFileLexer.h"
#include "cmMessageType.h"
#include "cmMessenger.h"
-#include "cmOutputConverter.h"
#include "cmState.h"
+#include "cmStateDirectory.h"
#include "cmSystemTools.h"
#include <assert.h>
@@ -390,9 +390,8 @@ void cmListFileBacktrace::PrintTitle(std::ostream& out) const
}
cmListFileContext lfc = this->TopEntry->Context;
cmStateSnapshot bottom = this->GetBottom();
- cmOutputConverter converter(bottom);
if (!bottom.GetState()->GetIsInTryCompile()) {
- lfc.FilePath = converter.ConvertToRelativePath(
+ lfc.FilePath = bottom.GetDirectory().ConvertToRelPathIfNotContained(
bottom.GetState()->GetSourceDirectory(), lfc.FilePath);
}
out << (lfc.Line ? " at " : " in ") << lfc;
@@ -409,7 +408,6 @@ void cmListFileBacktrace::PrintCallStack(std::ostream& out) const
bool first = true;
cmStateSnapshot bottom = this->GetBottom();
- cmOutputConverter converter(bottom);
for (Entry const* cur = this->TopEntry->Parent.get(); !cur->IsBottom();
cur = cur->Parent.get()) {
if (cur->Context.Name.empty()) {
@@ -423,7 +421,7 @@ void cmListFileBacktrace::PrintCallStack(std::ostream& out) const
}
cmListFileContext lfc = cur->Context;
if (!bottom.GetState()->GetIsInTryCompile()) {
- lfc.FilePath = converter.ConvertToRelativePath(
+ lfc.FilePath = bottom.GetDirectory().ConvertToRelPathIfNotContained(
bottom.GetState()->GetSourceDirectory(), lfc.FilePath);
}
out << " " << lfc << "\n";
diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h
index 529c3891d4..945741540b 100644
--- a/Source/cmListFileCache.h
+++ b/Source/cmListFileCache.h
@@ -29,12 +29,12 @@ struct cmCommandContext
{
std::string Lower;
std::string Original;
- cmCommandName() {}
+ cmCommandName() = default;
cmCommandName(std::string const& name) { *this = name; }
cmCommandName& operator=(std::string const& name);
} Name;
long Line = 0;
- cmCommandContext() {}
+ cmCommandContext() = default;
cmCommandContext(const char* name, int line)
: Name(name)
, Line(line)
@@ -50,7 +50,7 @@ struct cmListFileArgument
Quoted,
Bracket
};
- cmListFileArgument() {}
+ cmListFileArgument() = default;
cmListFileArgument(std::string v, Delimiter d, long line)
: Value(std::move(v))
, Delim(d)
@@ -73,7 +73,6 @@ public:
std::string Name;
std::string FilePath;
long Line = 0;
- cmListFileContext() {}
static cmListFileContext FromCommandContext(cmCommandContext const& lfcc,
std::string const& fileName)
@@ -110,15 +109,6 @@ public:
// indicated by the given valid snapshot.
cmListFileBacktrace(cmStateSnapshot const& snapshot);
- // Backtraces may be copied, moved, and assigned as values.
- cmListFileBacktrace(cmListFileBacktrace const&) = default;
- cmListFileBacktrace(cmListFileBacktrace&&) // NOLINT(clang-tidy)
- noexcept = default;
- cmListFileBacktrace& operator=(cmListFileBacktrace const&) = default;
- cmListFileBacktrace& operator=(cmListFileBacktrace&&) // NOLINT(clang-tidy)
- noexcept = default;
- ~cmListFileBacktrace() = default;
-
cmStateSnapshot GetBottom() const;
// Get a backtrace with the given file scope added to the top.
diff --git a/Source/cmLocalCommonGenerator.cxx b/Source/cmLocalCommonGenerator.cxx
index c6d2c5873c..75ad2a6581 100644
--- a/Source/cmLocalCommonGenerator.cxx
+++ b/Source/cmLocalCommonGenerator.cxx
@@ -26,9 +26,7 @@ cmLocalCommonGenerator::cmLocalCommonGenerator(cmGlobalGenerator* gg,
}
}
-cmLocalCommonGenerator::~cmLocalCommonGenerator()
-{
-}
+cmLocalCommonGenerator::~cmLocalCommonGenerator() = default;
std::string cmLocalCommonGenerator::GetTargetFortranFlags(
cmGeneratorTarget const* target, std::string const& config)
@@ -46,7 +44,7 @@ std::string cmLocalCommonGenerator::GetTargetFortranFlags(
target->GetFortranModuleDirectory(this->WorkingDirectory);
if (!mod_dir.empty()) {
mod_dir = this->ConvertToOutputFormat(
- this->ConvertToRelativePath(this->WorkingDirectory, mod_dir),
+ this->MaybeConvertToRelativePath(this->WorkingDirectory, mod_dir),
cmOutputConverter::SHELL);
} else {
mod_dir =
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 62aff99743..7e568188b9 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -316,7 +316,7 @@ void cmLocalGenerator::GenerateTestFiles()
for (cmStateSnapshot const& i : children) {
// TODO: Use add_subdirectory instead?
std::string outP = i.GetDirectory().GetCurrentBinary();
- outP = this->ConvertToRelativePath(parentBinDir, outP);
+ outP = this->MaybeConvertToRelativePath(parentBinDir, outP);
outP = cmOutputConverter::EscapeForCMake(outP);
fout << "subdirs(" << outP << ")" << std::endl;
}
@@ -881,31 +881,27 @@ void cmLocalGenerator::AddCompileOptions(std::string& flags,
this->AddCompilerRequirementFlag(flags, target, lang);
}
-void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
- cmGeneratorTarget const* target,
- const std::string& lang,
- const std::string& config,
- bool stripImplicitDirs,
- bool appendAllImplicitDirs) const
-{
- std::vector<BT<std::string>> tmp = this->GetIncludeDirectories(
- target, lang, config, stripImplicitDirs, appendAllImplicitDirs);
- dirs.reserve(tmp.size());
- for (BT<std::string>& v : tmp) {
- dirs.emplace_back(std::move(v.Value));
- }
-}
-
-std::vector<BT<std::string>> cmLocalGenerator::GetIncludeDirectories(
+std::vector<BT<std::string>> cmLocalGenerator::GetIncludeDirectoriesImplicit(
cmGeneratorTarget const* target, std::string const& lang,
std::string const& config, bool stripImplicitDirs,
bool appendAllImplicitDirs) const
{
std::vector<BT<std::string>> result;
-
// Do not repeat an include path.
std::set<std::string> emitted;
+ auto emitDir = [&result, &emitted](std::string const& dir) {
+ if (emitted.insert(dir).second) {
+ result.emplace_back(dir);
+ }
+ };
+
+ auto emitBT = [&result, &emitted](BT<std::string> const& dir) {
+ if (emitted.insert(dir.Value).second) {
+ result.emplace_back(dir);
+ }
+ };
+
// When automatic include directories are requested for a build then
// include the source and binary directories at the beginning of the
// include path to approximate include file behavior for an
@@ -915,61 +911,80 @@ std::vector<BT<std::string>> cmLocalGenerator::GetIncludeDirectories(
// per-source-file include paths.
if (this->Makefile->IsOn("CMAKE_INCLUDE_CURRENT_DIR")) {
// Current binary directory
- {
- std::string binDir =
- this->StateSnapshot.GetDirectory().GetCurrentBinary();
- if (emitted.insert(binDir).second) {
- result.emplace_back(std::move(binDir));
- }
- }
+ emitDir(this->StateSnapshot.GetDirectory().GetCurrentBinary());
// Current source directory
- {
- std::string srcDir =
- this->StateSnapshot.GetDirectory().GetCurrentSource();
- if (emitted.insert(srcDir).second) {
- result.emplace_back(std::move(srcDir));
- }
- }
+ emitDir(this->StateSnapshot.GetDirectory().GetCurrentSource());
}
if (!target) {
return result;
}
- // Implicit include directories
- std::vector<std::string> implicitDirs;
+ // Standard include directories to be added unconditionally at the end.
+ // These are intended to simulate additional implicit include directories.
+ std::vector<std::string> userStandardDirs;
{
- std::string rootPath;
- if (const char* sysrootCompile =
- this->Makefile->GetDefinition("CMAKE_SYSROOT_COMPILE")) {
- rootPath = sysrootCompile;
- } else {
- rootPath = this->Makefile->GetSafeDefinition("CMAKE_SYSROOT");
+ std::string key = "CMAKE_";
+ key += lang;
+ key += "_STANDARD_INCLUDE_DIRECTORIES";
+ std::string const value = this->Makefile->GetSafeDefinition(key);
+ cmSystemTools::ExpandListArgument(value, userStandardDirs);
+ for (std::string& usd : userStandardDirs) {
+ cmSystemTools::ConvertToUnixSlashes(usd);
}
+ }
- std::vector<std::string> impDirVec;
+ // Implicit include directories
+ std::vector<std::string> implicitDirs;
+ std::set<std::string> implicitSet;
+ // Checks if this is not an implicit include directory
+ auto notImplicit = [&implicitSet](std::string const& dir) {
+ return (implicitSet.find(dir) == implicitSet.end());
+ };
+ {
+ // Raw list of implicit include directories
+ // Start with "standard" directories that we unconditionally add below.
+ std::vector<std::string> impDirVec = userStandardDirs;
- // Get platform-wide implicit directories.
- if (const char* implicitIncludes = (this->Makefile->GetDefinition(
- "CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES"))) {
- cmSystemTools::ExpandListArgument(implicitIncludes, impDirVec);
+ // Load implicit include directories for this language.
+ // We ignore this for Fortran because:
+ // * There are no standard library headers to avoid overriding.
+ // * Compilers like gfortran do not search their own implicit include
+ // directories for modules ('.mod' files).
+ if (lang != "Fortran") {
+ std::string key = "CMAKE_";
+ key += lang;
+ key += "_IMPLICIT_INCLUDE_DIRECTORIES";
+ if (const char* value = this->Makefile->GetDefinition(key)) {
+ size_t const impDirVecOldSize = impDirVec.size();
+ cmSystemTools::ExpandListArgument(value, impDirVec);
+ // FIXME: Use cmRange with 'advance()' when it supports non-const.
+ for (size_t i = impDirVecOldSize; i < impDirVec.size(); ++i) {
+ cmSystemTools::ConvertToUnixSlashes(impDirVec[i]);
+ }
+ }
}
- // Load implicit include directories for this language.
- std::string key = "CMAKE_";
- key += lang;
- key += "_IMPLICIT_INCLUDE_DIRECTORIES";
- if (const char* value = this->Makefile->GetDefinition(key)) {
- cmSystemTools::ExpandListArgument(value, impDirVec);
+ // The Platform/UnixPaths module used to hard-code /usr/include for C, CXX,
+ // and CUDA in CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES, but those
+ // variables are now computed. On macOS the /usr/include directory is
+ // inside the platform SDK so the computed value does not contain it
+ // directly. In this case adding -I/usr/include can hide SDK headers so we
+ // must still exclude it.
+ if ((lang == "C" || lang == "CXX" || lang == "CUDA") &&
+ std::find(impDirVec.begin(), impDirVec.end(), "/usr/include") ==
+ impDirVec.end() &&
+ std::find_if(impDirVec.begin(), impDirVec.end(),
+ [](std::string const& d) {
+ return cmHasLiteralSuffix(d, "/usr/include");
+ }) != impDirVec.end()) {
+ impDirVec.emplace_back("/usr/include");
}
for (std::string const& i : impDirVec) {
- {
- std::string d = rootPath + i;
- cmSystemTools::ConvertToUnixSlashes(d);
- emitted.insert(std::move(d));
+ if (implicitSet.insert(i).second) {
+ implicitDirs.emplace_back(i);
}
- implicitDirs.push_back(i);
}
}
@@ -982,60 +997,49 @@ std::vector<BT<std::string>> cmLocalGenerator::GetIncludeDirectories(
if (this->Makefile->IsOn("CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE")) {
std::string const &topSourceDir = this->GetState()->GetSourceDirectory(),
&topBinaryDir = this->GetState()->GetBinaryDirectory();
- for (BT<std::string> const& i : userDirs) {
+ for (BT<std::string> const& udr : userDirs) {
// Emit this directory only if it is a subdirectory of the
// top-level source or binary tree.
- if (cmSystemTools::ComparePath(i.Value, topSourceDir) ||
- cmSystemTools::ComparePath(i.Value, topBinaryDir) ||
- cmSystemTools::IsSubDirectory(i.Value, topSourceDir) ||
- cmSystemTools::IsSubDirectory(i.Value, topBinaryDir)) {
- if (emitted.insert(i.Value).second) {
- result.push_back(i);
+ if (cmSystemTools::ComparePath(udr.Value, topSourceDir) ||
+ cmSystemTools::ComparePath(udr.Value, topBinaryDir) ||
+ cmSystemTools::IsSubDirectory(udr.Value, topSourceDir) ||
+ cmSystemTools::IsSubDirectory(udr.Value, topBinaryDir)) {
+ if (notImplicit(udr.Value)) {
+ emitBT(udr);
}
}
}
}
- // Construct the final ordered include directory list.
- for (BT<std::string> const& i : userDirs) {
- if (emitted.insert(i.Value).second) {
- result.push_back(i);
+ // Emit remaining non implicit user direcories.
+ for (BT<std::string> const& udr : userDirs) {
+ if (notImplicit(udr.Value)) {
+ emitBT(udr);
}
}
+ // Sort result
MoveSystemIncludesToEnd(result, config, lang, target);
- // Add standard include directories for this language.
- {
- std::vector<std::string> userStandardDirs;
- {
- std::string key = "CMAKE_";
- key += lang;
- key += "_STANDARD_INCLUDE_DIRECTORIES";
- std::string const value = this->Makefile->GetSafeDefinition(key);
- cmSystemTools::ExpandListArgument(value, userStandardDirs);
- }
- userDirs.reserve(userDirs.size() + userStandardDirs.size());
- for (std::string& d : userStandardDirs) {
- cmSystemTools::ConvertToUnixSlashes(d);
- result.emplace_back(d);
- userDirs.emplace_back(std::move(d));
- }
+ // Append standard include directories for this language.
+ userDirs.reserve(userDirs.size() + userStandardDirs.size());
+ for (std::string& usd : userStandardDirs) {
+ emitDir(usd);
+ userDirs.emplace_back(std::move(usd));
}
+ // Append compiler implicit include directories
if (!stripImplicitDirs) {
- // Append only implicit directories that were requested by the user
- for (std::string const& i : implicitDirs) {
- if (std::find(userDirs.begin(), userDirs.end(), i) != userDirs.end()) {
- result.emplace_back(i);
+ // Append implicit directories that were requested by the user only
+ for (BT<std::string> const& udr : userDirs) {
+ if (!notImplicit(udr.Value)) {
+ emitBT(udr);
}
}
- // Append remaining implicit directories on demand
+ // Append remaining implicit directories (on demand)
if (appendAllImplicitDirs) {
- for (std::string const& i : implicitDirs) {
- if (std::find(result.begin(), result.end(), i) == result.end()) {
- result.emplace_back(i);
- }
+ for (std::string& imd : implicitDirs) {
+ emitDir(imd);
}
}
}
@@ -1043,6 +1047,34 @@ std::vector<BT<std::string>> cmLocalGenerator::GetIncludeDirectories(
return result;
}
+void cmLocalGenerator::GetIncludeDirectoriesImplicit(
+ std::vector<std::string>& dirs, cmGeneratorTarget const* target,
+ const std::string& lang, const std::string& config, bool stripImplicitDirs,
+ bool appendAllImplicitDirs) const
+{
+ std::vector<BT<std::string>> tmp = this->GetIncludeDirectoriesImplicit(
+ target, lang, config, stripImplicitDirs, appendAllImplicitDirs);
+ dirs.reserve(dirs.size() + tmp.size());
+ for (BT<std::string>& v : tmp) {
+ dirs.emplace_back(std::move(v.Value));
+ }
+}
+
+std::vector<BT<std::string>> cmLocalGenerator::GetIncludeDirectories(
+ cmGeneratorTarget const* target, std::string const& lang,
+ std::string const& config) const
+{
+ return this->GetIncludeDirectoriesImplicit(target, lang, config);
+}
+
+void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
+ cmGeneratorTarget const* target,
+ const std::string& lang,
+ const std::string& config) const
+{
+ this->GetIncludeDirectoriesImplicit(dirs, target, lang, config);
+}
+
void cmLocalGenerator::GetStaticLibraryFlags(std::string& flags,
std::string const& config,
std::string const& linkLanguage,
@@ -2302,7 +2334,7 @@ std::string cmLocalGenerator::ConstructComment(
std::string currentBinaryDir = this->GetCurrentBinaryDirectory();
for (std::string const& o : ccg.GetOutputs()) {
comment += sep;
- comment += this->ConvertToRelativePath(currentBinaryDir, o);
+ comment += this->MaybeConvertToRelativePath(currentBinaryDir, o);
sep = ", ";
}
return comment;
@@ -2559,15 +2591,15 @@ std::string cmLocalGenerator::GetObjectFileNameWithoutTarget(
std::string const& fullPath = source.GetFullPath();
// Try referencing the source relative to the source tree.
- std::string relFromSource =
- this->ConvertToRelativePath(this->GetCurrentSourceDirectory(), fullPath);
+ std::string relFromSource = this->MaybeConvertToRelativePath(
+ this->GetCurrentSourceDirectory(), fullPath);
assert(!relFromSource.empty());
bool relSource = !cmSystemTools::FileIsFullPath(relFromSource);
bool subSource = relSource && relFromSource[0] != '.';
// Try referencing the source relative to the binary tree.
- std::string relFromBinary =
- this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(), fullPath);
+ std::string relFromBinary = this->MaybeConvertToRelativePath(
+ this->GetCurrentBinaryDirectory(), fullPath);
assert(!relFromBinary.empty());
bool relBinary = !cmSystemTools::FileIsFullPath(relFromBinary);
bool subBinary = relBinary && relFromBinary[0] != '.';
@@ -2666,6 +2698,13 @@ std::string const& cmLocalGenerator::GetCurrentSourceDirectory() const
return this->StateSnapshot.GetDirectory().GetCurrentSource();
}
+std::string cmLocalGenerator::MaybeConvertToRelativePath(
+ std::string const& local_path, std::string const& remote_path) const
+{
+ return this->StateSnapshot.GetDirectory().ConvertToRelPathIfNotContained(
+ local_path, remote_path);
+}
+
std::string cmLocalGenerator::GetTargetDirectory(
const cmGeneratorTarget* /*unused*/) const
{
@@ -2752,7 +2791,7 @@ bool cmLocalGenerator::CheckDefinition(std::string const& define) const
<< "CMake is dropping a preprocessor definition: " << define << "\n"
<< "Consider defining the macro in a (configured) header file.\n";
/* clang-format on */
- cmSystemTools::Message(e.str().c_str());
+ cmSystemTools::Message(e.str());
return false;
}
}
@@ -2767,7 +2806,7 @@ bool cmLocalGenerator::CheckDefinition(std::string const& define) const
<< "CMake is dropping a preprocessor definition: " << define << "\n"
<< "Consider defining the macro in a (configured) header file.\n";
/* clang-format on */
- cmSystemTools::Message(e.str().c_str());
+ cmSystemTools::Message(e.str());
return false;
}
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index ebc613bca1..f9839f6c19 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -239,22 +239,46 @@ public:
return true;
}
- /** @brief Get the include directories for the current makefile and language.
+ /** @brief Get the include directories for the current makefile and language
+ * and optional the compiler implicit include directories.
+ *
* @arg stripImplicitDirs Strip all directories found in
* CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES from the result.
* @arg appendAllImplicitDirs Append all directories found in
* CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES to the result.
*/
+ std::vector<BT<std::string>> GetIncludeDirectoriesImplicit(
+ cmGeneratorTarget const* target, std::string const& lang = "C",
+ std::string const& config = "", bool stripImplicitDirs = true,
+ bool appendAllImplicitDirs = false) const;
+
+ /** @brief Get the include directories for the current makefile and language
+ * and optional the compiler implicit include directories.
+ *
+ * @arg dirs Directories are appended to this list
+ */
+ void GetIncludeDirectoriesImplicit(std::vector<std::string>& dirs,
+ cmGeneratorTarget const* target,
+ const std::string& lang = "C",
+ const std::string& config = "",
+ bool stripImplicitDirs = true,
+ bool appendAllImplicitDirs = false) const;
+
+ /** @brief Get the include directories for the current makefile and language.
+ * @arg dirs Include directories are appended to this list
+ */
void GetIncludeDirectories(std::vector<std::string>& dirs,
cmGeneratorTarget const* target,
const std::string& lang = "C",
- const std::string& config = "",
- bool stripImplicitDirs = true,
- bool appendAllImplicitDirs = false) const;
+ const std::string& config = "") const;
+
+ /** @brief Get the include directories for the current makefile and language.
+ * @return The include directory list
+ */
std::vector<BT<std::string>> GetIncludeDirectories(
cmGeneratorTarget const* target, std::string const& lang = "C",
- std::string const& config = "", bool stripImplicitDirs = true,
- bool appendAllImplicitDirs = false) const;
+ std::string const& config = "") const;
+
void AddCompileOptions(std::string& flags, cmGeneratorTarget* target,
const std::string& lang, const std::string& config);
@@ -302,6 +326,16 @@ public:
std::string const& GetCurrentSourceDirectory() const;
/**
+ * Convert the given remote path to a relative path with respect to
+ * the given local path. Both paths must use forward slashes and not
+ * already be escaped or quoted.
+ * The conversion is skipped if the paths are not both in the source
+ * or both in the binary tree.
+ */
+ std::string MaybeConvertToRelativePath(std::string const& local_path,
+ std::string const& remote_path) const;
+
+ /**
* Generate a macOS application bundle Info.plist file.
*/
void GenerateAppleInfoPList(cmGeneratorTarget* target,
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 4b9837ce9b..c0afc25423 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -46,15 +46,13 @@ cmLocalNinjaGenerator::CreateRulePlaceholderExpander() const
return ret;
}
-cmLocalNinjaGenerator::~cmLocalNinjaGenerator()
-{
-}
+cmLocalNinjaGenerator::~cmLocalNinjaGenerator() = default;
void cmLocalNinjaGenerator::Generate()
{
// Compute the path to use when referencing the current output
// directory from the top output directory.
- this->HomeRelativeOutputPath = this->ConvertToRelativePath(
+ this->HomeRelativeOutputPath = this->MaybeConvertToRelativePath(
this->GetBinaryDirectory(), this->GetCurrentBinaryDirectory());
if (this->HomeRelativeOutputPath == ".") {
this->HomeRelativeOutputPath.clear();
@@ -139,7 +137,8 @@ std::string cmLocalNinjaGenerator::ConvertToIncludeReference(
format);
}
return this->ConvertToOutputFormat(
- this->ConvertToRelativePath(this->GetBinaryDirectory(), path), format);
+ this->MaybeConvertToRelativePath(this->GetBinaryDirectory(), path),
+ format);
}
// Private methods.
@@ -582,8 +581,8 @@ std::string cmLocalNinjaGenerator::MakeCustomLauncher(
if (!outputs.empty()) {
output = outputs[0];
if (ccg.GetWorkingDirectory().empty()) {
- output =
- this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(), output);
+ output = this->MaybeConvertToRelativePath(
+ this->GetCurrentBinaryDirectory(), output);
}
output = this->ConvertToOutputFormat(output, cmOutputConverter::SHELL);
}
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 7cb98b9a20..7eb4a03d57 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -98,9 +98,7 @@ cmLocalUnixMakefileGenerator3::cmLocalUnixMakefileGenerator3(
this->BorlandMakeCurlyHack = false;
}
-cmLocalUnixMakefileGenerator3::~cmLocalUnixMakefileGenerator3()
-{
-}
+cmLocalUnixMakefileGenerator3::~cmLocalUnixMakefileGenerator3() = default;
void cmLocalUnixMakefileGenerator3::Generate()
{
@@ -1278,8 +1276,7 @@ bool cmLocalUnixMakefileGenerator3::UpdateDependencies(
this->GlobalGenerator->GetCMakeInstance()->GetFileComparison();
{
int result;
- if (!ftc->FileTimeCompare(internalDependFile.c_str(), tgtInfo.c_str(),
- &result) ||
+ if (!ftc->FileTimeCompare(internalDependFile, tgtInfo, &result) ||
result < 0) {
if (verbose) {
std::ostringstream msg;
@@ -1299,8 +1296,7 @@ bool cmLocalUnixMakefileGenerator3::UpdateDependencies(
dirInfoFile += "/CMakeDirectoryInformation.cmake";
{
int result;
- if (!ftc->FileTimeCompare(internalDependFile.c_str(), dirInfoFile.c_str(),
- &result) ||
+ if (!ftc->FileTimeCompare(internalDependFile, dirInfoFile, &result) ||
result < 0) {
if (verbose) {
std::ostringstream msg;
@@ -1812,6 +1808,17 @@ void cmLocalUnixMakefileGenerator3::WriteDependLanguageInfo(
<< "_COMPILER_ID \"" << cid << "\")\n";
}
+ if (implicitLang.first == "Fortran") {
+ std::string smodSep =
+ this->Makefile->GetSafeDefinition("CMAKE_Fortran_SUBMODULE_SEP");
+ std::string smodExt =
+ this->Makefile->GetSafeDefinition("CMAKE_Fortran_SUBMODULE_EXT");
+ cmakefileStream << "set(CMAKE_Fortran_SUBMODULE_SEP \"" << smodSep
+ << "\")\n";
+ cmakefileStream << "set(CMAKE_Fortran_SUBMODULE_EXT \"" << smodExt
+ << "\")\n";
+ }
+
// Build a list of preprocessor definitions for the target.
std::set<std::string> defines;
this->GetTargetDefines(target, this->ConfigName, implicitLang.first,
@@ -2081,12 +2088,3 @@ void cmLocalUnixMakefileGenerator3::CreateCDCommand(
[&prefix](std::string const& s) { return prefix + s; });
}
}
-
-std::string cmLocalUnixMakefileGenerator3::MaybeConvertToRelativePath(
- std::string const& base, std::string const& path)
-{
- if (!this->GetStateSnapshot().GetDirectory().ContainsBoth(base, path)) {
- return path;
- }
- return cmSystemTools::ForceToRelativePath(base, path);
-}
diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h
index 1e1c59ea92..ced2dbd461 100644
--- a/Source/cmLocalUnixMakefileGenerator3.h
+++ b/Source/cmLocalUnixMakefileGenerator3.h
@@ -184,9 +184,6 @@ public:
// Eclipse generator.
void GetIndividualFileTargets(std::vector<std::string>& targets);
- std::string MaybeConvertToRelativePath(std::string const& base,
- std::string const& path);
-
protected:
void WriteLocalMakefile();
@@ -255,7 +252,7 @@ private:
{
cmGeneratorTarget* Target = nullptr;
std::string Language;
- LocalObjectEntry() {}
+ LocalObjectEntry() = default;
LocalObjectEntry(cmGeneratorTarget* t, std::string lang)
: Target(t)
, Language(std::move(lang))
@@ -267,7 +264,6 @@ private:
bool HasSourceExtension = false;
bool HasPreprocessRule = false;
bool HasAssembleRule = false;
- LocalObjectInfo() {}
};
void GetLocalObjectFiles(
std::map<std::string, LocalObjectInfo>& localObjectFiles);
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 9ea8c2e28b..7019552c3a 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -803,8 +803,8 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(
target->GetProperty("Fortran_MODULE_DIRECTORY");
std::string modDir;
if (target_mod_dir) {
- modDir = this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(),
- target_mod_dir);
+ modDir = this->MaybeConvertToRelativePath(
+ this->GetCurrentBinaryDirectory(), target_mod_dir);
} else {
modDir = ".";
}
@@ -1306,7 +1306,7 @@ void cmLocalVisualStudio7GeneratorInternals::OutputLibraries(
for (ItemVector::const_iterator l = libs.begin(); l != libs.end(); ++l) {
if (l->IsPath) {
std::string rel =
- lg->ConvertToRelativePath(currentBinDir, l->Value.c_str());
+ lg->MaybeConvertToRelativePath(currentBinDir, l->Value.c_str());
fout << lg->ConvertToXMLOutputPath(rel.c_str()) << " ";
} else if (!l->Target ||
l->Target->GetType() != cmStateEnums::INTERFACE_LIBRARY) {
@@ -1332,7 +1332,7 @@ void cmLocalVisualStudio7GeneratorInternals::OutputObjects(
i != objs.end(); ++i) {
if (!(*i)->GetObjectLibrary().empty()) {
std::string const& objFile = (*i)->GetFullPath();
- std::string rel = lg->ConvertToRelativePath(currentBinDir, objFile);
+ std::string rel = lg->MaybeConvertToRelativePath(currentBinDir, objFile);
fout << sep << lg->ConvertToXMLOutputPath(rel.c_str());
sep = " ";
}
@@ -1358,7 +1358,7 @@ void cmLocalVisualStudio7Generator::OutputLibraryDirectories(
// Switch to a relative path specification if it is shorter.
if (cmSystemTools::FileIsFullPath(dir.c_str())) {
std::string rel =
- this->ConvertToRelativePath(currentBinDir, dir.c_str());
+ this->MaybeConvertToRelativePath(currentBinDir, dir.c_str());
if (rel.size() < dir.size()) {
dir = rel;
}
diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx
index 2237da75fb..660729c3ac 100644
--- a/Source/cmLocalVisualStudioGenerator.cxx
+++ b/Source/cmLocalVisualStudioGenerator.cxx
@@ -210,9 +210,10 @@ std::string cmLocalVisualStudioGenerator::ConstructScript(
}
if (workingDirectory.empty()) {
- script += this->ConvertToOutputFormat(
- this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(), cmd),
- cmOutputConverter::SHELL);
+ script +=
+ this->ConvertToOutputFormat(this->MaybeConvertToRelativePath(
+ this->GetCurrentBinaryDirectory(), cmd),
+ cmOutputConverter::SHELL);
} else {
script += this->ConvertToOutputFormat(cmd.c_str(), SHELL);
}
diff --git a/Source/cmLocalXCodeGenerator.cxx b/Source/cmLocalXCodeGenerator.cxx
index 92c958d05e..9c36627b51 100644
--- a/Source/cmLocalXCodeGenerator.cxx
+++ b/Source/cmLocalXCodeGenerator.cxx
@@ -19,9 +19,7 @@ cmLocalXCodeGenerator::cmLocalXCodeGenerator(cmGlobalGenerator* gg,
this->EmitUniversalBinaryFlags = false;
}
-cmLocalXCodeGenerator::~cmLocalXCodeGenerator()
-{
-}
+cmLocalXCodeGenerator::~cmLocalXCodeGenerator() = default;
std::string cmLocalXCodeGenerator::GetTargetDirectory(
cmGeneratorTarget const*) const
diff --git a/Source/cmLocale.h b/Source/cmLocale.h
index 174f0f0f22..3580ec8125 100644
--- a/Source/cmLocale.h
+++ b/Source/cmLocale.h
@@ -10,16 +10,18 @@
class cmLocaleRAII
{
- CM_DISABLE_COPY(cmLocaleRAII)
-
public:
cmLocaleRAII()
: OldLocale(setlocale(LC_CTYPE, nullptr))
{
setlocale(LC_CTYPE, "");
}
+
~cmLocaleRAII() { setlocale(LC_CTYPE, this->OldLocale.c_str()); }
+ cmLocaleRAII(cmLocaleRAII const&) = delete;
+ cmLocaleRAII& operator=(cmLocaleRAII const&) = delete;
+
private:
std::string OldLocale;
};
diff --git a/Source/cmMSVC60LinkLineComputer.h b/Source/cmMSVC60LinkLineComputer.h
index 31223ecd4d..d767914b92 100644
--- a/Source/cmMSVC60LinkLineComputer.h
+++ b/Source/cmMSVC60LinkLineComputer.h
@@ -15,12 +15,14 @@ class cmStateDirectory;
class cmMSVC60LinkLineComputer : public cmLinkLineComputer
{
- CM_DISABLE_COPY(cmMSVC60LinkLineComputer)
-
public:
cmMSVC60LinkLineComputer(cmOutputConverter* outputConverter,
cmStateDirectory const& stateDir);
+ cmMSVC60LinkLineComputer(cmMSVC60LinkLineComputer const&) = delete;
+ cmMSVC60LinkLineComputer& operator=(cmMSVC60LinkLineComputer const&) =
+ delete;
+
std::string ConvertToLinkReference(std::string const& input) const override;
};
diff --git a/Source/cmMachO.cxx b/Source/cmMachO.cxx
index 7368812ec0..d4af1e0f32 100644
--- a/Source/cmMachO.cxx
+++ b/Source/cmMachO.cxx
@@ -91,7 +91,7 @@ public:
: Swap(_swap)
{
}
- virtual ~cmMachOHeaderAndLoadCommands() {}
+ virtual ~cmMachOHeaderAndLoadCommands() = default;
virtual bool read_mach_o(cmsys::ifstream& fin) = 0;
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index 411c0c3814..7279d5fcf8 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -17,11 +17,6 @@
class cmMacroHelperCommand : public cmCommand
{
public:
- cmMacroHelperCommand() {}
-
- ///! clean up any memory allocated by the macro
- ~cmMacroHelperCommand() override {}
-
/**
* This is a virtual constructor for the command.
*/
diff --git a/Source/cmMacroCommand.h b/Source/cmMacroCommand.h
index d967388bff..b54ed66050 100644
--- a/Source/cmMacroCommand.h
+++ b/Source/cmMacroCommand.h
@@ -18,15 +18,13 @@ class cmMakefile;
class cmMacroFunctionBlocker : public cmFunctionBlocker
{
public:
- cmMacroFunctionBlocker() { this->Depth = 0; }
- ~cmMacroFunctionBlocker() override {}
bool IsFunctionBlocked(const cmListFileFunction&, cmMakefile& mf,
cmExecutionStatus&) override;
bool ShouldRemove(const cmListFileFunction&, cmMakefile& mf) override;
std::vector<std::string> Args;
std::vector<cmListFileFunction> Functions;
- int Depth;
+ int Depth = 0;
};
/// Starts macro() ... endmacro() block
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index b59a73372b..7e33bda27f 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -322,7 +322,7 @@ void cmMakefile::PrintCommandTrace(const cmListFileFunction& lff) const
msg << " ";
}
msg << ")";
- cmSystemTools::Message(msg.str().c_str());
+ cmSystemTools::Message(msg.str());
}
// Helper class to make sure the call stack is valid.
@@ -1622,7 +1622,7 @@ void cmMakefile::ConfigureSubDirectory(cmMakefile* mf)
if (this->GetCMakeInstance()->GetDebugOutput()) {
std::string msg = " Entering ";
msg += currentStart;
- cmSystemTools::Message(msg.c_str());
+ cmSystemTools::Message(msg);
}
std::string const currentStartFile = currentStart + "/CMakeLists.txt";
@@ -1665,7 +1665,7 @@ void cmMakefile::ConfigureSubDirectory(cmMakefile* mf)
if (this->GetCMakeInstance()->GetDebugOutput()) {
std::string msg = " Returning to ";
msg += this->GetCurrentSourceDirectory();
- cmSystemTools::Message(msg.c_str());
+ cmSystemTools::Message(msg);
}
}
@@ -1985,7 +1985,9 @@ cmTarget* cmMakefile::AddLibrary(const std::string& lname,
// over changes in CMakeLists.txt, making the information stale and
// hence useless.
target->ClearDependencyInformation(*this);
- if (excludeFromAll || this->GetPropertyAsBool("EXCLUDE_FROM_ALL")) {
+ if (excludeFromAll ||
+ (type != cmStateEnums::INTERFACE_LIBRARY &&
+ this->GetPropertyAsBool("EXCLUDE_FROM_ALL"))) {
target->SetProperty("EXCLUDE_FROM_ALL", "TRUE");
}
target->AddSources(srcs);
@@ -2738,7 +2740,6 @@ typedef enum
} t_domain;
struct t_lookup
{
- t_lookup() {}
t_domain domain = NORMAL;
size_t loc = 0;
};
@@ -3750,8 +3751,7 @@ int cmMakefile::ConfigureFile(const char* infile, const char* outfile,
}
if (copyonly) {
- if (!cmSystemTools::CopyFileIfDifferent(sinfile.c_str(),
- soutfile.c_str())) {
+ if (!cmSystemTools::CopyFileIfDifferent(sinfile, soutfile)) {
return 0;
}
} else {
@@ -3802,8 +3802,7 @@ int cmMakefile::ConfigureFile(const char* infile, const char* outfile,
// close the files before attempting to copy
fin.close();
fout.close();
- if (!cmSystemTools::CopyFileIfDifferent(tempOutputFile.c_str(),
- soutfile.c_str())) {
+ if (!cmSystemTools::CopyFileIfDifferent(tempOutputFile, soutfile)) {
res = 0;
} else {
cmSystemTools::SetPermissions(soutfile, perm);
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 2bd44e2b60..70a5689e13 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -65,8 +65,6 @@ public:
*/
class cmMakefile
{
- CM_DISABLE_COPY(cmMakefile)
-
public:
/* Mark a variable as used */
void MarkVariableAsUsed(const std::string& var);
@@ -84,6 +82,9 @@ public:
*/
~cmMakefile();
+ cmMakefile(cmMakefile const&) = delete;
+ cmMakefile& operator=(cmMakefile const&) = delete;
+
cmDirectoryId GetDirectoryId() const;
bool ReadListFile(const std::string& filename);
@@ -780,15 +781,18 @@ public:
/** Helper class to push and pop scopes automatically. */
class ScopePushPop
{
- CM_DISABLE_COPY(ScopePushPop)
public:
ScopePushPop(cmMakefile* m)
: Makefile(m)
{
this->Makefile->PushScope();
}
+
~ScopePushPop() { this->Makefile->PopScope(); }
+ ScopePushPop(ScopePushPop const&) = delete;
+ ScopePushPop& operator=(ScopePushPop const&) = delete;
+
private:
cmMakefile* Makefile;
};
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index e576b5f8e6..e8ae5ae362 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -95,7 +95,13 @@ void cmMakefileExecutableTargetGenerator::WriteDeviceExecutableRule(
const bool hasCUDA =
(std::find(closure->Languages.begin(), closure->Languages.end(),
cuda_lang) != closure->Languages.end());
- if (!hasCUDA) {
+
+ bool doDeviceLinking = true;
+ if (const char* resolveDeviceSymbols =
+ this->GeneratorTarget->GetProperty("CUDA_RESOLVE_DEVICE_SYMBOLS")) {
+ doDeviceLinking = cmSystemTools::IsOn(resolveDeviceSymbols);
+ }
+ if (!hasCUDA || !doDeviceLinking) {
return;
}
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 72181ab99e..5a1ef4efe2 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -133,9 +133,12 @@ void cmMakefileLibraryTargetGenerator::WriteStaticLibraryRules()
(std::find(closure->Languages.begin(), closure->Languages.end(),
cuda_lang) != closure->Languages.end());
- const bool resolveDeviceSymbols =
- this->GeneratorTarget->GetPropertyAsBool("CUDA_RESOLVE_DEVICE_SYMBOLS");
- if (hasCUDA && resolveDeviceSymbols) {
+ bool doDeviceLinking = false;
+ if (const char* resolveDeviceSymbols =
+ this->GeneratorTarget->GetProperty("CUDA_RESOLVE_DEVICE_SYMBOLS")) {
+ doDeviceLinking = cmSystemTools::IsOn(resolveDeviceSymbols);
+ }
+ if (hasCUDA && doDeviceLinking) {
std::string linkRuleVar = "CMAKE_CUDA_DEVICE_LINK_LIBRARY";
this->WriteDeviceLibraryRules(linkRuleVar, false);
}
@@ -168,7 +171,12 @@ void cmMakefileLibraryTargetGenerator::WriteSharedLibraryRules(bool relink)
const bool hasCUDA =
(std::find(closure->Languages.begin(), closure->Languages.end(),
cuda_lang) != closure->Languages.end());
- if (hasCUDA) {
+ bool doDeviceLinking = true;
+ if (const char* resolveDeviceSymbols =
+ this->GeneratorTarget->GetProperty("CUDA_RESOLVE_DEVICE_SYMBOLS")) {
+ doDeviceLinking = cmSystemTools::IsOn(resolveDeviceSymbols);
+ }
+ if (hasCUDA && doDeviceLinking) {
std::string linkRuleVar = "CMAKE_CUDA_DEVICE_LINK_LIBRARY";
this->WriteDeviceLibraryRules(linkRuleVar, relink);
}
@@ -209,7 +217,12 @@ void cmMakefileLibraryTargetGenerator::WriteModuleLibraryRules(bool relink)
const bool hasCUDA =
(std::find(closure->Languages.begin(), closure->Languages.end(),
cuda_lang) != closure->Languages.end());
- if (hasCUDA) {
+ bool doDeviceLinking = true;
+ if (const char* resolveDeviceSymbols =
+ this->GeneratorTarget->GetProperty("CUDA_RESOLVE_DEVICE_SYMBOLS")) {
+ doDeviceLinking = cmSystemTools::IsOn(resolveDeviceSymbols);
+ }
+ if (hasCUDA && doDeviceLinking) {
std::string linkRuleVar = "CMAKE_CUDA_DEVICE_LINK_LIBRARY";
this->WriteDeviceLibraryRules(linkRuleVar, relink);
}
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 0fad2336f4..af34169c39 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -403,7 +403,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
err << "Warning: Source file \"" << source.GetFullPath()
<< "\" is listed multiple times for target \""
<< this->GeneratorTarget->GetName() << "\".";
- cmSystemTools::Message(err.str().c_str(), "Warning");
+ cmSystemTools::Message(err.str(), "Warning");
return;
}
diff --git a/Source/cmMessageCommand.cxx b/Source/cmMessageCommand.cxx
index 4c26c66686..95f5fcbbe9 100644
--- a/Source/cmMessageCommand.cxx
+++ b/Source/cmMessageCommand.cxx
@@ -70,7 +70,7 @@ bool cmMessageCommand::InitialPass(std::vector<std::string> const& args,
if (status) {
this->Makefile->DisplayStatus(message.c_str(), -1);
} else {
- cmSystemTools::Message(message.c_str());
+ cmSystemTools::Message(message);
}
}
if (fatal) {
diff --git a/Source/cmMessenger.cxx b/Source/cmMessenger.cxx
index 3d788f6927..1d790e2e8f 100644
--- a/Source/cmMessenger.cxx
+++ b/Source/cmMessenger.cxx
@@ -124,9 +124,9 @@ void displayMessage(MessageType t, std::ostringstream& msg)
if (t == MessageType::FATAL_ERROR || t == MessageType::INTERNAL_ERROR ||
t == MessageType::DEPRECATION_ERROR || t == MessageType::AUTHOR_ERROR) {
cmSystemTools::SetErrorOccured();
- cmSystemTools::Message(msg.str().c_str(), "Error");
+ cmSystemTools::Message(msg.str(), "Error");
} else {
- cmSystemTools::Message(msg.str().c_str(), "Warning");
+ cmSystemTools::Message(msg.str(), "Warning");
}
}
diff --git a/Source/cmNewLineStyle.cxx b/Source/cmNewLineStyle.cxx
index 12c18eea22..3f6523e09c 100644
--- a/Source/cmNewLineStyle.cxx
+++ b/Source/cmNewLineStyle.cxx
@@ -4,9 +4,7 @@
#include <stddef.h>
-cmNewLineStyle::cmNewLineStyle()
-{
-}
+cmNewLineStyle::cmNewLineStyle() = default;
bool cmNewLineStyle::IsValid() const
{
diff --git a/Source/cmNinjaLinkLineComputer.h b/Source/cmNinjaLinkLineComputer.h
index 0ed53f45a2..b2b2e84e1c 100644
--- a/Source/cmNinjaLinkLineComputer.h
+++ b/Source/cmNinjaLinkLineComputer.h
@@ -16,13 +16,14 @@ class cmStateDirectory;
class cmNinjaLinkLineComputer : public cmLinkLineComputer
{
- CM_DISABLE_COPY(cmNinjaLinkLineComputer)
-
public:
cmNinjaLinkLineComputer(cmOutputConverter* outputConverter,
cmStateDirectory const& stateDir,
cmGlobalNinjaGenerator const* gg);
+ cmNinjaLinkLineComputer(cmNinjaLinkLineComputer const&) = delete;
+ cmNinjaLinkLineComputer& operator=(cmNinjaLinkLineComputer const&) = delete;
+
std::string ConvertToLinkReference(std::string const& input) const override;
private:
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 0d05782ce4..cbc01035ff 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -566,22 +566,23 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement()
(std::find(closure->Languages.begin(), closure->Languages.end(),
cuda_lang) != closure->Languages.end());
- bool shouldHaveDeviceLinking = false;
- switch (genTarget.GetType()) {
- case cmStateEnums::SHARED_LIBRARY:
- case cmStateEnums::MODULE_LIBRARY:
- case cmStateEnums::EXECUTABLE:
- shouldHaveDeviceLinking = true;
- break;
- case cmStateEnums::STATIC_LIBRARY:
- shouldHaveDeviceLinking =
- genTarget.GetPropertyAsBool("CUDA_RESOLVE_DEVICE_SYMBOLS");
- break;
- default:
- break;
+ bool doDeviceLinking = false;
+ if (const char* resolveDeviceSymbols =
+ genTarget.GetProperty("CUDA_RESOLVE_DEVICE_SYMBOLS")) {
+ doDeviceLinking = cmSystemTools::IsOn(resolveDeviceSymbols);
+ } else {
+ switch (genTarget.GetType()) {
+ case cmStateEnums::SHARED_LIBRARY:
+ case cmStateEnums::MODULE_LIBRARY:
+ case cmStateEnums::EXECUTABLE:
+ doDeviceLinking = true;
+ break;
+ default:
+ break;
+ }
}
- if (!(shouldHaveDeviceLinking && hasCUDA)) {
+ if (!(doDeviceLinking && hasCUDA)) {
return;
}
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index edb0ef3ae8..82bc5f204a 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -173,8 +173,28 @@ void cmNinjaTargetGenerator::AddIncludeFlags(std::string& languageFlags,
bool cmNinjaTargetGenerator::NeedDepTypeMSVC(const std::string& lang) const
{
- return (this->GetMakefile()->GetSafeDefinition("CMAKE_NINJA_DEPTYPE_" +
- lang) == "msvc");
+ std::string const& deptype =
+ this->GetMakefile()->GetSafeDefinition("CMAKE_NINJA_DEPTYPE_" + lang);
+ if (deptype == "msvc") {
+ return true;
+ }
+ if (deptype == "intel") {
+ // Ninja does not really define "intel", but we use it to switch based
+ // on whether this environment supports "gcc" or "msvc" deptype.
+ if (!this->GetGlobalGenerator()->SupportsMultilineDepfile()) {
+ // This ninja version is too old to support the Intel depfile format.
+ // Fall back to msvc deptype.
+ return true;
+ }
+ if ((this->Makefile->GetHomeDirectory().find(' ') != std::string::npos) ||
+ (this->Makefile->GetHomeOutputDirectory().find(' ') !=
+ std::string::npos)) {
+ // The Intel compiler does not properly escape spaces in a depfile.
+ // Fall back to msvc deptype.
+ return true;
+ }
+ }
+ return false;
}
// TODO: Refactor with
@@ -630,10 +650,6 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang)
}
} else {
deptype = "gcc";
- const char* langdeptype = mf->GetDefinition("CMAKE_NINJA_DEPTYPE_" + lang);
- if (langdeptype) {
- deptype = langdeptype;
- }
depfile = "$DEP_FILE";
const std::string flagsName = "CMAKE_DEPFILE_FLAGS_" + lang;
std::string depfileFlags = mf->GetSafeDefinition(flagsName);
@@ -984,7 +1000,7 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
// (either attached to this source file or another one), assume that one of
// the target dependencies, OBJECT_DEPENDS or header file custom commands
// will rebuild the file.
- if (source->GetPropertyAsBool("GENERATED") &&
+ if (source->GetIsGenerated() &&
!source->GetPropertyAsBool("__CMAKE_GENERATED_BY_CMAKE") &&
!source->GetCustomCommand() &&
!this->GetGlobalGenerator()->HasCustomCommandOutput(sourceFileName)) {
@@ -1128,6 +1144,10 @@ void cmNinjaTargetGenerator::WriteTargetDependInfo(std::string const& lang)
mod_dir = this->Makefile->GetCurrentBinaryDirectory();
}
tdi["module-dir"] = mod_dir;
+ tdi["submodule-sep"] =
+ this->Makefile->GetSafeDefinition("CMAKE_Fortran_SUBMODULE_SEP");
+ tdi["submodule-ext"] =
+ this->Makefile->GetSafeDefinition("CMAKE_Fortran_SUBMODULE_EXT");
}
tdi["dir-cur-bld"] = this->Makefile->GetCurrentBinaryDirectory();
diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx
index 5057dc4347..95fcf66f46 100644
--- a/Source/cmNinjaUtilityTargetGenerator.cxx
+++ b/Source/cmNinjaUtilityTargetGenerator.cxx
@@ -26,9 +26,7 @@ cmNinjaUtilityTargetGenerator::cmNinjaUtilityTargetGenerator(
{
}
-cmNinjaUtilityTargetGenerator::~cmNinjaUtilityTargetGenerator()
-{
-}
+cmNinjaUtilityTargetGenerator::~cmNinjaUtilityTargetGenerator() = default;
void cmNinjaUtilityTargetGenerator::Generate()
{
diff --git a/Source/cmOSXBundleGenerator.h b/Source/cmOSXBundleGenerator.h
index ba5bee03a9..3dea6cc8a8 100644
--- a/Source/cmOSXBundleGenerator.h
+++ b/Source/cmOSXBundleGenerator.h
@@ -31,7 +31,7 @@ public:
struct MacOSXContentGeneratorType
{
- virtual ~MacOSXContentGeneratorType() {}
+ virtual ~MacOSXContentGeneratorType() = default;
virtual void operator()(cmSourceFile const& source,
const char* pkgloc) = 0;
};
diff --git a/Source/cmOrderDirectories.cxx b/Source/cmOrderDirectories.cxx
index 961e2b240d..2c28fc0b7d 100644
--- a/Source/cmOrderDirectories.cxx
+++ b/Source/cmOrderDirectories.cxx
@@ -48,7 +48,7 @@ public:
this->FileName = cmSystemTools::GetFilenameName(file);
}
}
- virtual ~cmOrderDirectoriesConstraint() {}
+ virtual ~cmOrderDirectoriesConstraint() = default;
void AddDirectory()
{
diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx
index 011c7d896b..7d88b088e8 100644
--- a/Source/cmOutputConverter.cxx
+++ b/Source/cmOutputConverter.cxx
@@ -10,7 +10,6 @@
#include <vector>
#include "cmState.h"
-#include "cmStateDirectory.h"
#include "cmSystemTools.h"
cmOutputConverter::cmOutputConverter(cmStateSnapshot const& snapshot)
@@ -72,17 +71,6 @@ std::string cmOutputConverter::ConvertDirectorySeparatorsForShell(
return result;
}
-std::string cmOutputConverter::ConvertToRelativePath(
- std::string const& local_path, std::string const& remote_path) const
-{
- if (!this->StateSnapshot.GetDirectory().ContainsBoth(local_path,
- remote_path)) {
- return remote_path;
- }
-
- return cmSystemTools::ForceToRelativePath(local_path, remote_path);
-}
-
static bool cmOutputConverterIsShellOperator(const std::string& str)
{
static std::set<std::string> shellOperators;
diff --git a/Source/cmOutputConverter.h b/Source/cmOutputConverter.h
index 5a4f879813..6438c7bad4 100644
--- a/Source/cmOutputConverter.h
+++ b/Source/cmOutputConverter.h
@@ -91,16 +91,6 @@ public:
};
static FortranFormat GetFortranFormat(const char* value);
- /**
- * Convert the given remote path to a relative path with respect to
- * the given local path. Both paths must use forward slashes and not
- * already be escaped or quoted.
- * The conversion is skipped if the paths are not both in the source
- * or both in the binary tree.
- */
- std::string ConvertToRelativePath(std::string const& local_path,
- std::string const& remote_path) const;
-
private:
cmState* GetState() const;
diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx
index ff1e027972..46d04a65f0 100644
--- a/Source/cmOutputRequiredFilesCommand.cxx
+++ b/Source/cmOutputRequiredFilesCommand.cxx
@@ -28,7 +28,7 @@ public:
* Construct with dependency generation marked not done; instance
* not placed in cmMakefile's list.
*/
- cmDependInformation() {}
+ cmDependInformation() = default;
/**
* The set of files on which this one depends.
diff --git a/Source/cmProcessOutput.cxx b/Source/cmProcessOutput.cxx
index e4ca426cc8..e80ea5c8d6 100644
--- a/Source/cmProcessOutput.cxx
+++ b/Source/cmProcessOutput.cxx
@@ -48,9 +48,7 @@ cmProcessOutput::cmProcessOutput(Encoding encoding, unsigned int maxSize)
#endif
}
-cmProcessOutput::~cmProcessOutput()
-{
-}
+cmProcessOutput::~cmProcessOutput() = default;
bool cmProcessOutput::DecodeText(std::string raw, std::string& decoded,
size_t id)
diff --git a/Source/cmProcessTools.h b/Source/cmProcessTools.h
index da3693d1a7..76163167a6 100644
--- a/Source/cmProcessTools.h
+++ b/Source/cmProcessTools.h
@@ -34,7 +34,7 @@ public:
return this->Process(data, static_cast<int>(strlen(data)));
}
- virtual ~OutputParser() {}
+ virtual ~OutputParser() = default;
protected:
/** Implement in a subclass to process a chunk of data. It should
diff --git a/Source/cmQTWrapCPPCommand.cxx b/Source/cmQTWrapCPPCommand.cxx
index d2133ed794..6acc7ef86b 100644
--- a/Source/cmQTWrapCPPCommand.cxx
+++ b/Source/cmQTWrapCPPCommand.cxx
@@ -50,7 +50,7 @@ bool cmQTWrapCPPCommand::InitialPass(std::vector<std::string> const& args,
if (cmSystemTools::FileIsFullPath(*j)) {
hname = *j;
} else {
- if (curr && curr->GetPropertyAsBool("GENERATED")) {
+ if (curr && curr->GetIsGenerated()) {
hname = this->Makefile->GetCurrentBinaryDirectory();
} else {
hname = this->Makefile->GetCurrentSourceDirectory();
diff --git a/Source/cmQTWrapUICommand.cxx b/Source/cmQTWrapUICommand.cxx
index 25dcd1a640..43b1fb9b6d 100644
--- a/Source/cmQTWrapUICommand.cxx
+++ b/Source/cmQTWrapUICommand.cxx
@@ -58,7 +58,7 @@ bool cmQTWrapUICommand::InitialPass(std::vector<std::string> const& args,
if (cmSystemTools::FileIsFullPath(*j)) {
uiName = *j;
} else {
- if (curr && curr->GetPropertyAsBool("GENERATED")) {
+ if (curr && curr->GetIsGenerated()) {
uiName = this->Makefile->GetCurrentBinaryDirectory();
} else {
uiName = this->Makefile->GetCurrentSourceDirectory();
diff --git a/Source/cmQtAutoGenGlobalInitializer.cxx b/Source/cmQtAutoGenGlobalInitializer.cxx
index 431c5bc21a..3ad91eec64 100644
--- a/Source/cmQtAutoGenGlobalInitializer.cxx
+++ b/Source/cmQtAutoGenGlobalInitializer.cxx
@@ -6,10 +6,12 @@
#include "cmAlgorithms.h"
#include "cmCustomCommandLines.h"
+#include "cmDuration.h"
#include "cmGeneratorTarget.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
+#include "cmProcessOutput.h"
#include "cmState.h"
#include "cmStateTypes.h"
#include "cmSystemTools.h"
@@ -129,9 +131,7 @@ cmQtAutoGenGlobalInitializer::cmQtAutoGenGlobalInitializer(
}
}
-cmQtAutoGenGlobalInitializer::~cmQtAutoGenGlobalInitializer()
-{
-}
+cmQtAutoGenGlobalInitializer::~cmQtAutoGenGlobalInitializer() = default;
void cmQtAutoGenGlobalInitializer::GetOrCreateGlobalTarget(
cmLocalGenerator* localGen, std::string const& name,
@@ -185,6 +185,68 @@ void cmQtAutoGenGlobalInitializer::AddToGlobalAutoRcc(
}
}
+bool cmQtAutoGenGlobalInitializer::GetExecutableTestOutput(
+ std::string const& generator, std::string const& executable,
+ std::string& error, std::string* output)
+{
+ // Check if we have cached output
+ {
+ auto it = this->ExecutableTestOutputs_.find(executable);
+ if (it != this->ExecutableTestOutputs_.end()) {
+ // Return output on demand
+ if (output != nullptr) {
+ *output = it->second;
+ }
+ return true;
+ }
+ }
+
+ // Check if the executable exists
+ if (!cmSystemTools::FileExists(executable, true)) {
+ error = "The \"";
+ error += generator;
+ error += "\" executable ";
+ error += cmQtAutoGen::Quoted(executable);
+ error += " does not exist.";
+ return false;
+ }
+
+ // Test the executable
+ std::string stdOut;
+ {
+ std::string stdErr;
+ std::vector<std::string> command;
+ command.push_back(executable);
+ command.emplace_back("-h");
+ int retVal = 0;
+ const bool runResult = cmSystemTools::RunSingleCommand(
+ command, &stdOut, &stdErr, &retVal, nullptr, cmSystemTools::OUTPUT_NONE,
+ cmDuration::zero(), cmProcessOutput::Auto);
+ if (!runResult) {
+ error = "Test run of \"";
+ error += generator;
+ error += "\" executable ";
+ error += cmQtAutoGen::Quoted(executable) + " failed.\n";
+ error += cmQtAutoGen::QuotedCommand(command);
+ error += "\n";
+ error += stdOut;
+ error += "\n";
+ error += stdErr;
+ return false;
+ }
+ }
+
+ // Return executable output on demand
+ if (output != nullptr) {
+ *output = stdOut;
+ }
+
+ // Register executable and output
+ this->ExecutableTestOutputs_.emplace(executable, std::move(stdOut));
+
+ return true;
+}
+
bool cmQtAutoGenGlobalInitializer::generate()
{
return (InitializeCustomTargets() && SetupCustomTargets());
diff --git a/Source/cmQtAutoGenGlobalInitializer.h b/Source/cmQtAutoGenGlobalInitializer.h
index 9e6bac0e3f..74184a0d51 100644
--- a/Source/cmQtAutoGenGlobalInitializer.h
+++ b/Source/cmQtAutoGenGlobalInitializer.h
@@ -8,6 +8,7 @@
#include <map>
#include <memory> // IWYU pragma: keep
#include <string>
+#include <unordered_map>
#include <vector>
class cmLocalGenerator;
@@ -38,10 +39,15 @@ private:
void AddToGlobalAutoRcc(cmLocalGenerator* localGen,
std::string const& targetName);
+ bool GetExecutableTestOutput(std::string const& generator,
+ std::string const& executable,
+ std::string& error, std::string* output);
+
private:
std::vector<std::unique_ptr<cmQtAutoGenInitializer>> Initializers_;
std::map<cmLocalGenerator*, std::string> GlobalAutoGenTargets_;
std::map<cmLocalGenerator*, std::string> GlobalAutoRccTargets_;
+ std::unordered_map<std::string, std::string> ExecutableTestOutputs_;
};
#endif
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index e0795d2c66..614a88bde6 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -520,19 +520,16 @@ bool cmQtAutoGenInitializer::InitMoc()
// Moc includes
{
- // We need to disable this until we have all implicit includes available.
- // See issue #18669.
- // bool const appendImplicit = (this->QtVersion.Major >= 5);
-
+ bool const appendImplicit = (this->QtVersion.Major >= 5);
auto GetIncludeDirs =
- [this, localGen](std::string const& cfg) -> std::vector<std::string> {
- bool const appendImplicit = false;
+ [this, localGen,
+ appendImplicit](std::string const& cfg) -> std::vector<std::string> {
// Get the include dirs for this target, without stripping the implicit
// include dirs off, see
// https://gitlab.kitware.com/cmake/cmake/issues/13667
std::vector<std::string> dirs;
- localGen->GetIncludeDirectories(dirs, this->Target, "CXX", cfg, false,
- appendImplicit);
+ localGen->GetIncludeDirectoriesImplicit(dirs, this->Target, "CXX", cfg,
+ false, appendImplicit);
return dirs;
};
@@ -619,40 +616,6 @@ bool cmQtAutoGenInitializer::InitUic()
}
}
}
- // .ui files skip and options
- {
- std::string const uiExt = "ui";
- std::string pathError;
- for (cmSourceFile* sf : makefile->GetSourceFiles()) {
- // sf->GetExtension() is only valid after sf->GetFullPath() ...
- // Since we're iterating over source files that might be not in the
- // target we need to check for path errors (not existing files).
- std::string const& fPath = sf->GetFullPath(&pathError);
- if (!pathError.empty()) {
- pathError.clear();
- continue;
- }
- if (sf->GetExtension() == uiExt) {
- std::string const absFile = cmSystemTools::GetRealPath(fPath);
- // Check if the .ui file should be skipped
- if (sf->GetPropertyAsBool("SKIP_AUTOUIC") ||
- sf->GetPropertyAsBool("SKIP_AUTOGEN")) {
- this->Uic.Skip.insert(absFile);
- }
- // Check if the .ui file has uic options
- std::string const uicOpts = sf->GetSafeProperty("AUTOUIC_OPTIONS");
- if (!uicOpts.empty()) {
- // Check if file isn't skipped
- if (this->Uic.Skip.count(absFile) == 0) {
- this->Uic.FileFiles.push_back(absFile);
- std::vector<std::string> optsVec;
- cmSystemTools::ExpandListArgument(uicOpts, optsVec);
- this->Uic.FileOptions.push_back(std::move(optsVec));
- }
- }
- }
- }
- }
// Uic executable
return GetUicExecutable();
@@ -667,29 +630,43 @@ bool cmQtAutoGenInitializer::InitScanFiles()
{
cmMakefile* makefile = this->Target->Target->GetMakefile();
+ // String constants
+ std::string const SKIP_AUTOGEN_str = "SKIP_AUTOGEN";
+ std::string const SKIP_AUTOMOC_str = "SKIP_AUTOMOC";
+ std::string const SKIP_AUTOUIC_str = "SKIP_AUTOUIC";
+
// Scan through target files
{
- std::string const qrcExt = "qrc";
+ // String constants
+ std::string const qrc_str = "qrc";
+ std::string const SKIP_AUTORCC_str = "SKIP_AUTORCC";
+ std::string const AUTORCC_OPTIONS_str = "AUTORCC_OPTIONS";
+
+ // Scan through target files
std::vector<cmSourceFile*> srcFiles;
this->Target->GetConfigCommonSourceFiles(srcFiles);
for (cmSourceFile* sf : srcFiles) {
- if (sf->GetPropertyAsBool("SKIP_AUTOGEN")) {
+ if (sf->GetPropertyAsBool(SKIP_AUTOGEN_str)) {
continue;
}
+
// sf->GetExtension() is only valid after sf->GetFullPath() ...
std::string const& fPath = sf->GetFullPath();
std::string const& ext = sf->GetExtension();
+
// Register generated files that will be scanned by moc or uic
if (this->Moc.Enabled || this->Uic.Enabled) {
cmSystemTools::FileFormat const fileType =
- cmSystemTools::GetFileFormat(ext.c_str());
+ cmSystemTools::GetFileFormat(ext);
if ((fileType == cmSystemTools::CXX_FILE_FORMAT) ||
(fileType == cmSystemTools::HEADER_FILE_FORMAT)) {
std::string const absPath = cmSystemTools::GetRealPath(fPath);
- if ((this->Moc.Enabled && !sf->GetPropertyAsBool("SKIP_AUTOMOC")) ||
- (this->Uic.Enabled && !sf->GetPropertyAsBool("SKIP_AUTOUIC"))) {
+ if ((this->Moc.Enabled &&
+ !sf->GetPropertyAsBool(SKIP_AUTOMOC_str)) ||
+ (this->Uic.Enabled &&
+ !sf->GetPropertyAsBool(SKIP_AUTOUIC_str))) {
// Register source
- const bool generated = sf->GetPropertyAsBool("GENERATED");
+ const bool generated = sf->GetIsGenerated();
if (fileType == cmSystemTools::HEADER_FILE_FORMAT) {
if (generated) {
this->AutogenTarget.HeadersGenerated.push_back(absPath);
@@ -707,18 +684,17 @@ bool cmQtAutoGenInitializer::InitScanFiles()
}
}
// Register rcc enabled files
- if (this->Rcc.Enabled && (ext == qrcExt) &&
- !sf->GetPropertyAsBool("SKIP_AUTORCC")) {
- // Register qrc file
- {
+ if (this->Rcc.Enabled) {
+ if ((ext == qrc_str) && !sf->GetPropertyAsBool(SKIP_AUTORCC_str)) {
+ // Register qrc file
Qrc qrc;
qrc.QrcFile = cmSystemTools::GetRealPath(fPath);
qrc.QrcName =
cmSystemTools::GetFilenameWithoutLastExtension(qrc.QrcFile);
- qrc.Generated = sf->GetPropertyAsBool("GENERATED");
+ qrc.Generated = sf->GetIsGenerated();
// RCC options
{
- std::string const opts = sf->GetSafeProperty("AUTORCC_OPTIONS");
+ std::string const opts = sf->GetSafeProperty(AUTORCC_OPTIONS_str);
if (!opts.empty()) {
cmSystemTools::ExpandListArgument(opts, qrc.Options);
}
@@ -734,43 +710,65 @@ bool cmQtAutoGenInitializer::InitScanFiles()
// mocs_compilation.cpp source acknowledged by this target.
this->Target->ClearSourcesCache();
+ // Scan through all source files in the makefile to extract moc and uic
+ // parameters. Historically we support non target source file parameters.
+ // The reason is that their file names might be discovered from source files
+ // at generation time.
if (this->Moc.Enabled || this->Uic.Enabled) {
- // Read skip files from makefile sources
- {
+ // String constants
+ std::string const ui_str = "ui";
+ std::string const AUTOUIC_OPTIONS_str = "AUTOUIC_OPTIONS";
+
+ for (cmSourceFile* sf : makefile->GetSourceFiles()) {
+ // sf->GetExtension() is only valid after sf->GetFullPath() ...
+ // Since we're iterating over source files that might be not in the
+ // target we need to check for path errors (not existing files).
std::string pathError;
- for (cmSourceFile* sf : makefile->GetSourceFiles()) {
- // sf->GetExtension() is only valid after sf->GetFullPath() ...
- // Since we're iterating over source files that might be not in the
- // target we need to check for path errors (not existing files).
- std::string const& fPath = sf->GetFullPath(&pathError);
- if (!pathError.empty()) {
- pathError.clear();
- continue;
+ std::string const& fullPath = sf->GetFullPath(&pathError);
+ if (!pathError.empty() || fullPath.empty()) {
+ continue;
+ }
+
+ // Check file type
+ auto const fileType = cmSystemTools::GetFileFormat(sf->GetExtension());
+ bool const isSource = (fileType == cmSystemTools::CXX_FILE_FORMAT) ||
+ (fileType == cmSystemTools::HEADER_FILE_FORMAT);
+ bool const isUi = (this->Moc.Enabled && sf->GetExtension() == ui_str);
+
+ // Process only certain file types
+ if (isSource || isUi) {
+ std::string const absFile = cmSystemTools::GetRealPath(fullPath);
+ // Acquire file properties
+ bool const skipAUTOGEN = sf->GetPropertyAsBool(SKIP_AUTOGEN_str);
+ bool const skipMoc = (this->Moc.Enabled && isSource) &&
+ (skipAUTOGEN || sf->GetPropertyAsBool(SKIP_AUTOMOC_str));
+ bool const skipUic = this->Uic.Enabled &&
+ (skipAUTOGEN || sf->GetPropertyAsBool(SKIP_AUTOUIC_str));
+
+ // Register moc and uic skipped file
+ if (skipMoc) {
+ this->Moc.Skip.insert(absFile);
}
- cmSystemTools::FileFormat const fileType =
- cmSystemTools::GetFileFormat(sf->GetExtension().c_str());
- if (!(fileType == cmSystemTools::CXX_FILE_FORMAT) &&
- !(fileType == cmSystemTools::HEADER_FILE_FORMAT)) {
- continue;
+ if (skipUic) {
+ this->Uic.Skip.insert(absFile);
}
- const bool skipAll = sf->GetPropertyAsBool("SKIP_AUTOGEN");
- const bool mocSkip = this->Moc.Enabled &&
- (skipAll || sf->GetPropertyAsBool("SKIP_AUTOMOC"));
- const bool uicSkip = this->Uic.Enabled &&
- (skipAll || sf->GetPropertyAsBool("SKIP_AUTOUIC"));
- if (mocSkip || uicSkip) {
- std::string const absFile = cmSystemTools::GetRealPath(fPath);
- if (mocSkip) {
- this->Moc.Skip.insert(absFile);
- }
- if (uicSkip) {
- this->Uic.Skip.insert(absFile);
+
+ // Check if the .ui file has uic options
+ if (isUi && !skipUic) {
+ std::string const uicOpts = sf->GetSafeProperty(AUTOUIC_OPTIONS_str);
+ if (!uicOpts.empty()) {
+ this->Uic.FileFiles.push_back(absFile);
+ std::vector<std::string> optsVec;
+ cmSystemTools::ExpandListArgument(uicOpts, optsVec);
+ this->Uic.FileOptions.push_back(std::move(optsVec));
}
}
}
}
+ }
- // Process GENERATED sources and headers
+ // Process GENERATED sources and headers
+ if (this->Moc.Enabled || this->Uic.Enabled) {
if (!this->AutogenTarget.SourcesGenerated.empty() ||
!this->AutogenTarget.HeadersGenerated.empty()) {
// Check status of policy CMP0071
@@ -846,13 +844,14 @@ bool cmQtAutoGenInitializer::InitScanFiles()
}
}
}
- // Sort headers and sources
- if (this->Moc.Enabled || this->Uic.Enabled) {
- std::sort(this->AutogenTarget.Headers.begin(),
- this->AutogenTarget.Headers.end());
- std::sort(this->AutogenTarget.Sources.begin(),
- this->AutogenTarget.Sources.end());
- }
+ }
+
+ // Sort headers and sources
+ if (this->Moc.Enabled || this->Uic.Enabled) {
+ std::sort(this->AutogenTarget.Headers.begin(),
+ this->AutogenTarget.Headers.end());
+ std::sort(this->AutogenTarget.Sources.begin(),
+ this->AutogenTarget.Sources.end());
}
// Process qrc files
@@ -1373,7 +1372,7 @@ void cmQtAutoGenInitializer::AddGeneratedSource(std::string const& filename,
this->Target->AddSource(filename, prepend);
}
-static unsigned int CharPtrToInt(const char* const input)
+static unsigned int CharPtrToUInt(const char* const input)
{
unsigned long tmp = 0;
if (input != nullptr && cmSystemTools::StringToULong(input, &tmp)) {
@@ -1382,36 +1381,43 @@ static unsigned int CharPtrToInt(const char* const input)
return 0;
}
-static unsigned int StringToInt(const std::string& input)
-{
- return input.empty() ? 0 : CharPtrToInt(input.c_str());
-}
-
-static std::vector<cmQtAutoGenInitializer::IntegerVersion> GetKnownQtVersions(
+static std::vector<cmQtAutoGen::IntegerVersion> GetKnownQtVersions(
cmGeneratorTarget const* target)
{
cmMakefile* makefile = target->Target->GetMakefile();
-
- std::vector<cmQtAutoGenInitializer::IntegerVersion> result;
- for (const std::string& prefix :
- std::vector<std::string>({ "Qt6Core", "Qt5Core", "QT" })) {
- auto tmp = cmQtAutoGenInitializer::IntegerVersion(
- StringToInt(makefile->GetSafeDefinition(prefix + "_VERSION_MAJOR")),
- StringToInt(makefile->GetSafeDefinition(prefix + "_VERSION_MINOR")));
- if (tmp.Major != 0) {
- result.push_back(tmp);
+ std::vector<cmQtAutoGen::IntegerVersion> result;
+ // Adds a version to the result (nullptr safe)
+ auto addVersion = [&result](const char* major, const char* minor) {
+ cmQtAutoGen::IntegerVersion ver(CharPtrToUInt(major),
+ CharPtrToUInt(minor));
+ if (ver.Major != 0) {
+ result.emplace_back(ver);
}
+ };
+ // Qt version variable prefixes
+ std::array<std::string, 3> const prefixes{ { "Qt6Core", "Qt5Core", "QT" } };
+
+ // Read versions from variables
+ for (const std::string& prefix : prefixes) {
+ addVersion(makefile->GetDefinition(prefix + "_VERSION_MAJOR"),
+ makefile->GetDefinition(prefix + "_VERSION_MINOR"));
+ }
+
+ // Read versions from directory properties
+ for (const std::string& prefix : prefixes) {
+ addVersion(makefile->GetProperty(prefix + "_VERSION_MAJOR"),
+ makefile->GetProperty(prefix + "_VERSION_MINOR"));
}
return result;
}
-std::pair<cmQtAutoGenInitializer::IntegerVersion, unsigned int>
+std::pair<cmQtAutoGen::IntegerVersion, unsigned int>
cmQtAutoGenInitializer::GetQtVersion(cmGeneratorTarget const* target)
{
std::pair<IntegerVersion, unsigned int> res(
IntegerVersion(),
- CharPtrToInt(target->GetLinkInterfaceDependentStringProperty(
+ CharPtrToUInt(target->GetLinkInterfaceDependentStringProperty(
"QT_MAJOR_VERSION", "")));
auto knownQtVersions = GetKnownQtVersions(target);
@@ -1433,18 +1439,18 @@ cmQtAutoGenInitializer::GetQtVersion(cmGeneratorTarget const* target)
return res;
}
-std::pair<bool, std::string> GetQtExecutable(
- const cmQtAutoGen::IntegerVersion& qtVersion, cmGeneratorTarget* target,
+std::pair<bool, std::string> cmQtAutoGenInitializer::GetQtExecutable(
const std::string& executable, bool ignoreMissingTarget, std::string* output)
{
const std::string upperExecutable = cmSystemTools::UpperCase(executable);
- std::string result =
- target->Target->GetSafeProperty("AUTO" + upperExecutable + "_EXECUTABLE");
+ std::string result = this->Target->Target->GetSafeProperty(
+ "AUTO" + upperExecutable + "_EXECUTABLE");
if (!result.empty()) {
- cmListFileBacktrace lfbt = target->Target->GetMakefile()->GetBacktrace();
+ cmListFileBacktrace lfbt =
+ this->Target->Target->GetMakefile()->GetBacktrace();
cmGeneratorExpression ge(lfbt);
std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(result);
- result = cge->Evaluate(target->GetLocalGenerator(), "");
+ result = cge->Evaluate(this->Target->GetLocalGenerator(), "");
return std::make_pair(true, result);
}
@@ -1454,12 +1460,12 @@ std::pair<bool, std::string> GetQtExecutable(
// Find executable
{
const std::string targetName =
- GetQtExecutableTargetName(qtVersion, executable);
+ GetQtExecutableTargetName(this->QtVersion, executable);
if (targetName.empty()) {
err = "The AUTO" + upperExecutable + " feature ";
err += "supports only Qt 4, Qt 5 and Qt 6.";
} else {
- cmLocalGenerator* localGen = target->GetLocalGenerator();
+ cmLocalGenerator* localGen = this->Target->GetLocalGenerator();
cmGeneratorTarget* tgt = localGen->FindGeneratorTargetToUse(targetName);
if (tgt != nullptr) {
if (tgt->IsImported()) {
@@ -1479,36 +1485,14 @@ std::pair<bool, std::string> GetQtExecutable(
// Test executable
if (err.empty()) {
- if (cmSystemTools::FileExists(result, true)) {
- std::vector<std::string> command;
- command.push_back(result);
- command.emplace_back("-h");
- std::string stdOut;
- std::string stdErr;
- int retVal = 0;
- const bool runResult = cmSystemTools::RunSingleCommand(
- command, &stdOut, &stdErr, &retVal, nullptr,
- cmSystemTools::OUTPUT_NONE, cmDuration::zero(), cmProcessOutput::Auto);
- if (!runResult) {
- err = "Test of \"" + executable + "\" binary ";
- err += cmQtAutoGen::Quoted(result) + " failed: ";
- err += cmQtAutoGen::QuotedCommand(command);
- } else {
- if (output != nullptr) {
- *output = stdOut;
- }
- }
- } else {
- err = "The \"" + executable + "\" binary ";
- err += cmQtAutoGen::Quoted(result);
- err += " does not exist";
- }
+ this->GlobalInitializer->GetExecutableTestOutput(executable, result, err,
+ output);
}
// Print error
if (!err.empty()) {
std::string msg = "AutoGen (";
- msg += target->GetName();
+ msg += this->Target->GetName();
msg += "): ";
msg += err;
cmSystemTools::Error(msg);
@@ -1520,16 +1504,14 @@ std::pair<bool, std::string> GetQtExecutable(
bool cmQtAutoGenInitializer::GetMocExecutable()
{
- const auto result =
- GetQtExecutable(this->QtVersion, this->Target, "moc", false, nullptr);
+ const auto result = this->GetQtExecutable("moc", false, nullptr);
this->Moc.Executable = result.second;
return result.first;
}
bool cmQtAutoGenInitializer::GetUicExecutable()
{
- const auto result =
- GetQtExecutable(this->QtVersion, this->Target, "uic", true, nullptr);
+ const auto result = this->GetQtExecutable("uic", true, nullptr);
this->Uic.Executable = result.second;
return result.first;
}
@@ -1537,8 +1519,7 @@ bool cmQtAutoGenInitializer::GetUicExecutable()
bool cmQtAutoGenInitializer::GetRccExecutable()
{
std::string stdOut;
- const auto result =
- GetQtExecutable(this->QtVersion, this->Target, "rcc", false, &stdOut);
+ const auto result = this->GetQtExecutable("rcc", false, &stdOut);
this->Rcc.Executable = result.second;
if (!result.first) {
return false;
diff --git a/Source/cmQtAutoGenInitializer.h b/Source/cmQtAutoGenInitializer.h
index eefbaf0285..781dd15d66 100644
--- a/Source/cmQtAutoGenInitializer.h
+++ b/Source/cmQtAutoGenInitializer.h
@@ -26,9 +26,6 @@ public:
class Qrc
{
public:
- Qrc() {}
-
- public:
std::string LockFile;
std::string QrcFile;
std::string QrcName;
@@ -113,6 +110,10 @@ private:
std::vector<std::string>& files,
std::string& errorMessage);
+ std::pair<bool, std::string> GetQtExecutable(const std::string& executable,
+ bool ignoreMissingTarget,
+ std::string* output);
+
private:
cmQtAutoGenGlobalInitializer* GlobalInitializer;
cmGeneratorTarget* Target;
diff --git a/Source/cmQtAutoGenerator.h b/Source/cmQtAutoGenerator.h
index 75143f5a64..9956a99a35 100644
--- a/Source/cmQtAutoGenerator.h
+++ b/Source/cmQtAutoGenerator.h
@@ -24,7 +24,6 @@ class cmMakefile;
/// @brief Base class for QtAutoGen gernerators
class cmQtAutoGenerator : public cmQtAutoGen
{
- CM_DISABLE_COPY(cmQtAutoGenerator)
public:
// -- Types
@@ -206,9 +205,6 @@ public:
bool MergedOutput = false;
};
- // -- Constructor
- ReadOnlyProcessT() = default;
-
// -- Const accessors
const SetupT& Setup() const { return Setup_; }
ProcessResultT* Result() const { return Setup_.Result; }
@@ -248,6 +244,9 @@ public:
cmQtAutoGenerator();
virtual ~cmQtAutoGenerator();
+ cmQtAutoGenerator(cmQtAutoGenerator const&) = delete;
+ cmQtAutoGenerator& operator=(cmQtAutoGenerator const&) = delete;
+
// -- Run
bool Run(std::string const& infoFile, std::string const& config);
diff --git a/Source/cmQtAutoGeneratorMocUic.cxx b/Source/cmQtAutoGeneratorMocUic.cxx
index 068f65c081..ddff4cf879 100644
--- a/Source/cmQtAutoGeneratorMocUic.cxx
+++ b/Source/cmQtAutoGeneratorMocUic.cxx
@@ -678,19 +678,21 @@ void cmQtAutoGeneratorMocUic::JobMocT::Process(WorkerT& wrk)
BuildFile += '/';
BuildFile += IncludeString;
} else {
- std::string rel = wrk.FileSys().GetFilePathChecksum(SourceFile);
- rel += "/moc_";
- rel += wrk.FileSys().GetFilenameWithoutLastExtension(SourceFile);
- rel += ".cpp";
- // Register relative file path
- wrk.Gen().ParallelMocAutoRegister(rel);
+ // Relative build path
+ std::string relPath = wrk.FileSys().GetFilePathChecksum(SourceFile);
+ relPath += "/moc_";
+ relPath += wrk.FileSys().GetFilenameWithoutLastExtension(SourceFile);
+
+ // Register relative file path with duplication check
+ relPath = wrk.Gen().ParallelMocAutoRegister(relPath);
+
// Absolute build path
if (wrk.Base().MultiConfig) {
BuildFile = wrk.Base().AutogenIncludeDir;
BuildFile += '/';
- BuildFile += rel;
+ BuildFile += relPath;
} else {
- BuildFile = wrk.Base().AbsoluteBuildPath(rel);
+ BuildFile = wrk.Base().AbsoluteBuildPath(relPath);
}
}
@@ -1111,8 +1113,7 @@ void cmQtAutoGeneratorMocUic::WorkerT::UVProcessStart(uv_async_t* handle)
{
std::lock_guard<std::mutex> lock(wrk.ProcessMutex_);
if (wrk.Process_ && !wrk.Process_->IsStarted()) {
- wrk.Process_->start(handle->loop,
- std::bind(&WorkerT::UVProcessFinished, &wrk));
+ wrk.Process_->start(handle->loop, [&wrk] { wrk.UVProcessFinished(); });
}
}
}
@@ -1144,9 +1145,7 @@ cmQtAutoGeneratorMocUic::cmQtAutoGeneratorMocUic()
UVRequest().init(*UVLoop(), &cmQtAutoGeneratorMocUic::UVPollStage, this);
}
-cmQtAutoGeneratorMocUic::~cmQtAutoGeneratorMocUic()
-{
-}
+cmQtAutoGeneratorMocUic::~cmQtAutoGeneratorMocUic() = default;
bool cmQtAutoGeneratorMocUic::Init(cmMakefile* makefile)
{
@@ -1956,11 +1955,31 @@ bool cmQtAutoGeneratorMocUic::ParallelMocIncluded(
return (MocIncludedFiles_.find(sourceFile) != MocIncludedFiles_.end());
}
-void cmQtAutoGeneratorMocUic::ParallelMocAutoRegister(
- std::string const& mocFile)
+std::string cmQtAutoGeneratorMocUic::ParallelMocAutoRegister(
+ std::string const& baseName)
{
- std::lock_guard<std::mutex> mocLock(JobsMutex_);
- MocAutoFiles_.emplace(mocFile);
+ std::string res;
+ {
+ std::lock_guard<std::mutex> mocLock(JobsMutex_);
+ res = baseName;
+ res += ".cpp";
+ if (MocAutoFiles_.find(res) == MocAutoFiles_.end()) {
+ MocAutoFiles_.emplace(res);
+ } else {
+ // Append number suffix to the file name
+ for (unsigned int ii = 2; ii != 1024; ++ii) {
+ res = baseName;
+ res += '_';
+ res += std::to_string(ii);
+ res += ".cpp";
+ if (MocAutoFiles_.find(res) == MocAutoFiles_.end()) {
+ MocAutoFiles_.emplace(res);
+ break;
+ }
+ }
+ }
+ }
+ return res;
}
void cmQtAutoGeneratorMocUic::ParallelMocAutoUpdated()
diff --git a/Source/cmQtAutoGeneratorMocUic.h b/Source/cmQtAutoGeneratorMocUic.h
index 0df2cffebd..c22df29ab3 100644
--- a/Source/cmQtAutoGeneratorMocUic.h
+++ b/Source/cmQtAutoGeneratorMocUic.h
@@ -28,11 +28,13 @@ class cmMakefile;
// @brief AUTOMOC and AUTOUIC generator
class cmQtAutoGeneratorMocUic : public cmQtAutoGenerator
{
- CM_DISABLE_COPY(cmQtAutoGeneratorMocUic)
public:
cmQtAutoGeneratorMocUic();
~cmQtAutoGeneratorMocUic() override;
+ cmQtAutoGeneratorMocUic(cmQtAutoGeneratorMocUic const&) = delete;
+ cmQtAutoGeneratorMocUic& operator=(cmQtAutoGeneratorMocUic const&) = delete;
+
public:
// -- Types
class WorkerT;
@@ -63,7 +65,6 @@ public:
///
class BaseSettingsT
{
- CM_DISABLE_COPY(BaseSettingsT)
public:
// -- Volatile methods
BaseSettingsT(FileSystem* fileSystem)
@@ -75,6 +76,9 @@ public:
{
}
+ BaseSettingsT(BaseSettingsT const&) = delete;
+ BaseSettingsT& operator=(BaseSettingsT const&) = delete;
+
// -- Const methods
std::string AbsoluteBuildPath(std::string const& relativePath) const;
bool FindHeader(std::string& header,
@@ -103,13 +107,15 @@ public:
///
class MocSettingsT
{
- CM_DISABLE_COPY(MocSettingsT)
public:
MocSettingsT(FileSystem* fileSys)
: FileSys(fileSys)
{
}
+ MocSettingsT(MocSettingsT const&) = delete;
+ MocSettingsT& operator=(MocSettingsT const&) = delete;
+
// -- Const methods
bool skipped(std::string const& fileName) const;
std::string FindMacro(std::string const& content) const;
@@ -145,9 +151,12 @@ public:
///
class UicSettingsT
{
- CM_DISABLE_COPY(UicSettingsT)
public:
UicSettingsT() = default;
+
+ UicSettingsT(UicSettingsT const&) = delete;
+ UicSettingsT& operator=(UicSettingsT const&) = delete;
+
// -- Const methods
bool skipped(std::string const& fileName) const;
@@ -166,10 +175,13 @@ public:
///
class JobT
{
- CM_DISABLE_COPY(JobT)
public:
JobT() = default;
virtual ~JobT() = default;
+
+ JobT(JobT const&) = delete;
+ JobT& operator=(JobT const&) = delete;
+
// -- Abstract processing interface
virtual void Process(WorkerT& wrk) = 0;
};
@@ -293,11 +305,13 @@ public:
///
class WorkerT
{
- CM_DISABLE_COPY(WorkerT)
public:
WorkerT(cmQtAutoGeneratorMocUic* gen, uv_loop_t* uvLoop);
~WorkerT();
+ WorkerT(WorkerT const&) = delete;
+ WorkerT& operator=(WorkerT const&) = delete;
+
// -- Const accessors
cmQtAutoGeneratorMocUic& Gen() const { return *Gen_; }
Logger& Log() const { return Gen_->Log(); }
@@ -375,7 +389,7 @@ public:
bool ParallelJobPushMoc(JobHandleT& jobHandle);
bool ParallelJobPushUic(JobHandleT& jobHandle);
bool ParallelMocIncluded(std::string const& sourceFile);
- void ParallelMocAutoRegister(std::string const& mocFile);
+ std::string ParallelMocAutoRegister(std::string const& baseName);
void ParallelMocAutoUpdated();
private:
diff --git a/Source/cmQtAutoGeneratorRcc.cxx b/Source/cmQtAutoGeneratorRcc.cxx
index 87c8d18fe5..021a15f189 100644
--- a/Source/cmQtAutoGeneratorRcc.cxx
+++ b/Source/cmQtAutoGeneratorRcc.cxx
@@ -10,8 +10,6 @@
#include "cmSystemTools.h"
#include "cmUVHandlePtr.h"
-#include <functional>
-
// -- Class methods
cmQtAutoGeneratorRcc::cmQtAutoGeneratorRcc()
@@ -20,9 +18,7 @@ cmQtAutoGeneratorRcc::cmQtAutoGeneratorRcc()
UVRequest().init(*UVLoop(), &cmQtAutoGeneratorRcc::UVPollStage, this);
}
-cmQtAutoGeneratorRcc::~cmQtAutoGeneratorRcc()
-{
-}
+cmQtAutoGeneratorRcc::~cmQtAutoGeneratorRcc() = default;
bool cmQtAutoGeneratorRcc::Init(cmMakefile* makefile)
{
@@ -664,8 +660,7 @@ bool cmQtAutoGeneratorRcc::StartProcess(
Process_ = cm::make_unique<ReadOnlyProcessT>();
Process_->setup(&ProcessResult_, mergedOutput, command, workingDirectory);
// Start process
- if (!Process_->start(UVLoop(),
- std::bind(&cm::uv_async_ptr::send, &UVRequest()))) {
+ if (!Process_->start(UVLoop(), [this] { UVRequest().send(); })) {
Log().ErrorFile(GeneratorT::RCC, QrcFile_, ProcessResult_.ErrorMessage);
Error_ = true;
// Clean up
diff --git a/Source/cmQtAutoGeneratorRcc.h b/Source/cmQtAutoGeneratorRcc.h
index 1148071a39..1ec1c4a8c4 100644
--- a/Source/cmQtAutoGeneratorRcc.h
+++ b/Source/cmQtAutoGeneratorRcc.h
@@ -17,11 +17,13 @@ class cmMakefile;
// @brief AUTORCC generator
class cmQtAutoGeneratorRcc : public cmQtAutoGenerator
{
- CM_DISABLE_COPY(cmQtAutoGeneratorRcc)
public:
cmQtAutoGeneratorRcc();
~cmQtAutoGeneratorRcc() override;
+ cmQtAutoGeneratorRcc(cmQtAutoGeneratorRcc const&) = delete;
+ cmQtAutoGeneratorRcc& operator=(cmQtAutoGeneratorRcc const&) = delete;
+
private:
// -- Types
diff --git a/Source/cmScriptGenerator.cxx b/Source/cmScriptGenerator.cxx
index ae0a158845..9182b4165c 100644
--- a/Source/cmScriptGenerator.cxx
+++ b/Source/cmScriptGenerator.cxx
@@ -16,9 +16,7 @@ cmScriptGenerator::cmScriptGenerator(std::string config_var,
{
}
-cmScriptGenerator::~cmScriptGenerator()
-{
-}
+cmScriptGenerator::~cmScriptGenerator() = default;
void cmScriptGenerator::Generate(
std::ostream& os, const std::string& config,
diff --git a/Source/cmScriptGenerator.h b/Source/cmScriptGenerator.h
index 725cbc6d65..e334d5badd 100644
--- a/Source/cmScriptGenerator.h
+++ b/Source/cmScriptGenerator.h
@@ -12,7 +12,7 @@
class cmScriptGeneratorIndent
{
public:
- cmScriptGeneratorIndent() {}
+ cmScriptGeneratorIndent() = default;
cmScriptGeneratorIndent(int level)
: Level(level)
{
@@ -44,13 +44,14 @@ inline std::ostream& operator<<(std::ostream& os,
*/
class cmScriptGenerator
{
- CM_DISABLE_COPY(cmScriptGenerator)
-
public:
cmScriptGenerator(std::string config_var,
std::vector<std::string> configurations);
virtual ~cmScriptGenerator();
+ cmScriptGenerator(cmScriptGenerator const&) = delete;
+ cmScriptGenerator& operator=(cmScriptGenerator const&) = delete;
+
void Generate(std::ostream& os, const std::string& config,
std::vector<std::string> const& configurationTypes);
diff --git a/Source/cmSearchPath.cxx b/Source/cmSearchPath.cxx
index 5dd4413c44..0f51e0eb6f 100644
--- a/Source/cmSearchPath.cxx
+++ b/Source/cmSearchPath.cxx
@@ -16,9 +16,7 @@ cmSearchPath::cmSearchPath(cmFindCommon* findCmd)
{
}
-cmSearchPath::~cmSearchPath()
-{
-}
+cmSearchPath::~cmSearchPath() = default;
void cmSearchPath::ExtractWithout(const std::set<std::string>& ignore,
std::vector<std::string>& outPaths,
diff --git a/Source/cmServer.cxx b/Source/cmServer.cxx
index f7d38799fa..e740c0519b 100644
--- a/Source/cmServer.cxx
+++ b/Source/cmServer.cxx
@@ -96,11 +96,16 @@ void cmServer::ProcessRequest(cmConnection* connection,
return;
}
- cmSystemTools::SetMessageCallback(reportMessage,
- const_cast<cmServerRequest*>(&request));
+ cmSystemTools::SetMessageCallback(
+ [&request](const char* msg, const char* title) {
+ reportMessage(msg, title, request);
+ });
+
if (this->Protocol) {
this->Protocol->CMakeInstance()->SetProgressCallback(
- reportProgress, const_cast<cmServerRequest*>(&request));
+ [&request](const char* msg, float prog) {
+ reportProgress(msg, prog, request);
+ });
this->WriteResponse(connection, this->Protocol->Process(request),
debug.get());
} else {
@@ -150,28 +155,25 @@ void cmServer::PrintHello(cmConnection* connection) const
this->WriteJsonObject(connection, hello, nullptr);
}
-void cmServer::reportProgress(const char* msg, float progress, void* data)
+void cmServer::reportProgress(const char* msg, float progress,
+ const cmServerRequest& request)
{
- const cmServerRequest* request = static_cast<const cmServerRequest*>(data);
- assert(request);
if (progress < 0.0f || progress > 1.0f) {
- request->ReportMessage(msg, "");
+ request.ReportMessage(msg, "");
} else {
- request->ReportProgress(0, static_cast<int>(progress * 1000), 1000, msg);
+ request.ReportProgress(0, static_cast<int>(progress * 1000), 1000, msg);
}
}
void cmServer::reportMessage(const char* msg, const char* title,
- bool& /* cancel */, void* data)
+ const cmServerRequest& request)
{
- const cmServerRequest* request = static_cast<const cmServerRequest*>(data);
- assert(request);
assert(msg);
std::string titleString;
if (title) {
titleString = title;
}
- request->ReportMessage(std::string(msg), titleString);
+ request.ReportMessage(std::string(msg), titleString);
}
cmServerResponse cmServer::SetProtocolVersion(const cmServerRequest& request)
diff --git a/Source/cmServer.h b/Source/cmServer.h
index ca37ce276d..e1ed27a0c1 100644
--- a/Source/cmServer.h
+++ b/Source/cmServer.h
@@ -88,14 +88,15 @@ protected:
class cmServer : public cmServerBase
{
- CM_DISABLE_COPY(cmServer)
-
public:
class DebugInfo;
cmServer(cmConnection* conn, bool supportExperimental);
~cmServer() override;
+ cmServer(cmServer const&) = delete;
+ cmServer& operator=(cmServer const&) = delete;
+
bool Serve(std::string* errorMessage) override;
cmFileMonitor* FileMonitor() const;
@@ -118,9 +119,10 @@ public:
void OnConnected(cmConnection* connection) override;
private:
- static void reportProgress(const char* msg, float progress, void* data);
- static void reportMessage(const char* msg, const char* title, bool& cancel,
- void* data);
+ static void reportProgress(const char* msg, float progress,
+ const cmServerRequest& request);
+ static void reportMessage(const char* msg, const char* title,
+ const cmServerRequest& request);
// Handle requests:
cmServerResponse SetProtocolVersion(const cmServerRequest& request);
diff --git a/Source/cmServerConnection.cxx b/Source/cmServerConnection.cxx
index 5caa019228..844a85890f 100644
--- a/Source/cmServerConnection.cxx
+++ b/Source/cmServerConnection.cxx
@@ -119,9 +119,7 @@ cmServerStdIoConnection::cmServerStdIoConnection()
{
}
-cmConnectionBufferStrategy::~cmConnectionBufferStrategy()
-{
-}
+cmConnectionBufferStrategy::~cmConnectionBufferStrategy() = default;
void cmConnectionBufferStrategy::clear()
{
diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx
index c3c81564ee..203ee93e42 100644
--- a/Source/cmServerProtocol.cxx
+++ b/Source/cmServerProtocol.cxx
@@ -222,13 +222,22 @@ bool cmServerProtocol1::DoActivate(const cmServerRequest& request,
std::string* errorMessage)
{
std::string sourceDirectory = request.Data[kSOURCE_DIRECTORY_KEY].asString();
- const std::string buildDirectory =
- request.Data[kBUILD_DIRECTORY_KEY].asString();
+ std::string buildDirectory = request.Data[kBUILD_DIRECTORY_KEY].asString();
std::string generator = request.Data[kGENERATOR_KEY].asString();
std::string extraGenerator = request.Data[kEXTRA_GENERATOR_KEY].asString();
std::string toolset = request.Data[kTOOLSET_KEY].asString();
std::string platform = request.Data[kPLATFORM_KEY].asString();
+ // normalize source and build directory
+ if (!sourceDirectory.empty()) {
+ sourceDirectory = cmSystemTools::CollapseFullPath(sourceDirectory);
+ cmSystemTools::ConvertToUnixSlashes(sourceDirectory);
+ }
+ if (!buildDirectory.empty()) {
+ buildDirectory = cmSystemTools::CollapseFullPath(buildDirectory);
+ cmSystemTools::ConvertToUnixSlashes(buildDirectory);
+ }
+
if (buildDirectory.empty()) {
setErrorMessage(errorMessage,
std::string("\"") + kBUILD_DIRECTORY_KEY +
diff --git a/Source/cmServerProtocol.h b/Source/cmServerProtocol.h
index 2d1507b43c..2f55a208f2 100644
--- a/Source/cmServerProtocol.h
+++ b/Source/cmServerProtocol.h
@@ -71,12 +71,13 @@ private:
class cmServerProtocol
{
- CM_DISABLE_COPY(cmServerProtocol)
-
public:
cmServerProtocol() = default;
virtual ~cmServerProtocol() = default;
+ cmServerProtocol(cmServerProtocol const&) = delete;
+ cmServerProtocol& operator=(cmServerProtocol const&) = delete;
+
virtual std::pair<int, int> ProtocolVersion() const = 0;
virtual bool IsExperimental() const = 0;
virtual const cmServerResponse Process(const cmServerRequest& request) = 0;
diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx
index 1a2d1c673d..6bd071cfb1 100644
--- a/Source/cmSetCommand.cxx
+++ b/Source/cmSetCommand.cxx
@@ -4,6 +4,7 @@
#include "cmAlgorithms.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmState.h"
#include "cmStateTypes.h"
#include "cmSystemTools.h"
@@ -37,6 +38,14 @@ bool cmSetCommand::InitialPass(std::vector<std::string> const& args,
putEnvArg += args[1];
cmSystemTools::PutEnv(putEnvArg);
}
+ // if there's extra arguments, warn user
+ // that they are ignored by this command.
+ if (args.size() > 2) {
+ std::string m = "Only the first value argument is used when setting "
+ "an environment variable. Argument '" +
+ args[2] + "' and later are unused.";
+ this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, m);
+ }
return true;
}
@@ -112,7 +121,15 @@ bool cmSetCommand::InitialPass(std::vector<std::string> const& args,
if (cache) {
std::string::size_type cacheStart = args.size() - 3 - (force ? 1 : 0);
- type = cmState::StringToCacheEntryType(args[cacheStart + 1].c_str());
+ if (!cmState::StringToCacheEntryType(args[cacheStart + 1].c_str(), type)) {
+ std::string m = "implicitly converting '" + args[cacheStart + 1] +
+ "' to 'STRING' type.";
+ this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, m);
+ // Setting this may not be required, since it's
+ // initialized as a string. Keeping this here to
+ // ensure that the type is actually converting to a string.
+ type = cmStateEnums::STRING;
+ }
docstring = args[cacheStart + 2].c_str();
}
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx
index efc6bb5c06..d05fb68d96 100644
--- a/Source/cmSourceFile.cxx
+++ b/Source/cmSourceFile.cxx
@@ -2,7 +2,8 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmSourceFile.h"
-#include <sstream>
+#include <array>
+#include <utility>
#include "cmCustomCommand.h"
#include "cmGlobalGenerator.h"
@@ -17,8 +18,6 @@ cmSourceFile::cmSourceFile(cmMakefile* mf, const std::string& name,
cmSourceFileLocationKind kind)
: Location(mf, name, kind)
{
- this->CustomCommand = nullptr;
- this->FindFullPathFailed = false;
}
cmSourceFile::~cmSourceFile()
@@ -32,6 +31,8 @@ std::string const& cmSourceFile::GetExtension() const
}
const std::string cmSourceFile::propLANGUAGE = "LANGUAGE";
+const std::string cmSourceFile::propLOCATION = "LOCATION";
+const std::string cmSourceFile::propGENERATED = "GENERATED";
void cmSourceFile::SetObjectLibrary(std::string const& objlib)
{
@@ -112,92 +113,88 @@ std::string const& cmSourceFile::GetFullPath() const
bool cmSourceFile::FindFullPath(std::string* error)
{
- // If this method has already failed once do not try again.
- if (this->FindFullPathFailed) {
- return false;
- }
-
- // If the file is generated compute the location without checking on
- // disk.
- if (this->GetPropertyAsBool("GENERATED")) {
+ // If the file is generated compute the location without checking on disk.
+ if (this->GetIsGenerated()) {
// The file is either already a full path or is relative to the
// build directory for the target.
this->Location.DirectoryUseBinary();
- this->FullPath = this->Location.GetDirectory();
- this->FullPath += "/";
- this->FullPath += this->Location.GetName();
+ this->FullPath = this->Location.GetFullPath();
return true;
}
- // The file is not generated. It must exist on disk.
- cmMakefile const* mf = this->Location.GetMakefile();
- const char* tryDirs[3] = { nullptr, nullptr, nullptr };
- if (this->Location.DirectoryIsAmbiguous()) {
- tryDirs[0] = mf->GetCurrentSourceDirectory().c_str();
- tryDirs[1] = mf->GetCurrentBinaryDirectory().c_str();
- } else {
- tryDirs[0] = "";
+ // If this method has already failed once do not try again.
+ if (this->FindFullPathFailed) {
+ return false;
}
- cmake const* const cmakeInst = mf->GetCMakeInstance();
- std::vector<std::string> const& srcExts = cmakeInst->GetSourceExtensions();
- std::vector<std::string> const& hdrExts = cmakeInst->GetHeaderExtensions();
- for (const char* const* di = tryDirs; *di; ++di) {
- std::string tryPath = this->Location.GetDirectory();
- if (!tryPath.empty()) {
- tryPath += "/";
- }
- tryPath += this->Location.GetName();
- tryPath = cmSystemTools::CollapseFullPath(tryPath, *di);
- if (this->TryFullPath(tryPath, "")) {
+ // The file is not generated. It must exist on disk.
+ cmMakefile const* makefile = this->Location.GetMakefile();
+ // Location path
+ std::string const lPath = this->Location.GetFullPath();
+ // List of extension lists
+ std::array<std::vector<std::string> const*, 2> const extsLists = {
+ { &makefile->GetCMakeInstance()->GetSourceExtensions(),
+ &makefile->GetCMakeInstance()->GetHeaderExtensions() }
+ };
+
+ // Tries to find the file in a given directory
+ auto findInDir = [this, &extsLists, &lPath](std::string const& dir) -> bool {
+ // Compute full path
+ std::string const fullPath = cmSystemTools::CollapseFullPath(lPath, dir);
+ // Try full path
+ if (cmSystemTools::FileExists(fullPath)) {
+ this->FullPath = fullPath;
return true;
}
- for (std::string const& ext : srcExts) {
- if (this->TryFullPath(tryPath, ext)) {
- return true;
+ // Try full path with extension
+ for (auto exts : extsLists) {
+ for (std::string const& ext : *exts) {
+ if (!ext.empty()) {
+ std::string extPath = fullPath;
+ extPath += '.';
+ extPath += ext;
+ if (cmSystemTools::FileExists(extPath)) {
+ this->FullPath = extPath;
+ return true;
+ }
+ }
}
}
- for (std::string const& ext : hdrExts) {
- if (this->TryFullPath(tryPath, ext)) {
- return true;
- }
+ // File not found
+ return false;
+ };
+
+ // Try to find the file in various directories
+ if (this->Location.DirectoryIsAmbiguous()) {
+ if (findInDir(makefile->GetCurrentSourceDirectory()) ||
+ findInDir(makefile->GetCurrentBinaryDirectory())) {
+ return true;
+ }
+ } else {
+ if (findInDir({})) {
+ return true;
}
}
- std::ostringstream e;
- std::string missing = this->Location.GetDirectory();
- if (!missing.empty()) {
- missing += "/";
- }
- missing += this->Location.GetName();
- e << "Cannot find source file:\n " << missing << "\nTried extensions";
- for (std::string const& srcExt : srcExts) {
- e << " ." << srcExt;
- }
- for (std::string const& ext : hdrExts) {
- e << " ." << ext;
+ // Compose error
+ std::string err;
+ err += "Cannot find source file:\n ";
+ err += lPath;
+ err += "\nTried extensions";
+ for (auto exts : extsLists) {
+ for (std::string const& ext : *exts) {
+ err += " .";
+ err += ext;
+ }
}
- if (error) {
- *error = e.str();
+ if (error != nullptr) {
+ *error = std::move(err);
} else {
- this->Location.GetMakefile()->IssueMessage(MessageType::FATAL_ERROR,
- e.str());
+ makefile->IssueMessage(MessageType::FATAL_ERROR, err);
}
this->FindFullPathFailed = true;
- return false;
-}
-bool cmSourceFile::TryFullPath(const std::string& path, const std::string& ext)
-{
- std::string tryPath = path;
- if (!ext.empty()) {
- tryPath += ".";
- tryPath += ext;
- }
- if (cmSystemTools::FileExists(tryPath)) {
- this->FullPath = tryPath;
- return true;
- }
+ // File not found
return false;
}
@@ -242,12 +239,22 @@ bool cmSourceFile::Matches(cmSourceFileLocation const& loc)
void cmSourceFile::SetProperty(const std::string& prop, const char* value)
{
this->Properties.SetProperty(prop, value);
+
+ // Update IsGenerated flag
+ if (prop == propGENERATED) {
+ this->IsGenerated = cmSystemTools::IsOn(value);
+ }
}
void cmSourceFile::AppendProperty(const std::string& prop, const char* value,
bool asString)
{
this->Properties.AppendProperty(prop, value, asString);
+
+ // Update IsGenerated flag
+ if (prop == propGENERATED) {
+ this->IsGenerated = this->GetPropertyAsBool(propGENERATED);
+ }
}
const char* cmSourceFile::GetPropertyForUser(const std::string& prop)
@@ -266,7 +273,7 @@ const char* cmSourceFile::GetPropertyForUser(const std::string& prop)
// cmSourceFileLocation class to commit to a particular full path to
// the source file as late as possible. If the users requests the
// LOCATION property we must commit now.
- if (prop == "LOCATION") {
+ if (prop == propLOCATION) {
// Commit to a location.
this->GetFullPath();
}
@@ -278,7 +285,7 @@ const char* cmSourceFile::GetPropertyForUser(const std::string& prop)
const char* cmSourceFile::GetProperty(const std::string& prop) const
{
// Check for computed properties.
- if (prop == "LOCATION") {
+ if (prop == propLOCATION) {
if (this->FullPath.empty()) {
return nullptr;
}
diff --git a/Source/cmSourceFile.h b/Source/cmSourceFile.h
index ab0f229277..a82a58aa90 100644
--- a/Source/cmSourceFile.h
+++ b/Source/cmSourceFile.h
@@ -55,6 +55,10 @@ public:
command like get_property or get_source_file_property. */
const char* GetPropertyForUser(const std::string& prop);
+ ///! Checks is the GENERATED property is set and true
+ /// @return Equivalent to GetPropertyAsBool("GENERATED")
+ bool GetIsGenerated() const { return this->IsGenerated; }
+
/**
* The full path to the file. The non-const version of this method
* may attempt to locate the file on disk and finalize its location.
@@ -106,20 +110,22 @@ public:
private:
cmSourceFileLocation Location;
cmPropertyMap Properties;
- cmCustomCommand* CustomCommand;
+ cmCustomCommand* CustomCommand = nullptr;
std::string Extension;
std::string Language;
std::string FullPath;
std::string ObjectLibrary;
std::vector<std::string> Depends;
- bool FindFullPathFailed;
+ bool FindFullPathFailed = false;
+ bool IsGenerated = false;
bool FindFullPath(std::string* error);
- bool TryFullPath(const std::string& path, const std::string& ext);
void CheckExtension();
void CheckLanguage(std::string const& ext);
static const std::string propLANGUAGE;
+ static const std::string propLOCATION;
+ static const std::string propGENERATED;
};
// TODO: Factor out into platform information modules.
diff --git a/Source/cmSourceFileLocation.cxx b/Source/cmSourceFileLocation.cxx
index 3dab63894b..acacba26c3 100644
--- a/Source/cmSourceFileLocation.cxx
+++ b/Source/cmSourceFileLocation.cxx
@@ -11,9 +11,7 @@
#include <assert.h>
-cmSourceFileLocation::cmSourceFileLocation()
-{
-}
+cmSourceFileLocation::cmSourceFileLocation() = default;
cmSourceFileLocation::cmSourceFileLocation(const cmSourceFileLocation& loc)
: Makefile(loc.Makefile)
@@ -44,6 +42,16 @@ cmSourceFileLocation::cmSourceFileLocation(cmMakefile const* mf,
}
}
+std::string cmSourceFileLocation::GetFullPath() const
+{
+ std::string path = this->GetDirectory();
+ if (!path.empty()) {
+ path += '/';
+ }
+ path += this->GetName();
+ return path;
+}
+
void cmSourceFileLocation::Update(cmSourceFileLocation const& loc)
{
if (this->AmbiguousDirectory && !loc.AmbiguousDirectory) {
diff --git a/Source/cmSourceFileLocation.h b/Source/cmSourceFileLocation.h
index 82747ba7a4..87040b882d 100644
--- a/Source/cmSourceFileLocation.h
+++ b/Source/cmSourceFileLocation.h
@@ -34,6 +34,8 @@ public:
cmSourceFileLocation();
cmSourceFileLocation(const cmSourceFileLocation& loc);
+ cmSourceFileLocation& operator=(cmSourceFileLocation const&) = delete;
+
/**
* Return whether the given source file location could refers to the
* same source file as this location given the level of ambiguity in
@@ -78,6 +80,11 @@ public:
const std::string& GetName() const { return this->Name; }
/**
+ * Get the full file path composed of GetDirectory() and GetName().
+ */
+ std::string GetFullPath() const;
+
+ /**
* Get the cmMakefile instance for which the source file was created.
*/
cmMakefile const* GetMakefile() const { return this->Makefile; }
@@ -94,8 +101,6 @@ private:
// Update the location with additional knowledge.
void Update(cmSourceFileLocation const& loc);
void UpdateExtension(const std::string& name);
-
- cmSourceFileLocation& operator=(const cmSourceFileLocation& loc) = delete;
};
#endif
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index fdd7b3d509..a08e9b8ba4 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -75,14 +75,23 @@ const char* cmState::CacheEntryTypeToString(cmStateEnums::CacheEntryType type)
cmStateEnums::CacheEntryType cmState::StringToCacheEntryType(const char* s)
{
+ cmStateEnums::CacheEntryType type = cmStateEnums::STRING;
+ StringToCacheEntryType(s, type);
+ return type;
+}
+
+bool cmState::StringToCacheEntryType(const char* s,
+ cmStateEnums::CacheEntryType& type)
+{
int i = 0;
while (cmCacheEntryTypes[i]) {
if (strcmp(s, cmCacheEntryTypes[i]) == 0) {
- return static_cast<cmStateEnums::CacheEntryType>(i);
+ type = static_cast<cmStateEnums::CacheEntryType>(i);
+ return true;
}
++i;
}
- return cmStateEnums::STRING;
+ return false;
}
bool cmState::IsCacheEntryType(std::string const& key)
diff --git a/Source/cmState.h b/Source/cmState.h
index e4474857b5..f755f8362d 100644
--- a/Source/cmState.h
+++ b/Source/cmState.h
@@ -65,6 +65,8 @@ public:
cmStateSnapshot Pop(cmStateSnapshot const& originSnapshot);
static cmStateEnums::CacheEntryType StringToCacheEntryType(const char*);
+ static bool StringToCacheEntryType(const char*,
+ cmStateEnums::CacheEntryType& type);
static const char* CacheEntryTypeToString(cmStateEnums::CacheEntryType);
static bool IsCacheEntryType(std::string const& key);
diff --git a/Source/cmStateDirectory.cxx b/Source/cmStateDirectory.cxx
index 40f694c0d9..6752743a1f 100644
--- a/Source/cmStateDirectory.cxx
+++ b/Source/cmStateDirectory.cxx
@@ -155,6 +155,15 @@ bool cmStateDirectory::ContainsBoth(std::string const& local_path,
return bothInBinary || bothInSource;
}
+std::string cmStateDirectory::ConvertToRelPathIfNotContained(
+ std::string const& local_path, std::string const& remote_path) const
+{
+ if (!this->ContainsBoth(local_path, remote_path)) {
+ return remote_path;
+ }
+ return cmSystemTools::ForceToRelativePath(local_path, remote_path);
+}
+
cmStateDirectory::cmStateDirectory(
cmLinkedTree<cmStateDetail::BuildsystemDirectoryStateType>::iterator iter,
const cmStateSnapshot& snapshot)
diff --git a/Source/cmStateDirectory.h b/Source/cmStateDirectory.h
index c4b18adf16..69565940d6 100644
--- a/Source/cmStateDirectory.h
+++ b/Source/cmStateDirectory.h
@@ -35,6 +35,9 @@ public:
bool ContainsBoth(std::string const& local_path,
std::string const& remote_path) const;
+ std::string ConvertToRelPathIfNotContained(
+ std::string const& local_path, std::string const& remote_path) const;
+
cmStringRange GetIncludeDirectoriesEntries() const;
cmBacktraceRange GetIncludeDirectoriesEntryBacktraces() const;
void AppendIncludeDirectoriesEntry(std::string const& vec,
diff --git a/Source/cmStringReplaceHelper.h b/Source/cmStringReplaceHelper.h
index 5cebde7644..b3e4704168 100644
--- a/Source/cmStringReplaceHelper.h
+++ b/Source/cmStringReplaceHelper.h
@@ -48,7 +48,7 @@ private:
: Number(n)
{
}
- RegexReplacement() {}
+ RegexReplacement() = default;
int Number;
std::string Value;
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index a16460f996..1d20e2f1ad 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -76,6 +76,15 @@
# include <malloc.h> /* for malloc/free on QNX */
#endif
+namespace {
+
+cmSystemTools::InterruptCallback s_InterruptCallback;
+cmSystemTools::MessageCallback s_MessageCallback;
+cmSystemTools::OutputCallback s_StderrCallback;
+cmSystemTools::OutputCallback s_StdoutCallback;
+
+} // namespace
+
static bool cm_isspace(char c)
{
return ((c & 0x80) == 0) && isspace(c);
@@ -161,15 +170,6 @@ bool cmSystemTools::s_FatalErrorOccured = false;
bool cmSystemTools::s_DisableMessages = false;
bool cmSystemTools::s_ForceUnixPaths = false;
-cmSystemTools::MessageCallback cmSystemTools::s_MessageCallback;
-cmSystemTools::OutputCallback cmSystemTools::s_StdoutCallback;
-cmSystemTools::OutputCallback cmSystemTools::s_StderrCallback;
-cmSystemTools::InterruptCallback cmSystemTools::s_InterruptCallback;
-void* cmSystemTools::s_MessageCallbackClientData;
-void* cmSystemTools::s_StdoutCallbackClientData;
-void* cmSystemTools::s_StderrCallbackClientData;
-void* cmSystemTools::s_InterruptCallbackClientData;
-
// replace replace with with as many times as it shows up in source.
// write the result into source.
#if defined(_WIN32) && !defined(__CYGWIN__)
@@ -267,52 +267,48 @@ void cmSystemTools::Error(const char* m1, const char* m2, const char* m3,
message += m4;
}
cmSystemTools::s_ErrorOccured = true;
- cmSystemTools::Message(message.c_str(), "Error");
+ cmSystemTools::Message(message, "Error");
}
void cmSystemTools::Error(const std::string& m)
{
std::string message = "CMake Error: " + m;
cmSystemTools::s_ErrorOccured = true;
- cmSystemTools::Message(message.c_str(), "Error");
+ cmSystemTools::Message(message, "Error");
}
-void cmSystemTools::SetInterruptCallback(InterruptCallback f, void* clientData)
+void cmSystemTools::SetInterruptCallback(InterruptCallback f)
{
- s_InterruptCallback = f;
- s_InterruptCallbackClientData = clientData;
+ s_InterruptCallback = std::move(f);
}
bool cmSystemTools::GetInterruptFlag()
{
if (s_InterruptCallback) {
- return (*s_InterruptCallback)(s_InterruptCallbackClientData);
+ return s_InterruptCallback();
}
return false;
}
-void cmSystemTools::SetMessageCallback(MessageCallback f, void* clientData)
+void cmSystemTools::SetMessageCallback(MessageCallback f)
{
- s_MessageCallback = f;
- s_MessageCallbackClientData = clientData;
+ s_MessageCallback = std::move(f);
}
-void cmSystemTools::SetStdoutCallback(OutputCallback f, void* clientData)
+void cmSystemTools::SetStdoutCallback(OutputCallback f)
{
- s_StdoutCallback = f;
- s_StdoutCallbackClientData = clientData;
+ s_StdoutCallback = std::move(f);
}
-void cmSystemTools::SetStderrCallback(OutputCallback f, void* clientData)
+void cmSystemTools::SetStderrCallback(OutputCallback f)
{
- s_StderrCallback = f;
- s_StderrCallbackClientData = clientData;
+ s_StderrCallback = std::move(f);
}
void cmSystemTools::Stderr(const std::string& s)
{
if (s_StderrCallback) {
- (*s_StderrCallback)(s.c_str(), s.length(), s_StderrCallbackClientData);
+ s_StderrCallback(s);
} else {
std::cerr << s << std::flush;
}
@@ -321,7 +317,7 @@ void cmSystemTools::Stderr(const std::string& s)
void cmSystemTools::Stdout(const std::string& s)
{
if (s_StdoutCallback) {
- (*s_StdoutCallback)(s.c_str(), s.length(), s_StdoutCallbackClientData);
+ s_StdoutCallback(s);
} else {
std::cout << s << std::flush;
}
@@ -333,8 +329,7 @@ void cmSystemTools::Message(const char* m1, const char* title)
return;
}
if (s_MessageCallback) {
- (*s_MessageCallback)(m1, title, s_DisableMessages,
- s_MessageCallbackClientData);
+ s_MessageCallback(m1, title);
return;
}
std::cerr << m1 << std::endl << std::flush;
@@ -940,17 +935,12 @@ std::string cmSystemTools::FileExistsInParentDirectories(const char* fname,
return "";
}
-bool cmSystemTools::cmCopyFile(const char* source, const char* destination)
+bool cmSystemTools::cmCopyFile(const std::string& source,
+ const std::string& destination)
{
return Superclass::CopyFileAlways(source, destination);
}
-bool cmSystemTools::CopyFileIfDifferent(const char* source,
- const char* destination)
-{
- return Superclass::CopyFileIfDifferent(source, destination);
-}
-
#ifdef _WIN32
cmSystemTools::WindowsFileRetry cmSystemTools::GetWindowsFileRetry()
{
@@ -1340,13 +1330,11 @@ bool cmSystemTools::SimpleGlob(const std::string& glob,
return res;
}
-cmSystemTools::FileFormat cmSystemTools::GetFileFormat(const char* cext)
+cmSystemTools::FileFormat cmSystemTools::GetFileFormat(std::string const& ext)
{
- if (!cext || *cext == 0) {
+ if (ext.empty()) {
return cmSystemTools::NO_FILE_FORMAT;
}
- // std::string ext = cmSystemTools::LowerCase(cext);
- std::string ext = cext;
if (ext == "c" || ext == ".c" || ext == "m" || ext == ".m") {
return cmSystemTools::C_FILE_FORMAT;
}
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index b30e4f7abf..0f92fe2575 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -10,6 +10,7 @@
#include "cmProcessOutput.h"
#include "cmsys/Process.h"
#include "cmsys/SystemTools.hxx" // IWYU pragma: export
+#include <functional>
#include <stddef.h>
#include <string>
#include <vector>
@@ -55,15 +56,13 @@ public:
*/
static std::string TrimWhitespace(const std::string& s);
- typedef void (*MessageCallback)(const char*, const char*, bool&, void*);
+ using MessageCallback = std::function<void(const char*, const char*)>;
/**
* Set the function used by GUIs to display error messages
* Function gets passed: message as a const char*,
- * title as a const char*, and a reference to bool that when
- * set to false, will disable further messages (cancel).
+ * title as a const char*.
*/
- static void SetMessageCallback(MessageCallback f,
- void* clientData = nullptr);
+ static void SetMessageCallback(MessageCallback f);
/**
* Display an error message.
@@ -76,20 +75,23 @@ public:
* Display a message.
*/
static void Message(const char* m, const char* title = nullptr);
+ static void Message(const std::string& m, const char* title = nullptr)
+ {
+ Message(m.c_str(), title);
+ }
- typedef void (*OutputCallback)(const char*, size_t length, void*);
+ using OutputCallback = std::function<void(std::string const&)>;
///! Send a string to stdout
static void Stdout(const std::string& s);
- static void SetStdoutCallback(OutputCallback, void* clientData = nullptr);
+ static void SetStdoutCallback(OutputCallback f);
///! Send a string to stderr
static void Stderr(const std::string& s);
- static void SetStderrCallback(OutputCallback, void* clientData = nullptr);
+ static void SetStderrCallback(OutputCallback f);
- typedef bool (*InterruptCallback)(void*);
- static void SetInterruptCallback(InterruptCallback f,
- void* clientData = nullptr);
+ using InterruptCallback = std::function<bool()>;
+ static void SetInterruptCallback(InterruptCallback f);
static bool GetInterruptFlag();
///! Return true if there was an error at any point.
@@ -175,8 +177,8 @@ public:
std::vector<std::string>& files, int type = 0);
///! Copy a file.
- static bool cmCopyFile(const char* source, const char* destination);
- static bool CopyFileIfDifferent(const char* source, const char* destination);
+ static bool cmCopyFile(const std::string& source,
+ const std::string& destination);
/** Rename a file or directory within a single disk volume (atomic
if possible). */
@@ -332,7 +334,7 @@ public:
/**
* Determine the file type based on the extension
*/
- static FileFormat GetFileFormat(const char* ext);
+ 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.
@@ -406,11 +408,13 @@ public:
original environment. */
class SaveRestoreEnvironment
{
- CM_DISABLE_COPY(SaveRestoreEnvironment)
public:
SaveRestoreEnvironment();
~SaveRestoreEnvironment();
+ SaveRestoreEnvironment(SaveRestoreEnvironment const&) = delete;
+ SaveRestoreEnvironment& operator=(SaveRestoreEnvironment const&) = delete;
+
private:
std::vector<std::string> Env;
};
@@ -544,14 +548,6 @@ private:
static bool s_FatalErrorOccured;
static bool s_DisableMessages;
static bool s_DisableRunCommandOutput;
- static MessageCallback s_MessageCallback;
- static OutputCallback s_StdoutCallback;
- static OutputCallback s_StderrCallback;
- static InterruptCallback s_InterruptCallback;
- static void* s_MessageCallbackClientData;
- static void* s_StdoutCallbackClientData;
- static void* s_StderrCallbackClientData;
- static void* s_InterruptCallbackClientData;
};
#endif
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index fe4893456e..93cdd46ce9 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -19,7 +19,6 @@
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmMessenger.h"
-#include "cmOutputConverter.h"
#include "cmProperty.h"
#include "cmSourceFile.h"
#include "cmSourceFileLocation.h"
@@ -747,11 +746,12 @@ void cmTarget::GetTllSignatureTraces(std::ostream& s, TLLSignature sig) const
const char* sigString =
(sig == cmTarget::KeywordTLLSignature ? "keyword" : "plain");
s << "The uses of the " << sigString << " signature are here:\n";
- cmOutputConverter converter(this->GetMakefile()->GetStateSnapshot());
+ cmStateDirectory cmDir =
+ this->GetMakefile()->GetStateSnapshot().GetDirectory();
for (auto const& cmd : this->TLLCommands) {
if (cmd.first == sig) {
cmListFileContext lfc = cmd.second;
- lfc.FilePath = converter.ConvertToRelativePath(
+ lfc.FilePath = cmDir.ConvertToRelPathIfNotContained(
this->Makefile->GetState()->GetSourceDirectory(), lfc.FilePath);
s << " * " << lfc << std::endl;
}
diff --git a/Source/cmTest.cxx b/Source/cmTest.cxx
index 4d0cbaafcc..7d45cf5e3f 100644
--- a/Source/cmTest.cxx
+++ b/Source/cmTest.cxx
@@ -14,9 +14,7 @@ cmTest::cmTest(cmMakefile* mf)
this->OldStyle = true;
}
-cmTest::~cmTest()
-{
-}
+cmTest::~cmTest() = default;
cmListFileBacktrace const& cmTest::GetBacktrace() const
{
diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx
index 603270153e..5102613eba 100644
--- a/Source/cmTestGenerator.cxx
+++ b/Source/cmTestGenerator.cxx
@@ -26,9 +26,7 @@ cmTestGenerator::cmTestGenerator(
this->LG = nullptr;
}
-cmTestGenerator::~cmTestGenerator()
-{
-}
+cmTestGenerator::~cmTestGenerator() = default;
void cmTestGenerator::Compute(cmLocalGenerator* lg)
{
diff --git a/Source/cmTestGenerator.h b/Source/cmTestGenerator.h
index f26d2ffb8a..8b9cf78a15 100644
--- a/Source/cmTestGenerator.h
+++ b/Source/cmTestGenerator.h
@@ -20,14 +20,15 @@ class cmTest;
*/
class cmTestGenerator : public cmScriptGenerator
{
- CM_DISABLE_COPY(cmTestGenerator)
-
public:
cmTestGenerator(cmTest* test,
std::vector<std::string> const& configurations =
std::vector<std::string>());
~cmTestGenerator() override;
+ cmTestGenerator(cmTestGenerator const&) = delete;
+ cmTestGenerator& operator=(cmTestGenerator const&) = delete;
+
void Compute(cmLocalGenerator* lg);
/** Test if this generator installs the test for a given configuration. */
diff --git a/Source/cmTimestamp.h b/Source/cmTimestamp.h
index 2f75acba0d..d5fbdfd671 100644
--- a/Source/cmTimestamp.h
+++ b/Source/cmTimestamp.h
@@ -15,8 +15,6 @@
class cmTimestamp
{
public:
- cmTimestamp() {}
-
std::string CurrentTime(const std::string& formatString, bool utcFlag);
std::string FileModificationTime(const char* path,
diff --git a/Source/cmUVHandlePtr.h b/Source/cmUVHandlePtr.h
index 73ee334da8..992c429b1b 100644
--- a/Source/cmUVHandlePtr.h
+++ b/Source/cmUVHandlePtr.h
@@ -61,7 +61,8 @@ protected:
void allocate(void* data = nullptr);
public:
- CM_DISABLE_COPY(uv_handle_ptr_base_)
+ uv_handle_ptr_base_(uv_handle_ptr_base_ const&) = delete;
+ uv_handle_ptr_base_& operator=(uv_handle_ptr_base_ const&) = delete;
uv_handle_ptr_base_(uv_handle_ptr_base_&&) noexcept;
uv_handle_ptr_base_& operator=(uv_handle_ptr_base_&&) noexcept;
@@ -86,8 +87,8 @@ public:
}
// Dtor and ctor need to be inline defined like this for default ctors and
- // dtors to work.
- uv_handle_ptr_base_() {}
+ // dtors to work. Some compilers do not like '= default' here.
+ uv_handle_ptr_base_() {} // NOLINT(modernize-use-equals-default)
uv_handle_ptr_base_(std::nullptr_t) {}
~uv_handle_ptr_base_() { reset(); }
diff --git a/Source/cmUseMangledMesaCommand.cxx b/Source/cmUseMangledMesaCommand.cxx
index 01ef5cbea4..9648b21d8f 100644
--- a/Source/cmUseMangledMesaCommand.cxx
+++ b/Source/cmUseMangledMesaCommand.cxx
@@ -100,6 +100,6 @@ void cmUseMangledMesaCommand::CopyAndFullPathMesaHeader(const char* source,
// close the files before attempting to copy
fin.close();
fout.close();
- cmSystemTools::CopyFileIfDifferent(tempOutputFile.c_str(), outFile.c_str());
+ cmSystemTools::CopyFileIfDifferent(tempOutputFile, outFile);
cmSystemTools::RemoveFile(tempOutputFile);
}
diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx
index f374626446..231bca41df 100644
--- a/Source/cmUtilitySourceCommand.cxx
+++ b/Source/cmUtilitySourceCommand.cxx
@@ -40,7 +40,7 @@ bool cmUtilitySourceCommand::InitialPass(std::vector<std::string> const& args,
msg += ". If your intention is to run this executable, you need to "
"preload the cache with the full path to a version of that "
"program, which runs on this build machine.";
- cmSystemTools::Message(msg.c_str(), "Warning");
+ cmSystemTools::Message(msg, "Warning");
}
} else {
cmState* state = this->Makefile->GetState();
diff --git a/Source/cmVSSetupHelper.cxx b/Source/cmVSSetupHelper.cxx
index 9187c29b9f..91a0e15124 100644
--- a/Source/cmVSSetupHelper.cxx
+++ b/Source/cmVSSetupHelper.cxx
@@ -188,8 +188,16 @@ bool cmVSSetupAPIHelper::GetVSInstanceInfo(
// Check if a compiler is installed with this instance.
{
std::string const vcRoot = vsInstanceInfo.GetInstallLocation();
- std::string const vcToolsVersionFile =
+ std::string vcToolsVersionFile =
vcRoot + "/VC/Auxiliary/Build/Microsoft.VCToolsVersion.default.txt";
+ if (!cmSystemTools::PathExists(vcToolsVersionFile)) {
+ // FIXME: VS 2019 Preview 2 installs the v142 toolset and does not
+ // provide the plain `Microsoft.VCToolsVersion.default.txt` that v141
+ // does. This should be fixed in preview 3 and this workaround can
+ // be dropped. Otherwise, we may need to switch to globbing.
+ vcToolsVersionFile = vcRoot +
+ "/VC/Auxiliary/Build/Microsoft.VCToolsVersion.v142.default.txt";
+ }
std::string vcToolsVersion;
cmsys::ifstream fin(vcToolsVersionFile.c_str());
if (!fin || !cmSystemTools::GetLineFromStream(fin, vcToolsVersion)) {
diff --git a/Source/cmVSSetupHelper.h b/Source/cmVSSetupHelper.h
index 4748a7aec5..1bda54a47b 100644
--- a/Source/cmVSSetupHelper.h
+++ b/Source/cmVSSetupHelper.h
@@ -112,8 +112,6 @@ struct VSInstanceInfo
bool IsWin10SDKInstalled = false;
bool IsWin81SDKInstalled = false;
- VSInstanceInfo() = default;
-
std::string GetInstallLocation() const;
};
diff --git a/Source/cmVariableWatch.cxx b/Source/cmVariableWatch.cxx
index bd5d19c396..3df1420991 100644
--- a/Source/cmVariableWatch.cxx
+++ b/Source/cmVariableWatch.cxx
@@ -19,13 +19,9 @@ const char* cmVariableWatch::GetAccessAsString(int access_type)
return cmVariableWatchAccessStrings[access_type];
}
-cmVariableWatch::cmVariableWatch()
-{
-}
+cmVariableWatch::cmVariableWatch() = default;
-cmVariableWatch::~cmVariableWatch()
-{
-}
+cmVariableWatch::~cmVariableWatch() = default;
bool cmVariableWatch::AddWatch(const std::string& variable, WatchMethod method,
void* client_data /*=0*/,
diff --git a/Source/cmVariableWatch.h b/Source/cmVariableWatch.h
index 2f444edf6b..5855fed292 100644
--- a/Source/cmVariableWatch.h
+++ b/Source/cmVariableWatch.h
@@ -66,7 +66,6 @@ protected:
WatchMethod Method = nullptr;
void* ClientData = nullptr;
DeleteData DeleteDataCall = nullptr;
- Pair() {}
~Pair()
{
if (this->DeleteDataCall && this->ClientData) {
diff --git a/Source/cmVariableWatchCommand.cxx b/Source/cmVariableWatchCommand.cxx
index 975d6e4307..5fe55bd535 100644
--- a/Source/cmVariableWatchCommand.cxx
+++ b/Source/cmVariableWatchCommand.cxx
@@ -84,9 +84,7 @@ static void deleteVariableWatchCallbackData(void* client_data)
delete data;
}
-cmVariableWatchCommand::cmVariableWatchCommand()
-{
-}
+cmVariableWatchCommand::cmVariableWatchCommand() = default;
cmVariableWatchCommand::~cmVariableWatchCommand()
{
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index ac4a4f526f..8e084172a4 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -376,7 +376,13 @@ void cmVisualStudio10TargetGenerator::Generate()
{
Elem e0(BuildFileStream, "Project");
e0.Attribute("DefaultTargets", "Build");
- e0.Attribute("ToolsVersion", this->GlobalGenerator->GetToolsVersion());
+ const char* toolsVersion = this->GlobalGenerator->GetToolsVersion();
+ if (this->GlobalGenerator->GetVersion() ==
+ cmGlobalVisualStudioGenerator::VS12 &&
+ this->GlobalGenerator->TargetsWindowsCE()) {
+ toolsVersion = "4.0";
+ }
+ e0.Attribute("ToolsVersion", toolsVersion);
e0.Attribute("xmlns",
"http://schemas.microsoft.com/developer/msbuild/2003");
@@ -2992,18 +2998,19 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaLinkOptions(
// Determine if we need to do a device link
bool doDeviceLinking = false;
- switch (this->GeneratorTarget->GetType()) {
- case cmStateEnums::SHARED_LIBRARY:
- case cmStateEnums::MODULE_LIBRARY:
- case cmStateEnums::EXECUTABLE:
- doDeviceLinking = true;
- break;
- case cmStateEnums::STATIC_LIBRARY:
- doDeviceLinking = this->GeneratorTarget->GetPropertyAsBool(
- "CUDA_RESOLVE_DEVICE_SYMBOLS");
- break;
- default:
- break;
+ if (const char* resolveDeviceSymbols =
+ this->GeneratorTarget->GetProperty("CUDA_RESOLVE_DEVICE_SYMBOLS")) {
+ doDeviceLinking = cmSystemTools::IsOn(resolveDeviceSymbols);
+ } else {
+ switch (this->GeneratorTarget->GetType()) {
+ case cmStateEnums::SHARED_LIBRARY:
+ case cmStateEnums::MODULE_LIBRARY:
+ case cmStateEnums::EXECUTABLE:
+ doDeviceLinking = true;
+ break;
+ default:
+ break;
+ }
}
cudaLinkOptions.AddFlag("PerformDeviceLink",
@@ -3584,8 +3591,8 @@ bool cmVisualStudio10TargetGenerator::ComputeLibOptions(
this->LocalGenerator->GetCurrentBinaryDirectory();
for (cmComputeLinkInformation::Item const& l : libs) {
if (l.IsPath && cmVS10IsTargetsFile(l.Value)) {
- std::string path =
- this->LocalGenerator->ConvertToRelativePath(currentBinDir, l.Value);
+ std::string path = this->LocalGenerator->MaybeConvertToRelativePath(
+ currentBinDir, l.Value);
ConvertToWindowsSlash(path);
this->AddTargetsFileAndConfigPair(path, config);
}
@@ -3668,8 +3675,8 @@ void cmVisualStudio10TargetGenerator::AddLibraries(
}
if (l.IsPath) {
- std::string path =
- this->LocalGenerator->ConvertToRelativePath(currentBinDir, l.Value);
+ std::string path = this->LocalGenerator->MaybeConvertToRelativePath(
+ currentBinDir, l.Value);
ConvertToWindowsSlash(path);
if (cmVS10IsTargetsFile(l.Value)) {
vsTargetVec.push_back(path);
@@ -3884,8 +3891,8 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences(Elem& e0)
this->WriteDotNetReferenceCustomTags(e2, name);
// If the dependency target is not managed (compiled with /clr or
- // C# target) we cannot reference it and have to set
- // 'ReferenceOutputAssembly' to false.
+ // C# target) and not a WinRT component we cannot reference it and
+ // have to set 'ReferenceOutputAssembly' to false.
auto referenceNotManaged =
dt->GetManagedType("") < cmGeneratorTarget::ManagedType::Mixed;
// Workaround to check for manually set /clr flags.
@@ -3902,6 +3909,12 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences(Elem& e0)
if (referenceNotManaged && dt->GetType() == cmStateEnums::STATIC_LIBRARY) {
referenceNotManaged = !dt->IsCSharpOnly();
}
+
+ // Referencing WinRT components is okay.
+ if (referenceNotManaged) {
+ referenceNotManaged = !dt->GetPropertyAsBool("VS_WINRT_COMPONENT");
+ }
+
if (referenceNotManaged) {
e2.Element("ReferenceOutputAssembly", "false");
e2.Element("CopyToOutputDirectory", "Never");
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 7d24e888c2..590100496d 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -25,12 +25,16 @@ class cmVS10GeneratorOptions;
class cmVisualStudio10TargetGenerator
{
- CM_DISABLE_COPY(cmVisualStudio10TargetGenerator)
-
public:
cmVisualStudio10TargetGenerator(cmGeneratorTarget* target,
cmGlobalVisualStudio10Generator* gg);
~cmVisualStudio10TargetGenerator();
+
+ cmVisualStudio10TargetGenerator(cmVisualStudio10TargetGenerator const&) =
+ delete;
+ cmVisualStudio10TargetGenerator& operator=(
+ cmVisualStudio10TargetGenerator const&) = delete;
+
void Generate();
private:
diff --git a/Source/cmVisualStudio10ToolsetOptions.cxx b/Source/cmVisualStudio10ToolsetOptions.cxx
index 39063ed917..a490e03df2 100644
--- a/Source/cmVisualStudio10ToolsetOptions.cxx
+++ b/Source/cmVisualStudio10ToolsetOptions.cxx
@@ -11,7 +11,9 @@ std::string cmVisualStudio10ToolsetOptions::GetClFlagTableName(
{
std::string const useToolset = this->GetToolsetName(name, toolset);
- if (toolset == "v141") {
+ if (toolset == "v142") {
+ return "v142";
+ } else if (toolset == "v141") {
return "v141";
} else if (useToolset == "v140") {
return "v140";
@@ -31,7 +33,10 @@ std::string cmVisualStudio10ToolsetOptions::GetCSharpFlagTableName(
{
std::string const useToolset = this->GetToolsetName(name, toolset);
- if ((useToolset == "v141")) {
+ if (useToolset == "v142") {
+ // FIXME: Add CSharp flag table for v142.
+ return "v141";
+ } else if (useToolset == "v141") {
return "v141";
} else if (useToolset == "v140") {
return "v140";
@@ -51,7 +56,8 @@ std::string cmVisualStudio10ToolsetOptions::GetRcFlagTableName(
{
std::string const useToolset = this->GetToolsetName(name, toolset);
- if ((useToolset == "v140") || (useToolset == "v141")) {
+ if ((useToolset == "v140") || (useToolset == "v141") ||
+ (useToolset == "v142")) {
return "v14";
} else if (useToolset == "v120") {
return "v12";
@@ -69,7 +75,8 @@ std::string cmVisualStudio10ToolsetOptions::GetLibFlagTableName(
{
std::string const useToolset = this->GetToolsetName(name, toolset);
- if ((useToolset == "v140") || (useToolset == "v141")) {
+ if ((useToolset == "v140") || (useToolset == "v141") ||
+ (useToolset == "v142")) {
return "v14";
} else if (useToolset == "v120") {
return "v12";
@@ -87,7 +94,9 @@ std::string cmVisualStudio10ToolsetOptions::GetLinkFlagTableName(
{
std::string const useToolset = this->GetToolsetName(name, toolset);
- if (useToolset == "v141") {
+ if (useToolset == "v142") {
+ return "v142";
+ } else if (useToolset == "v141") {
return "v141";
} else if (useToolset == "v140") {
return "v140";
@@ -107,7 +116,8 @@ std::string cmVisualStudio10ToolsetOptions::GetMasmFlagTableName(
{
std::string const useToolset = this->GetToolsetName(name, toolset);
- if ((useToolset == "v140") || (useToolset == "v141")) {
+ if ((useToolset == "v140") || (useToolset == "v141") ||
+ (useToolset == "v142")) {
return "v14";
} else if (useToolset == "v120") {
return "v12";
diff --git a/Source/cmXMLWriter.h b/Source/cmXMLWriter.h
index b080654095..1df8a09d77 100644
--- a/Source/cmXMLWriter.h
+++ b/Source/cmXMLWriter.h
@@ -16,12 +16,13 @@
class cmXMLWriter
{
- CM_DISABLE_COPY(cmXMLWriter)
-
public:
cmXMLWriter(std::ostream& output, std::size_t level = 0);
~cmXMLWriter();
+ cmXMLWriter(cmXMLWriter const&) = delete;
+ cmXMLWriter& operator=(cmXMLWriter const&) = delete;
+
void StartDocument(const char* encoding = "UTF-8");
void EndDocument();
diff --git a/Source/cm_codecvt.cxx b/Source/cm_codecvt.cxx
index 9519f9155a..821c112b3b 100644
--- a/Source/cm_codecvt.cxx
+++ b/Source/cm_codecvt.cxx
@@ -38,9 +38,7 @@ codecvt::codecvt(Encoding e)
}
}
-codecvt::~codecvt()
-{
-}
+codecvt::~codecvt() = default;
bool codecvt::do_always_noconv() const throw()
{
diff --git a/Source/cm_thread.hxx b/Source/cm_thread.hxx
index 84e6a5c326..b1f064585d 100644
--- a/Source/cm_thread.hxx
+++ b/Source/cm_thread.hxx
@@ -11,18 +11,18 @@ namespace cm {
class shared_mutex
{
uv_rwlock_t _M_;
- CM_DISABLE_COPY(shared_mutex)
public:
shared_mutex() { uv_rwlock_init(&_M_); }
~shared_mutex() { uv_rwlock_destroy(&_M_); }
- void lock() { uv_rwlock_wrlock(&_M_); }
+ shared_mutex(shared_mutex const&) = delete;
+ shared_mutex& operator=(shared_mutex const&) = delete;
+ void lock() { uv_rwlock_wrlock(&_M_); }
void unlock() { uv_rwlock_wrunlock(&_M_); }
void lock_shared() { uv_rwlock_rdlock(&_M_); }
-
void unlock_shared() { uv_rwlock_rdunlock(&_M_); }
};
@@ -30,7 +30,6 @@ template <typename T>
class shared_lock
{
T& _mutex;
- CM_DISABLE_COPY(shared_lock)
public:
shared_lock(T& m)
@@ -38,7 +37,12 @@ public:
{
_mutex.lock_shared();
}
+
~shared_lock() { _mutex.unlock_shared(); }
+
+ shared_lock(shared_lock const&) = delete;
+ shared_lock& operator=(shared_lock const&) = delete;
};
}
+
#endif
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 744b8fce46..8023298f9f 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -157,8 +157,6 @@ cmake::cmake(Role role, cmState::Mode mode)
#endif
this->GlobalGenerator = nullptr;
- this->ProgressCallback = nullptr;
- this->ProgressCallbackClientData = nullptr;
this->CurrentWorkingMode = NORMAL_MODE;
#ifdef CMAKE_BUILD_WITH_CMAKE
@@ -439,7 +437,7 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
}
}
std::cout << "loading initial cache file " << path << "\n";
- this->ReadListFile(args, path.c_str());
+ this->ReadListFile(args, path);
} else if (arg.find("-P", 0) == 0) {
i++;
if (i >= args.size()) {
@@ -453,7 +451,7 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
}
// Register fake project commands that hint misuse in script mode.
GetProjectCommandsInScriptMode(this->State);
- this->ReadListFile(args, path.c_str());
+ this->ReadListFile(args, path);
} else if (arg.find("--find-package", 0) == 0) {
findPackageMode = true;
}
@@ -467,7 +465,7 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
}
void cmake::ReadListFile(const std::vector<std::string>& args,
- const char* path)
+ const std::string& path)
{
// if a generator was not yet created, temporarily create one
cmGlobalGenerator* gg = this->GetGlobalGenerator();
@@ -480,7 +478,7 @@ void cmake::ReadListFile(const std::vector<std::string>& args,
}
// read in the list file to fill the cache
- if (path) {
+ if (!path.empty()) {
this->CurrentSnapshot = this->State->Reset();
std::string homeDir = this->GetHomeDirectory();
std::string homeOutputDir = this->GetHomeOutputDirectory();
@@ -501,7 +499,7 @@ void cmake::ReadListFile(const std::vector<std::string>& args,
mf.SetArgcArgv(args);
}
if (!mf.ReadListFile(path)) {
- cmSystemTools::Error("Error processing file: ", path);
+ cmSystemTools::Error("Error processing file: " + path);
}
this->SetHomeDirectory(homeDir);
this->SetHomeOutputDirectory(homeOutputDir);
@@ -1252,7 +1250,7 @@ int cmake::HandleDeleteCacheVariables(const std::string& var)
for (SaveCacheEntry const& i : saved) {
this->AddCacheEntry(i.key, i.value.c_str(), i.help.c_str(), i.type);
}
- cmSystemTools::Message(warning.str().c_str());
+ cmSystemTools::Message(warning.str());
// avoid reconfigure if there were errors
if (!cmSystemTools::GetErrorOccuredFlag()) {
// re-run configure
@@ -1608,14 +1606,14 @@ void cmake::PreLoadCMakeFiles()
if (!pre_load.empty()) {
pre_load += "/PreLoad.cmake";
if (cmSystemTools::FileExists(pre_load)) {
- this->ReadListFile(args, pre_load.c_str());
+ this->ReadListFile(args, pre_load);
}
}
pre_load = this->GetHomeOutputDirectory();
if (!pre_load.empty()) {
pre_load += "/PreLoad.cmake";
if (cmSystemTools::FileExists(pre_load)) {
- this->ReadListFile(args, pre_load.c_str());
+ this->ReadListFile(args, pre_load);
}
}
}
@@ -1922,17 +1920,15 @@ bool cmake::DeleteCache(const std::string& path)
return this->State->DeleteCache(path);
}
-void cmake::SetProgressCallback(ProgressCallbackType f, void* cd)
+void cmake::SetProgressCallback(ProgressCallbackType f)
{
- this->ProgressCallback = f;
- this->ProgressCallbackClientData = cd;
+ this->ProgressCallback = std::move(f);
}
void cmake::UpdateProgress(const char* msg, float prog)
{
if (this->ProgressCallback && !this->State->GetIsInTryCompile()) {
- (*this->ProgressCallback)(msg, prog, this->ProgressCallbackClientData);
- return;
+ this->ProgressCallback(msg, prog);
}
}
@@ -2146,8 +2142,7 @@ int cmake::CheckBuildSystem()
std::string dep_newest = *dep++;
for (; dep != depends.end(); ++dep) {
int result = 0;
- if (this->FileComparison->FileTimeCompare(dep_newest.c_str(), dep->c_str(),
- &result)) {
+ if (this->FileComparison->FileTimeCompare(dep_newest, *dep, &result)) {
if (result < 0) {
dep_newest = *dep;
}
@@ -2166,8 +2161,7 @@ int cmake::CheckBuildSystem()
std::string out_oldest = *out++;
for (; out != outputs.end(); ++out) {
int result = 0;
- if (this->FileComparison->FileTimeCompare(out_oldest.c_str(), out->c_str(),
- &result)) {
+ if (this->FileComparison->FileTimeCompare(out_oldest, *out, &result)) {
if (result > 0) {
out_oldest = *out;
}
@@ -2184,8 +2178,8 @@ int cmake::CheckBuildSystem()
// If any output is older than any dependency then rerun.
{
int result = 0;
- if (!this->FileComparison->FileTimeCompare(out_oldest.c_str(),
- dep_newest.c_str(), &result) ||
+ if (!this->FileComparison->FileTimeCompare(out_oldest, dep_newest,
+ &result) ||
result < 0) {
if (verbose) {
std::ostringstream msg;
@@ -2360,7 +2354,7 @@ int cmake::GetSystemInformation(std::vector<std::string>& args)
outFile += "/CMakeLists.txt";
// Copy file
- if (!cmSystemTools::cmCopyFile(inFile.c_str(), outFile.c_str())) {
+ if (!cmSystemTools::cmCopyFile(inFile, outFile)) {
std::cerr << "Error copying file \"" << inFile << "\" to \"" << outFile
<< "\".\n";
return 1;
@@ -2446,8 +2440,7 @@ static bool cmakeCheckStampFile(const std::string& stampName, bool verbose)
while (cmSystemTools::GetLineFromStream(fin, dep)) {
int result;
if (!dep.empty() && dep[0] != '#' &&
- (!ftc.FileTimeCompare(stampDepends.c_str(), dep.c_str(), &result) ||
- result < 0)) {
+ (!ftc.FileTimeCompare(stampDepends, dep, &result) || result < 0)) {
// The stamp depends file is older than this dependency. The
// build system is really out of date.
std::cout << "CMake is re-running because " << stampName
@@ -2540,7 +2533,8 @@ cmMessenger* cmake::GetMessenger() const
int cmake::Build(int jobs, const std::string& dir, const std::string& target,
const std::string& config,
- const std::vector<std::string>& nativeOptions, bool clean)
+ const std::vector<std::string>& nativeOptions, bool clean,
+ bool verbose)
{
this->SetHomeDirectory("");
@@ -2593,11 +2587,11 @@ int cmake::Build(int jobs, const std::string& dir, const std::string& target,
return 1;
}
projName = cachedProjectName;
- bool verbose = false;
+
const char* cachedVerbose =
this->State->GetCacheEntryValue("CMAKE_VERBOSE_MAKEFILE");
- if (cachedVerbose) {
- verbose = cmSystemTools::IsOn(cachedVerbose);
+ if (cmSystemTools::IsOn(cachedVerbose)) {
+ verbose = true;
}
#ifdef CMAKE_HAVE_VS_GENERATORS
@@ -2619,7 +2613,7 @@ int cmake::Build(int jobs, const std::string& dir, const std::string& target,
cachePath + "/" + "CMakeFiles/" + "VerifyGlobs.cmake";
if (cmSystemTools::FileExists(globVerifyScript)) {
std::vector<std::string> args;
- this->ReadListFile(args, globVerifyScript.c_str());
+ this->ReadListFile(args, globVerifyScript);
}
}
diff --git a/Source/cmake.h b/Source/cmake.h
index 0f53d28210..53d44f148a 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -5,6 +5,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
+#include <functional>
#include <map>
#include <memory> // IWYU pragma: keep
#include <set>
@@ -59,8 +60,6 @@ struct cmDocumentationEntry;
class cmake
{
- CM_DISABLE_COPY(cmake)
-
public:
enum Role
{
@@ -119,6 +118,9 @@ public:
/// Destructor
~cmake();
+ cmake(cmake const&) = delete;
+ cmake& operator=(cmake const&) = delete;
+
#if defined(CMAKE_BUILD_WITH_CMAKE)
Json::Value ReportVersionJson() const;
Json::Value ReportCapabilitiesJson(bool haveServerMode) const;
@@ -271,7 +273,7 @@ public:
///! Parse command line arguments that might set cache values
bool SetCacheArgs(const std::vector<std::string>&);
- typedef void (*ProgressCallbackType)(const char* msg, float progress, void*);
+ using ProgressCallbackType = std::function<void(const char*, float)>;
/**
* Set the function used by GUIs to receive progress updates
* Function gets passed: message as a const char*, a progress
@@ -279,7 +281,7 @@ public:
* number provided may be negative in cases where a message is
* to be displayed without any progress percentage.
*/
- void SetProgressCallback(ProgressCallbackType f, void* clientData = nullptr);
+ void SetProgressCallback(ProgressCallbackType f);
///! this is called by generators to update the progress
void UpdateProgress(const char* msg, float prog);
@@ -424,7 +426,8 @@ public:
///! run the --build option
int Build(int jobs, const std::string& dir, const std::string& target,
const std::string& config,
- const std::vector<std::string>& nativeOptions, bool clean);
+ const std::vector<std::string>& nativeOptions, bool clean,
+ bool verbose);
///! run the --open option
bool Open(const std::string& dir, bool dryRun);
@@ -441,7 +444,6 @@ public:
protected:
void RunCheckForUnusedVariables();
- void InitializeProperties();
int HandleDeleteCacheVariables(const std::string& var);
typedef std::vector<cmGlobalGeneratorFactory*> RegisteredGeneratorsVector;
@@ -461,7 +463,8 @@ protected:
std::string GeneratorToolset;
///! read in a cmake list file to initialize the cache
- void ReadListFile(const std::vector<std::string>& args, const char* path);
+ void ReadListFile(const std::vector<std::string>& args,
+ const std::string& path);
bool FindPackage(const std::vector<std::string>& args);
///! Check if CMAKE_CACHEFILE_DIR is set. If it is not, delete the log file.
@@ -484,8 +487,6 @@ protected:
private:
ProgressCallbackType ProgressCallback;
- void* ProgressCallbackClientData;
- bool InTryCompile;
WorkingMode CurrentWorkingMode;
bool DebugOutput;
bool Trace;
@@ -533,18 +534,6 @@ private:
void AppendGlobalGeneratorsDocumentation(std::vector<cmDocumentationEntry>&);
void AppendExtraGeneratorsDocumentation(std::vector<cmDocumentationEntry>&);
-
- /**
- * Convert a message type between a warning and an error, based on the state
- * of the error output CMake variables, in the cache.
- */
- MessageType ConvertMessageType(MessageType t) const;
-
- /*
- * Check if messages of this type should be output, based on the state of the
- * warning and error output CMake variables, in the cache.
- */
- bool IsMessageTypeVisible(MessageType t) const;
};
#define CMAKE_STANDARD_OPTIONS_TABLE \
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 0c254984ae..890b74e0f2 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -68,6 +68,8 @@ static const char* cmDocumentationUsageNote[][2] = {
" --clean-first = Build target 'clean' first, then build.\n" \
" (To clean only, use --target 'clean'.)\n" \
" --use-stderr = Ignored. Behavior is default in CMake >= 3.0.\n" \
+ " -v --verbose = Enable verbose output - if supported - including\n" \
+ " the build commands to be executed. \n" \
" -- = Pass remaining options to the native tool.\n"
static const char* cmDocumentationOptions[][2] = {
@@ -115,9 +117,8 @@ int do_cmake(int ac, char const* const* av);
static int do_build(int ac, char const* const* av);
static int do_open(int ac, char const* const* av);
-static cmMakefile* cmakemainGetMakefile(void* clientdata)
+static cmMakefile* cmakemainGetMakefile(cmake* cm)
{
- cmake* cm = static_cast<cmake*>(clientdata);
if (cm && cm->GetDebugOutput()) {
cmGlobalGenerator* gg = cm->GetGlobalGenerator();
if (gg) {
@@ -127,10 +128,10 @@ static cmMakefile* cmakemainGetMakefile(void* clientdata)
return nullptr;
}
-static std::string cmakemainGetStack(void* clientdata)
+static std::string cmakemainGetStack(cmake* cm)
{
std::string msg;
- cmMakefile* mf = cmakemainGetMakefile(clientdata);
+ cmMakefile* mf = cmakemainGetMakefile(cm);
if (mf) {
msg = mf->FormatListFileStack();
if (!msg.empty()) {
@@ -142,15 +143,14 @@ static std::string cmakemainGetStack(void* clientdata)
}
static void cmakemainMessageCallback(const char* m, const char* /*unused*/,
- bool& /*unused*/, void* clientdata)
+ cmake* cm)
{
- std::cerr << m << cmakemainGetStack(clientdata) << std::endl << std::flush;
+ std::cerr << m << cmakemainGetStack(cm) << std::endl << std::flush;
}
-static void cmakemainProgressCallback(const char* m, float prog,
- void* clientdata)
+static void cmakemainProgressCallback(const char* m, float prog, cmake* cm)
{
- cmMakefile* mf = cmakemainGetMakefile(clientdata);
+ cmMakefile* mf = cmakemainGetMakefile(cm);
std::string dir;
if ((mf) && (strstr(m, "Configuring") == m) && (prog < 0)) {
dir = " ";
@@ -161,8 +161,7 @@ static void cmakemainProgressCallback(const char* m, float prog,
}
if ((prog < 0) || (!dir.empty())) {
- std::cout << "-- " << m << dir << cmakemainGetStack(clientdata)
- << std::endl;
+ std::cout << "-- " << m << dir << cmakemainGetStack(cm) << std::endl;
}
std::cout.flush();
@@ -320,8 +319,12 @@ int do_cmake(int ac, char const* const* av)
cmake cm(role, mode);
cm.SetHomeDirectory("");
cm.SetHomeOutputDirectory("");
- cmSystemTools::SetMessageCallback(cmakemainMessageCallback, &cm);
- cm.SetProgressCallback(cmakemainProgressCallback, &cm);
+ cmSystemTools::SetMessageCallback([&cm](const char* msg, const char* title) {
+ cmakemainMessageCallback(msg, title, &cm);
+ });
+ cm.SetProgressCallback([&cm](const char* msg, float prog) {
+ cmakemainProgressCallback(msg, prog, &cm);
+ });
cm.SetWorkingMode(workingMode);
int res = cm.Run(args, view_only);
@@ -395,6 +398,7 @@ static int do_build(int ac, char const* const* av)
std::string dir;
std::vector<std::string> nativeOptions;
bool clean = false;
+ bool verbose = cmSystemTools::HasEnv("VERBOSE");
bool hasTarget = false;
enum Doing
@@ -435,6 +439,10 @@ static int do_build(int ac, char const* const* av)
} else if (strcmp(av[i], "--clean-first") == 0) {
clean = true;
doing = DoingNone;
+ } else if ((strcmp(av[i], "--verbose") == 0) ||
+ (strcmp(av[i], "-v") == 0)) {
+ verbose = true;
+ doing = DoingNone;
} else if (strcmp(av[i], "--use-stderr") == 0) {
/* tolerate legacy option */
} else if (strcmp(av[i], "--") == 0) {
@@ -491,9 +499,13 @@ static int do_build(int ac, char const* const* av)
}
cmake cm(cmake::RoleInternal, cmState::Unknown);
- cmSystemTools::SetMessageCallback(cmakemainMessageCallback, &cm);
- cm.SetProgressCallback(cmakemainProgressCallback, &cm);
- return cm.Build(jobs, dir, target, config, nativeOptions, clean);
+ cmSystemTools::SetMessageCallback([&cm](const char* msg, const char* title) {
+ cmakemainMessageCallback(msg, title, &cm);
+ });
+ cm.SetProgressCallback([&cm](const char* msg, float prog) {
+ cmakemainProgressCallback(msg, prog, &cm);
+ });
+ return cm.Build(jobs, dir, target, config, nativeOptions, clean, verbose);
#endif
}
@@ -529,8 +541,12 @@ static int do_open(int ac, char const* const* av)
}
cmake cm(cmake::RoleInternal, cmState::Unknown);
- cmSystemTools::SetMessageCallback(cmakemainMessageCallback, &cm);
- cm.SetProgressCallback(cmakemainProgressCallback, &cm);
+ cmSystemTools::SetMessageCallback([&cm](const char* msg, const char* title) {
+ cmakemainMessageCallback(msg, title, &cm);
+ });
+ cm.SetProgressCallback([&cm](const char* msg, float prog) {
+ cmakemainProgressCallback(msg, prog, &cm);
+ });
return cm.Open(dir, false) ? 0 : 1;
#endif
}
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index ce3691d479..d20c5d23a3 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -78,7 +78,8 @@ void CMakeCommandUsage(const char* program)
<< " capabilities - Report capabilities built into cmake "
"in JSON format\n"
<< " chdir dir cmd [args...] - run command in a given directory\n"
- << " compare_files file1 file2 - check if file1 is same as file2\n"
+ << " compare_files [--ignore-eol] file1 file2\n"
+ << " - check if file1 is same as file2\n"
<< " copy <file>... destination - copy files to destination "
"(either file or directory)\n"
<< " copy_directory <dir>... destination - copy content of <dir>... "
@@ -481,8 +482,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
// If error occurs we want to continue copying next files.
bool return_value = false;
for (std::string::size_type cc = 2; cc < args.size() - 1; cc++) {
- if (!cmSystemTools::cmCopyFile(args[cc].c_str(),
- args.back().c_str())) {
+ if (!cmSystemTools::cmCopyFile(args[cc], args.back())) {
std::cerr << "Error copying file \"" << args[cc] << "\" to \""
<< args.back() << "\".\n";
return_value = true;
@@ -504,8 +504,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
// If error occurs we want to continue copying next files.
bool return_value = false;
for (std::string::size_type cc = 2; cc < args.size() - 1; cc++) {
- if (!cmSystemTools::CopyFileIfDifferent(args[cc].c_str(),
- args.back().c_str())) {
+ if (!cmSystemTools::CopyFileIfDifferent(args[cc], args.back())) {
std::cerr << "Error copying file (if different) from \"" << args[cc]
<< "\" to \"" << args.back() << "\".\n";
return_value = true;
@@ -540,10 +539,20 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
}
// Compare files
- if (args[1] == "compare_files" && args.size() == 4) {
- if (cmSystemTools::FilesDiffer(args[2], args[3])) {
- std::cerr << "Files \"" << args[2] << "\" to \"" << args[3]
- << "\" are different.\n";
+ if (args[1] == "compare_files" && (args.size() == 4 || args.size() == 5)) {
+ bool filesDiffer;
+ if (args.size() == 4) {
+ filesDiffer = cmSystemTools::FilesDiffer(args[2], args[3]);
+ } else if (args[2] == "--ignore-eol") {
+ filesDiffer = cmsys::SystemTools::TextFilesDiffer(args[3], args[4]);
+ } else {
+ ::CMakeCommandUsage(args[0].c_str());
+ return 1;
+ }
+
+ if (filesDiffer) {
+ std::cerr << "Files \"" << args[args.size() - 2] << "\" to \""
+ << args[args.size() - 1] << "\" are different.\n";
return 1;
}
return 0;
@@ -1293,7 +1302,7 @@ bool cmcmd::SymlinkInternal(std::string const& file, std::string const& link)
cmSystemTools::RemoveFile(link);
}
#if defined(_WIN32) && !defined(__CYGWIN__)
- return cmSystemTools::CopyFileAlways(file.c_str(), link.c_str());
+ return cmSystemTools::CopyFileAlways(file, link);
#else
std::string linktext = cmSystemTools::GetFilenameName(file);
return cmSystemTools::CreateSymlink(linktext, link);
@@ -1350,8 +1359,8 @@ static void cmcmdProgressReport(std::string const& dir, std::string const& num)
int cmcmd::ExecuteEchoColor(std::vector<std::string>& args)
{
// The arguments are
- // argv[0] == <cmake-executable>
- // argv[1] == cmake_echo_color
+ // args[0] == <cmake-executable>
+ // args[1] == cmake_echo_color
bool enabled = true;
int color = cmsysTerminal_Color_Normal;
@@ -1408,10 +1417,10 @@ int cmcmd::ExecuteEchoColor(std::vector<std::string>& args)
int cmcmd::ExecuteLinkScript(std::vector<std::string>& args)
{
// The arguments are
- // argv[0] == <cmake-executable>
- // argv[1] == cmake_link_script
- // argv[2] == <link-script-name>
- // argv[3] == --verbose=?
+ // args[0] == <cmake-executable>
+ // args[1] == cmake_link_script
+ // args[2] == <link-script-name>
+ // args[3] == --verbose=?
bool verbose = false;
if (args.size() >= 4) {
if (args[3].find("--verbose=") == 0) {
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
index b33aa80291..e7da994625 100644
--- a/Source/kwsys/CMakeLists.txt
+++ b/Source/kwsys/CMakeLists.txt
@@ -42,6 +42,10 @@
# SET(KWSYS_HEADER_ROOT ${PROJECT_BINARY_DIR})
# INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR})
#
+# KWSYS_CXX_STANDARD = A value for CMAKE_CXX_STANDARD within KWSys.
+# Set to empty string to use no default value.
+# KWSYS_CXX_COMPILE_FEATURES = target_compile_features arguments for KWSys.
+#
# Optional settings to setup install rules are as follows:
#
# KWSYS_INSTALL_BIN_DIR = The installation target directories into
@@ -82,25 +86,17 @@
# any outside mailing list and no documentation of the change will be
# written.
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR)
+CMAKE_MINIMUM_REQUIRED(VERSION 3.1 FATAL_ERROR)
FOREACH(p
- CMP0022 # CMake 2.8, Define link interface - required by android_mk export
- CMP0025 # CMake 3.0, Compiler id for Apple Clang is now AppleClang.
- CMP0042 # CMake 3.0, MACOSX_RPATH is enabled by default.
- CMP0048 # CMake 3.0, Let the project command manage version variables.
CMP0056 # CMake 3.2, Honor link flags in try_compile() source-file signature.
CMP0063 # CMake 3.3, Honor visibility properties for all target types.
+ CMP0067 # CMake 3.8, Honor language standard in try_compile source-file signature.
CMP0069 # CMake 3.9, INTERPROCEDURAL_OPTIMIZATION is enforced when enabled.
)
IF(POLICY ${p})
CMAKE_POLICY(SET ${p} NEW)
ENDIF()
ENDFOREACH()
-SET(CMAKE_LEGACY_CYGWIN_WIN32 0)
-
-IF(CMAKE_VERSION VERSION_LESS 3.0)
- SET(KWSYS_SPLIT_OBJECTS_FROM_INTERFACE 0)
-ENDIF()
#-----------------------------------------------------------------------------
# If a namespace is not specified, use "kwsys" and enable testing.
@@ -121,6 +117,12 @@ SET_PROPERTY(DIRECTORY
"KWSYS_HEADER(%)=<${KWSYS_NAMESPACE}/%>"
)
+if(KWSYS_CXX_STANDARD)
+ set(CMAKE_CXX_STANDARD "${KWSYS_CXX_STANDARD}")
+elseif(NOT DEFINED CMAKE_CXX_STANDARD AND NOT DEFINED KWSYS_CXX_STANDARD)
+ set(CMAKE_CXX_STANDARD 11)
+endif()
+
# Select library components.
IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
SET(KWSYS_ENABLE_C 1)
@@ -884,6 +886,8 @@ IF(KWSYS_C_SRCS OR KWSYS_CXX_SRCS)
${KWSYS_TARGET_INTERFACE})
TARGET_SOURCES(${KWSYS_TARGET_LINK} INTERFACE
$<TARGET_OBJECTS:${KWSYS_TARGET_OBJECT}>)
+ target_compile_features(${KWSYS_TARGET_OBJECT} PRIVATE ${KWSYS_CXX_COMPILE_FEATURES})
+ target_compile_features(${KWSYS_TARGET_INTERFACE} INTERFACE ${KWSYS_CXX_COMPILE_FEATURES})
ELSE()
SET(KWSYS_TARGET_INTERFACE ${KWSYS_NAMESPACE})
SET(KWSYS_TARGET_OBJECT ${KWSYS_NAMESPACE})
@@ -892,6 +896,7 @@ IF(KWSYS_C_SRCS OR KWSYS_CXX_SRCS)
SET(KWSYS_LINK_DEPENDENCY PUBLIC)
ADD_LIBRARY(${KWSYS_TARGET_INTERFACE} ${KWSYS_LIBRARY_TYPE}
${KWSYS_C_SRCS} ${KWSYS_CXX_SRCS})
+ target_compile_features(${KWSYS_TARGET_INTERFACE} PUBLIC ${KWSYS_CXX_COMPILE_FEATURES})
ENDIF()
if (KWSYS_ALIAS_TARGET)
add_library(${KWSYS_ALIAS_TARGET} ALIAS ${KWSYS_TARGET_INTERFACE})
diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx
index 6c12355de7..f323efc4b0 100644
--- a/Source/kwsys/SystemInformation.cxx
+++ b/Source/kwsys/SystemInformation.cxx
@@ -4424,7 +4424,8 @@ bool SystemInformationImplementation::ParseSysCtl()
&count) == KERN_SUCCESS) {
len = sizeof(value);
err = sysctlbyname("hw.pagesize", &value, &len, KWSYS_NULLPTR, 0);
- int64_t available_memory = vmstat.free_count * value;
+ int64_t available_memory =
+ (vmstat.free_count + vmstat.inactive_count) * value;
this->AvailablePhysicalMemory =
static_cast<size_t>(available_memory / 1048576);
}
diff --git a/Source/kwsys/kwsysPlatformTests.cmake b/Source/kwsys/kwsysPlatformTests.cmake
index 5386a49a33..28d3f68e25 100644
--- a/Source/kwsys/kwsysPlatformTests.cmake
+++ b/Source/kwsys/kwsysPlatformTests.cmake
@@ -7,11 +7,16 @@ SET(KWSYS_PLATFORM_TEST_FILE_CXX kwsysPlatformTestsCXX.cxx)
MACRO(KWSYS_PLATFORM_TEST lang var description invert)
IF(NOT DEFINED ${var}_COMPILED)
MESSAGE(STATUS "${description}")
+ set(maybe_cxx_standard "")
+ if(CMAKE_VERSION VERSION_LESS 3.8 AND CMAKE_CXX_STANDARD)
+ set(maybe_cxx_standard "-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}")
+ endif()
TRY_COMPILE(${var}_COMPILED
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/${KWSYS_PLATFORM_TEST_FILE_${lang}}
COMPILE_DEFINITIONS -DTEST_${var} ${KWSYS_PLATFORM_TEST_DEFINES} ${KWSYS_PLATFORM_TEST_EXTRA_FLAGS}
CMAKE_FLAGS "-DLINK_LIBRARIES:STRING=${KWSYS_PLATFORM_TEST_LINK_LIBRARIES}"
+ ${maybe_cxx_standard}
OUTPUT_VARIABLE OUTPUT)
IF(${var}_COMPILED)
FILE(APPEND
diff --git a/Templates/MSBuild/FlagTables/v10_CSharp.json b/Templates/MSBuild/FlagTables/v10_CSharp.json
index a0780a4a5a..5989aea1ec 100644
--- a/Templates/MSBuild/FlagTables/v10_CSharp.json
+++ b/Templates/MSBuild/FlagTables/v10_CSharp.json
@@ -299,11 +299,15 @@
"flags": []
},
{
- "name": "DisabledWarnings",
- "switch": "nowarn",
+ "name": "NoWarn",
+ "switch": "nowarn:",
"comment": "",
"value": "",
- "flags": []
+ "flags": [
+ "UserValue",
+ "UserRequired",
+ "CommaAppendable"
+ ]
},
{
"name": "CheckForOverflowUnderflow",
diff --git a/Templates/MSBuild/FlagTables/v11_CSharp.json b/Templates/MSBuild/FlagTables/v11_CSharp.json
index a0780a4a5a..5989aea1ec 100644
--- a/Templates/MSBuild/FlagTables/v11_CSharp.json
+++ b/Templates/MSBuild/FlagTables/v11_CSharp.json
@@ -299,11 +299,15 @@
"flags": []
},
{
- "name": "DisabledWarnings",
- "switch": "nowarn",
+ "name": "NoWarn",
+ "switch": "nowarn:",
"comment": "",
"value": "",
- "flags": []
+ "flags": [
+ "UserValue",
+ "UserRequired",
+ "CommaAppendable"
+ ]
},
{
"name": "CheckForOverflowUnderflow",
diff --git a/Templates/MSBuild/FlagTables/v12_CSharp.json b/Templates/MSBuild/FlagTables/v12_CSharp.json
index a0780a4a5a..5989aea1ec 100644
--- a/Templates/MSBuild/FlagTables/v12_CSharp.json
+++ b/Templates/MSBuild/FlagTables/v12_CSharp.json
@@ -299,11 +299,15 @@
"flags": []
},
{
- "name": "DisabledWarnings",
- "switch": "nowarn",
+ "name": "NoWarn",
+ "switch": "nowarn:",
"comment": "",
"value": "",
- "flags": []
+ "flags": [
+ "UserValue",
+ "UserRequired",
+ "CommaAppendable"
+ ]
},
{
"name": "CheckForOverflowUnderflow",
diff --git a/Templates/MSBuild/FlagTables/v140_CSharp.json b/Templates/MSBuild/FlagTables/v140_CSharp.json
index a0780a4a5a..5989aea1ec 100644
--- a/Templates/MSBuild/FlagTables/v140_CSharp.json
+++ b/Templates/MSBuild/FlagTables/v140_CSharp.json
@@ -299,11 +299,15 @@
"flags": []
},
{
- "name": "DisabledWarnings",
- "switch": "nowarn",
+ "name": "NoWarn",
+ "switch": "nowarn:",
"comment": "",
"value": "",
- "flags": []
+ "flags": [
+ "UserValue",
+ "UserRequired",
+ "CommaAppendable"
+ ]
},
{
"name": "CheckForOverflowUnderflow",
diff --git a/Templates/MSBuild/FlagTables/v141_CSharp.json b/Templates/MSBuild/FlagTables/v141_CSharp.json
index a0780a4a5a..5989aea1ec 100644
--- a/Templates/MSBuild/FlagTables/v141_CSharp.json
+++ b/Templates/MSBuild/FlagTables/v141_CSharp.json
@@ -299,11 +299,15 @@
"flags": []
},
{
- "name": "DisabledWarnings",
- "switch": "nowarn",
+ "name": "NoWarn",
+ "switch": "nowarn:",
"comment": "",
"value": "",
- "flags": []
+ "flags": [
+ "UserValue",
+ "UserRequired",
+ "CommaAppendable"
+ ]
},
{
"name": "CheckForOverflowUnderflow",
diff --git a/Templates/MSBuild/FlagTables/v142_CL.json b/Templates/MSBuild/FlagTables/v142_CL.json
new file mode 100644
index 0000000000..95b9d14f61
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v142_CL.json
@@ -0,0 +1,1212 @@
+[
+ {
+ "name": "DebugInformationFormat",
+ "switch": "",
+ "comment": "None",
+ "value": "None",
+ "flags": []
+ },
+ {
+ "name": "DebugInformationFormat",
+ "switch": "Z7",
+ "comment": "C7 compatible",
+ "value": "OldStyle",
+ "flags": []
+ },
+ {
+ "name": "DebugInformationFormat",
+ "switch": "Zi",
+ "comment": "Program Database",
+ "value": "ProgramDatabase",
+ "flags": []
+ },
+ {
+ "name": "DebugInformationFormat",
+ "switch": "ZI",
+ "comment": "Program Database for Edit And Continue",
+ "value": "EditAndContinue",
+ "flags": []
+ },
+ {
+ "name": "CompileAsManaged",
+ "switch": "",
+ "comment": "No Common Language RunTime Support",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "CompileAsManaged",
+ "switch": "clr",
+ "comment": "Common Language RunTime Support",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "CompileAsManaged",
+ "switch": "clr:pure",
+ "comment": "Pure MSIL Common Language RunTime Support",
+ "value": "Pure",
+ "flags": []
+ },
+ {
+ "name": "CompileAsManaged",
+ "switch": "clr:safe",
+ "comment": "Safe MSIL Common Language RunTime Support",
+ "value": "Safe",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W0",
+ "comment": "Turn Off All Warnings",
+ "value": "TurnOffAllWarnings",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W1",
+ "comment": "Level1",
+ "value": "Level1",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W2",
+ "comment": "Level2",
+ "value": "Level2",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W3",
+ "comment": "Level3",
+ "value": "Level3",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W4",
+ "comment": "Level4",
+ "value": "Level4",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "Wall",
+ "comment": "EnableAllWarnings",
+ "value": "EnableAllWarnings",
+ "flags": []
+ },
+ {
+ "name": "DiagnosticsFormat",
+ "switch": "diagnostics:caret",
+ "comment": "Caret",
+ "value": "Caret",
+ "flags": []
+ },
+ {
+ "name": "DiagnosticsFormat",
+ "switch": "diagnostics:column",
+ "comment": "Column Info",
+ "value": "Column",
+ "flags": []
+ },
+ {
+ "name": "DiagnosticsFormat",
+ "switch": "diagnostics:classic",
+ "comment": "Classic",
+ "value": "Classic",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "",
+ "comment": "Custom",
+ "value": "Custom",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "Od",
+ "comment": "Disabled",
+ "value": "Disabled",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "O1",
+ "comment": "Maximum Optimization (Favor Size)",
+ "value": "MinSpace",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "O2",
+ "comment": "Maximum Optimization (Favor Speed)",
+ "value": "MaxSpeed",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "Ox",
+ "comment": "Optimizations (Favor Speed)",
+ "value": "Full",
+ "flags": []
+ },
+ {
+ "name": "InlineFunctionExpansion",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "InlineFunctionExpansion",
+ "switch": "Ob0",
+ "comment": "Disabled",
+ "value": "Disabled",
+ "flags": []
+ },
+ {
+ "name": "InlineFunctionExpansion",
+ "switch": "Ob1",
+ "comment": "Only __inline",
+ "value": "OnlyExplicitInline",
+ "flags": []
+ },
+ {
+ "name": "InlineFunctionExpansion",
+ "switch": "Ob2",
+ "comment": "Any Suitable",
+ "value": "AnySuitable",
+ "flags": []
+ },
+ {
+ "name": "FavorSizeOrSpeed",
+ "switch": "Os",
+ "comment": "Favor small code",
+ "value": "Size",
+ "flags": []
+ },
+ {
+ "name": "FavorSizeOrSpeed",
+ "switch": "Ot",
+ "comment": "Favor fast code",
+ "value": "Speed",
+ "flags": []
+ },
+ {
+ "name": "FavorSizeOrSpeed",
+ "switch": "",
+ "comment": "Neither",
+ "value": "Neither",
+ "flags": []
+ },
+ {
+ "name": "ExceptionHandling",
+ "switch": "EHa",
+ "comment": "Yes with SEH Exceptions",
+ "value": "Async",
+ "flags": []
+ },
+ {
+ "name": "ExceptionHandling",
+ "switch": "EHsc",
+ "comment": "Yes",
+ "value": "Sync",
+ "flags": []
+ },
+ {
+ "name": "ExceptionHandling",
+ "switch": "EHs",
+ "comment": "Yes with Extern C functions",
+ "value": "SyncCThrow",
+ "flags": []
+ },
+ {
+ "name": "ExceptionHandling",
+ "switch": "",
+ "comment": "No",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "BasicRuntimeChecks",
+ "switch": "RTCs",
+ "comment": "Stack Frames",
+ "value": "StackFrameRuntimeCheck",
+ "flags": []
+ },
+ {
+ "name": "BasicRuntimeChecks",
+ "switch": "RTCu",
+ "comment": "Uninitialized variables",
+ "value": "UninitializedLocalUsageCheck",
+ "flags": []
+ },
+ {
+ "name": "BasicRuntimeChecks",
+ "switch": "RTC1",
+ "comment": "Both (/RTC1, equiv. to /RTCsu)",
+ "value": "EnableFastChecks",
+ "flags": []
+ },
+ {
+ "name": "BasicRuntimeChecks",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "RuntimeLibrary",
+ "switch": "MT",
+ "comment": "Multi-threaded",
+ "value": "MultiThreaded",
+ "flags": []
+ },
+ {
+ "name": "RuntimeLibrary",
+ "switch": "MTd",
+ "comment": "Multi-threaded Debug",
+ "value": "MultiThreadedDebug",
+ "flags": []
+ },
+ {
+ "name": "RuntimeLibrary",
+ "switch": "MD",
+ "comment": "Multi-threaded DLL",
+ "value": "MultiThreadedDLL",
+ "flags": []
+ },
+ {
+ "name": "RuntimeLibrary",
+ "switch": "MDd",
+ "comment": "Multi-threaded Debug DLL",
+ "value": "MultiThreadedDebugDLL",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp1",
+ "comment": "1 Byte",
+ "value": "1Byte",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp2",
+ "comment": "2 Bytes",
+ "value": "2Bytes",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp4",
+ "comment": "4 Byte",
+ "value": "4Bytes",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp8",
+ "comment": "8 Bytes",
+ "value": "8Bytes",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp16",
+ "comment": "16 Bytes",
+ "value": "16Bytes",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "BufferSecurityCheck",
+ "switch": "GS-",
+ "comment": "Disable Security Check",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "BufferSecurityCheck",
+ "switch": "GS",
+ "comment": "Enable Security Check",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ControlFlowGuard",
+ "switch": "guard:cf",
+ "comment": "Yes",
+ "value": "Guard",
+ "flags": []
+ },
+ {
+ "name": "ControlFlowGuard",
+ "switch": "",
+ "comment": "No",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "arch:SSE",
+ "comment": "Streaming SIMD Extensions",
+ "value": "StreamingSIMDExtensions",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "arch:SSE2",
+ "comment": "Streaming SIMD Extensions 2",
+ "value": "StreamingSIMDExtensions2",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "arch:AVX",
+ "comment": "Advanced Vector Extensions",
+ "value": "AdvancedVectorExtensions",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "arch:AVX2",
+ "comment": "Advanced Vector Extensions 2",
+ "value": "AdvancedVectorExtensions2",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "arch:IA32",
+ "comment": "No Enhanced Instructions",
+ "value": "NoExtensions",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointModel",
+ "switch": "fp:precise",
+ "comment": "Precise",
+ "value": "Precise",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointModel",
+ "switch": "fp:strict",
+ "comment": "Strict",
+ "value": "Strict",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointModel",
+ "switch": "fp:fast",
+ "comment": "Fast",
+ "value": "Fast",
+ "flags": []
+ },
+ {
+ "name": "SpectreMitigation",
+ "switch": "Qspectre-",
+ "comment": "Spectre mitigations disabled",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "SpectreMitigation",
+ "switch": "Qspectre",
+ "comment": "Spectre mitigations enabled",
+ "value": "Spectre",
+ "flags": []
+ },
+ {
+ "name": "LanguageStandard",
+ "switch": "std:c++14",
+ "comment": "ISO C++14 Standard",
+ "value": "stdcpp14",
+ "flags": []
+ },
+ {
+ "name": "LanguageStandard",
+ "switch": "std:c++17",
+ "comment": "ISO C++17 Standard",
+ "value": "stdcpp17",
+ "flags": []
+ },
+ {
+ "name": "LanguageStandard",
+ "switch": "std:c++latest",
+ "comment": "Preview - Features from the Latest C++ Working Draft",
+ "value": "stdcpplatest",
+ "flags": []
+ },
+ {
+ "name": "PrecompiledHeader",
+ "switch": "Yc",
+ "comment": "Create",
+ "value": "Create",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "PrecompiledHeader",
+ "switch": "Yu",
+ "comment": "Use",
+ "value": "Use",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "PrecompiledHeader",
+ "switch": "Y-",
+ "comment": "Not Using Precompiled Headers",
+ "value": "NotUsing",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "",
+ "comment": "No Listing",
+ "value": "NoListing",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "FA",
+ "comment": "Assembly-Only Listing",
+ "value": "AssemblyCode",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "FAc",
+ "comment": "Assembly With Machine Code",
+ "value": "AssemblyAndMachineCode",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "FAs",
+ "comment": "Assembly With Source Code",
+ "value": "AssemblyAndSourceCode",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "FAcs",
+ "comment": "Assembly, Machine Code and Source",
+ "value": "All",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gd",
+ "comment": "__cdecl",
+ "value": "Cdecl",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gr",
+ "comment": "__fastcall",
+ "value": "FastCall",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gz",
+ "comment": "__stdcall",
+ "value": "StdCall",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gv",
+ "comment": "__vectorcall",
+ "value": "VectorCall",
+ "flags": []
+ },
+ {
+ "name": "CompileAs",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "CompileAs",
+ "switch": "TC",
+ "comment": "Compile as C Code",
+ "value": "CompileAsC",
+ "flags": []
+ },
+ {
+ "name": "CompileAs",
+ "switch": "TP",
+ "comment": "Compile as C++ Code",
+ "value": "CompileAsCpp",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:none",
+ "comment": "Do Not Send Report",
+ "value": "None",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:prompt",
+ "comment": "Prompt Immediately",
+ "value": "Prompt",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:queue",
+ "comment": "Queue For Next Login",
+ "value": "Queue",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:send",
+ "comment": "Send Automatically",
+ "value": "Send",
+ "flags": []
+ },
+ {
+ "name": "SupportJustMyCode",
+ "switch": "JMC-",
+ "comment": "Support Just My Code Debugging",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "SupportJustMyCode",
+ "switch": "JMC",
+ "comment": "Support Just My Code Debugging",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "CompileAsWinRT",
+ "switch": "ZW",
+ "comment": "Consume Windows Runtime Extension",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "WinRTNoStdLib",
+ "switch": "ZW:nostdlib",
+ "comment": "No Standard WinRT Libraries",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SuppressStartupBanner",
+ "switch": "nologo",
+ "comment": "Suppress Startup Banner",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningAsError",
+ "switch": "WX-",
+ "comment": "Treat Warnings As Errors",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningAsError",
+ "switch": "WX",
+ "comment": "Treat Warnings As Errors",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SDLCheck",
+ "switch": "sdl-",
+ "comment": "SDL checks",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "SDLCheck",
+ "switch": "sdl",
+ "comment": "SDL checks",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "MultiProcessorCompilation",
+ "switch": "MP",
+ "comment": "Multi-processor Compilation",
+ "value": "true",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "IntrinsicFunctions",
+ "switch": "Oi",
+ "comment": "Enable Intrinsic Functions",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "OmitFramePointers",
+ "switch": "Oy-",
+ "comment": "Omit Frame Pointers",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "OmitFramePointers",
+ "switch": "Oy",
+ "comment": "Omit Frame Pointers",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableFiberSafeOptimizations",
+ "switch": "GT",
+ "comment": "Enable Fiber-Safe Optimizations",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "WholeProgramOptimization",
+ "switch": "GL",
+ "comment": "Whole Program Optimization",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "UndefineAllPreprocessorDefinitions",
+ "switch": "u",
+ "comment": "Undefine All Preprocessor Definitions",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "IgnoreStandardIncludePath",
+ "switch": "X",
+ "comment": "Ignore Standard Include Paths",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreprocessToFile",
+ "switch": "P",
+ "comment": "Preprocess to a File",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreprocessSuppressLineNumbers",
+ "switch": "EP",
+ "comment": "Preprocess Suppress Line Numbers",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreprocessKeepComments",
+ "switch": "C",
+ "comment": "Keep Comments",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "StringPooling",
+ "switch": "GF-",
+ "comment": "Enable String Pooling",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "StringPooling",
+ "switch": "GF",
+ "comment": "Enable String Pooling",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "MinimalRebuild",
+ "switch": "Gm-",
+ "comment": "Enable Minimal Rebuild",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "MinimalRebuild",
+ "switch": "Gm",
+ "comment": "Enable Minimal Rebuild",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SmallerTypeCheck",
+ "switch": "RTCc",
+ "comment": "Smaller Type Check",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "FunctionLevelLinking",
+ "switch": "Gy-",
+ "comment": "Enable Function-Level Linking",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "FunctionLevelLinking",
+ "switch": "Gy",
+ "comment": "Enable Function-Level Linking",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableParallelCodeGeneration",
+ "switch": "Qpar-",
+ "comment": "Enable Parallel Code Generation",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "EnableParallelCodeGeneration",
+ "switch": "Qpar",
+ "comment": "Enable Parallel Code Generation",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointExceptions",
+ "switch": "fp:except-",
+ "comment": "Enable Floating Point Exceptions",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointExceptions",
+ "switch": "fp:except",
+ "comment": "Enable Floating Point Exceptions",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "CreateHotpatchableImage",
+ "switch": "hotpatch",
+ "comment": "Create Hotpatchable Image",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DisableLanguageExtensions",
+ "switch": "Za",
+ "comment": "Disable Language Extensions",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ConformanceMode",
+ "switch": "permissive-",
+ "comment": "Conformance mode enabled",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ConformanceMode",
+ "switch": "permissive",
+ "comment": "Conformance mode disabled",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TreatWChar_tAsBuiltInType",
+ "switch": "Zc:wchar_t-",
+ "comment": "Treat WChar_t As Built in Type",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TreatWChar_tAsBuiltInType",
+ "switch": "Zc:wchar_t",
+ "comment": "Treat WChar_t As Built in Type",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ForceConformanceInForLoopScope",
+ "switch": "Zc:forScope-",
+ "comment": "Force Conformance in For Loop Scope",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "ForceConformanceInForLoopScope",
+ "switch": "Zc:forScope",
+ "comment": "Force Conformance in For Loop Scope",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "RemoveUnreferencedCodeData",
+ "switch": "Zc:inline-",
+ "comment": "Remove unreferenced code and data",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "RemoveUnreferencedCodeData",
+ "switch": "Zc:inline",
+ "comment": "Remove unreferenced code and data",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnforceTypeConversionRules",
+ "switch": "Zc:rvalueCast-",
+ "comment": "Enforce type conversion rules",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "EnforceTypeConversionRules",
+ "switch": "Zc:rvalueCast",
+ "comment": "Enforce type conversion rules",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "RuntimeTypeInfo",
+ "switch": "GR-",
+ "comment": "Enable Run-Time Type Information",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "RuntimeTypeInfo",
+ "switch": "GR",
+ "comment": "Enable Run-Time Type Information",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "OpenMPSupport",
+ "switch": "openmp-",
+ "comment": "Open MP Support",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "OpenMPSupport",
+ "switch": "openmp",
+ "comment": "Open MP Support",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableModules",
+ "switch": "experimental:module",
+ "comment": "Enable C++ Modules (experimental)",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ExpandAttributedSource",
+ "switch": "Fx",
+ "comment": "Expand Attributed Source",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "UseUnicodeForAssemblerListing",
+ "switch": "FAu",
+ "comment": "Use Unicode For Assembler Listing",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GenerateXMLDocumentationFiles",
+ "switch": "doc",
+ "comment": "Generate XML Documentation Files",
+ "value": "true",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "BrowseInformation",
+ "switch": "FR",
+ "comment": "Enable Browse Information",
+ "value": "true",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "ShowIncludes",
+ "switch": "showIncludes",
+ "comment": "Show Includes",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnablePREfast",
+ "switch": "analyze-",
+ "comment": "Enable Code Analysis",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "EnablePREfast",
+ "switch": "analyze",
+ "comment": "Enable Code Analysis",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "UseFullPaths",
+ "switch": "FC",
+ "comment": "Use Full Paths",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "OmitDefaultLibName",
+ "switch": "Zl",
+ "comment": "Omit Default Library Name",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AdditionalIncludeDirectories",
+ "switch": "I",
+ "comment": "Additional Include Directories",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "AdditionalUsingDirectories",
+ "switch": "AI",
+ "comment": "Additional #using Directories",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "PreprocessorDefinitions",
+ "switch": "D",
+ "comment": "Preprocessor Definitions",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "UndefinePreprocessorDefinitions",
+ "switch": "U",
+ "comment": "Undefine Preprocessor Definitions",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "DisableSpecificWarnings",
+ "switch": "wd",
+ "comment": "Disable Specific Warnings",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ForcedIncludeFiles",
+ "switch": "FI",
+ "comment": "Forced Include File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ForcedUsingFiles",
+ "switch": "FU",
+ "comment": "Forced #using File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "PREfastLog",
+ "switch": "analyze:log",
+ "comment": "Code Analysis Log",
+ "value": "",
+ "flags": [
+ "UserFollowing"
+ ]
+ },
+ {
+ "name": "PREfastAdditionalPlugins",
+ "switch": "analyze:plugin",
+ "comment": "Additional Code Analysis Native plugins",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "TreatSpecificWarningsAsErrors",
+ "switch": "we",
+ "comment": "Treat Specific Warnings As Errors",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "WarningVersion",
+ "switch": "Wv:",
+ "comment": "Warning Version",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "PreprocessOutputPath",
+ "switch": "Fi",
+ "comment": "Preprocess Output Path",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "PrecompiledHeaderFile",
+ "switch": "Yu",
+ "comment": "Precompiled Header File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "PrecompiledHeaderFile",
+ "switch": "Yc",
+ "comment": "Precompiled Header File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "PrecompiledHeaderOutputFile",
+ "switch": "Fp",
+ "comment": "Precompiled Header Output File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "AssemblerListingLocation",
+ "switch": "Fa",
+ "comment": "ASM List Location",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ObjectFileName",
+ "switch": "Fo",
+ "comment": "Object File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ProgramDataBaseFileName",
+ "switch": "Fd",
+ "comment": "Program Database File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "XMLDocumentationFileName",
+ "switch": "doc",
+ "comment": "XML Documentation File Name",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "BrowseInformationFile",
+ "switch": "FR",
+ "comment": "Browse Information File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "ProcessorNumber",
+ "switch": "MP",
+ "comment": "Number of processors",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ }
+]
diff --git a/Templates/MSBuild/FlagTables/v142_Link.json b/Templates/MSBuild/FlagTables/v142_Link.json
new file mode 100644
index 0000000000..66ee76fcb4
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v142_Link.json
@@ -0,0 +1,1323 @@
+[
+ {
+ "name": "ShowProgress",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE",
+ "comment": "Display all progress messages",
+ "value": "LinkVerbose",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:Lib",
+ "comment": "For Libraries Searched",
+ "value": "LinkVerboseLib",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:ICF",
+ "comment": "About COMDAT folding during optimized linking",
+ "value": "LinkVerboseICF",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:REF",
+ "comment": "About data removed during optimized linking",
+ "value": "LinkVerboseREF",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:SAFESEH",
+ "comment": "About Modules incompatible with SEH",
+ "value": "LinkVerboseSAFESEH",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:CLR",
+ "comment": "About linker activity related to managed code",
+ "value": "LinkVerboseCLR",
+ "flags": []
+ },
+ {
+ "name": "ForceFileOutput",
+ "switch": "FORCE",
+ "comment": "Enabled",
+ "value": "Enabled",
+ "flags": []
+ },
+ {
+ "name": "ForceFileOutput",
+ "switch": "FORCE:MULTIPLE",
+ "comment": "Multiply Defined Symbol Only",
+ "value": "MultiplyDefinedSymbolOnly",
+ "flags": []
+ },
+ {
+ "name": "ForceFileOutput",
+ "switch": "FORCE:UNRESOLVED",
+ "comment": "Undefined Symbol Only",
+ "value": "UndefinedSymbolOnly",
+ "flags": []
+ },
+ {
+ "name": "CreateHotPatchableImage",
+ "switch": "FUNCTIONPADMIN",
+ "comment": "Enabled",
+ "value": "Enabled",
+ "flags": []
+ },
+ {
+ "name": "CreateHotPatchableImage",
+ "switch": "FUNCTIONPADMIN:5",
+ "comment": "X86 Image Only",
+ "value": "X86Image",
+ "flags": []
+ },
+ {
+ "name": "CreateHotPatchableImage",
+ "switch": "FUNCTIONPADMIN:6",
+ "comment": "X64 Image Only",
+ "value": "X64Image",
+ "flags": []
+ },
+ {
+ "name": "CreateHotPatchableImage",
+ "switch": "FUNCTIONPADMIN:16",
+ "comment": "Itanium Image Only",
+ "value": "ItaniumImage",
+ "flags": []
+ },
+ {
+ "name": "UACExecutionLevel",
+ "switch": "level='asInvoker'",
+ "comment": "asInvoker",
+ "value": "AsInvoker",
+ "flags": []
+ },
+ {
+ "name": "UACExecutionLevel",
+ "switch": "level='highestAvailable'",
+ "comment": "highestAvailable",
+ "value": "HighestAvailable",
+ "flags": []
+ },
+ {
+ "name": "UACExecutionLevel",
+ "switch": "level='requireAdministrator'",
+ "comment": "requireAdministrator",
+ "value": "RequireAdministrator",
+ "flags": []
+ },
+ {
+ "name": "GenerateDebugInformation",
+ "switch": "DEBUG",
+ "comment": "Generate Debug Information",
+ "value": "true",
+ "flags": [
+ "CaseInsensitive"
+ ]
+ },
+ {
+ "name": "GenerateDebugInformation",
+ "switch": "DEBUG:FASTLINK",
+ "comment": "Generate Debug Information optimized for faster links",
+ "value": "DebugFastLink",
+ "flags": [
+ "CaseInsensitive"
+ ]
+ },
+ {
+ "name": "GenerateDebugInformation",
+ "switch": "DEBUG:FULL",
+ "comment": "Generate Debug Information optimized for sharing and publishing",
+ "value": "DebugFull",
+ "flags": [
+ "CaseInsensitive"
+ ]
+ },
+ {
+ "name": "GenerateDebugInformation",
+ "switch": "DEBUG:NONE",
+ "comment": "Produces no debugging information",
+ "value": "false",
+ "flags": [
+ "CaseInsensitive"
+ ]
+ },
+ {
+ "name": "SubSystem",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:CONSOLE",
+ "comment": "Console",
+ "value": "Console",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:WINDOWS",
+ "comment": "Windows",
+ "value": "Windows",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:NATIVE",
+ "comment": "Native",
+ "value": "Native",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_APPLICATION",
+ "comment": "EFI Application",
+ "value": "EFI Application",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER",
+ "comment": "EFI Boot Service Driver",
+ "value": "EFI Boot Service Driver",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_ROM",
+ "comment": "EFI ROM",
+ "value": "EFI ROM",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_RUNTIME_DRIVER",
+ "comment": "EFI Runtime",
+ "value": "EFI Runtime",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:POSIX",
+ "comment": "POSIX",
+ "value": "POSIX",
+ "flags": []
+ },
+ {
+ "name": "Driver",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "Driver",
+ "switch": "Driver",
+ "comment": "Driver",
+ "value": "Driver",
+ "flags": []
+ },
+ {
+ "name": "Driver",
+ "switch": "DRIVER:UPONLY",
+ "comment": "UP Only",
+ "value": "UpOnly",
+ "flags": []
+ },
+ {
+ "name": "Driver",
+ "switch": "DRIVER:WDM",
+ "comment": "WDM",
+ "value": "WDM",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG:incremental",
+ "comment": "Use Fast Link Time Code Generation",
+ "value": "UseFastLinkTimeCodeGeneration",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG",
+ "comment": "Use Link Time Code Generation",
+ "value": "UseLinkTimeCodeGeneration",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG:PGInstrument",
+ "comment": "Profile Guided Optimization - Instrument",
+ "value": "PGInstrument",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG:PGOptimize",
+ "comment": "Profile Guided Optimization - Optimization",
+ "value": "PGOptimization",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG:PGUpdate",
+ "comment": "Profile Guided Optimization - Update",
+ "value": "PGUpdate",
+ "flags": []
+ },
+ {
+ "name": "GenerateWindowsMetadata",
+ "switch": "WINMD",
+ "comment": "Yes",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GenerateWindowsMetadata",
+ "switch": "WINMD:NO",
+ "comment": "No",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataSignHash",
+ "switch": "WINMDSIGNHASH:SHA1",
+ "comment": "SHA1",
+ "value": "SHA1",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataSignHash",
+ "switch": "WINMDSIGNHASH:SHA256",
+ "comment": "SHA256",
+ "value": "SHA256",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataSignHash",
+ "switch": "WINMDSIGNHASH:SHA384",
+ "comment": "SHA384",
+ "value": "SHA384",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataSignHash",
+ "switch": "WINMDSIGNHASH:SHA512",
+ "comment": "SHA512",
+ "value": "SHA512",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:ARM",
+ "comment": "MachineARM",
+ "value": "MachineARM",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:ARM64",
+ "comment": "MachineARM64",
+ "value": "MachineARM64",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:EBC",
+ "comment": "MachineEBC",
+ "value": "MachineEBC",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:IA64",
+ "comment": "MachineIA64",
+ "value": "MachineIA64",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPS",
+ "comment": "MachineMIPS",
+ "value": "MachineMIPS",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPS16",
+ "comment": "MachineMIPS16",
+ "value": "MachineMIPS16",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPSFPU",
+ "comment": "MachineMIPSFPU",
+ "value": "MachineMIPSFPU",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPSFPU16",
+ "comment": "MachineMIPSFPU16",
+ "value": "MachineMIPSFPU16",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:SH4",
+ "comment": "MachineSH4",
+ "value": "MachineSH4",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:THUMB",
+ "comment": "MachineTHUMB",
+ "value": "MachineTHUMB",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:X64",
+ "comment": "MachineX64",
+ "value": "MachineX64",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:X86",
+ "comment": "MachineX86",
+ "value": "MachineX86",
+ "flags": []
+ },
+ {
+ "name": "CLRThreadAttribute",
+ "switch": "CLRTHREADATTRIBUTE:MTA",
+ "comment": "MTA threading attribute",
+ "value": "MTAThreadingAttribute",
+ "flags": []
+ },
+ {
+ "name": "CLRThreadAttribute",
+ "switch": "CLRTHREADATTRIBUTE:STA",
+ "comment": "STA threading attribute",
+ "value": "STAThreadingAttribute",
+ "flags": []
+ },
+ {
+ "name": "CLRThreadAttribute",
+ "switch": "CLRTHREADATTRIBUTE:NONE",
+ "comment": "Default threading attribute",
+ "value": "DefaultThreadingAttribute",
+ "flags": []
+ },
+ {
+ "name": "CLRImageType",
+ "switch": "CLRIMAGETYPE:IJW",
+ "comment": "Force IJW image",
+ "value": "ForceIJWImage",
+ "flags": []
+ },
+ {
+ "name": "CLRImageType",
+ "switch": "CLRIMAGETYPE:PURE",
+ "comment": "Force Pure IL Image",
+ "value": "ForcePureILImage",
+ "flags": []
+ },
+ {
+ "name": "CLRImageType",
+ "switch": "CLRIMAGETYPE:SAFE",
+ "comment": "Force Safe IL Image",
+ "value": "ForceSafeILImage",
+ "flags": []
+ },
+ {
+ "name": "CLRImageType",
+ "switch": "",
+ "comment": "Default image type",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "SignHash",
+ "switch": "CLRSIGNHASH:SHA1",
+ "comment": "SHA1",
+ "value": "SHA1",
+ "flags": []
+ },
+ {
+ "name": "SignHash",
+ "switch": "CLRSIGNHASH:SHA256",
+ "comment": "SHA256",
+ "value": "SHA256",
+ "flags": []
+ },
+ {
+ "name": "SignHash",
+ "switch": "CLRSIGNHASH:SHA384",
+ "comment": "SHA384",
+ "value": "SHA384",
+ "flags": []
+ },
+ {
+ "name": "SignHash",
+ "switch": "CLRSIGNHASH:SHA512",
+ "comment": "SHA512",
+ "value": "SHA512",
+ "flags": []
+ },
+ {
+ "name": "LinkErrorReporting",
+ "switch": "ERRORREPORT:PROMPT",
+ "comment": "PromptImmediately",
+ "value": "PromptImmediately",
+ "flags": []
+ },
+ {
+ "name": "LinkErrorReporting",
+ "switch": "ERRORREPORT:QUEUE",
+ "comment": "Queue For Next Login",
+ "value": "QueueForNextLogin",
+ "flags": []
+ },
+ {
+ "name": "LinkErrorReporting",
+ "switch": "ERRORREPORT:SEND",
+ "comment": "Send Error Report",
+ "value": "SendErrorReport",
+ "flags": []
+ },
+ {
+ "name": "LinkErrorReporting",
+ "switch": "ERRORREPORT:NONE",
+ "comment": "No Error Report",
+ "value": "NoErrorReport",
+ "flags": []
+ },
+ {
+ "name": "CLRSupportLastError",
+ "switch": "CLRSupportLastError",
+ "comment": "Enabled",
+ "value": "Enabled",
+ "flags": []
+ },
+ {
+ "name": "CLRSupportLastError",
+ "switch": "CLRSupportLastError:NO",
+ "comment": "Disabled",
+ "value": "Disabled",
+ "flags": []
+ },
+ {
+ "name": "CLRSupportLastError",
+ "switch": "CLRSupportLastError:SYSTEMDLL",
+ "comment": "System Dlls Only",
+ "value": "SystemDlls",
+ "flags": []
+ },
+ {
+ "name": "LinkIncremental",
+ "switch": "INCREMENTAL:NO",
+ "comment": "Enable Incremental Linking",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "LinkIncremental",
+ "switch": "INCREMENTAL",
+ "comment": "Enable Incremental Linking",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SuppressStartupBanner",
+ "switch": "NOLOGO",
+ "comment": "Suppress Startup Banner",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "LinkStatus",
+ "switch": "LTCG:NOSTATUS",
+ "comment": "Link Status",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "LinkStatus",
+ "switch": "LTCG:STATUS",
+ "comment": "Link Status",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreventDllBinding",
+ "switch": "ALLOWBIND:NO",
+ "comment": "Prevent Dll Binding",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "PreventDllBinding",
+ "switch": "ALLOWBIND",
+ "comment": "Prevent Dll Binding",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatLinkerWarningAsErrors",
+ "switch": "WX:NO",
+ "comment": "Treat Linker Warning As Errors",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TreatLinkerWarningAsErrors",
+ "switch": "WX",
+ "comment": "Treat Linker Warning As Errors",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "IgnoreAllDefaultLibraries",
+ "switch": "NODEFAULTLIB",
+ "comment": "Ignore All Default Libraries",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GenerateManifest",
+ "switch": "MANIFEST:NO",
+ "comment": "Generate Manifest",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "GenerateManifest",
+ "switch": "MANIFEST",
+ "comment": "Generate Manifest",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AllowIsolation",
+ "switch": "ALLOWISOLATION:NO",
+ "comment": "Allow Isolation",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "AllowIsolation",
+ "switch": "",
+ "comment": "Allow Isolation",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableUAC",
+ "switch": "MANIFESTUAC:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired",
+ "SpaceAppendable"
+ ]
+ },
+ {
+ "name": "UACUIAccess",
+ "switch": "uiAccess='false'",
+ "comment": "UAC Bypass UI Protection",
+ "value": "false",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "UACUIAccess",
+ "switch": "uiAccess='false'",
+ "comment": "UAC Bypass UI Protection",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "UACUIAccess",
+ "switch": "uiAccess='true'",
+ "comment": "UAC Bypass UI Protection",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ManifestEmbed",
+ "switch": "manifest:embed",
+ "comment": "Embed Manifest",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GenerateMapFile",
+ "switch": "MAP",
+ "comment": "Generate Map File",
+ "value": "true",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "MapExports",
+ "switch": "MAPINFO:EXPORTS",
+ "comment": "Map Exports",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AssemblyDebug",
+ "switch": "ASSEMBLYDEBUG:DISABLE",
+ "comment": "Debuggable Assembly",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "AssemblyDebug",
+ "switch": "ASSEMBLYDEBUG",
+ "comment": "Debuggable Assembly",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "LargeAddressAware",
+ "switch": "LARGEADDRESSAWARE:NO",
+ "comment": "Enable Large Addresses",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "LargeAddressAware",
+ "switch": "LARGEADDRESSAWARE",
+ "comment": "Enable Large Addresses",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TerminalServerAware",
+ "switch": "TSAWARE:NO",
+ "comment": "Terminal Server",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TerminalServerAware",
+ "switch": "TSAWARE",
+ "comment": "Terminal Server",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SwapRunFromCD",
+ "switch": "SWAPRUN:CD",
+ "comment": "Swap Run From CD",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SwapRunFromNET",
+ "switch": "SWAPRUN:NET",
+ "comment": "Swap Run From Network",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "OptimizeReferences",
+ "switch": "OPT:NOREF",
+ "comment": "References",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "OptimizeReferences",
+ "switch": "OPT:REF",
+ "comment": "References",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableCOMDATFolding",
+ "switch": "OPT:NOICF",
+ "comment": "Enable COMDAT Folding",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "EnableCOMDATFolding",
+ "switch": "OPT:ICF",
+ "comment": "Enable COMDAT Folding",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "IgnoreEmbeddedIDL",
+ "switch": "IGNOREIDL",
+ "comment": "Ignore Embedded IDL",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AppContainer",
+ "switch": "APPCONTAINER",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataLinkDelaySign",
+ "switch": "WINMDDELAYSIGN:NO",
+ "comment": "Windows Metadata Delay Sign",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataLinkDelaySign",
+ "switch": "WINMDDELAYSIGN",
+ "comment": "Windows Metadata Delay Sign",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "NoEntryPoint",
+ "switch": "NOENTRY",
+ "comment": "No Entry Point",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SetChecksum",
+ "switch": "RELEASE",
+ "comment": "Set Checksum",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "RandomizedBaseAddress",
+ "switch": "DYNAMICBASE:NO",
+ "comment": "Randomized Base Address",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "RandomizedBaseAddress",
+ "switch": "DYNAMICBASE",
+ "comment": "Randomized Base Address",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "FixedBaseAddress",
+ "switch": "FIXED:NO",
+ "comment": "Fixed Base Address",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "FixedBaseAddress",
+ "switch": "FIXED",
+ "comment": "Fixed Base Address",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DataExecutionPrevention",
+ "switch": "NXCOMPAT:NO",
+ "comment": "Data Execution Prevention (DEP)",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "DataExecutionPrevention",
+ "switch": "NXCOMPAT",
+ "comment": "Data Execution Prevention (DEP)",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TurnOffAssemblyGeneration",
+ "switch": "NOASSEMBLY",
+ "comment": "Turn Off Assembly Generation",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SupportUnloadOfDelayLoadedDLL",
+ "switch": "DELAY:UNLOAD",
+ "comment": "Unload delay loaded DLL",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SupportNobindOfDelayLoadedDLL",
+ "switch": "DELAY:NOBIND",
+ "comment": "Nobind delay loaded DLL",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "Profile",
+ "switch": "PROFILE",
+ "comment": "Profile",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "LinkDelaySign",
+ "switch": "DELAYSIGN:NO",
+ "comment": "Delay Sign",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "LinkDelaySign",
+ "switch": "DELAYSIGN",
+ "comment": "Delay Sign",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "CLRUnmanagedCodeCheck",
+ "switch": "CLRUNMANAGEDCODECHECK:NO",
+ "comment": "CLR Unmanaged Code Check",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "CLRUnmanagedCodeCheck",
+ "switch": "CLRUNMANAGEDCODECHECK",
+ "comment": "CLR Unmanaged Code Check",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DetectOneDefinitionRule",
+ "switch": "ODR",
+ "comment": "Detect One Definition Rule violations",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ImageHasSafeExceptionHandlers",
+ "switch": "SAFESEH:NO",
+ "comment": "Image Has Safe Exception Handlers",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "ImageHasSafeExceptionHandlers",
+ "switch": "SAFESEH",
+ "comment": "Image Has Safe Exception Handlers",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "LinkDLL",
+ "switch": "DLL",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AdditionalLibraryDirectories",
+ "switch": "LIBPATH:",
+ "comment": "Additional Library Directories",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "Natvis",
+ "switch": "NATVIS:",
+ "comment": "Natvis files",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "IgnoreSpecificDefaultLibraries",
+ "switch": "NODEFAULTLIB:",
+ "comment": "Ignore Specific Default Libraries",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "AddModuleNamesToAssembly",
+ "switch": "ASSEMBLYMODULE:",
+ "comment": "Add Module to Assembly",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "EmbedManagedResourceFile",
+ "switch": "ASSEMBLYRESOURCE:",
+ "comment": "Embed Managed Resource File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ForceSymbolReferences",
+ "switch": "INCLUDE:",
+ "comment": "Force Symbol References",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "DelayLoadDLLs",
+ "switch": "DELAYLOAD:",
+ "comment": "Delay Loaded Dlls",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "AssemblyLinkResource",
+ "switch": "ASSEMBLYLINKRESOURCE:",
+ "comment": "Assembly Link Resource",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "AdditionalManifestDependencies",
+ "switch": "MANIFESTDEPENDENCY:",
+ "comment": "Additional Manifest Dependencies",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ManifestInput",
+ "switch": "manifestinput:",
+ "comment": "Manifest Input",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "OutputFile",
+ "switch": "OUT:",
+ "comment": "Output File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "Version",
+ "switch": "VERSION:",
+ "comment": "Version",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "SpecifySectionAttributes",
+ "switch": "SECTION:",
+ "comment": "Specify Section Attributes",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MSDOSStubFileName",
+ "switch": "STUB:",
+ "comment": "MS-DOS Stub File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ModuleDefinitionFile",
+ "switch": "DEF:",
+ "comment": "Module Definition File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ManifestFile",
+ "switch": "ManifestFile:",
+ "comment": "Manifest File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ProgramDatabaseFile",
+ "switch": "PDB:",
+ "comment": "Generate Program Database File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "StripPrivateSymbols",
+ "switch": "PDBSTRIPPED:",
+ "comment": "Strip Private Symbols",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MapFileName",
+ "switch": "MAP:",
+ "comment": "Map File Name",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "HeapReserveSize",
+ "switch": "HEAP:",
+ "comment": "Heap Reserve Size",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "HeapCommitSize",
+ "switch": "HEAP",
+ "comment": "Heap Commit Size",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "StackReserveSize",
+ "switch": "STACK:",
+ "comment": "Stack Reserve Size",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "StackCommitSize",
+ "switch": "STACK",
+ "comment": "Stack Commit Size",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "FunctionOrder",
+ "switch": "ORDER:@",
+ "comment": "Function Order",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ProfileGuidedDatabase",
+ "switch": "PGD:",
+ "comment": "Profile Guided Database",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MidlCommandFile",
+ "switch": "MIDL:@",
+ "comment": "MIDL Commands",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MergedIDLBaseFileName",
+ "switch": "IDLOUT:",
+ "comment": "Merged IDL Base File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "TypeLibraryFile",
+ "switch": "TLBOUT:",
+ "comment": "Type Library",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "WindowsMetadataFile",
+ "switch": "WINMDFILE:",
+ "comment": "Windows Metadata File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "WindowsMetadataLinkKeyFile",
+ "switch": "WINMDKEYFILE:",
+ "comment": "Windows Metadata Key File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "WindowsMetadataKeyContainer",
+ "switch": "WINMDKEYCONTAINER:",
+ "comment": "Windows Metadata Key Container",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "EntryPointSymbol",
+ "switch": "ENTRY:",
+ "comment": "Entry Point",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "BaseAddress",
+ "switch": "BASE:",
+ "comment": "Base Address",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ImportLibrary",
+ "switch": "IMPLIB:",
+ "comment": "Import Library",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MergeSections",
+ "switch": "MERGE:",
+ "comment": "Merge Sections",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "LinkKeyFile",
+ "switch": "KEYFILE:",
+ "comment": "Key File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "KeyContainer",
+ "switch": "KEYCONTAINER:",
+ "comment": "Key Container",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "TypeLibraryResourceID",
+ "switch": "TLBID:",
+ "comment": "TypeLib Resource ID",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "SectionAlignment",
+ "switch": "ALIGN:",
+ "comment": "SectionAlignment",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ }
+]
diff --git a/Templates/Windows/ApplicationIcon.png b/Templates/Windows/ApplicationIcon.png
index 7d95d4e081..c715e1bc73 100644
--- a/Templates/Windows/ApplicationIcon.png
+++ b/Templates/Windows/ApplicationIcon.png
Binary files differ
diff --git a/Templates/Windows/Logo.png b/Templates/Windows/Logo.png
index e26771cb33..65f91ac0f9 100644
--- a/Templates/Windows/Logo.png
+++ b/Templates/Windows/Logo.png
Binary files differ
diff --git a/Templates/Windows/SmallLogo.png b/Templates/Windows/SmallLogo.png
index 1eb0d9d528..460c0222d4 100644
--- a/Templates/Windows/SmallLogo.png
+++ b/Templates/Windows/SmallLogo.png
Binary files differ
diff --git a/Templates/Windows/SmallLogo44x44.png b/Templates/Windows/SmallLogo44x44.png
index 28810b7c0e..c2374581a8 100644
--- a/Templates/Windows/SmallLogo44x44.png
+++ b/Templates/Windows/SmallLogo44x44.png
Binary files differ
diff --git a/Templates/Windows/SplashScreen.png b/Templates/Windows/SplashScreen.png
index c951e031bd..8342565809 100644
--- a/Templates/Windows/SplashScreen.png
+++ b/Templates/Windows/SplashScreen.png
Binary files differ
diff --git a/Templates/Windows/StoreLogo.png b/Templates/Windows/StoreLogo.png
index dcb672712c..508c8a809a 100644
--- a/Templates/Windows/StoreLogo.png
+++ b/Templates/Windows/StoreLogo.png
Binary files differ
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 0c6eabcf46..6c888ccd89 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1704,18 +1704,37 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
DEPENDS ExternalProjectUpdateSetup )
# do each of the tutorial steps
- foreach(STP RANGE 1 7)
- add_test(TutorialStep${STP} ${CMAKE_CTEST_COMMAND}
+ function(add_tutorial_test step_name use_mymath)
+ set(tutorial_test_name Tutorial${step_name})
+ set(tutorial_build_dir "${CMake_BINARY_DIR}/Tests/Tutorial/${step_name}")
+ if (use_mymath)
+ set(tutorial_build_options "")
+ else()
+ set(tutorial_test_name ${tutorial_test_name}_MYMATH)
+ set(tutorial_build_dir "${tutorial_build_dir}_MYMATH")
+ set(tutorial_build_options -DUSE_MYMATH:BOOL=OFF)
+ endif()
+ add_test(${tutorial_test_name} ${CMAKE_CTEST_COMMAND}
--build-and-test
- "${CMake_SOURCE_DIR}/Tests/Tutorial/Step${STP}"
- "${CMake_BINARY_DIR}/Tests/Tutorial/Step${STP}"
- --build-two-config
+ "${CMake_SOURCE_DIR}/Tests/Tutorial/${step_name}"
+ ${tutorial_build_dir}_Build
${build_generator_args}
--build-project Tutorial
- --build-options ${build_options}
+ --build-options ${build_options} ${tutorial_build_options}
--test-command Tutorial 25.0)
- endforeach()
- list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Tutorial")
+ list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/${tutorial_build_dir}_Build")
+ endfunction()
+
+ if(NOT CMake_TEST_EXTERNAL_CMAKE)
+ foreach(STP RANGE 1 11)
+ add_tutorial_test(Step${STP} TRUE)
+ endforeach()
+ add_tutorial_test(Complete TRUE)
+ foreach(STP RANGE 3 11)
+ add_tutorial_test(Step${STP} FALSE)
+ endforeach()
+ add_tutorial_test(Complete FALSE)
+ endif()
add_test(testing ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE}
--build-and-test
@@ -2349,7 +2368,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
add_test_GhsMulti_rename_install(EXEC_AND_LIB)
add_test_GhsMulti(multiple_source_groups GhsMultiSrcGroups Default "")
add_test_GhsMulti(multiple_source_groups_folders GhsMultiSrcGroups PropFolders "-DTEST_PROP=ON")
- add_test_GhsMulti(multiple_source_groups_all_folders GhsMultiSrcGroups AllFolders "-DGHS_NO_SOURCE_GROUP_FILE=ON")
+ add_test_GhsMulti(multiple_source_groups_all_folders GhsMultiSrcGroups AllFolders "-DCMAKE_GHS_NO_SOURCE_GROUP_FILE=ON")
add_test_GhsMulti(unsupported_targets GhsMultiUnsupportedTargets "" "")
add_test_GhsMulti(object_library GhsMultiObjectLibrary "" "")
add_test_GhsMulti(exclude GhsMultiExclude "" ""
diff --git a/Tests/CMakeTests/FileDownloadInput.png b/Tests/CMakeTests/FileDownloadInput.png
index 7bbcee413c..9ab565a1b4 100644
--- a/Tests/CMakeTests/FileDownloadInput.png
+++ b/Tests/CMakeTests/FileDownloadInput.png
Binary files differ
diff --git a/Tests/CMakeTests/FileDownloadTest.cmake.in b/Tests/CMakeTests/FileDownloadTest.cmake.in
index f6d9ad99b9..39354490be 100644
--- a/Tests/CMakeTests/FileDownloadTest.cmake.in
+++ b/Tests/CMakeTests/FileDownloadTest.cmake.in
@@ -32,7 +32,7 @@ file(DOWNLOAD
${url}
${dir}/file3.png
TIMEOUT 2
- EXPECTED_MD5 d16778650db435bda3a8c3435c3ff5d1
+ EXPECTED_MD5 dbd330d52f4dbd60115d4191904ded92
)
message(STATUS "FileDownload:4")
@@ -41,7 +41,7 @@ file(DOWNLOAD
${dir}/file3.png
TIMEOUT 2
STATUS status
- EXPECTED_HASH SHA1=50c614fc28b39c1281d0517bb6d5858b4359c9b7
+ EXPECTED_HASH SHA1=67eee17f79d9ac557284fc0b8ad19f25723fb578
)
message(STATUS "FileDownload:5")
@@ -50,7 +50,7 @@ file(DOWNLOAD
${dir}/file3.png
TIMEOUT 2
STATUS status
- EXPECTED_HASH SHA224=73cd5f442b04e8320e4f907f8e1b21d4befff98b5bd77bc32526ea68
+ EXPECTED_HASH SHA224=ba283726bbb602776818b463943189afd91836cb7ee5dd6e2c7b5ae4
)
message(STATUS "FileDownload:6")
@@ -59,7 +59,7 @@ file(DOWNLOAD
${dir}/file3.png
TIMEOUT 2
STATUS status
- EXPECTED_HASH SHA256=2e067f6c09cbc7cd619c8fbcc44eb64cd6b45a95e4cddb3a585eee1f731c4da9
+ EXPECTED_HASH SHA256=cf3334b1275071e1da6e8c396ccb72cf1b2388d8c937526f3af26230affb9423
)
message(STATUS "FileDownload:7")
@@ -68,7 +68,7 @@ file(DOWNLOAD
${dir}/file3.png
TIMEOUT 2
STATUS status
- EXPECTED_HASH SHA384=398bf41902a7251c30e522b307e3e41e3fb617c765b3feaa99b2f7d063894708ad399267ccc25d877437a10e5e890d35
+ EXPECTED_HASH SHA384=43a5d13978d97c660db44481aee0604cb4ff6ca0775cd5c2cd68cd8000e107e507c4caf6c228941231041e282ffb8950
)
message(STATUS "FileDownload:8")
@@ -77,7 +77,7 @@ file(DOWNLOAD
${dir}/file3.png
TIMEOUT 2
STATUS status
- EXPECTED_HASH SHA512=c51854d21052713968b849c2b4263cf54be03bc3a7e9847a6c71c6c8d1d13cd805fe1b9fa95f9ba1d0a5631513974f6fae21e34ab5b171d94bad48df5f073e48
+ EXPECTED_HASH SHA512=6984e0909a1018030ccaa418e3be1654223cdccff0fe6adc745f9aea7e377f178be53b9fc7d54a6f81c2b62ef9ddcd38ba1978fedf4c5e7139baaf355eefad5b
)
message(STATUS "FileDownload:9")
file(DOWNLOAD
@@ -85,7 +85,7 @@ file(DOWNLOAD
${dir}/file3.png
TIMEOUT 2
STATUS status
- EXPECTED_HASH MD5=d16778650db435bda3a8c3435c3ff5d1
+ EXPECTED_HASH MD5=dbd330d52f4dbd60115d4191904ded92
)
message(STATUS "FileDownload:10")
@@ -94,7 +94,7 @@ file(DOWNLOAD
${dir}/file3.png
TIMEOUT 2
STATUS status
- EXPECTED_MD5 d16778650db435bda3a8c3435c3ff5d1
+ EXPECTED_MD5 dbd330d52f4dbd60115d4191904ded92
)
message(STATUS "${status}")
diff --git a/Tests/CMakeTests/FileUploadTest.cmake.in b/Tests/CMakeTests/FileUploadTest.cmake.in
index 9e2290988c..0e6f080483 100644
--- a/Tests/CMakeTests/FileUploadTest.cmake.in
+++ b/Tests/CMakeTests/FileUploadTest.cmake.in
@@ -35,7 +35,7 @@ execute_process(COMMAND ${CMAKE_COMMAND} -E md5sum
"@CMAKE_CURRENT_BINARY_DIR@/uploads/file1.png"
OUTPUT_VARIABLE sum1
OUTPUT_STRIP_TRAILING_WHITESPACE)
-if(NOT sum1 MATCHES "^d16778650db435bda3a8c3435c3ff5d1 .*/uploads/file1.png$")
+if(NOT sum1 MATCHES "^dbd330d52f4dbd60115d4191904ded92 .*/uploads/file1.png$")
message(FATAL_ERROR "file1.png did not upload correctly (sum1='${sum1}')")
endif()
@@ -43,7 +43,7 @@ execute_process(COMMAND ${CMAKE_COMMAND} -E md5sum
"@CMAKE_CURRENT_BINARY_DIR@/uploads/file2.png"
OUTPUT_VARIABLE sum2
OUTPUT_STRIP_TRAILING_WHITESPACE)
-if(NOT sum2 MATCHES "^d16778650db435bda3a8c3435c3ff5d1 .*/uploads/file2.png$")
+if(NOT sum2 MATCHES "^dbd330d52f4dbd60115d4191904ded92 .*/uploads/file2.png$")
message(FATAL_ERROR "file2.png did not upload correctly (sum2='${sum2}')")
endif()
diff --git a/Tests/CudaOnly/CMakeLists.txt b/Tests/CudaOnly/CMakeLists.txt
index 9c4f86a31d..f1fd344871 100644
--- a/Tests/CudaOnly/CMakeLists.txt
+++ b/Tests/CudaOnly/CMakeLists.txt
@@ -7,6 +7,17 @@ ADD_TEST_MACRO(CudaOnly.ResolveDeviceSymbols CudaOnlyResolveDeviceSymbols)
ADD_TEST_MACRO(CudaOnly.SeparateCompilation CudaOnlySeparateCompilation)
ADD_TEST_MACRO(CudaOnly.WithDefs CudaOnlyWithDefs)
+add_test(NAME CudaOnly.DontResolveDeviceSymbols COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMAKE_CURRENT_SOURCE_DIR}/DontResolveDeviceSymbols/"
+ "${CMAKE_CURRENT_BINARY_DIR}/DontResolveDeviceSymbols/"
+ ${build_generator_args}
+ --build-project DontResolveDeviceSymbols
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+
if(MSVC)
ADD_TEST_MACRO(CudaOnly.PDB CudaOnlyPDB)
endif()
diff --git a/Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt b/Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt
new file mode 100644
index 0000000000..6190089028
--- /dev/null
+++ b/Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt
@@ -0,0 +1,50 @@
+cmake_minimum_required(VERSION 3.13)
+project (DontResolveDeviceSymbols CUDA)
+
+# Find nm and dumpbin
+if(CMAKE_NM)
+ set(dump_command ${CMAKE_NM})
+ set(dump_args --defined-only)
+ set(symbol_name cudaRegisterLinkedBinary)
+else()
+ include(GetPrerequisites)
+ message(STATUS "calling list_prerequisites to find dumpbin")
+ list_prerequisites("${CMAKE_COMMAND}" 0 0 0)
+ if(gp_dumpbin)
+ set(dump_command ${gp_dumpbin})
+ set(dump_args /SYMBOLS)
+ set(symbol_name nv_fatb)
+ endif()
+endif()
+
+
+#Goal for this example:
+# Build a static library that defines multiple methods and kernels that
+# use each other.
+# Don't resolve the device symbols in the static library
+# Don't resolve the device symbols in the executable library
+# Verify that we can't use those device symbols from anything
+string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=[compute_30] -gencode arch=compute_50,code=\\\"compute_50\\\"")
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CUDA_STANDARD 11)
+
+add_library(CUDANoDeviceResolve SHARED file1.cu)
+set_target_properties(CUDANoDeviceResolve
+ PROPERTIES
+ CUDA_SEPARABLE_COMPILATION ON
+ CUDA_RESOLVE_DEVICE_SYMBOLS OFF
+ POSITION_INDEPENDENT_CODE ON)
+if(MSVC)
+ target_link_options(CUDANoDeviceResolve PRIVATE "/FORCE:UNRESOLVED")
+endif()
+
+if(dump_command)
+add_custom_command(TARGET CUDANoDeviceResolve POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ -DDUMP_COMMAND=${dump_command}
+ -DDUMP_ARGS=${dump_args}
+ -DSYMBOL_NAME=${symbol_name}
+ -DTEST_LIBRARY_PATH=$<TARGET_FILE:CUDANoDeviceResolve>
+ -P ${CMAKE_CURRENT_SOURCE_DIR}/verify.cmake
+ )
+endif()
diff --git a/Tests/CudaOnly/DontResolveDeviceSymbols/file1.cu b/Tests/CudaOnly/DontResolveDeviceSymbols/file1.cu
new file mode 100644
index 0000000000..3924f67c6c
--- /dev/null
+++ b/Tests/CudaOnly/DontResolveDeviceSymbols/file1.cu
@@ -0,0 +1,69 @@
+
+#include <iostream>
+
+static __global__ void file1_kernel(int in, int* out)
+{
+ *out = in * in;
+}
+
+int choose_cuda_device()
+{
+ int nDevices = 0;
+ cudaError_t err = cudaGetDeviceCount(&nDevices);
+ if (err != cudaSuccess) {
+ std::cerr << "Failed to retrieve the number of CUDA enabled devices"
+ << std::endl;
+ return 1;
+ }
+ for (int i = 0; i < nDevices; ++i) {
+ cudaDeviceProp prop;
+ cudaError_t err = cudaGetDeviceProperties(&prop, i);
+ if (err != cudaSuccess) {
+ std::cerr << "Could not retrieve properties from CUDA device " << i
+ << std::endl;
+ return 1;
+ }
+ std::cout << "prop.major: " << prop.major << std::endl;
+ if (prop.major >= 3) {
+ err = cudaSetDevice(i);
+ if (err != cudaSuccess) {
+ std::cout << "Could not select CUDA device " << i << std::endl;
+ } else {
+ return 0;
+ }
+ }
+ }
+
+ std::cout << "Could not find a CUDA enabled card supporting compute >=3.0"
+ << std::endl;
+
+ return 1;
+}
+
+int file1_launch_kernel()
+{
+ int ret = choose_cuda_device();
+ if (ret) {
+ return 0;
+ }
+
+ int input = 4;
+
+ int* output;
+ cudaError_t err = cudaMallocManaged(&output, sizeof(int));
+ cudaDeviceSynchronize();
+ if (err != cudaSuccess) {
+ return 1;
+ }
+
+ file1_kernel<<<1, 1>>>(input, output);
+ cudaDeviceSynchronize();
+ err = cudaGetLastError();
+ std::cout << err << " " << cudaGetErrorString(err) << std::endl;
+ if (err == cudaSuccess) {
+ // This kernel launch should failed as the device linking never occured
+ std::cerr << "file1_kernel: kernel launch should have failed" << std::endl;
+ return 1;
+ }
+ return 0;
+}
diff --git a/Tests/CudaOnly/DontResolveDeviceSymbols/main.cu b/Tests/CudaOnly/DontResolveDeviceSymbols/main.cu
new file mode 100644
index 0000000000..84a7a19eb7
--- /dev/null
+++ b/Tests/CudaOnly/DontResolveDeviceSymbols/main.cu
@@ -0,0 +1,7 @@
+
+#include <iostream>
+
+int main(int argc, char** argv)
+{
+ return 0;
+}
diff --git a/Tests/CudaOnly/DontResolveDeviceSymbols/verify.cmake b/Tests/CudaOnly/DontResolveDeviceSymbols/verify.cmake
new file mode 100644
index 0000000000..9bb426da0b
--- /dev/null
+++ b/Tests/CudaOnly/DontResolveDeviceSymbols/verify.cmake
@@ -0,0 +1,14 @@
+execute_process(COMMAND ${DUMP_COMMAND} ${DUMP_ARGS} ${TEST_LIBRARY_PATH}
+ RESULT_VARIABLE RESULT
+ OUTPUT_VARIABLE OUTPUT
+ ERROR_VARIABLE ERROR
+)
+
+if(NOT "${RESULT}" STREQUAL "0")
+ message(FATAL_ERROR "${DUMP_COMMAND} failed [${RESULT}] [${OUTPUT}] [${ERROR}]")
+endif()
+
+if("${OUTPUT}" MATCHES "${SYMBOL_NAME}")
+ message(FATAL_ERROR
+ "The '${SYMBOL_NAME}' symbol is defined; device linking occurred!")
+endif()
diff --git a/Tests/ExternalProjectLocal/CMakeLists.txt b/Tests/ExternalProjectLocal/CMakeLists.txt
index 55fd713300..1075a9d079 100644
--- a/Tests/ExternalProjectLocal/CMakeLists.txt
+++ b/Tests/ExternalProjectLocal/CMakeLists.txt
@@ -20,71 +20,55 @@ set(binary_base "${base}/Build")
set_property(DIRECTORY PROPERTY EP_BASE ${base})
set_property(DIRECTORY PROPERTY EP_STEP_TARGETS configure build test)
-if(NOT DEFINED can_build_tutorial_step5)
- set(can_build_tutorial_step5 1)
-
- # The ExternalProject builds of Tutorial Step5 cannot be built
- # correctly 2nd and later times in an in-source build...
- # (because the CMakeCache.txt from the real in-source build of
- # the Tests/Tutorial/Step5 directory gets copied when we do
- # the "source directory copy" step... but it still refers to
- # its original path which yields a configure error.) So:
- #
- if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
- set(can_build_tutorial_step5 0)
- endif()
-endif()
# Local DIR:
#
-if(can_build_tutorial_step5)
- set(proj TutorialStep5-Local)
- ExternalProject_Add(${proj}
- URL "${CMAKE_CURRENT_SOURCE_DIR}/../Tutorial/Step5"
- CMAKE_CACHE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
- CMAKE_ARGS -G ${CMAKE_GENERATOR} <SOURCE_DIR>
- TEST_BEFORE_INSTALL 1
- LOG_INSTALL 1
- )
- set_property(TARGET ${proj} PROPERTY FOLDER "Local")
- ExternalProject_Get_Property(${proj} install_dir)
- set(TutorialStep5_install_dir ${install_dir})
-
- set(proj TutorialStep5-Local-TestAfterInstall)
- ExternalProject_Add(${proj}
- URL "${CMAKE_CURRENT_SOURCE_DIR}/../Tutorial/Step5"
- CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -G ${CMAKE_GENERATOR} <SOURCE_DIR>
- CMAKE_CACHE_DEFAULT_ARGS -DUSE_MYMATH:BOOL=OFF
- TEST_AFTER_INSTALL 1
- LOG_TEST 1
- )
- set_property(TARGET ${proj} PROPERTY FOLDER "Local")
-
- set(proj TutorialStep5-Local-TestExcludeFromMainBefore)
- ExternalProject_Add(${proj}
- URL "${CMAKE_CURRENT_SOURCE_DIR}/../Tutorial/Step5"
- CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -G ${CMAKE_GENERATOR} <SOURCE_DIR>
- CMAKE_CACHE_DEFAULT_ARGS -DUSE_MYMATH:BOOL=OFF
- TEST_BEFORE_INSTALL 1
- TEST_EXCLUDE_FROM_MAIN 1
- STEP_TARGETS test
- LOG_TEST 1
- )
- set_property(TARGET ${proj} PROPERTY FOLDER "Local")
-
- set(proj TutorialStep5-Local-TestExcludeFromMainAfter)
- ExternalProject_Add(${proj}
- URL "${CMAKE_CURRENT_SOURCE_DIR}/../Tutorial/Step5"
- CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -G ${CMAKE_GENERATOR} <SOURCE_DIR>
- CMAKE_CACHE_DEFAULT_ARGS -DUSE_MYMATH:BOOL=OFF
- TEST_AFTER_INSTALL 1
- TEST_EXCLUDE_FROM_MAIN 1
- STEP_TARGETS test
- LOG_TEST 1
- )
- set_property(TARGET ${proj} PROPERTY FOLDER "Local")
+set(proj TutorialStep5-Local)
+ExternalProject_Add(${proj}
+URL "${CMAKE_CURRENT_SOURCE_DIR}/Step5"
+CMAKE_CACHE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+CMAKE_ARGS -G ${CMAKE_GENERATOR} <SOURCE_DIR>
+TEST_BEFORE_INSTALL 1
+LOG_INSTALL 1
+)
+set_property(TARGET ${proj} PROPERTY FOLDER "Local")
+ExternalProject_Get_Property(${proj} install_dir)
+set(TutorialStep5_install_dir ${install_dir})
+
+set(proj TutorialStep5-Local-TestAfterInstall)
+ExternalProject_Add(${proj}
+URL "${CMAKE_CURRENT_SOURCE_DIR}/Step5"
+CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -G ${CMAKE_GENERATOR} <SOURCE_DIR>
+CMAKE_CACHE_DEFAULT_ARGS -DUSE_MYMATH:BOOL=OFF
+TEST_AFTER_INSTALL 1
+LOG_TEST 1
+)
+set_property(TARGET ${proj} PROPERTY FOLDER "Local")
+
+set(proj TutorialStep5-Local-TestExcludeFromMainBefore)
+ExternalProject_Add(${proj}
+URL "${CMAKE_CURRENT_SOURCE_DIR}/Step5"
+CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -G ${CMAKE_GENERATOR} <SOURCE_DIR>
+CMAKE_CACHE_DEFAULT_ARGS -DUSE_MYMATH:BOOL=OFF
+TEST_BEFORE_INSTALL 1
+TEST_EXCLUDE_FROM_MAIN 1
+STEP_TARGETS test
+LOG_TEST 1
+)
+set_property(TARGET ${proj} PROPERTY FOLDER "Local")
+
+set(proj TutorialStep5-Local-TestExcludeFromMainAfter)
+ExternalProject_Add(${proj}
+URL "${CMAKE_CURRENT_SOURCE_DIR}/Step5"
+CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -G ${CMAKE_GENERATOR} <SOURCE_DIR>
+CMAKE_CACHE_DEFAULT_ARGS -DUSE_MYMATH:BOOL=OFF
+TEST_AFTER_INSTALL 1
+TEST_EXCLUDE_FROM_MAIN 1
+STEP_TARGETS test
+LOG_TEST 1
+)
+set_property(TARGET ${proj} PROPERTY FOLDER "Local")
-endif()
# Local TAR:
@@ -209,12 +193,10 @@ enable_testing()
#
# BuildTree tests:
#
-if(can_build_tutorial_step5)
- add_test(TutorialStep5-Local-BuildTreeTest
- "${binary_base}/TutorialStep5-Local/Tutorial" 42)
- set_property(TEST TutorialStep5-Local-BuildTreeTest
- APPEND PROPERTY LABELS Step5 BuildTree)
-endif()
+add_test(TutorialStep5-Local-BuildTreeTest
+"${binary_base}/TutorialStep5-Local/Tutorial" 42)
+set_property(TEST TutorialStep5-Local-BuildTreeTest
+APPEND PROPERTY LABELS Step5 BuildTree)
add_test(TutorialStep1-LocalTAR-BuildTreeTest
"${binary_base}/TutorialStep1-LocalTAR/EP-Tutorial" 36)
@@ -234,12 +216,7 @@ add_test(TutorialStep1-LocalNoDirTGZ-BuildTreeTest
# InstallTree tests:
#
-if(can_build_tutorial_step5)
- add_test(TutorialStep5-InstallTreeTest
- "${TutorialStep5_install_dir}/bin/Tutorial" 49)
- set_property(TEST TutorialStep5-InstallTreeTest
- APPEND PROPERTY LABELS Step5 InstallTree)
-endif()
-
-
-message(STATUS "can_build_tutorial_step5='${can_build_tutorial_step5}'")
+add_test(TutorialStep5-InstallTreeTest
+"${TutorialStep5_install_dir}/bin/Tutorial" 49)
+set_property(TEST TutorialStep5-InstallTreeTest
+APPEND PROPERTY LABELS Step5 InstallTree)
diff --git a/Tests/ExternalProjectLocal/Step5/CMakeLists.txt b/Tests/ExternalProjectLocal/Step5/CMakeLists.txt
new file mode 100644
index 0000000000..93b3880f06
--- /dev/null
+++ b/Tests/ExternalProjectLocal/Step5/CMakeLists.txt
@@ -0,0 +1,71 @@
+cmake_minimum_required (VERSION 2.6)
+project (Tutorial)
+
+# The version number.
+set (Tutorial_VERSION_MAJOR 1)
+set (Tutorial_VERSION_MINOR 0)
+
+# does this system provide the log and exp functions?
+include (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake)
+check_function_exists (log HAVE_LOG)
+check_function_exists (exp HAVE_EXP)
+
+# should we use our own math functions
+option(USE_MYMATH "Use tutorial provided math implementation" ON)
+
+# configure a header file to pass some of the CMake settings
+# to the source code
+configure_file (
+ "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
+ "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ )
+
+# add the binary tree to the search path for include files
+# so that we will find TutorialConfig.h
+include_directories ("${PROJECT_BINARY_DIR}")
+
+# add the MathFunctions library?
+if (USE_MYMATH)
+ include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions")
+ add_subdirectory (MathFunctions)
+ set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions)
+endif ()
+
+# add the executable
+add_executable (Tutorial tutorial.cxx)
+target_link_libraries (Tutorial ${EXTRA_LIBS})
+
+# add the install targets
+install (TARGETS Tutorial DESTINATION bin)
+install (FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ DESTINATION include)
+
+# enable testing
+enable_testing ()
+
+# does the application run
+add_test (TutorialRuns Tutorial 25)
+
+# does the usage message work?
+add_test (TutorialUsage Tutorial)
+set_tests_properties (TutorialUsage
+ PROPERTIES
+ PASS_REGULAR_EXPRESSION "Usage:.*number"
+ )
+
+#define a macro to simplify adding tests
+macro (do_test arg result)
+ add_test (TutorialComp${arg} Tutorial ${arg})
+ set_tests_properties (TutorialComp${arg}
+ PROPERTIES PASS_REGULAR_EXPRESSION ${result}
+ )
+endmacro ()
+
+# do a bunch of result based tests
+do_test (4 "4 is 2")
+do_test (9 "9 is 3")
+do_test (5 "5 is 2.236")
+do_test (7 "7 is 2.645")
+do_test (25 "25 is 5")
+do_test (-25 "-25 is 0")
+do_test (0.0001 "0.0001 is 0.01")
diff --git a/Tests/ExternalProjectLocal/Step5/MathFunctions/CMakeLists.txt b/Tests/ExternalProjectLocal/Step5/MathFunctions/CMakeLists.txt
new file mode 100644
index 0000000000..453a46332e
--- /dev/null
+++ b/Tests/ExternalProjectLocal/Step5/MathFunctions/CMakeLists.txt
@@ -0,0 +1,17 @@
+# first we add the executable that generates the table
+# add the binary tree directory to the search path for include files
+include_directories( ${CMAKE_CURRENT_BINARY_DIR} )
+
+add_executable(MakeTable MakeTable.cxx )
+# add the command to generate the source code
+add_custom_command (
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ DEPENDS MakeTable
+ )
+
+# add the main library
+add_library(MathFunctions mysqrt.cxx ${CMAKE_CURRENT_BINARY_DIR}/Table.h )
+
+install (TARGETS MathFunctions DESTINATION bin)
+install (FILES MathFunctions.h DESTINATION include)
diff --git a/Tests/ExternalProjectLocal/Step5/MathFunctions/MakeTable.cxx b/Tests/ExternalProjectLocal/Step5/MathFunctions/MakeTable.cxx
new file mode 100644
index 0000000000..cebd50fcc1
--- /dev/null
+++ b/Tests/ExternalProjectLocal/Step5/MathFunctions/MakeTable.cxx
@@ -0,0 +1,32 @@
+// A simple program that builds a sqrt table
+#include <math.h>
+#include <stdio.h>
+
+int main(int argc, char* argv[])
+{
+ int i;
+ double result;
+
+ // make sure we have enough arguments
+ if (argc < 2) {
+ return 1;
+ }
+
+ // open the output file
+ FILE* fout = fopen(argv[1], "w");
+ if (!fout) {
+ return 1;
+ }
+
+ // create a source file with a table of square roots
+ fprintf(fout, "double sqrtTable[] = {\n");
+ for (i = 0; i < 10; ++i) {
+ result = sqrt(static_cast<double>(i));
+ fprintf(fout, "%g,\n", result);
+ }
+
+ // close the table with a zero
+ fprintf(fout, "0};\n");
+ fclose(fout);
+ return 0;
+}
diff --git a/Tests/ExternalProjectLocal/Step5/MathFunctions/MathFunctions.h b/Tests/ExternalProjectLocal/Step5/MathFunctions/MathFunctions.h
new file mode 100644
index 0000000000..cd36bccffd
--- /dev/null
+++ b/Tests/ExternalProjectLocal/Step5/MathFunctions/MathFunctions.h
@@ -0,0 +1 @@
+double mysqrt(double x);
diff --git a/Tests/ExternalProjectLocal/Step5/MathFunctions/mysqrt.cxx b/Tests/ExternalProjectLocal/Step5/MathFunctions/mysqrt.cxx
new file mode 100644
index 0000000000..458ed63a15
--- /dev/null
+++ b/Tests/ExternalProjectLocal/Step5/MathFunctions/mysqrt.cxx
@@ -0,0 +1,40 @@
+#include "MathFunctions.h"
+#include "TutorialConfig.h"
+#include <stdio.h>
+
+// include the generated table
+#include "Table.h"
+
+#include <math.h>
+
+// a hack square root calculation using simple operations
+double mysqrt(double x)
+{
+ if (x <= 0) {
+ return 0;
+ }
+
+ double result;
+
+ // if we have both log and exp then use them
+ double delta;
+
+ // use the table to help find an initial value
+ result = x;
+ if (x >= 1 && x < 10) {
+ result = sqrtTable[static_cast<int>(x)];
+ }
+
+ // do ten iterations
+ int i;
+ for (i = 0; i < 10; ++i) {
+ if (result <= 0) {
+ result = 0.1;
+ }
+ delta = x - (result * result);
+ result = result + 0.5 * delta / result;
+ fprintf(stdout, "Computing sqrt of %g to be %g\n", x, result);
+ }
+
+ return result;
+}
diff --git a/Tests/ExternalProjectLocal/Step5/TutorialConfig.h.in b/Tests/ExternalProjectLocal/Step5/TutorialConfig.h.in
new file mode 100644
index 0000000000..e97ce24ea9
--- /dev/null
+++ b/Tests/ExternalProjectLocal/Step5/TutorialConfig.h.in
@@ -0,0 +1,8 @@
+// the configured options and settings for Tutorial
+#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
+#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
+#cmakedefine USE_MYMATH
+
+// does the platform provide exp and log functions?
+#cmakedefine HAVE_LOG
+#cmakedefine HAVE_EXP
diff --git a/Tests/ExternalProjectLocal/Step5/tutorial.cxx b/Tests/ExternalProjectLocal/Step5/tutorial.cxx
new file mode 100644
index 0000000000..37f6ac4567
--- /dev/null
+++ b/Tests/ExternalProjectLocal/Step5/tutorial.cxx
@@ -0,0 +1,33 @@
+// A simple program that computes the square root of a number
+#include "TutorialConfig.h"
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#ifdef USE_MYMATH
+# include "MathFunctions.h"
+#endif
+
+int main(int argc, char* argv[])
+{
+ if (argc < 2) {
+ fprintf(stdout, "%s Version %d.%d\n", argv[0], Tutorial_VERSION_MAJOR,
+ Tutorial_VERSION_MINOR);
+ fprintf(stdout, "Usage: %s number\n", argv[0]);
+ return 1;
+ }
+
+ double inputValue = atof(argv[1]);
+ double outputValue = 0;
+
+ if (inputValue >= 0) {
+#ifdef USE_MYMATH
+ outputValue = mysqrt(inputValue);
+#else
+ outputValue = sqrt(inputValue);
+#endif
+ }
+
+ fprintf(stdout, "The square root of %g is %g\n", inputValue, outputValue);
+ return 0;
+}
diff --git a/Tests/FindOctave/Test/CMakeLists.txt b/Tests/FindOctave/Test/CMakeLists.txt
index ce33fcdc94..73aa8319d8 100644
--- a/Tests/FindOctave/Test/CMakeLists.txt
+++ b/Tests/FindOctave/Test/CMakeLists.txt
@@ -10,6 +10,10 @@ add_executable(test_tgt main.cpp)
target_link_libraries(test_tgt Octave::Octave)
add_test(NAME test_tgt COMMAND test_tgt)
+add_executable(test_octinterp_tgt interp_main.cpp)
+target_link_libraries(test_octinterp_tgt Octave::Octinterp)
+add_test(NAME test_octinterp_tgt COMMAND test_octinterp_tgt)
+
add_test(NAME test_tgt_exe
COMMAND Octave::Interpreter -q --eval "runtests('.')"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
diff --git a/Tests/FindOctave/Test/interp_main.cpp b/Tests/FindOctave/Test/interp_main.cpp
new file mode 100644
index 0000000000..1efa1879cd
--- /dev/null
+++ b/Tests/FindOctave/Test/interp_main.cpp
@@ -0,0 +1,26 @@
+#include <iostream>
+#include <oct.h>
+#include <octave.h>
+#include <parse.h>
+#include <toplev.h>
+
+int main(void)
+{
+ string_vector argv(2);
+ argv(0) = "embedded";
+ argv(1) = "-q";
+
+ try {
+ octave_main(2, argv.c_str_vec(), 1);
+ octave_value_list in;
+ in(0) = 72.0;
+ const octave_value_list result = feval("sqrt", in);
+ std::cout << "result is " << result(0).scalar_value() << std::endl;
+ clean_up_and_exit(0);
+ } catch (const octave::exit_exception& ex) {
+ std::cerr << "Octave interpreter exited with status = " << ex.exit_status()
+ << std::endl;
+ } catch (const octave::execution_exception&) {
+ std::cerr << "error encountered in Octave evaluator!" << std::endl;
+ }
+}
diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt
index 52623d0286..7023615f2f 100644
--- a/Tests/Fortran/CMakeLists.txt
+++ b/Tests/Fortran/CMakeLists.txt
@@ -99,6 +99,11 @@ function(test_fortran_c_interface_module)
target_link_libraries(myc myfort)
set_property(TARGET myc PROPERTY COMPILE_DEFINITIONS ${MYC_DEFS})
+ add_library(myfort_obj OBJECT mysub.f)
+ add_library(myc_use_obj myc.c $<TARGET_OBJECTS:myfort_obj>)
+ add_executable(mainc_use_obj mainc.c)
+ target_link_libraries(mainc_use_obj myc_use_obj)
+
add_library(mycxx mycxx.cxx)
target_link_libraries(mycxx myc)
diff --git a/Tests/InterfaceLibrary/CMakeLists.txt b/Tests/InterfaceLibrary/CMakeLists.txt
index 6aae09ac29..954c02d511 100644
--- a/Tests/InterfaceLibrary/CMakeLists.txt
+++ b/Tests/InterfaceLibrary/CMakeLists.txt
@@ -47,6 +47,7 @@ target_link_libraries(InterfaceLibrary
add_dependencies(InterfaceLibrary item_fake_tgt)
add_subdirectory(libsdir)
+add_subdirectory(excluded EXCLUDE_FROM_ALL)
add_executable(sharedlibtestexe sharedlibtestexe.cpp)
target_link_libraries(sharedlibtestexe shared_iface imported::iface)
diff --git a/Tests/InterfaceLibrary/excluded/CMakeLists.txt b/Tests/InterfaceLibrary/excluded/CMakeLists.txt
new file mode 100644
index 0000000000..69a6807c90
--- /dev/null
+++ b/Tests/InterfaceLibrary/excluded/CMakeLists.txt
@@ -0,0 +1 @@
+add_library(excluded_iface INTERFACE)
diff --git a/Tests/QtAutogen/MocOsMacros/TestClass.cpp b/Tests/QtAutogen/MocOsMacros/TestClass.cpp
index 340d130b14..13f8fd93aa 100644
--- a/Tests/QtAutogen/MocOsMacros/TestClass.cpp
+++ b/Tests/QtAutogen/MocOsMacros/TestClass.cpp
@@ -1,6 +1,11 @@
#include "TestClass.hpp"
#include <iostream>
+void TestClass::open()
+{
+ std::cout << "open\n";
+}
+
// -- Mac
#ifndef Q_OS_MAC
void TestClass::MacNotDef()
diff --git a/Tests/QtAutogen/MocOsMacros/TestClass.hpp b/Tests/QtAutogen/MocOsMacros/TestClass.hpp
index 53000aa79c..87fd494789 100644
--- a/Tests/QtAutogen/MocOsMacros/TestClass.hpp
+++ b/Tests/QtAutogen/MocOsMacros/TestClass.hpp
@@ -3,12 +3,17 @@
#include <QObject>
#include <QtGlobal>
+// include qplatformdefs.h for #18669
+#include <qplatformdefs.h>
class TestClass : public QObject
{
Q_OBJECT
public Q_SLOTS:
+ // Method named "open" to test if #18669 is fixed
+ void open();
+
// -- Mac
#ifndef Q_OS_MAC
void MacNotDef();
diff --git a/Tests/QtAutogen/SameName/CMakeLists.txt b/Tests/QtAutogen/SameName/CMakeLists.txt
index 6d42499e69..8d4f71f65e 100644
--- a/Tests/QtAutogen/SameName/CMakeLists.txt
+++ b/Tests/QtAutogen/SameName/CMakeLists.txt
@@ -17,6 +17,10 @@ add_executable(sameName
ccc/item.cpp
ccc/data.qrc
item.cpp
+ object.h
+ object.h++
+ object.hpp
+ object.hxx
data.qrc
main.cpp
)
diff --git a/Tests/QtAutogen/SameName/main.cpp b/Tests/QtAutogen/SameName/main.cpp
index a4ffcb350a..92f15cd5f7 100644
--- a/Tests/QtAutogen/SameName/main.cpp
+++ b/Tests/QtAutogen/SameName/main.cpp
@@ -3,14 +3,25 @@
#include "bbb/aaa/item.hpp"
#include "bbb/item.hpp"
#include "ccc/item.hpp"
+#include "item.hpp"
+#include "object.h"
+#include "object.h++"
+#include "object.hpp"
+#include "object.hxx"
int main(int argv, char** args)
{
- // Object instances
+ // Item instances
+ ::Item item;
::aaa::Item aaa_item;
::aaa::bbb::Item aaa_bbb_item;
::bbb::Item bbb_item;
::bbb::aaa::Item bbb_aaa_item;
::ccc::Item ccc_item;
+ // Object instances
+ ::Object_h obj_h;
+ ::Object_hplpl obj_hplpl;
+ ::Object_hpp obj_hpp;
+ ::Object_hxx obj_hxx;
return 0;
}
diff --git a/Tests/QtAutogen/SameName/object.h b/Tests/QtAutogen/SameName/object.h
new file mode 100644
index 0000000000..86620941ac
--- /dev/null
+++ b/Tests/QtAutogen/SameName/object.h
@@ -0,0 +1,13 @@
+#ifndef OBJECT_H
+#define OBJECT_H
+
+#include <QObject>
+
+class Object_h : public QObject
+{
+ Q_OBJECT
+ Q_SLOT
+ void go(){};
+};
+
+#endif
diff --git a/Tests/QtAutogen/SameName/object.h++ b/Tests/QtAutogen/SameName/object.h++
new file mode 100644
index 0000000000..64222b7eca
--- /dev/null
+++ b/Tests/QtAutogen/SameName/object.h++
@@ -0,0 +1,13 @@
+#ifndef OBJECT_HPLPL
+#define OBJECT_HPLPL
+
+#include <QObject>
+
+class Object_hplpl : public QObject
+{
+ Q_OBJECT
+ Q_SLOT
+ void go(){};
+};
+
+#endif
diff --git a/Tests/QtAutogen/SameName/object.hpp b/Tests/QtAutogen/SameName/object.hpp
new file mode 100644
index 0000000000..035050ec74
--- /dev/null
+++ b/Tests/QtAutogen/SameName/object.hpp
@@ -0,0 +1,13 @@
+#ifndef OBJECT_HPP
+#define OBJECT_HPP
+
+#include <QObject>
+
+class Object_hpp : public QObject
+{
+ Q_OBJECT
+ Q_SLOT
+ void go(){};
+};
+
+#endif
diff --git a/Tests/QtAutogen/SameName/object.hxx b/Tests/QtAutogen/SameName/object.hxx
new file mode 100644
index 0000000000..c3c050f130
--- /dev/null
+++ b/Tests/QtAutogen/SameName/object.hxx
@@ -0,0 +1,13 @@
+#ifndef OBJECT_HXX
+#define OBJECT_HXX
+
+#include <QObject>
+
+class Object_hxx : public QObject
+{
+ Q_OBJECT
+ Q_SLOT
+ void go(){};
+};
+
+#endif
diff --git a/Tests/QtAutogen/Tests.cmake b/Tests/QtAutogen/Tests.cmake
index c53fb4f1d8..096d5e3bd5 100644
--- a/Tests/QtAutogen/Tests.cmake
+++ b/Tests/QtAutogen/Tests.cmake
@@ -39,8 +39,7 @@ endif()
# Qt5 only tests
if(QT_TEST_VERSION GREATER 4)
ADD_AUTOGEN_TEST(MocMacroName mocMacroName)
- # Disabled for issue #18669
- #ADD_AUTOGEN_TEST(MocOsMacros)
+ ADD_AUTOGEN_TEST(MocOsMacros)
ADD_AUTOGEN_TEST(RerunMocPlugin)
if(APPLE)
ADD_AUTOGEN_TEST(MacOsFW)
diff --git a/Tests/RunCMake/Autogen/QtInFunction.cmake b/Tests/RunCMake/Autogen/QtInFunction.cmake
new file mode 100644
index 0000000000..a44bc5ab48
--- /dev/null
+++ b/Tests/RunCMake/Autogen/QtInFunction.cmake
@@ -0,0 +1,13 @@
+enable_language(CXX)
+
+function (use_autogen target)
+ find_package(Qt5 REQUIRED COMPONENTS Core Widgets)
+ set(Qt5Core_VERSION_MAJOR "${Qt5Core_VERSION_MAJOR}" PARENT_SCOPE)
+ set(Qt5Core_VERSION_MINOR "${Qt5Core_VERSION_MINOR}" PARENT_SCOPE)
+ set_property(TARGET "${target}" PROPERTY AUTOMOC 1)
+ set_property(TARGET "${target}" PROPERTY AUTORCC 1)
+ set_property(TARGET "${target}" PROPERTY AUTOUIC 1)
+endfunction ()
+
+add_executable(main empty.cpp)
+use_autogen(main)
diff --git a/Tests/RunCMake/Autogen/QtInFunctionNested-stderr.txt b/Tests/RunCMake/Autogen/QtInFunctionNested-stderr.txt
new file mode 100644
index 0000000000..1c6660a5ee
--- /dev/null
+++ b/Tests/RunCMake/Autogen/QtInFunctionNested-stderr.txt
@@ -0,0 +1,8 @@
+^CMake Warning \(dev\) in CMakeLists.txt:
+ AUTOGEN: No valid Qt version found for target main. AUTOMOC, AUTOUIC and
+ AUTORCC disabled. Consider adding:
+
+ find_package\(Qt<QTVERSION> COMPONENTS Widgets\)
+
+ to your CMakeLists.txt file.
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/Autogen/QtInFunctionNested.cmake b/Tests/RunCMake/Autogen/QtInFunctionNested.cmake
new file mode 100644
index 0000000000..5421ba00df
--- /dev/null
+++ b/Tests/RunCMake/Autogen/QtInFunctionNested.cmake
@@ -0,0 +1,17 @@
+enable_language(CXX)
+
+function (use_autogen target)
+ find_package(Qt5 REQUIRED COMPONENTS Core Widgets)
+ set(Qt5Core_VERSION_MAJOR "${Qt5Core_VERSION_MAJOR}" PARENT_SCOPE)
+ set(Qt5Core_VERSION_MINOR "${Qt5Core_VERSION_MINOR}" PARENT_SCOPE)
+ set_property(TARGET "${target}" PROPERTY AUTOMOC 1)
+ set_property(TARGET "${target}" PROPERTY AUTORCC 1)
+ set_property(TARGET "${target}" PROPERTY AUTOUIC 1)
+endfunction ()
+
+function (wrap_autogen target)
+ use_autogen("${target}")
+endfunction ()
+
+add_executable(main empty.cpp)
+wrap_autogen(main)
diff --git a/Tests/RunCMake/Autogen/QtInFunctionProperty.cmake b/Tests/RunCMake/Autogen/QtInFunctionProperty.cmake
new file mode 100644
index 0000000000..35f1cd16ca
--- /dev/null
+++ b/Tests/RunCMake/Autogen/QtInFunctionProperty.cmake
@@ -0,0 +1,21 @@
+enable_language(CXX)
+
+function (use_autogen target)
+ find_package(Qt5 REQUIRED COMPONENTS Core Widgets)
+ set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
+ PROPERTY
+ Qt5Core_VERSION_MAJOR "${Qt5Core_VERSION_MAJOR}")
+ set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
+ PROPERTY
+ Qt5Core_VERSION_MINOR "${Qt5Core_VERSION_MINOR}")
+ set_property(TARGET "${target}" PROPERTY AUTOMOC 1)
+ set_property(TARGET "${target}" PROPERTY AUTORCC 1)
+ set_property(TARGET "${target}" PROPERTY AUTOUIC 1)
+endfunction ()
+
+function (wrap_autogen target)
+ use_autogen("${target}")
+endfunction ()
+
+add_executable(main empty.cpp)
+wrap_autogen(main)
diff --git a/Tests/RunCMake/Autogen/RunCMakeTest.cmake b/Tests/RunCMake/Autogen/RunCMakeTest.cmake
index e52f28d257..a31b67cd7d 100644
--- a/Tests/RunCMake/Autogen/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Autogen/RunCMakeTest.cmake
@@ -1,3 +1,8 @@
include(RunCMake)
run_cmake(NoQt)
+if (with_qt5)
+ run_cmake(QtInFunction)
+ run_cmake(QtInFunctionNested)
+ run_cmake(QtInFunctionProperty)
+endif ()
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index e6c90b4a1a..1f3e5c3006 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -123,7 +123,7 @@ if(NOT CMAKE_GENERATOR MATCHES "Visual Studio|Xcode")
add_RunCMake_test(CMP0065)
endif()
if(CMAKE_GENERATOR MATCHES "Make")
- add_RunCMake_test(Make)
+ add_RunCMake_test(Make -DMAKE_IS_GNU=${MAKE_IS_GNU})
endif()
if(CMAKE_GENERATOR STREQUAL "Ninja")
set(Ninja_ARGS
@@ -150,7 +150,14 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
endif()
add_RunCMake_test(AndroidTestUtilities)
-add_RunCMake_test(Autogen)
+set(autogen_with_qt5 FALSE)
+if(CMake_TEST_Qt5)
+ find_package(Qt5Widgets QUIET NO_MODULE)
+endif()
+if(CMake_TEST_Qt5 AND Qt5Widgets_FOUND)
+ set(autogen_with_qt5 TRUE)
+endif ()
+add_RunCMake_test(Autogen -Dwith_qt5=${autogen_with_qt5})
add_RunCMake_test(BuildDepends)
if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Unix Makefiles|Ninja")
add_RunCMake_test(Byproducts)
diff --git a/Tests/RunCMake/CommandLine/E_compare_files-different-eol-result.txt b/Tests/RunCMake/CommandLine/E_compare_files-different-eol-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_compare_files-different-eol-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_compare_files-different-eol-stderr.txt b/Tests/RunCMake/CommandLine/E_compare_files-different-eol-stderr.txt
new file mode 100644
index 0000000000..4729ccb8fa
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_compare_files-different-eol-stderr.txt
@@ -0,0 +1 @@
+^Files ".*/compare_files/lf" to ".*/compare_files/crlf" are different.$
diff --git a/Tests/RunCMake/CommandLine/E_compare_files-ignore-eol-nonexistent-result.txt b/Tests/RunCMake/CommandLine/E_compare_files-ignore-eol-nonexistent-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_compare_files-ignore-eol-nonexistent-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_compare_files-ignore-eol-nonexistent-stderr.txt b/Tests/RunCMake/CommandLine/E_compare_files-ignore-eol-nonexistent-stderr.txt
new file mode 100644
index 0000000000..8a9ca81f88
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_compare_files-ignore-eol-nonexistent-stderr.txt
@@ -0,0 +1 @@
+^Files "nonexistent_a" to "nonexistent_b" are different.$
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index c1aaf0db89..23fb9ef46d 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -18,6 +18,10 @@ run_cmake_command(Uno-src ${CMAKE_COMMAND} -B DummyBuildDir -UVAR)
run_cmake_command(E-no-arg ${CMAKE_COMMAND} -E)
run_cmake_command(E_capabilities ${CMAKE_COMMAND} -E capabilities)
run_cmake_command(E_capabilities-arg ${CMAKE_COMMAND} -E capabilities --extra-arg)
+run_cmake_command(E_compare_files-different-eol ${CMAKE_COMMAND} -E compare_files ${RunCMake_SOURCE_DIR}/compare_files/lf ${RunCMake_SOURCE_DIR}/compare_files/crlf)
+run_cmake_command(E_compare_files-ignore-eol-same ${CMAKE_COMMAND} -E compare_files --ignore-eol ${RunCMake_SOURCE_DIR}/compare_files/lf ${RunCMake_SOURCE_DIR}/compare_files/crlf)
+run_cmake_command(E_compare_files-ignore-eol-empty ${CMAKE_COMMAND} -E compare_files --ignore-eol ${RunCMake_SOURCE_DIR}/compare_files/empty1 ${RunCMake_SOURCE_DIR}/compare_files/empty2)
+run_cmake_command(E_compare_files-ignore-eol-nonexistent ${CMAKE_COMMAND} -E compare_files --ignore-eol nonexistent_a nonexistent_b)
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)
diff --git a/Tests/RunCMake/CommandLine/compare_files/.gitattributes b/Tests/RunCMake/CommandLine/compare_files/.gitattributes
new file mode 100644
index 0000000000..91d5c104c9
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/compare_files/.gitattributes
@@ -0,0 +1,2 @@
+crlf eol=crlf
+lf eol=lf
diff --git a/Tests/RunCMake/CommandLine/compare_files/crlf b/Tests/RunCMake/CommandLine/compare_files/crlf
new file mode 100644
index 0000000000..a29bdeb434
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/compare_files/crlf
@@ -0,0 +1 @@
+line1
diff --git a/Tests/RunCMake/CommandLine/compare_files/empty1 b/Tests/RunCMake/CommandLine/compare_files/empty1
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/compare_files/empty1
diff --git a/Tests/RunCMake/CommandLine/compare_files/empty2 b/Tests/RunCMake/CommandLine/compare_files/empty2
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/compare_files/empty2
diff --git a/Tests/RunCMake/CommandLine/compare_files/lf b/Tests/RunCMake/CommandLine/compare_files/lf
new file mode 100644
index 0000000000..a29bdeb434
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/compare_files/lf
@@ -0,0 +1 @@
+line1
diff --git a/Tests/RunCMake/FetchContent/MakeAvailable-stdout.txt b/Tests/RunCMake/FetchContent/MakeAvailable-stdout.txt
new file mode 100644
index 0000000000..6e6c730628
--- /dev/null
+++ b/Tests/RunCMake/FetchContent/MakeAvailable-stdout.txt
@@ -0,0 +1,2 @@
+Confirmation project has been added
+.*Confirmation script has been called
diff --git a/Tests/RunCMake/FetchContent/MakeAvailable.cmake b/Tests/RunCMake/FetchContent/MakeAvailable.cmake
new file mode 100644
index 0000000000..a93f1f70da
--- /dev/null
+++ b/Tests/RunCMake/FetchContent/MakeAvailable.cmake
@@ -0,0 +1,20 @@
+include(FetchContent)
+
+FetchContent_Declare(
+ WithProject
+ SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/WithProject
+)
+FetchContent_Declare(
+ WithoutProject
+ SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/WithoutProject
+)
+
+# Order is important and will be verified by test output
+FetchContent_MakeAvailable(WithProject WithoutProject)
+
+get_property(addedWith GLOBAL PROPERTY FetchWithProject SET)
+if(NOT addedWith)
+ message(SEND_ERROR "Subdir with CMakeLists.txt not added")
+endif()
+
+include(${withoutproject_SOURCE_DIR}/confirmMessage.cmake)
diff --git a/Tests/RunCMake/FetchContent/MakeAvailableTwice-stdout.txt b/Tests/RunCMake/FetchContent/MakeAvailableTwice-stdout.txt
new file mode 100644
index 0000000000..8d3b7c04f7
--- /dev/null
+++ b/Tests/RunCMake/FetchContent/MakeAvailableTwice-stdout.txt
@@ -0,0 +1,4 @@
+-- Before first[
+ ]+-- Confirmation project has been added[
+ ]+-- Between both[
+ ]+-- After last
diff --git a/Tests/RunCMake/FetchContent/MakeAvailableTwice.cmake b/Tests/RunCMake/FetchContent/MakeAvailableTwice.cmake
new file mode 100644
index 0000000000..a9af020914
--- /dev/null
+++ b/Tests/RunCMake/FetchContent/MakeAvailableTwice.cmake
@@ -0,0 +1,12 @@
+include(FetchContent)
+
+FetchContent_Declare(
+ WithProject
+ SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/WithProject
+)
+
+message(STATUS "Before first")
+FetchContent_MakeAvailable(WithProject)
+message(STATUS "Between both")
+FetchContent_MakeAvailable(WithProject)
+message(STATUS "After last")
diff --git a/Tests/RunCMake/FetchContent/MakeAvailableUndeclared-result.txt b/Tests/RunCMake/FetchContent/MakeAvailableUndeclared-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/FetchContent/MakeAvailableUndeclared-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/FetchContent/MakeAvailableUndeclared-stderr.txt b/Tests/RunCMake/FetchContent/MakeAvailableUndeclared-stderr.txt
new file mode 100644
index 0000000000..9715b78891
--- /dev/null
+++ b/Tests/RunCMake/FetchContent/MakeAvailableUndeclared-stderr.txt
@@ -0,0 +1 @@
+No content details recorded for NoDetails
diff --git a/Tests/RunCMake/FetchContent/MakeAvailableUndeclared.cmake b/Tests/RunCMake/FetchContent/MakeAvailableUndeclared.cmake
new file mode 100644
index 0000000000..bd57cbe1a9
--- /dev/null
+++ b/Tests/RunCMake/FetchContent/MakeAvailableUndeclared.cmake
@@ -0,0 +1,3 @@
+include(FetchContent)
+
+FetchContent_MakeAvailable(NoDetails)
diff --git a/Tests/RunCMake/FetchContent/RunCMakeTest.cmake b/Tests/RunCMake/FetchContent/RunCMakeTest.cmake
index 9c1ab6682f..e28ae96ddf 100644
--- a/Tests/RunCMake/FetchContent/RunCMakeTest.cmake
+++ b/Tests/RunCMake/FetchContent/RunCMakeTest.cmake
@@ -11,6 +11,9 @@ run_cmake(VarDefinitions)
run_cmake(GetProperties)
run_cmake(DirOverrides)
run_cmake(UsesTerminalOverride)
+run_cmake(MakeAvailable)
+run_cmake(MakeAvailableTwice)
+run_cmake(MakeAvailableUndeclared)
# We need to pass through CMAKE_GENERATOR and CMAKE_MAKE_PROGRAM
# to ensure the test can run on machines where the build tool
diff --git a/Tests/RunCMake/FetchContent/WithProject/CMakeLists.txt b/Tests/RunCMake/FetchContent/WithProject/CMakeLists.txt
new file mode 100644
index 0000000000..b6a37508e7
--- /dev/null
+++ b/Tests/RunCMake/FetchContent/WithProject/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 3.13)
+project(WithProject LANGUAGES NONE)
+
+set_property(GLOBAL PROPERTY FetchWithProject YES)
+message(STATUS "Confirmation project has been added")
diff --git a/Tests/RunCMake/FetchContent/WithoutProject/confirmMessage.cmake b/Tests/RunCMake/FetchContent/WithoutProject/confirmMessage.cmake
new file mode 100644
index 0000000000..a2f5c61d0b
--- /dev/null
+++ b/Tests/RunCMake/FetchContent/WithoutProject/confirmMessage.cmake
@@ -0,0 +1 @@
+message(STATUS "Confirmation script has been called")
diff --git a/Tests/RunCMake/Framework/InstallBeforeFramework-stderr.txt b/Tests/RunCMake/Framework/InstallBeforeFramework-stderr.txt
new file mode 100644
index 0000000000..a3a7c6cbb6
--- /dev/null
+++ b/Tests/RunCMake/Framework/InstallBeforeFramework-stderr.txt
@@ -0,0 +1,7 @@
+^CMake Warning \(dev\) at InstallBeforeFramework.cmake:4 \(install\):
+ Target 'foo' was changed to a FRAMEWORK sometime after install\(\). This may
+ result in the wrong install DESTINATION. Set the FRAMEWORK property
+ earlier.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/Framework/InstallBeforeFramework.cmake b/Tests/RunCMake/Framework/InstallBeforeFramework.cmake
new file mode 100644
index 0000000000..3791dace79
--- /dev/null
+++ b/Tests/RunCMake/Framework/InstallBeforeFramework.cmake
@@ -0,0 +1,5 @@
+enable_language(C)
+
+add_library(foo SHARED foo.c)
+install(TARGETS foo LIBRARY DESTINATION lib)
+set_property(TARGET foo PROPERTY FRAMEWORK TRUE)
diff --git a/Tests/RunCMake/Framework/RunCMakeTest.cmake b/Tests/RunCMake/Framework/RunCMakeTest.cmake
index 4fc83f801d..e705a31fa1 100644
--- a/Tests/RunCMake/Framework/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Framework/RunCMakeTest.cmake
@@ -1,5 +1,7 @@
include(RunCMake)
+run_cmake(InstallBeforeFramework)
+
function(framework_layout_test Name Toolchain Type)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${Toolchain}${Type}FrameworkLayout-build)
set(RunCMake_TEST_NO_CLEAN 1)
diff --git a/Tests/RunCMake/GeneratorExpression/GENEX_EVAL-recursion2-stderr.txt b/Tests/RunCMake/GeneratorExpression/GENEX_EVAL-recursion2-stderr.txt
index fd954e6cc2..ed68400573 100644
--- a/Tests/RunCMake/GeneratorExpression/GENEX_EVAL-recursion2-stderr.txt
+++ b/Tests/RunCMake/GeneratorExpression/GENEX_EVAL-recursion2-stderr.txt
@@ -1,7 +1,7 @@
^CMake Error at GENEX_EVAL-recursion2.cmake:8 \(add_custom_target\):
Error evaluating generator expression:
- \$<GENEX_EVAL:\$<TARGET_PROPERTY:CUSTOM_PROPERTY1>>
+ \$<GENEX_EVAL:\$<TARGET_PROPERTY:CUSTOM_PROPERTY2>>
Dependency loop found.
Call Stack \(most recent call first\):
@@ -11,7 +11,7 @@ Call Stack \(most recent call first\):
CMake Error at GENEX_EVAL-recursion2.cmake:8 \(add_custom_target\):
Loop step 1
- \$<GENEX_EVAL:\$<TARGET_PROPERTY:CUSTOM_PROPERTY2>>
+ \$<GENEX_EVAL:\$<TARGET_PROPERTY:CUSTOM_PROPERTY1>>
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
@@ -20,7 +20,7 @@ Call Stack \(most recent call first\):
CMake Error at GENEX_EVAL-recursion2.cmake:8 \(add_custom_target\):
Loop step 2
- \$<TARGET_GENEX_EVAL:recursion,\$<TARGET_PROPERTY:recursion,CUSTOM_PROPERTY1>>
+ \$<GENEX_EVAL:\$<TARGET_PROPERTY:CUSTOM_PROPERTY2>>
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/GENEX_EVAL.cmake b/Tests/RunCMake/GeneratorExpression/GENEX_EVAL.cmake
index ab8988b269..153cd176f8 100644
--- a/Tests/RunCMake/GeneratorExpression/GENEX_EVAL.cmake
+++ b/Tests/RunCMake/GeneratorExpression/GENEX_EVAL.cmake
@@ -7,5 +7,6 @@ add_library (example SHARED empty.c)
set_property (TARGET example PROPERTY CUSTOM_PROPERTY1 "PROPERTY1")
set_property (TARGET example PROPERTY CUSTOM_PROPERTY2 "$<TARGET_PROPERTY:CUSTOM_PROPERTY1>")
set_property (TARGET example PROPERTY CUSTOM_PROPERTY3 "$<GENEX_EVAL:BEFORE_$<TARGET_PROPERTY:CUSTOM_PROPERTY2>_AFTER>")
+set_property (TARGET example PROPERTY CUSTOM_PROPERTY4 "$<GENEX_EVAL:$<TARGET_PROPERTY:CUSTOM_PROPERTY3>>")
-file(GENERATE OUTPUT "GENEX_EVAL-generated.txt" CONTENT "$<TARGET_GENEX_EVAL:example,$<TARGET_PROPERTY:example,CUSTOM_PROPERTY3>>")
+file(GENERATE OUTPUT "GENEX_EVAL-generated.txt" CONTENT "$<TARGET_GENEX_EVAL:example,$<TARGET_PROPERTY:example,CUSTOM_PROPERTY4>>")
diff --git a/Tests/RunCMake/GeneratorToolset/BadToolsetHostArchTwice-stderr.txt b/Tests/RunCMake/GeneratorToolset/BadToolsetHostArchTwice-stderr.txt
index 164d3aa79d..7067423f45 100644
--- a/Tests/RunCMake/GeneratorToolset/BadToolsetHostArchTwice-stderr.txt
+++ b/Tests/RunCMake/GeneratorToolset/BadToolsetHostArchTwice-stderr.txt
@@ -5,6 +5,6 @@ CMake Error at CMakeLists.txt:[0-9]+ \(project\):
given toolset specification
- Test Toolset,host=x64,host=x64
+ Test Toolset,host=x64,host=x86
that contains duplicate field key 'host'\.$
diff --git a/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake
index ccf58b4d99..ef8fd25404 100644
--- a/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake
@@ -16,14 +16,16 @@ if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[012456]")
set(RunCMake_GENERATOR_TOOLSET "Test Toolset,host=x64")
run_cmake(TestToolsetHostArchBoth)
set(RunCMake_GENERATOR_TOOLSET ",host=x64")
- run_cmake(TestToolsetHostArchOnly)
+ run_cmake(TestToolsetHostArchOnly_x64)
set(RunCMake_GENERATOR_TOOLSET "host=x64")
- run_cmake(TestToolsetHostArchOnly)
+ run_cmake(TestToolsetHostArchOnly_x64)
+ set(RunCMake_GENERATOR_TOOLSET "host=x86")
+ run_cmake(TestToolsetHostArchOnly_x86)
set(RunCMake_GENERATOR_TOOLSET "Test Toolset")
run_cmake(TestToolsetHostArchNone)
set(RunCMake_GENERATOR_TOOLSET "Test Toolset,host=x65")
run_cmake(BadToolsetHostArch)
- set(RunCMake_GENERATOR_TOOLSET "Test Toolset,host=x64,host=x64")
+ set(RunCMake_GENERATOR_TOOLSET "Test Toolset,host=x64,host=x86")
run_cmake(BadToolsetHostArchTwice)
if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[56]")
set(RunCMake_GENERATOR_TOOLSET "Test Toolset,version=Test Toolset Version")
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone-stdout.txt b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone-stdout.txt
index 576b40cc0c..e5e6c8da9b 100644
--- a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone-stdout.txt
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone-stdout.txt
@@ -1,2 +1,2 @@
-- CMAKE_VS_PLATFORM_TOOLSET='Test Toolset'
--- CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE=''
+-- CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE='.*'
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone.cmake b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone.cmake
index 26926f9dbd..085bb6b173 100644
--- a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone.cmake
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone.cmake
@@ -1,2 +1,15 @@
message(STATUS "CMAKE_VS_PLATFORM_TOOLSET='${CMAKE_VS_PLATFORM_TOOLSET}'")
message(STATUS "CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE='${CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE}'")
+
+if(CMAKE_GENERATOR MATCHES "Visual Studio 1[6]")
+ cmake_host_system_information(RESULT is_64_bit QUERY IS_64BIT)
+ if(is_64_bit)
+ if(NOT "${CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE}" STREQUAL "x64")
+ message(FATAL_ERROR "CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE is not 'x64' as expected.")
+ endif()
+ endif()
+else()
+ if(NOT "${CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE}" STREQUAL "")
+ message(FATAL_ERROR "CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE is not empty as expected.")
+ endif()
+endif()
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly-stdout.txt b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x64-stdout.txt
index 8271bd4876..8271bd4876 100644
--- a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly-stdout.txt
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x64-stdout.txt
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly.cmake b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x64.cmake
index 26926f9dbd..26926f9dbd 100644
--- a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly.cmake
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x64.cmake
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x86-stdout.txt b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x86-stdout.txt
new file mode 100644
index 0000000000..c7293dc42a
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x86-stdout.txt
@@ -0,0 +1,2 @@
+-- CMAKE_VS_PLATFORM_TOOLSET='v[0-9]+'
+-- CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE='x86'
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x86.cmake b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x86.cmake
new file mode 100644
index 0000000000..26926f9dbd
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x86.cmake
@@ -0,0 +1,2 @@
+message(STATUS "CMAKE_VS_PLATFORM_TOOLSET='${CMAKE_VS_PLATFORM_TOOLSET}'")
+message(STATUS "CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE='${CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE}'")
diff --git a/Tests/RunCMake/Make/RunCMakeTest.cmake b/Tests/RunCMake/Make/RunCMakeTest.cmake
index 3b2b8f5932..82db6b7425 100644
--- a/Tests/RunCMake/Make/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Make/RunCMakeTest.cmake
@@ -16,5 +16,22 @@ run_TargetMessages(OFF)
run_TargetMessages(VAR-ON -DCMAKE_TARGET_MESSAGES=ON)
run_TargetMessages(VAR-OFF -DCMAKE_TARGET_MESSAGES=OFF)
+function(run_VerboseBuild)
+ run_cmake(VerboseBuild)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/VerboseBuild-build)
+ if(RunCMake_GENERATOR STREQUAL "Watcom WMake")
+ # wmake does not actually show the verbose output.
+ set(RunCMake-stdout-file VerboseBuild-build-watcom-stdout.txt)
+ endif()
+ run_cmake_command(VerboseBuild-build ${CMAKE_COMMAND} --build . -v --clean-first)
+ unset(RunCMake-stdout-file)
+ if(MAKE_IS_GNU)
+ set(RunCMake-stdout-file VerboseBuild-nowork-gnu-stdout.txt)
+ endif()
+ run_cmake_command(VerboseBuild-nowork ${CMAKE_COMMAND} --build . --verbose)
+endfunction()
+run_VerboseBuild()
+
run_cmake(CustomCommandDepfile-ERROR)
run_cmake(IncludeRegexSubdir)
diff --git a/Tests/RunCMake/Make/VerboseBuild-build-stdout.txt b/Tests/RunCMake/Make/VerboseBuild-build-stdout.txt
new file mode 100644
index 0000000000..884bf953e5
--- /dev/null
+++ b/Tests/RunCMake/Make/VerboseBuild-build-stdout.txt
@@ -0,0 +1 @@
+.*DEFINE_FOR_VERBOSE_DETECTION.*hello.dir.*
diff --git a/Tests/RunCMake/Make/VerboseBuild-build-watcom-stdout.txt b/Tests/RunCMake/Make/VerboseBuild-build-watcom-stdout.txt
new file mode 100644
index 0000000000..9c558e357c
--- /dev/null
+++ b/Tests/RunCMake/Make/VerboseBuild-build-watcom-stdout.txt
@@ -0,0 +1 @@
+.
diff --git a/Tests/RunCMake/Make/VerboseBuild-nowork-gnu-stdout.txt b/Tests/RunCMake/Make/VerboseBuild-nowork-gnu-stdout.txt
new file mode 100644
index 0000000000..3e65cd95fd
--- /dev/null
+++ b/Tests/RunCMake/Make/VerboseBuild-nowork-gnu-stdout.txt
@@ -0,0 +1 @@
+.*Nothing to be done for.*hello.*
diff --git a/Tests/RunCMake/Make/VerboseBuild.cmake b/Tests/RunCMake/Make/VerboseBuild.cmake
new file mode 100644
index 0000000000..70a971d13f
--- /dev/null
+++ b/Tests/RunCMake/Make/VerboseBuild.cmake
@@ -0,0 +1,8 @@
+enable_language(C)
+
+# Make sure compile command is not hidden in a temp file.
+string(REPLACE "${CMAKE_START_TEMP_FILE}" "" CMAKE_C_COMPILE_OBJECT "${CMAKE_C_COMPILE_OBJECT}")
+string(REPLACE "${CMAKE_END_TEMP_FILE}" "" CMAKE_C_COMPILE_OBJECT "${CMAKE_C_COMPILE_OBJECT}")
+
+add_executable(hello hello.c)
+target_compile_definitions(hello PRIVATE "DEFINE_FOR_VERBOSE_DETECTION")
diff --git a/Tests/RunCMake/Make/hello.c b/Tests/RunCMake/Make/hello.c
new file mode 100644
index 0000000000..aac8b4e0f3
--- /dev/null
+++ b/Tests/RunCMake/Make/hello.c
@@ -0,0 +1,7 @@
+#include <stdio.h>
+
+int main(void)
+{
+ printf("Hello world!\n");
+ return 0;
+}
diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
index 9e1e9a5fd5..8fa650a61d 100644
--- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
@@ -30,6 +30,15 @@ function(run_NoWorkToDo)
endfunction()
run_NoWorkToDo()
+function(run_VerboseBuild)
+ run_cmake(VerboseBuild)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/VerboseBuild-build)
+ run_cmake_command(VerboseBuild-build ${CMAKE_COMMAND} --build . -v --clean-first)
+ run_cmake_command(VerboseBuild-nowork ${CMAKE_COMMAND} --build . --verbose)
+endfunction()
+run_VerboseBuild()
+
function(run_CMP0058 case)
# Use a single build tree for a few tests without cleaning.
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CMP0058-${case}-build)
diff --git a/Tests/RunCMake/Ninja/VerboseBuild-build-stdout.txt b/Tests/RunCMake/Ninja/VerboseBuild-build-stdout.txt
new file mode 100644
index 0000000000..884bf953e5
--- /dev/null
+++ b/Tests/RunCMake/Ninja/VerboseBuild-build-stdout.txt
@@ -0,0 +1 @@
+.*DEFINE_FOR_VERBOSE_DETECTION.*hello.dir.*
diff --git a/Tests/RunCMake/Ninja/VerboseBuild-nowork-stdout.txt b/Tests/RunCMake/Ninja/VerboseBuild-nowork-stdout.txt
new file mode 100644
index 0000000000..60a9228b0d
--- /dev/null
+++ b/Tests/RunCMake/Ninja/VerboseBuild-nowork-stdout.txt
@@ -0,0 +1 @@
+^ninja: no work to do
diff --git a/Tests/RunCMake/Ninja/VerboseBuild.cmake b/Tests/RunCMake/Ninja/VerboseBuild.cmake
new file mode 100644
index 0000000000..424e54eece
--- /dev/null
+++ b/Tests/RunCMake/Ninja/VerboseBuild.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+add_executable(hello hello.c)
+target_compile_definitions(hello PRIVATE "DEFINE_FOR_VERBOSE_DETECTION")
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/ParseImplicitIncludeInfo.cmake b/Tests/RunCMake/ParseImplicitIncludeInfo/ParseImplicitIncludeInfo.cmake
index 21d4df23ee..ce8d45b9a4 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/ParseImplicitIncludeInfo.cmake
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/ParseImplicitIncludeInfo.cmake
@@ -9,20 +9,32 @@ project(Minimal NONE)
# has special handling (it should not parse).
#
set(targets
- craype-C-Cray-8.7 craype-CXX-Cray-8.7
- craype-C-GNU-7.3.0 craype-CXX-GNU-7.3.0
+ aix-C-XL-13.1.3 aix-CXX-XL-13.1.3
+ craype-C-Cray-8.7 craype-CXX-Cray-8.7 craype-Fortran-Cray-8.7
+ 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
darwin-C-AppleClang-8.0.0.8000042 darwin-CXX-AppleClang-8.0.0.8000042
+ darwin_nostdinc-C-AppleClang-8.0.0.8000042
+ darwin_nostdinc-CXX-AppleClang-8.0.0.8000042
empty-C empty-CXX
- freebsd-C-Clang-3.3.0 freebsd-CXX-Clang-3.3.0
- linux-C-GNU-7.3.0 linux-CXX-GNU-7.3.0
+ freebsd-C-Clang-3.3.0 freebsd-CXX-Clang-3.3.0 freebsd-Fortran-GNU-4.6.4
+ linux-C-GNU-7.3.0 linux-CXX-GNU-7.3.0 linux-Fortran-GNU-7.3.0
linux-C-Intel-18.0.0.20170811 linux-CXX-Intel-18.0.0.20170811
+ linux-C-PGI-18.10.1 linux-CXX-PGI-18.10.1
+ linux-Fortran-PGI-18.10.1 linux_pgf77-Fortran-PGI-18.10.1
+ linux_nostdinc-C-PGI-18.10.1 linux_nostdinc-CXX-PGI-18.10.1
+ linux_nostdinc-Fortran-PGI-18.10.1
+ linux-C-XL-12.1.0 linux-CXX-XL-12.1.0 linux-Fortran-XL-14.1.0
+ linux_nostdinc-C-XL-12.1.0 linux_nostdinc-CXX-XL-12.1.0
+ linux_nostdinc_i-C-XL-12.1.0 linux_nostdinc-CXX-XL-12.1.0
+ linux-C-XL-16.1.0.0 linux-CXX-XL-16.1.0.0
linux-CUDA-NVIDIA-9.2.148
mingw.org-C-GNU-4.9.3 mingw.org-CXX-GNU-4.9.3
netbsd-C-GNU-4.8.5 netbsd-CXX-GNU-4.8.5
+ netbsd_nostdinc-C-GNU-4.8.5 netbsd_nostdinc-CXX-GNU-4.8.5
openbsd-C-Clang-5.0.1 openbsd-CXX-Clang-5.0.1
- #FIXME: The parser does not handle SunPro yet.
- #sunos-C-SunPro-5.13.0 sunos-CXX-SunPro-5.13.0
+ sunos-C-SunPro-5.13.0 sunos-CXX-SunPro-5.13.0 sunos-Fortran-SunPro-8.8.0
)
include(${CMAKE_ROOT}/Modules/CMakeParseImplicitIncludeInfo.cmake)
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/CMakeLists.txt b/Tests/RunCMake/ParseImplicitIncludeInfo/data/CMakeLists.txt
index fb4e57b0fe..b854e2ea2c 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/CMakeLists.txt
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/CMakeLists.txt
@@ -34,6 +34,8 @@ foreach(lang IN ITEMS ${LANGUAGES})
set(file ${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp)
elseif("${lang}" STREQUAL "CUDA")
set(file ${CMAKE_ROOT}/Modules/CMakeCUDACompilerABI.cu)
+ elseif("${lang}" STREQUAL "Fortran")
+ set(file ${CMAKE_ROOT}/Modules/CMakeFortranCompilerABI.F)
else()
message(FATAL_ERROR "unknown language ${lang}")
endif()
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/README b/Tests/RunCMake/ParseImplicitIncludeInfo/data/README
index 489c7872cd..4f19b3c234 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/README
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/README
@@ -5,8 +5,21 @@ directories parser for testing. For each configuration there is one
To generate ".input" files for a system, create a temporary build
directory and chdir to it. Then run cmake pointing to this directory.
The CMakeLists.txt file here will generate ".input" files in your
-build directory.
+build directory. The default set of languages is C and CXX. This
+can be changed with -DLANGUAGES=language_list. For example:
+-DLANGUAGES=Fortran will generate Fortran parser input.
The ".output" files should be generated by hand from the input files.
The test will compare the parser output to the manually generated
".output" file. The two should match.
+
+For compilers that support "-nostdinc"-like flags, you can generate
+a test for this with a command like:
+cmake -DUNAME=netbsd_nostdinc \
+ -DCMAKE_C_FLAGS=-nostdinc -DCMAKE_CXX_FLAGS=-nostdinc .
+
+Here is an example for testing the XL compiler with both -I and nostdinc:
+
+env CC=xlc CXX=xlC cmake -DUNAME=linux_nostdinc_i \
+ -DCMAKE_C_FLAGS='-qnostdinc -I/tmp/ii/test_c' \
+ -DCMAKE_CXX_FLAGS='-qnostdinc -I/tmp/ii/test_c -I/tmp/ii/test_cxx' .
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-C-XL-13.1.3.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-C-XL-13.1.3.input
new file mode 100644
index 0000000000..14517c5cb4
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-C-XL-13.1.3.input
@@ -0,0 +1,40 @@
+CMAKE_LANG=C
+CMAKE_C_COMPILER_ABI=
+CMAKE_C_COMPILER_AR=
+CMAKE_C_COMPILER_ARCHITECTURE_ID=
+CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_C_COMPILER_ID=XL
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=13.1.3
+CMAKE_C_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_424d1/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_424d1.dir/build.make CMakeFiles/cmTC_424d1.dir/build
+gmake[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building C object CMakeFiles/cmTC_424d1.dir/CMakeCCompilerABI.c.o
+/opt/IBM/xlc/13.1.3/bin/xlc -qthreaded -qhalt=e -V -o CMakeFiles/cmTC_424d1.dir/CMakeCCompilerABI.c.o -c /tmp/CMake/Modules/CMakeCCompilerABI.c
+export XL_CONFIG=/opt/IBM/xlc/13.1.3/etc/xlc.cfg.72:xlc
+export XL_ASMOBJFILES=/tmp/xlcASvf7aid
+export "XL_DIS=/opt/IBM/xlc/13.1.3/exe/dis -o "CMakeFiles/cmTC_424d1.dir/CMakeCCompilerABI.c.o" "CMakeCCompilerABI.o""
+/opt/IBM/xlc/13.1.3/exe/xlcentry -qosvar=aix.7.2 -qlanglvl=extc99 -qcpluscmt -qkeyword=inline -qalias=ansi -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX50 -D_AIX51 -D_AIX52 -D_AIX53 -D_AIX61 -D_AIX71 -D_AIX72 -D_IBMR2 -D_POWER -qthreaded -qhalt=e -qasm_as=/bin/as -qc_stdinc=/opt/IBM/xlc/13.1.3/include:/opt/IBM/xlmass/8.1.3/include:/usr/include -qvac_include_path=/opt/IBM/xlc/13.1.3/include -oCMakeFiles/cmTC_424d1.dir/CMakeCCompilerABI.c.o /tmp/CMake/Modules/CMakeCCompilerABI.c /tmp/xlcW0uR7aia /tmp/xlcW1uV7aib /dev/null /tmp/xlcLvj7aieF.lst /dev/null /tmp/xlcW2vb7aic
+export XL_BACKEND=/opt/IBM/xlc/13.1.3/exe/xlCcode
+export XL_LINKER=/bin/ld
+/opt/IBM/xlc/13.1.3/exe/xlCcode -qlanglvl=extc99 -qcpluscmt -qkeyword=inline -qalias=ansi -qthreaded -qhalt=e /tmp/xlcW0uR7aia /tmp/xlcW1uV7aib CMakeFiles/cmTC_424d1.dir/CMakeCCompilerABI.c.o /tmp/xlcLvj7aieB.lst /tmp/xlcW2vb7aic
+rm /tmp/xlcASvf7aid
+rm /tmp/xlcLvj7aie
+rm /tmp/xlcW0uR7aia
+rm /tmp/xlcW1uV7aib
+rm /tmp/xlcW2vb7aic
+Linking C executable cmTC_424d1
+/tmp/CMake/bin/cmake -E cmake_link_script CMakeFiles/cmTC_424d1.dir/link.txt --verbose=1
+/opt/IBM/xlc/13.1.3/bin/xlc -qthreaded -qhalt=e -Wl,-bnoipath -Wl,-brtl -V -Wl,-bexpall CMakeFiles/cmTC_424d1.dir/CMakeCCompilerABI.c.o -o cmTC_424d1 -Wl,-blibpath:/usr/lib:/lib
+export XL_CONFIG=/opt/IBM/xlc/13.1.3/etc/xlc.cfg.72:xlc
+/bin/ld -b32 /lib/crt0.o -bpT:0x10000000 -bpD:0x20000000 -bnoipath -brtl -bexpall CMakeFiles/cmTC_424d1.dir/CMakeCCompilerABI.c.o -o cmTC_424d1 -blibpath:/usr/lib:/lib -L/opt/IBM/xlmass/8.1.3/lib/aix61 -L/opt/IBM/xlc/13.1.3/lib -lxlopt -lxlipa -lxl -lc
+rm /tmp/xlcW0wn7aia
+rm /tmp/xlcW1wr7aib
+rm /tmp/xlcW2wz7aic
+gmake[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-C-XL-13.1.3.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-C-XL-13.1.3.output
new file mode 100644
index 0000000000..91b35ad15d
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-C-XL-13.1.3.output
@@ -0,0 +1 @@
+/opt/IBM/xlc/13.1.3/include;/opt/IBM/xlmass/8.1.3/include;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-CXX-XL-13.1.3.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-CXX-XL-13.1.3.input
new file mode 100644
index 0000000000..5aec849e14
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-CXX-XL-13.1.3.input
@@ -0,0 +1,44 @@
+CMAKE_LANG=CXX
+CMAKE_CXX_COMPILER_ABI=
+CMAKE_CXX_COMPILER_AR=
+CMAKE_CXX_COMPILER_ARCHITECTURE_ID=
+CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CXX_COMPILER_ID=XL
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=13.1.3
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_e8f3a/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_e8f3a.dir/build.make CMakeFiles/cmTC_e8f3a.dir/build
+gmake[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building CXX object CMakeFiles/cmTC_e8f3a.dir/CMakeCXXCompilerABI.cpp.o
+/opt/IBM/xlC/13.1.3/bin/xlC -+ -qthreaded -qhalt=s -V -o CMakeFiles/cmTC_e8f3a.dir/CMakeCXXCompilerABI.cpp.o -c /tmp/CMake/Modules/CMakeCXXCompilerABI.cpp
+export XL_CONFIG=/opt/IBM/xlc/13.1.3/etc/xlc.cfg.72:xlC
+export XL_XLCMP_PATH=/opt/IBM/xlc/13.1.3:/opt/IBM/xlC/13.1.3
+export XL_COMPILER=xlc++
+export XL_ASMOBJFILES=/tmp/xlcAS3F7aid
+export "XL_DIS=/opt/IBM/xlc/13.1.3/exe/dis -o "CMakeFiles/cmTC_e8f3a.dir/CMakeCXXCompilerABI.cpp.o" "CMakeCXXCompilerABI.o""
+/opt/IBM/xlC/13.1.3/exe/xlCentry -qosvar=aix.7.2 -qalias=ansi -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX50 -D_AIX51 -D_AIX52 -D_AIX53 -D_AIX61 -D_AIX71 -D_AIX72 -D_IBMR2 -D_POWER -qthreaded -qhalt=s -qasm_as=/bin/as -qcpp_stdinc=/opt/IBM/xlC/13.1.3/include:/opt/IBM/xlmass/8.1.3/include:/usr/include -qc_stdinc=/opt/IBM/xlc/13.1.3/include:/opt/IBM/xlmass/8.1.3/include:/usr/include -oCMakeFiles/cmTC_e8f3a.dir/CMakeCXXCompilerABI.cpp.o /tmp/CMake/Modules/CMakeCXXCompilerABI.cpp /tmp/xlcW03r7aia /tmp/xlcW1347aib /dev/null /tmp/xlcL3J7aieF.lst /dev/null /tmp/xlcW2387aic
+export XL_BACKEND=/opt/IBM/xlc/13.1.3/exe/xlCcode
+export XL_LINKER=/bin/ld
+/opt/IBM/xlc/13.1.3/exe/xlCcode -qalias=ansi -qthreaded -qhalt=s /tmp/xlcW03r7aia /tmp/xlcW1347aib CMakeFiles/cmTC_e8f3a.dir/CMakeCXXCompilerABI.cpp.o /tmp/xlcL3J7aieB.lst /tmp/xlcW2387aic
+rm /tmp/xlcAS3F7aid
+rm /tmp/xlcL3J7aie
+rm /tmp/xlcW03r7aia
+rm /tmp/xlcW1347aib
+rm /tmp/xlcW2387aic
+Linking CXX executable cmTC_e8f3a
+/tmp/CMake/bin/cmake -E cmake_link_script CMakeFiles/cmTC_e8f3a.dir/link.txt --verbose=1
+/opt/IBM/xlC/13.1.3/bin/xlC -qthreaded -qhalt=s -Wl,-bnoipath -Wl,-brtl -V -Wl,-bexpall CMakeFiles/cmTC_e8f3a.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_e8f3a -Wl,-blibpath:/usr/lib:/lib
+export XL_CONFIG=/opt/IBM/xlc/13.1.3/etc/xlc.cfg.72:xlC
+/bin/ld -b32 /lib/crt0.o /lib/crti.o -bpT:0x10000000 -bpD:0x20000000 -bnoipath -brtl -bexpall CMakeFiles/cmTC_e8f3a.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_e8f3a -blibpath:/usr/lib:/lib -bcdtors:all:0:s -btmplrename -L/opt/IBM/xlmass/8.1.3/lib/aix61 -L/opt/IBM/xlc/13.1.3/lib -lxlopt -lxlipa -lxl -L/opt/IBM/xlC/13.1.3/lib -lC -lm -lc |
+/opt/IBM/xlC/13.1.3/bin/c++filt -S |
+/bin/sed '/317.*::virtual-fn-table-ptr$/ s/^\(.*: \)*{*\([^}]*\)\(}*.*\)::virtual-fn-table-ptr$/\1Virtual table for class "\2": Some possible causes are: first non-inline virtual function in "\2" is not defined or the class is a template instantiation and an explicit instantiation definition of the class is missing./'
+rm /tmp/xlcW04Jtaea
+rm /tmp/xlcW14Vtaeb
+rm /tmp/xlcW24Vtaec
+gmake[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-CXX-XL-13.1.3.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-CXX-XL-13.1.3.output
new file mode 100644
index 0000000000..264e4fe3b9
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-CXX-XL-13.1.3.output
@@ -0,0 +1 @@
+/opt/IBM/xlC/13.1.3/include;/opt/IBM/xlmass/8.1.3/include;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-8.7.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-8.7.input
new file mode 100644
index 0000000000..4c4e2f4834
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-8.7.input
@@ -0,0 +1,52 @@
+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=8.7
+CMAKE_Fortran_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_9c3ab/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_9c3ab.dir/build.make CMakeFiles/cmTC_9c3ab.dir/build
+gmake[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building Fortran object CMakeFiles/cmTC_9c3ab.dir/CMakeFortranCompilerABI.F.o
+/opt/cray/pe/craype/2.5.15/bin/ftn -em -J. -v -c /usr/projects/hpcsoft/cle6.0/common/cmake/3.10.2/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F -o CMakeFiles/cmTC_9c3ab.dir/CMakeFortranCompilerABI.F.o
+
+/opt/cray/pe/cce/8.7.4/cce/x86_64/bin/ftnfe -h cpu=haswell -D__CRAYXC -D__CRAY_HASWELL -D__CRAYXT_COMPUTE_LINUX_TARGET -h network=aries -em -J. -I/opt/cray/pe/cce/8.7.4/cce/x86_64/include/craylibs -I/usr/include -I/usr/include -I/opt/cray/pe/libsci/18.07.1/CRAY/8.6/x86_64/include -I/opt/cray/pe/mpt/7.7.3/gni/mpich-cray/8.6/include -I/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include -I/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include -I/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include -I/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include -I/opt/cray/dmapp/7.1.1-6.0.5.0_49.8__g1125556.ari/include -I/opt/cray/pe/pmi/5.0.14/include -I/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include -I/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include -I/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include -I/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include -I/opt/cray-hss-devel/8.0.0/include -hpl=/tmp/pe_32428//pldir -usystem_mod=/opt/cray/pe/cce/8.7.4/cce/x86_64/lib/libmodules.a -usystem_mod=/opt/cray/pe/cce/8.7.4/cce/x86_64/lib/libomp.a -usystem_mod=/opt/cray/pe/cce/8.7.4/cce/x86_64/lib/omp_lib.a -usystem_mod=/opt/cray/pe/cce/8.7.4/cce/x86_64/lib/libopenacc.a -usystem_mod=/opt/cray/pe/libsci/18.07.1/CRAY/8.6/x86_64/include -usystem_mod=/opt/cray/pe/mpt/7.7.3/gni/mpich-cray/8.6/include -usystem_mod=/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include -usystem_mod=/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include -usystem_mod=/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include -usystem_mod=/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include -usystem_mod=/opt/cray/dmapp/7.1.1-6.0.5.0_49.8__g1125556.ari/include -usystem_mod=/opt/cray/pe/pmi/5.0.14/include -usystem_mod=/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include -usystem_mod=/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include -usystem_mod=/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include -usystem_mod=/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include -usystem_mod=/opt/cray-hss-devel/8.0.0/include -ux=x8503 -udv=87000 -ffixed -CZ/tmp/pe_32428/CMakeFortranCompilerABI.T -Cx -CX/tmp/pe_32428/CMakeFortranCompilerABI.xml -hdecompile=/tmp/ii/CMakeFiles/CMakeTmp/CMakeFiles/cmTC_9c3ab.dir/CMakeFortranCompilerABI. -S /tmp/pe_32428/CMakeFortranCompilerABI_1.s -Oipa3 -uo=/tmp/ii/CMakeFiles/CMakeTmp/CMakeFiles/cmTC_9c3ab.dir/CMakeFortranCompilerABI.F.o -ufile_id=1 /usr/projects/hpcsoft/cle6.0/common/cmake/3.10.2/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F
+
+/opt/cray/pe/cce/8.7.4/cce/x86_64/bin/optcg /tmp/pe_32428//pldir 1
+
+/opt/cray/pe/cce/8.7.4/binutils/x86_64/x86_64-pc-linux-gnu/bin/as -o CMakeFiles/cmTC_9c3ab.dir/CMakeFortranCompilerABI.F.o --64 /tmp/pe_32428/CMakeFortranCompilerABI_1.s
+rm /tmp/pe_32428/CMakeFortranCompilerABI_1.s
+rm /tmp/pe_32428//pldir/PL_path
+rm /tmp/pe_32428//pldir/iline_1
+rm /tmp/pe_32428//pldir/gline_1
+rm /tmp/pe_32428//pldir/PL_global_data
+rm /tmp/pe_32428//pldir/PL_module_list
+rm /tmp/pe_32428//pldir/CMakeFortranCompilerABI_1.inl
+rmdir /tmp/pe_32428//pldir
+rm /tmp/pe_32428//CMakeFortranCompilerABI_1.xml.Ttmp
+rm /tmp/pe_32428//CMakeFortranCompilerABI.T
+rm /tmp/pe_32428//CMakeFortranCompilerABI_1.cif.Ttmp
+rm /tmp/pe_32428//CMakeFortranCompilerABI.Tfe
+rm /tmp/pe_32428//CMakeFortranCompilerABI.xml
+rmdir /tmp/pe_32428/
+Linking Fortran executable cmTC_9c3ab
+/usr/projects/hpcsoft/cle6.0/common/cmake/3.10.2/bin/cmake -E cmake_link_script CMakeFiles/cmTC_9c3ab.dir/link.txt --verbose=1
+/opt/cray/pe/craype/2.5.15/bin/ftn -v -dynamic CMakeFiles/cmTC_9c3ab.dir/CMakeFortranCompilerABI.F.o -o cmTC_9c3ab
+
+/opt/cray/pe/cce/8.7.4/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/6.1.0/snos/lib/gcc/x86_64-suse-linux/6.1.0//crtbegin.o /opt/gcc/6.1.0/snos/lib/gcc/x86_64-suse-linux/6.1.0//crtfastmath.o /opt/cray/pe/cce/8.7.4/cce/x86_64/lib/no_mmap.o CMakeFiles/cmTC_9c3ab.dir/CMakeFortranCompilerABI.F.o -Bdynamic -rpath=/opt/cray/pe/cce/8.7.4/cce/x86_64/lib -L/opt/gcc/6.1.0/snos/lib64 -rpath=/opt/cray/pe/gcc-libs -L/opt/cray/pe/libsci/18.07.1/CRAY/8.6/x86_64/lib -L/opt/cray/dmapp/default/lib64 -L/opt/cray/pe/mpt/7.7.3/gni/mpich-cray/8.6/lib -L/opt/cray/dmapp/default/lib64 -L/opt/cray/pe/mpt/7.7.3/gni/mpich-cray/8.6/lib -L/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/lib64 -L/opt/cray/pe/atp/2.1.3/libApp -L/opt/cray/pe/cce/8.7.4/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 -lsci_cray_mpi_mp --no-as-needed --as-needed -lsci_cray_mp --no-as-needed --as-needed -lmpich_cray --no-as-needed --as-needed -lmpichf90_cray --no-as-needed --as-needed -lpgas-dmapp --no-as-needed -lquadmath -lomp -lcraymp -lmodules -lfi -lcraymath -lf -lu -lcsup --as-needed -latomic --no-as-needed --as-needed -lgfortran --no-as-needed --whole-archive -ltcmalloc_minimal --no-whole-archive -lstdc++ -lpthread --start-group -lc -lcsup -lgcc_eh -lm -lgcc --end-group -L /opt/gcc/6.1.0/snos/lib/gcc/x86_64-suse-linux/6.1.0 -L /opt/cray/pe/cce/8.7.4/binutils/x86_64/x86_64-pc-linux-gnu/..//x86_64-unknown-linux-gnu/lib -EL -o cmTC_9c3ab /opt/gcc/6.1.0/snos/lib/gcc/x86_64-suse-linux/6.1.0//crtend.o /usr/lib64//crtn.o
+
+/opt/cray/pe/cce/8.7.4/binutils/x86_64/bin/objcopy --remove-section=.note.ftn_module_data cmTC_9c3ab
+rm /tmp/pe_32450//pldir/PL_path
+rm /tmp/pe_32450//pldir/PL_global_data
+rm /tmp/pe_32450//pldir/PL_module_list
+rmdir /tmp/pe_32450//pldir
+rmdir /tmp/pe_32450/
+gmake[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-8.7.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-8.7.output
new file mode 100644
index 0000000000..d57439c66e
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-8.7.output
@@ -0,0 +1 @@
+/opt/cray/pe/cce/8.7.4/cce/x86_64/include/craylibs;/usr/include;/usr/include;/opt/cray/pe/libsci/18.07.1/CRAY/8.6/x86_64/include;/opt/cray/pe/mpt/7.7.3/gni/mpich-cray/8.6/include;/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include;/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include;/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include;/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include;/opt/cray/dmapp/7.1.1-6.0.5.0_49.8__g1125556.ari/include;/opt/cray/pe/pmi/5.0.14/include;/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include;/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include;/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include;/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include;/opt/cray-hss-devel/8.0.0/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-GNU-7.3.0.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-GNU-7.3.0.input
new file mode 100644
index 0000000000..bee298c378
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-GNU-7.3.0.input
@@ -0,0 +1,83 @@
+CMAKE_LANG=Fortran
+CMAKE_Fortran_COMPILER_ABI=
+CMAKE_Fortran_COMPILER_AR=/usr/bin/gcc-ar
+CMAKE_Fortran_COMPILER_ARCHITECTURE_ID=
+CMAKE_Fortran_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_Fortran_COMPILER_ID=GNU
+CMAKE_Fortran_COMPILER_LAUNCHER=
+CMAKE_Fortran_COMPILER_LOADED=1
+CMAKE_Fortran_COMPILER_RANLIB=/usr/bin/gcc-ranlib
+CMAKE_Fortran_COMPILER_TARGET=
+CMAKE_Fortran_COMPILER_VERSION=7.3.0
+CMAKE_Fortran_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_390ef/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_390ef.dir/build.make CMakeFiles/cmTC_390ef.dir/build
+gmake[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building Fortran object CMakeFiles/cmTC_390ef.dir/CMakeFortranCompilerABI.F.o
+/opt/cray/pe/craype/2.5.15/bin/ftn -v -c /usr/projects/hpcsoft/cle6.0/common/cmake/3.10.2/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F -o CMakeFiles/cmTC_390ef.dir/CMakeFortranCompilerABI.F.o
+Using built-in specs.
+COLLECT_GCC=/opt/gcc/7.3.0/bin/../snos/bin/gfortran
+Target: x86_64-suse-linux
+Configured with: ../cray-gcc-7.3.0-201801270210.d61239fc6000b/configure --prefix=/opt/gcc/7.3.0/snos --disable-nls --libdir=/opt/gcc/7.3.0/snos/lib --enable-languages=c,c++,fortran --with-gxx-include-dir=/opt/gcc/7.3.0/snos/include/g++ --with-slibdir=/opt/gcc/7.3.0/snos/lib --with-system-zlib --enable-shared --enable-__cxa_atexit --build=x86_64-suse-linux --with-ppl --with-cloog --disable-multilib
+Thread model: posix
+gcc version 7.3.0 20180125 (Cray Inc.) (GCC)
+COLLECT_GCC_OPTIONS='-march=core-avx2' '-D' '__CRAYXC' '-D' '__CRAY_HASWELL' '-D' '__CRAYXT_COMPUTE_LINUX_TARGET' '-D' '__TARGET_LINUX__' '-v' '-c' '-o' 'CMakeFiles/cmTC_390ef.dir/CMakeFortranCompilerABI.F.o' '-I' '/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include' '-I' '/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include' '-I' '/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include' '-I' '/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include' '-I' '/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include' '-I' '/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include' '-I' '/opt/cray/pe/pmi/5.0.14/include' '-I' '/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include' '-I' '/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include' '-I' '/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include' '-I' '/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include' '-I' '/opt/cray-hss-devel/8.0.0/include'
+ /opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/f951 /usr/projects/hpcsoft/cle6.0/common/cmake/3.10.2/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F -ffixed-form -cpp=/tmp/ccxLli6i.f90 -quiet -v -I /opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include -I /opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include -I /opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include -I /opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include -I /opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include -I /opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include -I /opt/cray/pe/pmi/5.0.14/include -I /opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include -I /opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include -I /opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include -I /opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include -I /opt/cray-hss-devel/8.0.0/include -D __CRAYXC -D __CRAY_HASWELL -D __CRAYXT_COMPUTE_LINUX_TARGET -D __TARGET_LINUX__ /usr/projects/hpcsoft/cle6.0/common/cmake/3.10.2/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F -quiet -dumpbase CMakeFortranCompilerABI.F -march=core-avx2 -auxbase-strip CMakeFiles/cmTC_390ef.dir/CMakeFortranCompilerABI.F.o -version -fintrinsic-modules-path /opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/finclude -o /tmp/ccqY0cGk.s
+GNU Fortran (GCC) version 7.3.0 20180125 (Cray Inc.) (x86_64-suse-linux)
+ compiled by GNU C version 7.3.0 20180125 (Cray Inc.), GMP version 6.0.0, MPFR version 3.1.3, MPC version 1.0.3, isl version isl-0.15-GMP
+
+GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
+ignoring nonexistent directory "/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/../../../../x86_64-suse-linux/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ /opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include
+ /opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include
+ /opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include
+ /opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include
+ /opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include
+ /opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include
+ /opt/cray/pe/pmi/5.0.14/include
+ /opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include
+ /opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include
+ /opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include
+ /opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include
+ /opt/cray-hss-devel/8.0.0/include
+ /opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/finclude
+ /opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/include
+ /usr/local/include
+ /opt/gcc/7.3.0/snos/include
+ /opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/include-fixed
+ /usr/include
+End of search list.
+GNU Fortran2008 (GCC) version 7.3.0 20180125 (Cray Inc.) (x86_64-suse-linux)
+ compiled by GNU C version 7.3.0 20180125 (Cray Inc.), GMP version 6.0.0, MPFR version 3.1.3, MPC version 1.0.3, isl version isl-0.15-GMP
+
+GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
+COLLECT_GCC_OPTIONS='-march=core-avx2' '-D' '__CRAYXC' '-D' '__CRAY_HASWELL' '-D' '__CRAYXT_COMPUTE_LINUX_TARGET' '-D' '__TARGET_LINUX__' '-v' '-c' '-o' 'CMakeFiles/cmTC_390ef.dir/CMakeFortranCompilerABI.F.o' '-I' '/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include' '-I' '/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include' '-I' '/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include' '-I' '/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include' '-I' '/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include' '-I' '/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include' '-I' '/opt/cray/pe/pmi/5.0.14/include' '-I' '/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include' '-I' '/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include' '-I' '/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include' '-I' '/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include' '-I' '/opt/cray-hss-devel/8.0.0/include'
+ as -v -I /opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include -I /opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include -I /opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include -I /opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include -I /opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include -I /opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include -I /opt/cray/pe/pmi/5.0.14/include -I /opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include -I /opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include -I /opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include -I /opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include -I /opt/cray-hss-devel/8.0.0/include --64 -o CMakeFiles/cmTC_390ef.dir/CMakeFortranCompilerABI.F.o /tmp/ccqY0cGk.s
+GNU assembler version 2.31.1 (x86_64-suse-linux) using BFD version (GNU Binutils SUSE Linux Enterprise 12) 2.31.1.20180828-9.26
+COMPILER_PATH=/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/:/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/
+LIBRARY_PATH=/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/../../../:/lib/:/usr/lib/
+COLLECT_GCC_OPTIONS='-march=core-avx2' '-D' '__CRAYXC' '-D' '__CRAY_HASWELL' '-D' '__CRAYXT_COMPUTE_LINUX_TARGET' '-D' '__TARGET_LINUX__' '-v' '-c' '-o' 'CMakeFiles/cmTC_390ef.dir/CMakeFortranCompilerABI.F.o' '-I' '/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include' '-I' '/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include' '-I' '/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include' '-I' '/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include' '-I' '/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include' '-I' '/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include' '-I' '/opt/cray/pe/pmi/5.0.14/include' '-I' '/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include' '-I' '/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include' '-I' '/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include' '-I' '/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include' '-I' '/opt/cray-hss-devel/8.0.0/include'
+Linking Fortran executable cmTC_390ef
+/usr/projects/hpcsoft/cle6.0/common/cmake/3.10.2/bin/cmake -E cmake_link_script CMakeFiles/cmTC_390ef.dir/link.txt --verbose=1
+/opt/cray/pe/craype/2.5.15/bin/ftn -v -dynamic CMakeFiles/cmTC_390ef.dir/CMakeFortranCompilerABI.F.o -o cmTC_390ef
+Driving: /opt/gcc/7.3.0/bin/../snos/bin/gfortran -march=core-avx2 -D__CRAYXC -D__CRAY_HASWELL -D__CRAYXT_COMPUTE_LINUX_TARGET -D__TARGET_LINUX__ -v CMakeFiles/cmTC_390ef.dir/CMakeFortranCompilerABI.F.o -o cmTC_390ef -Wl,-rpath=/opt/cray/pe/gcc-libs -Wl,-Bdynamic -I/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include -I/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include -I/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include -I/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include -I/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include -I/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include -I/opt/cray/pe/pmi/5.0.14/include -I/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include -I/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include -I/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include -I/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include -I/opt/cray-hss-devel/8.0.0/include -L/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/lib -L/opt/cray/dmapp/default/lib64 -L/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/lib -L/opt/cray/dmapp/default/lib64 -L/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/lib -L/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/lib64 -L/opt/cray/pe/atp/2.1.3/libApp -Wl,--no-as-needed,-lAtpSigHandler,-lAtpSigHCommData -Wl,--undefined=_ATP_Data_Globals -Wl,--undefined=__atpHandlerInstall -lrca -Wl,--as-needed,-lsci_gnu_71_mpi,--no-as-needed -Wl,--as-needed,-lsci_gnu_71,--no-as-needed -Wl,--as-needed,-lmpich_gnu_71,--no-as-needed -Wl,--as-needed,-lmpichf90_gnu_71,--no-as-needed -Wl,--as-needed,-lgfortran,-lquadmath,--no-as-needed -Wl,--as-needed,-lpthread,--no-as-needed -l gfortran -l m -shared-libgcc
+Using built-in specs.
+COLLECT_GCC=/opt/gcc/7.3.0/bin/../snos/bin/gfortran
+COLLECT_LTO_WRAPPER=/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/lto-wrapper
+Target: x86_64-suse-linux
+Configured with: ../cray-gcc-7.3.0-201801270210.d61239fc6000b/configure --prefix=/opt/gcc/7.3.0/snos --disable-nls --libdir=/opt/gcc/7.3.0/snos/lib --enable-languages=c,c++,fortran --with-gxx-include-dir=/opt/gcc/7.3.0/snos/include/g++ --with-slibdir=/opt/gcc/7.3.0/snos/lib --with-system-zlib --enable-shared --enable-__cxa_atexit --build=x86_64-suse-linux --with-ppl --with-cloog --disable-multilib
+Thread model: posix
+gcc version 7.3.0 20180125 (Cray Inc.) (GCC)
+Reading specs from /opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/../../../../lib64/libgfortran.spec
+rename spec lib to liborig
+COLLECT_GCC_OPTIONS='-march=core-avx2' '-D' '__CRAYXC' '-D' '__CRAY_HASWELL' '-D' '__CRAYXT_COMPUTE_LINUX_TARGET' '-D' '__TARGET_LINUX__' '-v' '-o' 'cmTC_390ef' '-I' '/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include' '-I' '/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include' '-I' '/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include' '-I' '/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include' '-I' '/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include' '-I' '/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include' '-I' '/opt/cray/pe/pmi/5.0.14/include' '-I' '/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include' '-I' '/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include' '-I' '/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include' '-I' '/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include' '-I' '/opt/cray-hss-devel/8.0.0/include' '-L/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/lib' '-L/opt/cray/dmapp/default/lib64' '-L/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/lib' '-L/opt/cray/dmapp/default/lib64' '-L/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/lib' '-L/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/lib64' '-L/opt/cray/pe/atp/2.1.3/libApp' '-shared-libgcc'
+COMPILER_PATH=/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/:/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/
+LIBRARY_PATH=/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/../../../:/lib/:/usr/lib/
+COLLECT_GCC_OPTIONS='-march=core-avx2' '-D' '__CRAYXC' '-D' '__CRAY_HASWELL' '-D' '__CRAYXT_COMPUTE_LINUX_TARGET' '-D' '__TARGET_LINUX__' '-v' '-o' 'cmTC_390ef' '-I' '/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include' '-I' '/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include' '-I' '/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include' '-I' '/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include' '-I' '/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include' '-I' '/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include' '-I' '/opt/cray/pe/pmi/5.0.14/include' '-I' '/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include' '-I' '/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include' '-I' '/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include' '-I' '/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include' '-I' '/opt/cray-hss-devel/8.0.0/include' '-L/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/lib' '-L/opt/cray/dmapp/default/lib64' '-L/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/lib' '-L/opt/cray/dmapp/default/lib64' '-L/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/lib' '-L/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/lib64' '-L/opt/cray/pe/atp/2.1.3/libApp' '-shared-libgcc'
+ /opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/collect2 -plugin /opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/liblto_plugin.so -plugin-opt=/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/lto-wrapper -plugin-opt=-fresolution=/tmp/cc1AyzSl.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lquadmath -plugin-opt=-pass-through=-lm -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o cmTC_390ef /usr/lib/../lib64/crt1.o /usr/lib/../lib64/crti.o /opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/crtbegin.o -L/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/lib -L/opt/cray/dmapp/default/lib64 -L/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/lib -L/opt/cray/dmapp/default/lib64 -L/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/lib -L/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/lib64 -L/opt/cray/pe/atp/2.1.3/libApp -L/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0 -L/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/../../.. CMakeFiles/cmTC_390ef.dir/CMakeFortranCompilerABI.F.o -rpath=/opt/cray/pe/gcc-libs -Bdynamic --no-as-needed -lAtpSigHandler -lAtpSigHCommData --undefined=_ATP_Data_Globals --undefined=__atpHandlerInstall -lrca --as-needed -lsci_gnu_71_mpi --no-as-needed --as-needed -lsci_gnu_71 --no-as-needed --as-needed -lmpich_gnu_71 --no-as-needed --as-needed -lmpichf90_gnu_71 --no-as-needed --as-needed -lgfortran -lquadmath --no-as-needed --as-needed -lpthread --no-as-needed -lgfortran -lm -lgcc_s -lgcc -lquadmath -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/crtend.o /usr/lib/../lib64/crtn.o
+COLLECT_GCC_OPTIONS='-march=core-avx2' '-D' '__CRAYXC' '-D' '__CRAY_HASWELL' '-D' '__CRAYXT_COMPUTE_LINUX_TARGET' '-D' '__TARGET_LINUX__' '-v' '-o' 'cmTC_390ef' '-I' '/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include' '-I' '/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include' '-I' '/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include' '-I' '/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include' '-I' '/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include' '-I' '/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include' '-I' '/opt/cray/pe/pmi/5.0.14/include' '-I' '/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include' '-I' '/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include' '-I' '/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include' '-I' '/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include' '-I' '/opt/cray-hss-devel/8.0.0/include' '-L/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/lib' '-L/opt/cray/dmapp/default/lib64' '-L/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/lib' '-L/opt/cray/dmapp/default/lib64' '-L/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/lib' '-L/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/lib64' '-L/opt/cray/pe/atp/2.1.3/libApp' '-shared-libgcc'
+gmake[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-GNU-7.3.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-GNU-7.3.0.output
new file mode 100644
index 0000000000..5b96c9d083
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-GNU-7.3.0.output
@@ -0,0 +1 @@
+/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include;/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include;/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include;/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include;/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include;/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include;/opt/cray/pe/pmi/5.0.14/include;/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include;/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include;/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include;/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include;/opt/cray-hss-devel/8.0.0/include;/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/finclude;/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/include;/usr/local/include;/opt/gcc/7.3.0/snos/include;/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/include-fixed;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Intel-18.0.2.20180210.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Intel-18.0.2.20180210.input
new file mode 100644
index 0000000000..4cdff74ec0
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Intel-18.0.2.20180210.input
@@ -0,0 +1,80 @@
+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=Intel
+CMAKE_Fortran_COMPILER_LAUNCHER=
+CMAKE_Fortran_COMPILER_LOADED=1
+CMAKE_Fortran_COMPILER_RANLIB=
+CMAKE_Fortran_COMPILER_TARGET=
+CMAKE_Fortran_COMPILER_VERSION=18.0.2.20180210
+CMAKE_Fortran_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_7523d/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_7523d.dir/build.make CMakeFiles/cmTC_7523d.dir/build
+gmake[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building Fortran object CMakeFiles/cmTC_7523d.dir/CMakeFortranCompilerABI.F.o
+/opt/cray/pe/craype/2.5.15/bin/ftn -v -c /usr/share/cmake/Modules/CMakeFortranCompilerABI.F -o CMakeFiles/cmTC_7523d.dir/CMakeFortranCompilerABI.F.o
+ifort version 18.0.2
+/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/bin/intel64/fpp -D__INTEL_COMPILER=1800 -D__INTEL_COMPILER_UPDATE=2 -D__unix__ -D__unix -D__linux__ -D__linux -D__gnu_linux__ -Dunix -Dlinux -D__ELF__ -D__x86_64 -D__x86_64__ -D__amd64 -D__amd64__ -D__INTEL_COMPILER_BUILD_DATE=20180210 -D__INTEL_OFFLOAD -D__pentium4 -D__pentium4__ -D__tune_pentium4__ -D__SSE2__ -D__SSE2_MATH__ -D__SSE3__ -D__SSSE3__ -D__SSE4_1__ -D__SSE4_2__ -D__SSE__ -D__SSE_MATH__ -D__MMX__ -D__AVX__ -D__AVX_I__ -D__AVX2__ -D__FMA__ -D__CRAYXC -D__CRAY_HASWELL -D__CRAYXT_COMPUTE_LINUX_TARGET -I. -I/opt/cray/pe/libsci/18.07.1/INTEL/16.0/x86_64/include -I/opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/include -I/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include -I/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include -I/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include -I/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include -I/opt/cray/pe/pmi/5.0.14/include -I/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include -I/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include -I/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include -I/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include -I/opt/cray-hss-devel/8.0.0/include -I/opt/intel/2018.2.199/compilers_and_libraries_2018/linux/mkl/include -I/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include/intel64 -I/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include/icc -I/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include -I/usr/local/include -I/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/include -I/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/include-fixed -I/opt/gcc/6.3.0/snos/include/ -I/usr/include -fixed -4Ycpp -4Ncvf -f_com=yes -MX /usr/share/cmake/Modules/CMakeFortranCompilerABI.F /tmp/ifortjocHCJ.i
+#include "..." search starts here:
+#include <...> search starts here:
+ .
+ /opt/cray/pe/libsci/18.07.1/INTEL/16.0/x86_64/include
+ /opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/include
+ /opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include
+ /opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include
+ /opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include
+ /opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include
+ /opt/cray/pe/pmi/5.0.14/include
+ /opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include
+ /opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include
+ /opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include
+ /opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include
+ /opt/cray-hss-devel/8.0.0/include
+ /opt/intel/2018.2.199/compilers_and_libraries_2018/linux/mkl/include
+ /opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include/intel64
+ /opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include/icc
+ /opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include
+ /usr/local/include
+ /opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/include
+ /opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/include-fixed
+ /opt/gcc/6.3.0/snos/include/
+ /usr/include
+End of search list.
+/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/bin/intel64/fortcom -D__INTEL_COMPILER=1800 -D__INTEL_COMPILER_UPDATE=2 -D__unix__ -D__unix -D__linux__ -D__linux -D__gnu_linux__ -Dunix -Dlinux -D__ELF__ -D__x86_64 -D__x86_64__ -D__amd64 -D__amd64__ -D__INTEL_COMPILER_BUILD_DATE=20180210 -D__INTEL_OFFLOAD -D__pentium4 -D__pentium4__ -D__tune_pentium4__ -D__SSE2__ -D__SSE2_MATH__ -D__SSE3__ -D__SSSE3__ -D__SSE4_1__ -D__SSE4_2__ -D__SSE__ -D__SSE_MATH__ -D__MMX__ -D__AVX__ -D__AVX_I__ -D__AVX2__ -D__FMA__ -mGLOB_pack_sort_init_list -I/usr/share/cmake/Modules -I. -I/opt/cray/pe/libsci/18.07.1/INTEL/16.0/x86_64/include -I/opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/include -I/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include -I/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include -I/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include -I/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include -I/opt/cray/pe/pmi/5.0.14/include -I/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include -I/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include -I/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include -I/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include -I/opt/cray-hss-devel/8.0.0/include -I/opt/intel/2018.2.199/compilers_and_libraries_2018/linux/mkl/include -I/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include/intel64 -I/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include/icc -I/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include -I/usr/local/include -I/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/include -I/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/include-fixed -I/opt/gcc/6.3.0/snos/include/ -I/usr/include -D__CRAYXC -D__CRAY_HASWELL -D__CRAYXT_COMPUTE_LINUX_TARGET -O2 "-reentrancy none" -simd -offload_host -mGLOB_em64t=TRUE -mP1OPT_version=18.0-intel64 -mGLOB_diag_file=CMakeFiles/cmTC_7523d.dir/CMakeFortranCompilerABI.F.diag -mGLOB_long_size_64 -mGLOB_routine_pointer_size_64 -mGLOB_source_language=GLOB_SOURCE_LANGUAGE_F90 -mP2OPT_static_promotion -mP1OPT_print_version=FALSE -mCG_use_gas_got_workaround=F -mP2OPT_align_option_used=TRUE -mGLOB_gcc_version=630 "-mGLOB_options_string=-I/opt/cray/pe/libsci/18.07.1/INTEL/16.0/x86_64/include -I/opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/include -I/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include -I/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include -I/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include -I/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include -I/opt/cray/pe/pmi/5.0.14/include -I/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include -I/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include -I/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include -I/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include -I/opt/cray-hss-devel/8.0.0/include -xCORE-AVX2 -static -D__CRAYXC -D__CRAY_HASWELL -D__CRAYXT_COMPUTE_LINUX_TARGET -v -c -o CMakeFiles/cmTC_7523d.dir/CMakeFortranCompilerABI.F.o" -mGLOB_cxx_limited_range=FALSE -mCG_extend_parms=FALSE -mGLOB_compiler_bin_directory=/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/bin/intel64 -mGLOB_as_output_backup_file_name=/tmp/ifortYH2Bi3as_.s -mIPOPT_activate -mIPOPT_lite -mGLOB_instruction_tuning=0x0 -mGLOB_uarch_tuning=0x0 -mGLOB_product_id_code=0x22006d90 -mCG_bnl_movbe=T -mGLOB_extended_instructions=0x4000 -mGLOB_advanced_optim=TRUE -mP3OPT_use_mspp_call_convention -mP2OPT_subs_out_of_bound=FALSE -mP2OPT_disam_type_based_disam=2 -mGLOB_ansi_alias -mPGOPTI_value_profile_use=T -mP2OPT_il0_array_sections=TRUE -mGLOB_offload_mode=1 -mP2OPT_offload_unique_var_string=ifort0690104118gDFZUy -mP2OPT_hlo_level=2 -mP2OPT_hlo -mP2OPT_hpo_rtt_control=0 -mIPOPT_args_in_regs=0 -mP2OPT_disam_assume_nonstd_intent_in=FALSE -mGLOB_imf_mapping_library=/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/bin/intel64/libiml_attr.so -mPGOPTI_gen_threadsafe_level=0 -mIPOPT_lto_object_enabled -mIPOPT_lto_object_value=1 -mIPOPT_obj_output_file_name=CMakeFiles/cmTC_7523d.dir/CMakeFortranCompilerABI.F.o -mIPOPT_whole_archive_fixup_file_name=/tmp/ifortwarch8cLx6A -mGLOB_linker_version=2.31.1.20180828 -mGLOB_driver_tempfile_name=/tmp/iforttempfiledtmF0m -mP3OPT_asm_target=P3OPT_ASM_TARGET_GAS -mGLOB_async_unwind_tables=TRUE -mGLOB_obj_output_file=CMakeFiles/cmTC_7523d.dir/CMakeFortranCompilerABI.F.o -mGLOB_source_dialect=GLOB_SOURCE_DIALECT_FORTRAN -mP1OPT_source_file_name=/usr/share/cmake/Modules/CMakeFortranCompilerABI.F -mP1OPT_full_source_file_name=/usr/share/cmake/Modules/CMakeFortranCompilerABI.F -mP2OPT_symtab_type_copy=true /tmp/ifortjocHCJ.i
+#include "..." search starts here:
+#include <...> search starts here:
+ /usr/share/cmake/Modules
+ .
+ /opt/cray/pe/libsci/18.07.1/INTEL/16.0/x86_64/include
+ /opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/include
+ /opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include
+ /opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include
+ /opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include
+ /opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include
+ /opt/cray/pe/pmi/5.0.14/include
+ /opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include
+ /opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include
+ /opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include
+ /opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include
+ /opt/cray-hss-devel/8.0.0/include
+ /opt/intel/2018.2.199/compilers_and_libraries_2018/linux/mkl/include
+ /opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include/intel64
+ /opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include/icc
+ /opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include
+ /usr/local/include
+ /opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/include
+ /opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/include-fixed
+ /opt/gcc/6.3.0/snos/include/
+ /usr/include
+End of search list.
+Linking Fortran executable cmTC_7523d
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_7523d.dir/link.txt --verbose=1
+/opt/cray/pe/craype/2.5.15/bin/ftn -v CMakeFiles/cmTC_7523d.dir/CMakeFortranCompilerABI.F.o -o cmTC_7523d
+ifort version 18.0.2
+/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/bin/intel64/fortcom -mGLOB_em64t=TRUE -mP1OPT_version=18.0-intel64 -mGLOB_diag_file=CMakeFiles/cmTC_7523d.dir/CMakeFortranCompilerABI.F.diag -mGLOB_long_size_64 -mGLOB_routine_pointer_size_64 -mGLOB_source_language=GLOB_SOURCE_LANGUAGE_F90 -mP2OPT_static_promotion -mP1OPT_print_version=FALSE -mCG_use_gas_got_workaround=F -mP2OPT_align_option_used=TRUE -mGLOB_gcc_version=630 "-mGLOB_options_string=-I/opt/cray/pe/libsci/18.07.1/INTEL/16.0/x86_64/include -I/opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/include -I/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include -I/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include -I/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include -I/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include -I/opt/cray/pe/pmi/5.0.14/include -I/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include -I/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include -I/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include -I/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include -I/opt/cray-hss-devel/8.0.0/include -xCORE-AVX2 -static -D__CRAYXC -D__CRAY_HASWELL -D__CRAYXT_COMPUTE_LINUX_TARGET -v -o cmTC_7523d -L/opt/cray/pe/libsci/18.07.1/INTEL/16.0/x86_64/lib -L/opt/cray/dmapp/default/lib64 -L/opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/lib -L/opt/cray/dmapp/default/lib64 -L/opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/lib -L/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/lib64 -L/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/lib64 -L/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/lib64 -L/opt/cray/pe/pmi/5.0.14/lib64 -L/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/lib64 -L/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/lib64 -L/opt/cray/pe/atp/2.1.3/libApp -L/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/lib64 -Wl,-Ttext-segment=0x20000000,-zmax-page-size=0x20000000 -Wl,--whole-archive,-lhugetlbfs,--no-whole-archive -Wl,--no-as-needed,-lAtpSigHandler,-lAtpSigHCommData -Wl,--undefined=_ATP_Data_Globals -Wl,--undefined=__atpHandlerInstall -lpthread -lmpichf90_intel -lrt -lugni -lpmi -lm -lpthread -ldl -lsci_intel_mpi -lsci_intel -lm -ldl -lmpich_intel -lrt -lugni -lpthread -lpmi -lm -ldl -lpmi -lpthread -lalpslli -lpthread -lwlm_detect -lalpsutil -lpthread -lrca -lxpmem -lugni -lpthread -ludreg -lsci_intel -lm -lpthread -ldl -lhugetlbfs -Wl,--as-needed,-limf,--no-as-needed -Wl,--as-needed,-lm,--no-as-needed -Wl,--as-needed,-lpthread,--no-as-needed" -mGLOB_cxx_limited_range=FALSE -mCG_extend_parms=FALSE -mGLOB_compiler_bin_directory=/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/bin/intel64 -mGLOB_as_output_backup_file_name=/tmp/ifort3JZMSVas_.s -mGLOB_dashboard_use_source_name -mIPOPT_activate -mGLOB_product_id_code=0x22006d90 -mGLOB_extended_instructions=0x4000 -mGLOB_advanced_optim=TRUE -mP3OPT_use_mspp_call_convention -mP2OPT_subs_out_of_bound=FALSE -mP2OPT_disam_type_based_disam=2 -mGLOB_ansi_alias -mPGOPTI_value_profile_use=T -mGLOB_opt_report_use_source_name -mP2OPT_il0_array_sections=TRUE -mGLOB_offload_mode=1 -mP2OPT_offload_unique_var_string=ifort0690373519HAIHNw -mP2OPT_hlo -mP2OPT_hpo_rtt_control=0 -mIPOPT_args_in_regs=0 -mP2OPT_disam_assume_nonstd_intent_in=FALSE -mGLOB_imf_mapping_library=/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/bin/intel64/libiml_attr.so -mPGOPTI_gen_threadsafe_level=0 -mIPOPT_link -mIPOPT_ipo_activate -mIPOPT_mo_activate -mIPOPT_source_files_list=/tmp/ifortslis6v0DlA -mIPOPT_mo_global_data -mIPOPT_link_script_file=/tmp/ifortscriptsKB8Qm "-mIPOPT_cmdline_link="/usr/lib/../lib64/crt1.o" "/usr/lib/../lib64/crti.o" "/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/crtbeginT.o" "--build-id" "-static" "-m" "elf_x86_64" "-L/opt/cray/pe/libsci/18.07.1/INTEL/16.0/x86_64/lib" "-L/opt/cray/dmapp/default/lib64" "-L/opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/lib" "-L/opt/cray/dmapp/default/lib64" "-L/opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/lib" "-L/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/lib64" "-L/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/lib64" "-L/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/lib64" "-L/opt/cray/pe/pmi/5.0.14/lib64" "-L/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/lib64" "-L/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/lib64" "-L/opt/cray/pe/atp/2.1.3/libApp" "-L/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/lib64" "-o" "cmTC_7523d" "/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64_lin/for_main.o" "-L/opt/intel/2018.2.199/compilers_and_libraries_2018/linux/mkl/lib/intel64" "-L/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64_lin" "-L/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/" "-L/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/../../../../lib64" "-L/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/../../../../lib64/" "-L/lib/../lib64" "-L/lib/../lib64/" "-L/usr/lib/../lib64" "-L/usr/lib/../lib64/" "-L/opt/intel/2018.2.199/compilers_and_libraries_2018/linux/mkl/lib/intel64/" "-L/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/../../../" "-L/lib64" "-L/lib/" "-L/usr/lib64" "-L/usr/lib" "CMakeFiles/cmTC_7523d.dir/CMakeFortranCompilerABI.F.o" "-Ttext-segment=0x20000000" "-zmax-page-size=0x20000000" "--whole-archive" "-lhugetlbfs" "--no-whole-archive" "--no-as-needed" "-lAtpSigHandler" "-lAtpSigHCommData" "--undefined=_ATP_Data_Globals" "--undefined=__atpHandlerInstall" "-lpthread" "-lmpichf90_intel" "-lrt" "-lugni" "-lpmi" "-L/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64_lin" "-limf" "-lm" "-lpthread" "-ldl" "-lsci_intel_mpi" "-lsci_intel" "-L/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64_lin" "-limf" "-lm" "-ldl" "-lmpich_intel" "-lrt" "-lugni" "-lpthread" "-lpmi" "-L/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64_lin" "-limf" "-lm" "-ldl" "-lpmi" "-lpthread" "-lalpslli" "-lpthread" "-lwlm_detect" "-lalpsutil" "-lpthread" "-lrca" "-lxpmem" "-lugni" "-lpthread" "-ludreg" "-lsci_intel" "-L/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64_lin" "-limf" "-lm" "-lpthread" "-ldl" "-lhugetlbfs" "--as-needed" "-limf" "--no-as-needed" "--as-needed" "-lm" "--no-as-needed" "--as-needed" "-lpthread" "--no-as-needed" "-lifport" "-lifcore" "-limf" "-lsvml" "-lm" "-lipgo" "-lirc" "-lsvml" "-lc" "-lgcc" "-lgcc_eh" "-lirc_s" "-ldl" "-lc" "/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/crtend.o" "/usr/lib/../lib64/crtn.o"" -mIPOPT_il_in_obj -mIPOPT_ipo_activate_warn=FALSE -mIPOPT_obj_output_file_name=/tmp/ipo_ifort5KgIiT.o -mIPOPT_whole_archive_fixup_file_name=/tmp/ifortwarchltBXsh -mGLOB_linker_version=2.31.1.20180828 -mGLOB_driver_tempfile_name=/tmp/iforttempfilesugt03 -mP3OPT_asm_target=P3OPT_ASM_TARGET_GAS -mGLOB_async_unwind_tables=TRUE -mGLOB_obj_output_file=/tmp/ipo_ifort5KgIiT.o -mGLOB_source_dialect=GLOB_SOURCE_DIALECT_NONE -mP1OPT_source_file_name=ipo_out.f -mP2OPT_symtab_type_copy=true CMakeFiles/cmTC_7523d.dir/CMakeFortranCompilerABI.F.o -mIPOPT_object_files=T -mIPOPT_assembly_files=/tmp/ifortalisCY2Fjs -mIPOPT_generated_tempfiles=/tmp/ifortelisXEqaPe -mIPOPT_embedded_object_base_name=/tmp/iforteobjRoVEk1 -mIPOPT_cmdline_link_new_name=/tmp/ifortllisJHg9PN
+ld /usr/lib/../lib64/crt1.o /usr/lib/../lib64/crti.o /opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/crtbeginT.o --build-id -static -m elf_x86_64 -L/opt/cray/pe/libsci/18.07.1/INTEL/16.0/x86_64/lib -L/opt/cray/dmapp/default/lib64 -L/opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/lib -L/opt/cray/dmapp/default/lib64 -L/opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/lib -L/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/lib64 -L/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/lib64 -L/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/lib64 -L/opt/cray/pe/pmi/5.0.14/lib64 -L/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/lib64 -L/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/lib64 -L/opt/cray/pe/atp/2.1.3/libApp -L/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/lib64 -o cmTC_7523d /opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64_lin/for_main.o -L/opt/intel/2018.2.199/compilers_and_libraries_2018/linux/mkl/lib/intel64 -L/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64_lin -L/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/ -L/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/../../../../lib64 -L/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/../../../../lib64/ -L/lib/../lib64 -L/lib/../lib64/ -L/usr/lib/../lib64 -L/usr/lib/../lib64/ -L/opt/intel/2018.2.199/compilers_and_libraries_2018/linux/mkl/lib/intel64/ -L/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/../../../ -L/lib64 -L/lib/ -L/usr/lib64 -L/usr/lib CMakeFiles/cmTC_7523d.dir/CMakeFortranCompilerABI.F.o -Ttext-segment=0x20000000 -zmax-page-size=0x20000000 --whole-archive -lhugetlbfs --no-whole-archive --no-as-needed -lAtpSigHandler -lAtpSigHCommData --undefined=_ATP_Data_Globals --undefined=__atpHandlerInstall -lpthread -lmpichf90_intel -lrt -lugni -lpmi -L/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64_lin -limf -lm -lpthread -ldl -lsci_intel_mpi -lsci_intel -L/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64_lin -limf -lm -ldl -lmpich_intel -lrt -lugni -lpthread -lpmi -L/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64_lin -limf -lm -ldl -lpmi -lpthread -lalpslli -lpthread -lwlm_detect -lalpsutil -lpthread -lrca -lxpmem -lugni -lpthread -ludreg -lsci_intel -L/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64_lin -limf -lm -lpthread -ldl -lhugetlbfs --as-needed -limf --no-as-needed --as-needed -lm --no-as-needed --as-needed -lpthread --no-as-needed -lifport -lifcore -limf -lsvml -lm -lipgo -lirc -lsvml -lc -lgcc -lgcc_eh -lirc_s -ldl -lc /opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/crtend.o /usr/lib/../lib64/crtn.o
+gmake[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Intel-18.0.2.20180210.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Intel-18.0.2.20180210.output
new file mode 100644
index 0000000000..c3915b6735
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Intel-18.0.2.20180210.output
@@ -0,0 +1 @@
+.;/opt/cray/pe/libsci/18.07.1/INTEL/16.0/x86_64/include;/opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/include;/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include;/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include;/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include;/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include;/opt/cray/pe/pmi/5.0.14/include;/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include;/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include;/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include;/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include;/opt/cray-hss-devel/8.0.0/include;/opt/intel/2018.2.199/compilers_and_libraries_2018/linux/mkl/include;/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include/intel64;/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include/icc;/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include;/usr/local/include;/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/include;/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/include-fixed;/opt/gcc/6.3.0/snos/include/;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-C-AppleClang-8.0.0.8000042.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-C-AppleClang-8.0.0.8000042.input
new file mode 100644
index 0000000000..effaedf552
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-C-AppleClang-8.0.0.8000042.input
@@ -0,0 +1,44 @@
+CMAKE_LANG=C
+CMAKE_C_COMPILER_ABI=
+CMAKE_C_COMPILER_AR=
+CMAKE_C_COMPILER_ARCHITECTURE_ID=
+CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_C_COMPILER_ID=AppleClang
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=8.0.0.8000042
+CMAKE_C_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/make" "cmTC_ba7aa/fast"
+/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_ba7aa.dir/build.make CMakeFiles/cmTC_ba7aa.dir/build
+Building C object CMakeFiles/cmTC_ba7aa.dir/CMakeCCompilerABI.c.o
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -nostdinc -v -Wl,-v -o CMakeFiles/cmTC_ba7aa.dir/CMakeCCompilerABI.c.o -c /usr/local/pkg.1804/share/cmake-3.10/Modules/CMakeCCompilerABI.c
+Apple LLVM version 8.0.0 (clang-800.0.42.1)
+Target: x86_64-apple-darwin15.6.0
+Thread model: posix
+InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
+clang: warning: -Wl,-v: 'linker' input unused
+ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.11.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name CMakeCCompilerABI.c -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 274.2 -v -dwarf-column-info -debugger-tuning=lldb -coverage-file /private/tmp/ii/CMakeFiles/CMakeTmp/CMakeFiles/cmTC_ba7aa.dir/CMakeCCompilerABI.c.o -nostdsysteminc -nobuiltininc -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0 -fdebug-compilation-dir /private/tmp/ii/CMakeFiles/CMakeTmp -ferror-limit 19 -fmessage-length 0 -stack-protector 1 -fblocks -fobjc-runtime=macosx-10.11.0 -fencode-extended-block-signature -fmax-type-align=16 -fdiagnostics-show-option -o CMakeFiles/cmTC_ba7aa.dir/CMakeCCompilerABI.c.o -x c /usr/local/pkg.1804/share/cmake-3.10/Modules/CMakeCCompilerABI.c
+clang -cc1 version 8.0.0 (clang-800.0.42.1) default target x86_64-apple-darwin15.6.0
+#include "..." search starts here:
+End of search list.
+Linking C executable cmTC_ba7aa
+/usr/local/pkg.1804/bin/cmake -E cmake_link_script CMakeFiles/cmTC_ba7aa.dir/link.txt --verbose=1
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -nostdinc -v -Wl,-v -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_ba7aa.dir/CMakeCCompilerABI.c.o -o cmTC_ba7aa
+Apple LLVM version 8.0.0 (clang-800.0.42.1)
+Target: x86_64-apple-darwin15.6.0
+Thread model: posix
+InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
+clang: warning: argument unused during compilation: '-nostdinc'
+ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min 10.11.0 -o cmTC_ba7aa -v -search_paths_first -headerpad_max_install_names CMakeFiles/cmTC_ba7aa.dir/CMakeCCompilerABI.c.o -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/lib/darwin/libclang_rt.osx.a
+@(#)PROGRAM:ld PROJECT:ld64-274.2
+configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em (tvOS)
+Library search paths:
+ /usr/lib
+ /usr/local/lib
+Framework search paths:
+ /Library/Frameworks/
+ /System/Library/Frameworks/
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-C-AppleClang-8.0.0.8000042.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-C-AppleClang-8.0.0.8000042.output
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-C-AppleClang-8.0.0.8000042.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-CXX-AppleClang-8.0.0.8000042.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-CXX-AppleClang-8.0.0.8000042.input
new file mode 100644
index 0000000000..5504e9472d
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-CXX-AppleClang-8.0.0.8000042.input
@@ -0,0 +1,44 @@
+CMAKE_LANG=CXX
+CMAKE_CXX_COMPILER_ABI=
+CMAKE_CXX_COMPILER_AR=
+CMAKE_CXX_COMPILER_ARCHITECTURE_ID=
+CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CXX_COMPILER_ID=AppleClang
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=8.0.0.8000042
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/make" "cmTC_638bd/fast"
+/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_638bd.dir/build.make CMakeFiles/cmTC_638bd.dir/build
+Building CXX object CMakeFiles/cmTC_638bd.dir/CMakeCXXCompilerABI.cpp.o
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -nostdinc -v -Wl,-v -o CMakeFiles/cmTC_638bd.dir/CMakeCXXCompilerABI.cpp.o -c /usr/local/pkg.1804/share/cmake-3.10/Modules/CMakeCXXCompilerABI.cpp
+Apple LLVM version 8.0.0 (clang-800.0.42.1)
+Target: x86_64-apple-darwin15.6.0
+Thread model: posix
+InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
+clang: warning: -Wl,-v: 'linker' input unused
+ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.11.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name CMakeCXXCompilerABI.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 274.2 -v -dwarf-column-info -debugger-tuning=lldb -coverage-file /private/tmp/ii/CMakeFiles/CMakeTmp/CMakeFiles/cmTC_638bd.dir/CMakeCXXCompilerABI.cpp.o -nostdsysteminc -nobuiltininc -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0 -stdlib=libc++ -fdeprecated-macro -fdebug-compilation-dir /private/tmp/ii/CMakeFiles/CMakeTmp -ferror-limit 19 -fmessage-length 0 -stack-protector 1 -fblocks -fobjc-runtime=macosx-10.11.0 -fencode-extended-block-signature -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -o CMakeFiles/cmTC_638bd.dir/CMakeCXXCompilerABI.cpp.o -x c++ /usr/local/pkg.1804/share/cmake-3.10/Modules/CMakeCXXCompilerABI.cpp
+clang -cc1 version 8.0.0 (clang-800.0.42.1) default target x86_64-apple-darwin15.6.0
+#include "..." search starts here:
+End of search list.
+Linking CXX executable cmTC_638bd
+/usr/local/pkg.1804/bin/cmake -E cmake_link_script CMakeFiles/cmTC_638bd.dir/link.txt --verbose=1
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -nostdinc -v -Wl,-v -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_638bd.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_638bd
+Apple LLVM version 8.0.0 (clang-800.0.42.1)
+Target: x86_64-apple-darwin15.6.0
+Thread model: posix
+InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
+clang: warning: argument unused during compilation: '-nostdinc'
+ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min 10.11.0 -o cmTC_638bd -v -search_paths_first -headerpad_max_install_names CMakeFiles/cmTC_638bd.dir/CMakeCXXCompilerABI.cpp.o -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/lib/darwin/libclang_rt.osx.a
+@(#)PROGRAM:ld PROJECT:ld64-274.2
+configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em (tvOS)
+Library search paths:
+ /usr/lib
+ /usr/local/lib
+Framework search paths:
+ /Library/Frameworks/
+ /System/Library/Frameworks/
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-CXX-AppleClang-8.0.0.8000042.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-CXX-AppleClang-8.0.0.8000042.output
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-CXX-AppleClang-8.0.0.8000042.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-Fortran-GNU-4.6.4.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-Fortran-GNU-4.6.4.input
new file mode 100644
index 0000000000..8a5d7411a1
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-Fortran-GNU-4.6.4.input
@@ -0,0 +1,78 @@
+CMAKE_LANG=Fortran
+CMAKE_Fortran_COMPILER_ABI=
+CMAKE_Fortran_COMPILER_AR=
+CMAKE_Fortran_COMPILER_ARCHITECTURE_ID=
+CMAKE_Fortran_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_Fortran_COMPILER_ID=GNU
+CMAKE_Fortran_COMPILER_LAUNCHER=
+CMAKE_Fortran_COMPILER_LOADED=1
+CMAKE_Fortran_COMPILER_RANLIB=
+CMAKE_Fortran_COMPILER_TARGET=
+CMAKE_Fortran_COMPILER_VERSION=4.6.4
+CMAKE_Fortran_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/local/bin/gmake" "cmTC_9ec75/fast"
+/usr/local/bin/gmake -f CMakeFiles/cmTC_9ec75.dir/build.make CMakeFiles/cmTC_9ec75.dir/build
+gmake[1]: Entering directory `/tmp/ii/CMakeFiles/CMakeTmp'
+Building Fortran object CMakeFiles/cmTC_9ec75.dir/CMakeFortranCompilerABI.F.o
+/usr/local/bin/gfortran46 -v -c /usr/local/share/cmake-3.7/Modules/CMakeFortranCompilerABI.F -o CMakeFiles/cmTC_9ec75.dir/CMakeFortranCompilerABI.F.o
+Using built-in specs.
+COLLECT_GCC=/usr/local/bin/gfortran46
+COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/lto-wrapper
+Target: x86_64-portbld-freebsd10.0
+Configured with: ./../gcc-4.6.4/configure --disable-bootstrap --disable-nls --libdir=/usr/local/lib/gcc46 --libexecdir=/usr/local/libexec/gcc46 --program-suffix=46 --with-as=/usr/local/bin/as --with-gmp=/usr/local --with-gxx-include-dir=/usr/local/lib/gcc46/include/c++/ --with-ld=/usr/local/bin/ld --with-pkgversion='FreeBSD Ports Collection' --with-system-zlib --disable-libgcj --enable-languages=c,c++,objc,fortran --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/gcc46 --build=x86_64-portbld-freebsd10.0
+Thread model: posix
+gcc version 4.6.4 (FreeBSD Ports Collection)
+COLLECT_GCC_OPTIONS='-v' '-c' '-o' 'CMakeFiles/cmTC_9ec75.dir/CMakeFortranCompilerABI.F.o' '-mtune=generic' '-march=x86-64'
+ /usr/local/libexec/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/f951 /usr/local/share/cmake-3.7/Modules/CMakeFortranCompilerABI.F -ffixed-form -cpp=/tmp//ccp5PsLd.f90 -quiet -v /usr/local/share/cmake-3.7/Modules/CMakeFortranCompilerABI.F -quiet -dumpbase CMakeFortranCompilerABI.F -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_9ec75.dir/CMakeFortranCompilerABI.F.o -version -fintrinsic-modules-path /usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/finclude -o /tmp//ccGWxrQ5.s
+GNU Fortran (FreeBSD Ports Collection) version 4.6.4 (x86_64-portbld-freebsd10.0)
+ compiled by GNU C version 4.2.1 Compatible FreeBSD Clang 3.3 (tags/RELEASE_33/final 183502), GMP version 5.1.3, MPFR version 3.1.2, MPC version 1.0.1
+GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
+ignoring nonexistent directory "/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/../../../../../x86_64-portbld-freebsd10.0/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ /usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/finclude
+ /usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/include
+ /usr/local/include
+ /usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/include-fixed
+ /usr/include
+End of search list.
+GNU Fortran (FreeBSD Ports Collection) version 4.6.4 (x86_64-portbld-freebsd10.0)
+ compiled by GNU C version 4.2.1 Compatible FreeBSD Clang 3.3 (tags/RELEASE_33/final 183502), GMP version 5.1.3, MPFR version 3.1.2, MPC version 1.0.1
+GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
+COLLECT_GCC_OPTIONS='-v' '-c' '-o' 'CMakeFiles/cmTC_9ec75.dir/CMakeFortranCompilerABI.F.o' '-mtune=generic' '-march=x86-64'
+ /usr/local/bin/as -v -o CMakeFiles/cmTC_9ec75.dir/CMakeFortranCompilerABI.F.o /tmp//ccGWxrQ5.s
+GNU assembler version 2.23.2 (x86_64-portbld-freebsd10.0) using BFD version (GNU Binutils) 2.23.2
+COMPILER_PATH=/usr/local/libexec/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/:/usr/local/libexec/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/:/usr/local/libexec/gcc46/gcc/x86_64-portbld-freebsd10.0/:/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/:/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/:/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/../../../../../x86_64-portbld-freebsd10.0/bin/
+LIBRARY_PATH=/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/:/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/../../../../../x86_64-portbld-freebsd10.0/lib/:/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/../../../:/lib/:/usr/lib/
+COLLECT_GCC_OPTIONS='-v' '-c' '-o' 'CMakeFiles/cmTC_9ec75.dir/CMakeFortranCompilerABI.F.o' '-mtune=generic' '-march=x86-64'
+Linking Fortran executable cmTC_9ec75
+/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_9ec75.dir/link.txt --verbose=1
+/usr/local/bin/gfortran46 -v CMakeFiles/cmTC_9ec75.dir/CMakeFortranCompilerABI.F.o -o cmTC_9ec75
+Driving: /usr/local/bin/gfortran46 -v CMakeFiles/cmTC_9ec75.dir/CMakeFortranCompilerABI.F.o -o cmTC_9ec75 -l gfortran -l m -shared-libgcc
+Using built-in specs.
+COLLECT_GCC=/usr/local/bin/gfortran46
+COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/lto-wrapper
+Target: x86_64-portbld-freebsd10.0
+Configured with: ./../gcc-4.6.4/configure --disable-bootstrap --disable-nls --libdir=/usr/local/lib/gcc46 --libexecdir=/usr/local/libexec/gcc46 --program-suffix=46 --with-as=/usr/local/bin/as --with-gmp=/usr/local --with-gxx-include-dir=/usr/local/lib/gcc46/include/c++/ --with-ld=/usr/local/bin/ld --with-pkgversion='FreeBSD Ports Collection' --with-system-zlib --disable-libgcj --enable-languages=c,c++,objc,fortran --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/gcc46 --build=x86_64-portbld-freebsd10.0
+Thread model: posix
+gcc version 4.6.4 (FreeBSD Ports Collection)
+Reading specs from /usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/../../../libgfortran.spec
+rename spec lib to liborig
+COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_9ec75' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
+COMPILER_PATH=/usr/local/libexec/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/:/usr/local/libexec/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/:/usr/local/libexec/gcc46/gcc/x86_64-portbld-freebsd10.0/:/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/:/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/:/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/../../../../../x86_64-portbld-freebsd10.0/bin/
+LIBRARY_PATH=/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/:/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/../../../../../x86_64-portbld-freebsd10.0/lib/:/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/../../../:/lib/:/usr/lib/
+COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_9ec75' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
+ /usr/local/libexec/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/collect2 --eh-frame-hdr -V -dynamic-linker /libexec/ld-elf.so.1 -o cmTC_9ec75 /usr/lib/crt1.o /usr/lib/crti.o /usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/crtbegin.o -L/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4 -L/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/../../../../../x86_64-portbld-freebsd10.0/lib -L/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/../../.. CMakeFiles/cmTC_9ec75.dir/CMakeFortranCompilerABI.F.o -lgfortran -lm -lgcc_s -lgcc -lquadmath -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/crtend.o /usr/lib/crtn.o
+GNU ld (GNU Binutils) 2.23.2
+ Supported emulations:
+ elf_x86_64_fbsd
+ elf_i386_fbsd
+ elf_x86_64
+ elf_i386
+ elf_l1om
+ elf_l1om_fbsd
+ elf_k1om
+ elf_k1om_fbsd
+gmake[1]: Leaving directory `/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-Fortran-GNU-4.6.4.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-Fortran-GNU-4.6.4.output
new file mode 100644
index 0000000000..c0aee11188
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-Fortran-GNU-4.6.4.output
@@ -0,0 +1 @@
+/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/finclude;/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/include;/usr/local/include;/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/include-fixed;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-PGI-18.10.1.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-PGI-18.10.1.input
new file mode 100644
index 0000000000..cfc3e7b1c8
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-PGI-18.10.1.input
@@ -0,0 +1,36 @@
+CMAKE_LANG=C
+CMAKE_C_COMPILER_ABI=
+CMAKE_C_COMPILER_AR=
+CMAKE_C_COMPILER_ARCHITECTURE_ID=
+CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_C_COMPILER_ID=PGI
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=18.10.1
+CMAKE_C_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/make" "cmTC_81a12/fast"
+/usr/bin/make -f CMakeFiles/cmTC_81a12.dir/build.make CMakeFiles/cmTC_81a12.dir/build
+make[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building C object CMakeFiles/cmTC_81a12.dir/CMakeCCompilerABI.c.o
+/mnt/pgi/linux86-64/2018/bin/pgcc -v -o CMakeFiles/cmTC_81a12.dir/CMakeCCompilerABI.c.o -c /usr/share/cmake-3.10/Modules/CMakeCCompilerABI.c
+Export PGI_CURR_CUDA_HOME=/mnt/pgi/linux86-64/2018/cuda/9.1
+Export PGI=/mnt/pgi
+
+/mnt/pgi/linux86-64/18.10/bin/pgc /usr/share/cmake-3.10/Modules/CMakeCCompilerABI.c -opt 1 -x 119 0xa10000 -x 122 0x40 -x 123 0x1000 -x 127 4 -x 127 17 -x 19 0x400000 -x 28 0x40000 -x 120 0x10000000 -x 70 0x8000 -x 122 1 -x 125 0x20000 -quad -x 59 4 -tp k8 -x 120 0x1000 -astype 0 -stdinc /mnt/pgi/linux86-64/18.10/include-gcc70:/mnt/pgi/linux86-64/18.10/include:/usr/lib/gcc/x86_64-linux-gnu/7/include:/usr/local/include:/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed:/usr/include/x86_64-linux-gnu:/usr/include -def unix -def __unix -def __unix__ -def linux -def __linux -def __linux__ -def __NO_MATH_INLINES -def __LP64__ -def __x86_64 -def __x86_64__ -def __LONG_MAX__=9223372036854775807L -def '__SIZE_TYPE__=unsigned long int' -def '__PTRDIFF_TYPE__=long int' -def __extension__= -def __amd_64__amd64__ -def __k8 -def __k8__ -def __SSE__ -def __MMX__ -def __SSE2__ -def __SSE3__ -predicate '#machine(x86_64) #lint(off) #system(posix) #cpu(x86_64)' -cmdline '+pgcc /usr/share/cmake-3.10/Modules/CMakeCCompilerABI.c -v -o CMakeFiles/cmTC_81a12.dir/CMakeCCompilerABI.c.o -c' -outfile CMakeFiles/cmTC_81a12.dir/CMakeCCompilerABI.c.o -x 123 0x80000000 -x 123 4 -x 2 0x400 -preinclude _c_macros.h -x 119 0x20 -def __pgnu_vsn=70300 -x 120 0x200000 -x 70 0x40000000 -x 164 0x800000 -y 163 0xc0000000 -x 189 0x10 -y 189 0x4000000 -asm /tmp/pgccl1BeHkOmG3zk.s
+PGC/x86-64 Linux 18.10-1: compilation successful
+
+/usr/bin/as /tmp/pgccl1BeHkOmG3zk.s -o CMakeFiles/cmTC_81a12.dir/CMakeCCompilerABI.c.o
+Unlinking /tmp/pgccl1BeHkOmG3zk.s
+Unlinking /tmp/pgccJ1BePEjJHZ9x.ll
+Linking C executable cmTC_81a12
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_81a12.dir/link.txt --verbose=1
+/mnt/pgi/linux86-64/2018/bin/pgcc -v CMakeFiles/cmTC_81a12.dir/CMakeCCompilerABI.c.o -o cmTC_81a12
+Export PGI_CURR_CUDA_HOME=/mnt/pgi/linux86-64/2018/cuda/9.1
+Export PGI=/mnt/pgi
+
+/usr/bin/ld /usr/lib/x86_64-linux-gnu/crt1.o /usr/lib/x86_64-linux-gnu/crti.o /mnt/pgi/linux86-64/18.10/lib/trace_init.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbegin.o /mnt/pgi/linux86-64/18.10/lib/initmp.o --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /mnt/pgi/linux86-64/18.10/lib/pgi.ld -L/mnt/pgi/linux86-64/18.10/lib -L/usr/lib64 -L/usr/lib/gcc/x86_64-linux-gnu/7 CMakeFiles/cmTC_81a12.dir/CMakeCCompilerABI.c.o -rpath /mnt/pgi/linux86-64/18.10/lib -rpath /usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib64 -o cmTC_81a12 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib64 -lpgmp -lnuma -lpthread --start-group -lpgmath -lnspgc -lpgc --end-group -lm -lgcc -lc -lgcc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/7/crtend.o /usr/lib/x86_64-linux-gnu/crtn.o
+make[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-PGI-18.10.1.output
new file mode 100644
index 0000000000..289c530a62
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-PGI-18.10.1.output
@@ -0,0 +1 @@
+/mnt/pgi/linux86-64/18.10/include-gcc70;/mnt/pgi/linux86-64/18.10/include;/usr/lib/gcc/x86_64-linux-gnu/7/include;/usr/local/include;/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed;/usr/include/x86_64-linux-gnu;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-12.1.0.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-12.1.0.input
new file mode 100644
index 0000000000..a6d9e5a48e
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-12.1.0.input
@@ -0,0 +1,42 @@
+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=XL
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=12.1.0
+CMAKE_C_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_79cdf/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_79cdf.dir/build.make CMakeFiles/cmTC_79cdf.dir/build
+gmake[1]: Entering directory `/tmp/ii/CMakeFiles/CMakeTmp'
+Building C object CMakeFiles/cmTC_79cdf.dir/CMakeCCompilerABI.c.o
+/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/bin/xlc -qthreaded -qhalt=e -V -o CMakeFiles/cmTC_79cdf.dir/CMakeCCompilerABI.c.o -c /soft/buildtools/cmake/3.5.2/share/cmake-3.5/Modules/CMakeCCompilerABI.c
+export XL_CONFIG=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/etc/vac.cfg.rhel6.9.gcc447:xlc
+export XLC_USR_CONFIG=/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/etc/V1R2M4.vac.cfg.rhel6.9.gcc447
+export XL_ASMOBJFILES=/tmp/xlcASgBamaX
+export "XL_DIS=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/dis -o "CMakeFiles/cmTC_79cdf.dir/CMakeCCompilerABI.c.o" "CMakeCCompilerABI.o""
+/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/xlcentry -qosvar=rhel.6.9 -qlanglvl=extc99 -qcpluscmt -qkeyword=inline -qalias=ansi -qtls -D_CALL_SYSV -D__null=0 -D__NO_MATH_INLINES -qtls -q64 -qgnu_version=4.4.7 -qthreaded -qhalt=e -qasm_as=/usr/bin/as -qc_stdinc=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/include:/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/include -qgcc_c_stdinc=/usr/local/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/crt/include:/usr/include -qcomplexgccincl=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/include:/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/include:/usr/local/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/crt/include:/usr/include -qvac_include_path=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/include -oCMakeFiles/cmTC_79cdf.dir/CMakeCCompilerABI.c.o /soft/buildtools/cmake/3.5.2/share/cmake-3.5/Modules/CMakeCCompilerABI.c /tmp/xlcW06RQxFR /tmp/xlcW1Og9D2y /dev/null /tmp/xlcLUravVDF.lst /dev/null /tmp/xlcW2kTjRpg
+export XL_BACKEND=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/xlCcode
+export XL_LINKER=/usr/bin/ld
+/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/xlCcode -qlanglvl=extc99 -qcpluscmt -qkeyword=inline -qalias=ansi -qtls -qtls -qthreaded -qhalt=e /tmp/xlcW06RQxFR /tmp/xlcW1Og9D2y CMakeFiles/cmTC_79cdf.dir/CMakeCCompilerABI.c.o /tmp/xlcLUravVDB.lst /tmp/xlcW2kTjRpg
+rm /tmp/xlcASgBamaX
+rm /tmp/xlcLUravVD
+rm /tmp/xlcW06RQxFR
+rm /tmp/xlcW1Og9D2y
+rm /tmp/xlcW2kTjRpg
+Linking C executable cmTC_79cdf
+/soft/buildtools/cmake/3.5.2/bin/cmake -E cmake_link_script CMakeFiles/cmTC_79cdf.dir/link.txt --verbose=1
+/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/bin/xlc -qthreaded -qhalt=e -V CMakeFiles/cmTC_79cdf.dir/CMakeCCompilerABI.c.o -o cmTC_79cdf -Wl,-export-dynamic
+export XL_CONFIG=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/etc/vac.cfg.rhel6.9.gcc447:xlc
+export XLC_USR_CONFIG=/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/etc/V1R2M4.vac.cfg.rhel6.9.gcc447
+/usr/bin/ld --eh-frame-hdr -Qy -melf64ppc /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crt1.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crti.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/crtbegin.o -L/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/lib64 -L/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/lib64 -L/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/lib64 -L/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/lib64 -R/soft/compilers/ibmcmp-oct2017/lib64/bg -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../.. CMakeFiles/cmTC_79cdf.dir/CMakeCCompilerABI.c.o -o cmTC_79cdf -export-dynamic -dynamic-linker /lib64/ld64.so.1 -lxlopt -lxl -ldl -lgcc_s -lgcc -lm -lc -lgcc_s -lgcc /usr/lib/gcc/ppc64-redhat-linux/4.4.7/crtend.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crtn.o
+rm /tmp/xlcW0JVPZO4
+rm /tmp/xlcW1cwDxtZ
+rm /tmp/xlcW2j5Va8T
+gmake[1]: Leaving directory `/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-12.1.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-12.1.0.output
new file mode 100644
index 0000000000..eceacf954e
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-12.1.0.output
@@ -0,0 +1 @@
+/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/include;/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include;/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/include;/usr/local/include;/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/crt/include;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-16.1.0.0.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-16.1.0.0.input
new file mode 100644
index 0000000000..97fa28be9c
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-16.1.0.0.input
@@ -0,0 +1,40 @@
+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=XL
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=16.1.0.0
+CMAKE_C_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_56ad1/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_56ad1.dir/build.make CMakeFiles/cmTC_56ad1.dir/build
+gmake[1]: Entering directory `/tmp/ii/CMakeFiles/CMakeTmp'
+Building C object CMakeFiles/cmTC_56ad1.dir/CMakeCCompilerABI.c.o
+/opt/ibm/xlC/16.1.0/bin/xlc -qthreaded -V -o CMakeFiles/cmTC_56ad1.dir/CMakeCCompilerABI.c.o -c "/tmp/CMake/Modules/CMakeCCompilerABI.c"
+export XL_CONFIG=/opt/ibm/xlC/16.1.0/etc/xlc.cfg.centos.7.gcc.4.8.5:xlc
+export XL_ASMOBJFILES=/tmp/xlcASSb1cI4
+export "XL_DIS=/opt/ibm/xlC/16.1.0/exe/dis -o "CMakeFiles/cmTC_56ad1.dir/CMakeCCompilerABI.c.o" "CMakeCCompilerABI.o""
+/opt/ibm/xlC/16.1.0/exe/xlCentry -qosvar=centos.7.0 -qlanglvl=extc99 -qalias=ansi -qthreaded -D_REENTRANT -D__VACPP_MULTI__ -qtls -q64 -D_CALL_SYSV -D__NO_MATH_INLINES -D_CALL_ELF=2 -Wno-parentheses -Wno-unused-value -maltivec -qtls -q64 -qgnu_version=4.8.5 -qthreaded -qasm_as=/usr/bin/as -qc_stdinc=/opt/ibm/xlsmp/5.1.0/include:/opt/ibm/xlsmp/5.1.0/include:/opt/ibm/xlmass/9.1.0/include:/opt/ibm/xlC/16.1.0/include -qgcc_c_stdinc=/opt/ibm/xlC/16.1.0/include:/usr/local/include:/opt/ibm/xlC/16.1.0/include:/usr/include -qcomplexgccincl=/opt/ibm/xlsmp/5.1.0/include:/opt/ibm/xlmass/9.1.0/include:/opt/ibm/xlC/16.1.0/include:/opt/ibm/xlC/16.1.0/include:/usr/local/include:/opt/ibm/xlC/16.1.0/include:/usr/include -qvac_include_path=/opt/ibm/xlC/16.1.0/include -oCMakeFiles/cmTC_56ad1.dir/CMakeCCompilerABI.c.o "/tmp/CMake/Modules/CMakeCCompilerABI.c" /tmp/xlcW0T1FYwj /tmp/xlcW1fu4lVT /dev/null /tmp/xlcLWBpG6EF.lst /dev/null /tmp/xlcW2TKQJju
+export XL_BACKEND=/opt/ibm/xlC/16.1.0/exe/xlCcode
+export XL_LINKER=/usr/bin/ld
+/opt/ibm/xlC/16.1.0/exe/xlCcode -qlanglvl=extc99 -qalias=ansi -qthreaded -qtls -maltivec -qtls -qthreaded /tmp/xlcW0T1FYwj /tmp/xlcW1fu4lVT CMakeFiles/cmTC_56ad1.dir/CMakeCCompilerABI.c.o /tmp/xlcLWBpG6EB.lst /tmp/xlcW2TKQJju
+rm /tmp/xlcASSb1cI4
+rm /tmp/xlcLWBpG6E
+rm /tmp/xlcW0T1FYwj
+rm /tmp/xlcW1fu4lVT
+rm /tmp/xlcW2TKQJju
+Linking C executable cmTC_56ad1
+"/tmp/CMake/bin/cmake" -E cmake_link_script CMakeFiles/cmTC_56ad1.dir/link.txt --verbose=1
+/opt/ibm/xlC/16.1.0/bin/xlc -qthreaded -V -Wl,-export-dynamic CMakeFiles/cmTC_56ad1.dir/CMakeCCompilerABI.c.o -o cmTC_56ad1
+export XL_CONFIG=/opt/ibm/xlC/16.1.0/etc/xlc.cfg.centos.7.gcc.4.8.5:xlc
+/usr/bin/ld --eh-frame-hdr -Qy -melf64lppc -dynamic-linker /lib64/ld64.so.2 --enable-new-dtags /usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../../../lib64/crt1.o /usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../../../lib64/crti.o /usr/lib/gcc/ppc64le-redhat-linux/4.8.5/crtbegin.o -L/opt/ibm/xlsmp/5.1.0/lib -L/opt/ibm/xlmass/9.1.0/lib -L/opt/ibm/xlC/16.1.0/lib -R/opt/ibm/lib -L/usr/lib/gcc/ppc64le-redhat-linux/4.8.5 -L/usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../.. -export-dynamic CMakeFiles/cmTC_56ad1.dir/CMakeCCompilerABI.c.o -o cmTC_56ad1 -lxlopt -lxl --as-needed -ldl --no-as-needed -lgcc_s --as-needed -lpthread --no-as-needed -lgcc -lm -lc -lgcc_s -lgcc /usr/lib/gcc/ppc64le-redhat-linux/4.8.5/crtend.o /usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../../../lib64/crtn.o
+rm /tmp/xlcW0S2fv6n
+rm /tmp/xlcW11wDdxY
+rm /tmp/xlcW2JqnWXy
+gmake[1]: Leaving directory `/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-16.1.0.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-16.1.0.0.output
new file mode 100644
index 0000000000..2a89b17bc2
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-16.1.0.0.output
@@ -0,0 +1 @@
+/opt/ibm/xlsmp/5.1.0/include;/opt/ibm/xlsmp/5.1.0/include;/opt/ibm/xlmass/9.1.0/include;/opt/ibm/xlC/16.1.0/include;/opt/ibm/xlC/16.1.0/include;/usr/local/include;/opt/ibm/xlC/16.1.0/include;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-PGI-18.10.1.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-PGI-18.10.1.input
new file mode 100644
index 0000000000..f95627ee40
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-PGI-18.10.1.input
@@ -0,0 +1,40 @@
+CMAKE_LANG=CXX
+CMAKE_CXX_COMPILER_ABI=
+CMAKE_CXX_COMPILER_AR=
+CMAKE_CXX_COMPILER_ARCHITECTURE_ID=
+CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CXX_COMPILER_ID=PGI
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=18.10.1
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/make" "cmTC_9932f/fast"
+/usr/bin/make -f CMakeFiles/cmTC_9932f.dir/build.make CMakeFiles/cmTC_9932f.dir/build
+make[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building CXX object CMakeFiles/cmTC_9932f.dir/CMakeCXXCompilerABI.cpp.o
+/mnt/pgi/linux86-64/2018/bin/pgc++ -v -o CMakeFiles/cmTC_9932f.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake-3.10/Modules/CMakeCXXCompilerABI.cpp
+Export PGI_CURR_CUDA_HOME=/mnt/pgi/linux86-64/2018/cuda/9.1
+Export PGI=/mnt/pgi
+
+/mnt/pgi/linux86-64/18.10/bin/pggpp1 --llalign -Dunix -D__unix -D__unix__ -Dlinux -D__linux -D__linux__ -D__NO_MATH_INLINES -D__LP64__ -D__x86_64 -D__x86_64__ -D__LONG_MAX__=9223372036854775807L '-D__SIZE_TYPE__=unsigned long int' '-D__PTRDIFF_TYPE__=long int' -D__extension__= -D__amd_64__amd64__ -D__k8 -D__k8__ -D__SSE__ -D__MMX__ -D__SSE2__ -D__SSE3__ -D__PGI -D_GNU_SOURCE -D_PGCG_SOURCE -I- -I/mnt/pgi/linux86-64/18.10/include-gcc70 -I/mnt/pgi/linux86-64/18.10/include -I/usr/include/c++/7 -I/usr/include/x86_64-linux-gnu/c++/7 -I/usr/include/c++/7/backward -I/usr/lib/gcc/x86_64-linux-gnu/7/include -I/usr/local/include -I/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed -I/usr/include/x86_64-linux-gnu -I/usr/include --preinclude _cplus_preinclude.h --preinclude_macros _cplus_macros.h --gnu_version=70300 -D__pgnu_vsn=70300 -q -o /tmp/pgc++9bCe3jXUexoO.il /usr/share/cmake-3.10/Modules/CMakeCXXCompilerABI.cpp
+
+/mnt/pgi/linux86-64/18.10/bin/pggpp2 /usr/share/cmake-3.10/Modules/CMakeCXXCompilerABI.cpp -opt 1 -x 119 0xa10000 -x 122 0x40 -x 123 0x1000 -x 127 4 -x 127 17 -x 19 0x400000 -x 28 0x40000 -x 120 0x10000000 -x 70 0x8000 -x 122 1 -x 125 0x20000 -quad -x 59 4 -tp k8 -x 120 0x1000 -astype 0 -fn /usr/share/cmake-3.10/Modules/CMakeCXXCompilerABI.cpp -il /tmp/pgc++9bCe3jXUexoO.il -x 117 0x600 -x 123 0x80000000 -x 123 4 -x 119 0x20 -def __pgnu_vsn=70300 -x 120 0x200000 -x 70 0x40000000 -x 164 0x800000 -y 163 0xc0000000 -x 189 0x10 -y 189 0x4000000 -gnuvsn 70300 -x 69 0x200 -cmdline '+pgc++ /tmp/pgc++9bCe3jXUexoO.il -v -o CMakeFiles/cmTC_9932f.dir/CMakeCXXCompilerABI.cpp.o -c' -asm /tmp/pgc++LbCeVyAxx_Yt.s
+PGCC/x86 Linux 18.10-1: compilation successful
+
+/usr/bin/as /tmp/pgc++LbCeVyAxx_Yt.s -o CMakeFiles/cmTC_9932f.dir/CMakeCXXCompilerABI.cpp.o
+Action(ReadTIFile(./CMakeCXXCompilerABI.ti))
+Unlinking /tmp/pgc++9bCe3jXUexoO.il
+Unlinking /tmp/pgc++LbCeVyAxx_Yt.s
+Unlinking /tmp/pgc++nbCeNEnzNVv3.ll
+Linking CXX executable cmTC_9932f
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_9932f.dir/link.txt --verbose=1
+/mnt/pgi/linux86-64/2018/bin/pgc++ -v CMakeFiles/cmTC_9932f.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_9932f
+Export PGI_CURR_CUDA_HOME=/mnt/pgi/linux86-64/2018/cuda/9.1
+Export PGI=/mnt/pgi
+
+/usr/bin/ld /usr/lib/x86_64-linux-gnu/crt1.o /usr/lib/x86_64-linux-gnu/crti.o /mnt/pgi/linux86-64/18.10/lib/trace_init.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbegin.o /mnt/pgi/linux86-64/18.10/lib/initmp.o --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /mnt/pgi/linux86-64/18.10/lib/pgi.ld -L/mnt/pgi/linux86-64/18.10/lib -L/usr/lib64 -L/usr/lib/gcc/x86_64-linux-gnu/7 CMakeFiles/cmTC_9932f.dir/CMakeCXXCompilerABI.cpp.o -rpath /mnt/pgi/linux86-64/18.10/lib -rpath /usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib64 -o cmTC_9932f -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib64 -latomic -lpgatm -lstdc++ -lpgmp -lnuma -lpthread --start-group -lpgmath -lnspgc -lpgc --end-group -lm -lgcc -lc -lgcc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/7/crtend.o /usr/lib/x86_64-linux-gnu/crtn.o
+make[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-PGI-18.10.1.output
new file mode 100644
index 0000000000..8c9d24ae51
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-PGI-18.10.1.output
@@ -0,0 +1 @@
+/mnt/pgi/linux86-64/18.10/include-gcc70;/mnt/pgi/linux86-64/18.10/include;/usr/include/c++/7;/usr/include/x86_64-linux-gnu/c++/7;/usr/include/c++/7/backward;/usr/lib/gcc/x86_64-linux-gnu/7/include;/usr/local/include;/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed;/usr/include/x86_64-linux-gnu;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-12.1.0.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-12.1.0.input
new file mode 100644
index 0000000000..494b45c143
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-12.1.0.input
@@ -0,0 +1,42 @@
+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=XL
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=12.1.0
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_a9a18/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_a9a18.dir/build.make CMakeFiles/cmTC_a9a18.dir/build
+gmake[1]: Entering directory `/tmp/ii/CMakeFiles/CMakeTmp'
+Building CXX object CMakeFiles/cmTC_a9a18.dir/CMakeCXXCompilerABI.cpp.o
+/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/bin/xlc++ -+ -qthreaded -qhalt=e -V -o CMakeFiles/cmTC_a9a18.dir/CMakeCXXCompilerABI.cpp.o -c /soft/buildtools/cmake/3.5.2/share/cmake-3.5/Modules/CMakeCXXCompilerABI.cpp
+export XL_CONFIG=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/etc/vac.cfg.rhel6.9.gcc447:xlc++
+export XLC_USR_CONFIG=/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/etc/V1R2M4.vac.cfg.rhel6.9.gcc447
+export XL_ASMOBJFILES=/tmp/xlcAS0adOWz
+export "XL_DIS=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/dis -o "CMakeFiles/cmTC_a9a18.dir/CMakeCXXCompilerABI.cpp.o" "CMakeCXXCompilerABI.o""
+/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/exe/xlCentry -qosvar=rhel.6.9 -qalias=ansi -qtls -D_CALL_SYSV -D__null=0 -D__NO_MATH_INLINES -qtls -q64 -qgnu_version=4.4.7 -qthreaded -qhalt=e -qasm_as=/usr/bin/as -qcpp_stdinc=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/include:/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include:/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/include -qc_stdinc=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/include:/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/include -qgcc_cpp_stdinc=/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../include/c++/4.4.7:/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/ppc64-redhat-linux:/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/backward:/usr/local/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/crt/include:/usr/include -qgcc_c_stdinc=/usr/local/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/crt/include:/usr/include -qcomplexgccincl=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/include:/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/include:/usr/local/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/crt/include:/usr/include -oCMakeFiles/cmTC_a9a18.dir/CMakeCXXCompilerABI.cpp.o /soft/buildtools/cmake/3.5.2/share/cmake-3.5/Modules/CMakeCXXCompilerABI.cpp /tmp/xlcW0C4fVNg /tmp/xlcW1gn9wsn /dev/null /tmp/xlcLo7QvMFF.lst /dev/null /tmp/xlcW2svId7t
+export XL_BACKEND=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/xlCcode
+export XL_LINKER=/usr/bin/ld
+/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/xlCcode -qalias=ansi -qtls -qtls -qthreaded -qhalt=e /tmp/xlcW0C4fVNg /tmp/xlcW1gn9wsn CMakeFiles/cmTC_a9a18.dir/CMakeCXXCompilerABI.cpp.o /tmp/xlcLo7QvMFB.lst /tmp/xlcW2svId7t
+rm /tmp/xlcAS0adOWz
+rm /tmp/xlcLo7QvMF
+rm /tmp/xlcW0C4fVNg
+rm /tmp/xlcW1gn9wsn
+rm /tmp/xlcW2svId7t
+Linking CXX executable cmTC_a9a18
+/soft/buildtools/cmake/3.5.2/bin/cmake -E cmake_link_script CMakeFiles/cmTC_a9a18.dir/link.txt --verbose=1
+/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/bin/xlc++ -qthreaded -qhalt=e -V CMakeFiles/cmTC_a9a18.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_a9a18 -Wl,-export-dynamic
+export XL_CONFIG=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/etc/vac.cfg.rhel6.9.gcc447:xlc++
+export XLC_USR_CONFIG=/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/etc/V1R2M4.vac.cfg.rhel6.9.gcc447
+/usr/bin/ld --eh-frame-hdr -Qy -melf64ppc /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crt1.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crti.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/crtbegin.o -L/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/lib64 -L/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/lib64 -L/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/lib64 -L/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/lib64 -R/soft/compilers/ibmcmp-oct2017/lib64/bg -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../.. -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../.. CMakeFiles/cmTC_a9a18.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_a9a18 -export-dynamic -dynamic-linker /lib64/ld64.so.1 -lxlopt -lxl -libmc++ -lxlopt -lxl -lstdc++ -lm -ldl -lgcc_s -lgcc -lm -lc -lgcc_s -lgcc -ldl -lgcc_s -lgcc -lm -lc -lgcc_s -lgcc /usr/lib/gcc/ppc64-redhat-linux/4.4.7/crtend.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crtn.o
+rm /tmp/xlcW0zyCKVs
+rm /tmp/xlcW1UOt3GL
+rm /tmp/xlcW2lKGvs4
+gmake[1]: Leaving directory `/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-12.1.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-12.1.0.output
new file mode 100644
index 0000000000..1c545e074c
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-12.1.0.output
@@ -0,0 +1 @@
+/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/include;/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include;/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/include;/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../include/c++/4.4.7;/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/ppc64-redhat-linux;/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/backward;/usr/local/include;/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/crt/include;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-16.1.0.0.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-16.1.0.0.input
new file mode 100644
index 0000000000..37aa450fbc
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-16.1.0.0.input
@@ -0,0 +1,40 @@
+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=XL
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=16.1.0.0
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_f0c9c/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_f0c9c.dir/build.make CMakeFiles/cmTC_f0c9c.dir/build
+gmake[1]: Entering directory `/tmp/ii/CMakeFiles/CMakeTmp'
+Building CXX object CMakeFiles/cmTC_f0c9c.dir/CMakeCXXCompilerABI.cpp.o
+/opt/ibm/xlC/16.1.0/bin/xlc++ -+ -qthreaded -V -o CMakeFiles/cmTC_f0c9c.dir/CMakeCXXCompilerABI.cpp.o -c "/tmp/CMake/Modules/CMakeCXXCompilerABI.cpp"
+export XL_CONFIG=/opt/ibm/xlC/16.1.0/etc/xlc.cfg.centos.7.gcc.4.8.5:xlc++
+export XL_ASMOBJFILES=/tmp/xlcASfU5Npd
+export "XL_DIS=/opt/ibm/xlC/16.1.0/exe/dis -o "CMakeFiles/cmTC_f0c9c.dir/CMakeCXXCompilerABI.cpp.o" "CMakeCXXCompilerABI.o""
+/opt/ibm/xlC/16.1.0/exe/xlCentry -qosvar=centos.7.0 -qalias=ansi -qthreaded -D_REENTRANT -D__VACPP_MULTI__ -qtls -q64 -D_CALL_SYSV -D__NO_MATH_INLINES -D_CALL_ELF=2 -Wno-parentheses -Wno-unused-value -maltivec -qtls -q64 -qgnu_version=4.8.5 -qthreaded -xc++ -qasm_as=/usr/bin/as -qcpp_stdinc=/opt/ibm/xlsmp/5.1.0/include:/opt/ibm/xlmass/9.1.0/include:/opt/ibm/xlC/16.1.0/include -qc_stdinc=/opt/ibm/xlsmp/5.1.0/include:/opt/ibm/xlsmp/5.1.0/include:/opt/ibm/xlmass/9.1.0/include:/opt/ibm/xlC/16.1.0/include -qgcc_cpp_stdinc=/usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../../../include/c++/4.8.5:/usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../../../include/c++/4.8.5/ppc64le-redhat-linux:/usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../../../include/c++/4.8.5/backward:/opt/ibm/xlC/16.1.0/include:/usr/local/include:/opt/ibm/xlC/16.1.0/include:/usr/include -qgcc_c_stdinc=/opt/ibm/xlC/16.1.0/include:/usr/local/include:/opt/ibm/xlC/16.1.0/include:/usr/include -qcomplexgccincl=/opt/ibm/xlsmp/5.1.0/include:/opt/ibm/xlmass/9.1.0/include:/opt/ibm/xlC/16.1.0/include:/opt/ibm/xlC/16.1.0/include:/usr/local/include:/opt/ibm/xlC/16.1.0/include:/usr/include -oCMakeFiles/cmTC_f0c9c.dir/CMakeCXXCompilerABI.cpp.o "/tmp/CMake/Modules/CMakeCXXCompilerABI.cpp" /tmp/xlcW02F8mZr /tmp/xlcW1xG0Ns2 /dev/null /tmp/xlcLI57mTNF.lst /dev/null /tmp/xlcW2qVifWC
+export XL_BACKEND=/opt/ibm/xlC/16.1.0/exe/xlCcode
+export XL_LINKER=/usr/bin/ld
+/opt/ibm/xlC/16.1.0/exe/xlCcode -qalias=ansi -qthreaded -qtls -maltivec -qtls -qthreaded /tmp/xlcW02F8mZr /tmp/xlcW1xG0Ns2 CMakeFiles/cmTC_f0c9c.dir/CMakeCXXCompilerABI.cpp.o /tmp/xlcLI57mTNB.lst /tmp/xlcW2qVifWC
+rm /tmp/xlcASfU5Npd
+rm /tmp/xlcLI57mTN
+rm /tmp/xlcW02F8mZr
+rm /tmp/xlcW1xG0Ns2
+rm /tmp/xlcW2qVifWC
+Linking CXX executable cmTC_f0c9c
+"/tmp/CMake/bin/cmake" -E cmake_link_script CMakeFiles/cmTC_f0c9c.dir/link.txt --verbose=1
+/opt/ibm/xlC/16.1.0/bin/xlc++ -qthreaded -V -Wl,-export-dynamic CMakeFiles/cmTC_f0c9c.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_f0c9c
+export XL_CONFIG=/opt/ibm/xlC/16.1.0/etc/xlc.cfg.centos.7.gcc.4.8.5:xlc++
+/usr/bin/ld --eh-frame-hdr -Qy -melf64lppc -dynamic-linker /lib64/ld64.so.2 --enable-new-dtags /usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../../../lib64/crt1.o /usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../../../lib64/crti.o /usr/lib/gcc/ppc64le-redhat-linux/4.8.5/crtbegin.o -L/opt/ibm/xlsmp/5.1.0/lib -L/opt/ibm/xlmass/9.1.0/lib -L/opt/ibm/xlC/16.1.0/lib -R/opt/ibm/lib -L/usr/lib/gcc/ppc64le-redhat-linux/4.8.5 -L/usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../.. -export-dynamic CMakeFiles/cmTC_f0c9c.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_f0c9c -lxlopt -lxl -libmc++ -lstdc++ -lm -ldl -lgcc_s -lgcc --as-needed -lpthread --no-as-needed -lm -lc -lgcc_s -lgcc /usr/lib/gcc/ppc64le-redhat-linux/4.8.5/crtend.o /usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../../../lib64/crtn.o
+rm /tmp/xlcW0HSoDlw
+rm /tmp/xlcW1dUcwR6
+rm /tmp/xlcW25pPonH
+gmake[1]: Leaving directory `/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-16.1.0.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-16.1.0.0.output
new file mode 100644
index 0000000000..a34973c856
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-16.1.0.0.output
@@ -0,0 +1 @@
+/opt/ibm/xlsmp/5.1.0/include;/opt/ibm/xlmass/9.1.0/include;/opt/ibm/xlC/16.1.0/include;/usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../../../include/c++/4.8.5;/usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../../../include/c++/4.8.5/ppc64le-redhat-linux;/usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../../../include/c++/4.8.5/backward;/opt/ibm/xlC/16.1.0/include;/usr/local/include;/opt/ibm/xlC/16.1.0/include;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-GNU-7.3.0.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-GNU-7.3.0.input
new file mode 100644
index 0000000000..4582433dee
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-GNU-7.3.0.input
@@ -0,0 +1,76 @@
+CMAKE_LANG=Fortran
+CMAKE_Fortran_COMPILER_ABI=
+CMAKE_Fortran_COMPILER_AR=/usr/bin/gcc-ar-7
+CMAKE_Fortran_COMPILER_ARCHITECTURE_ID=
+CMAKE_Fortran_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_Fortran_COMPILER_ID=GNU
+CMAKE_Fortran_COMPILER_LAUNCHER=
+CMAKE_Fortran_COMPILER_LOADED=1
+CMAKE_Fortran_COMPILER_RANLIB=/usr/bin/gcc-ranlib-7
+CMAKE_Fortran_COMPILER_TARGET=
+CMAKE_Fortran_COMPILER_VERSION=7.3.0
+CMAKE_Fortran_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/make" "cmTC_1cf45/fast"
+/usr/bin/make -f CMakeFiles/cmTC_1cf45.dir/build.make CMakeFiles/cmTC_1cf45.dir/build
+make[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building Fortran object CMakeFiles/cmTC_1cf45.dir/CMakeFortranCompilerABI.F.o
+/usr/bin/f95 -v -c /proj/TableFS/data/chuck/cmake/f/share/cmake-3.13/Modules/CMakeFortranCompilerABI.F -o CMakeFiles/cmTC_1cf45.dir/CMakeFortranCompilerABI.F.o
+Using built-in specs.
+COLLECT_GCC=/usr/bin/f95
+OFFLOAD_TARGET_NAMES=nvptx-none
+OFFLOAD_TARGET_DEFAULT=1
+Target: x86_64-linux-gnu
+Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.3.0-27ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
+Thread model: posix
+gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04)
+COLLECT_GCC_OPTIONS='-v' '-c' '-o' 'CMakeFiles/cmTC_1cf45.dir/CMakeFortranCompilerABI.F.o' '-mtune=generic' '-march=x86-64'
+ /usr/lib/gcc/x86_64-linux-gnu/7/f951 /proj/TableFS/data/chuck/cmake/f/share/cmake-3.13/Modules/CMakeFortranCompilerABI.F -ffixed-form -cpp=/tmp/cc9yADLU.f90 -quiet -v -imultiarch x86_64-linux-gnu /proj/TableFS/data/chuck/cmake/f/share/cmake-3.13/Modules/CMakeFortranCompilerABI.F -quiet -dumpbase CMakeFortranCompilerABI.F -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_1cf45.dir/CMakeFortranCompilerABI.F.o -version -fintrinsic-modules-path /usr/lib/gcc/x86_64-linux-gnu/7/finclude -o /tmp/ccH7qQQk.s
+GNU Fortran (Ubuntu 7.3.0-27ubuntu1~18.04) version 7.3.0 (x86_64-linux-gnu)
+ compiled by GNU C version 7.3.0, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version isl-0.19-GMP
+
+GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
+ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
+ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/7/../../../../x86_64-linux-gnu/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ /usr/lib/gcc/x86_64-linux-gnu/7/finclude
+ /usr/lib/gcc/x86_64-linux-gnu/7/include
+ /usr/local/include
+ /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed
+ /usr/include/x86_64-linux-gnu
+ /usr/include
+End of search list.
+GNU Fortran2008 (Ubuntu 7.3.0-27ubuntu1~18.04) version 7.3.0 (x86_64-linux-gnu)
+ compiled by GNU C version 7.3.0, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version isl-0.19-GMP
+
+GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
+COLLECT_GCC_OPTIONS='-v' '-c' '-o' 'CMakeFiles/cmTC_1cf45.dir/CMakeFortranCompilerABI.F.o' '-mtune=generic' '-march=x86-64'
+ as -v --64 -o CMakeFiles/cmTC_1cf45.dir/CMakeFortranCompilerABI.F.o /tmp/ccH7qQQk.s
+GNU assembler version 2.30 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.30
+COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/
+LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../:/lib/:/usr/lib/
+COLLECT_GCC_OPTIONS='-v' '-c' '-o' 'CMakeFiles/cmTC_1cf45.dir/CMakeFortranCompilerABI.F.o' '-mtune=generic' '-march=x86-64'
+Linking Fortran executable cmTC_1cf45
+/proj/TableFS/data/chuck/cmake/f/bin/cmake -E cmake_link_script CMakeFiles/cmTC_1cf45.dir/link.txt --verbose=1
+/usr/bin/f95 -v CMakeFiles/cmTC_1cf45.dir/CMakeFortranCompilerABI.F.o -o cmTC_1cf45
+Driving: /usr/bin/f95 -v CMakeFiles/cmTC_1cf45.dir/CMakeFortranCompilerABI.F.o -o cmTC_1cf45 -l gfortran -l m -shared-libgcc
+Using built-in specs.
+COLLECT_GCC=/usr/bin/f95
+COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
+OFFLOAD_TARGET_NAMES=nvptx-none
+OFFLOAD_TARGET_DEFAULT=1
+Target: x86_64-linux-gnu
+Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.3.0-27ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
+Thread model: posix
+gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04)
+Reading specs from /usr/lib/gcc/x86_64-linux-gnu/7/libgfortran.spec
+rename spec lib to liborig
+COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_1cf45' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
+COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/
+LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../:/lib/:/usr/lib/
+COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_1cf45' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
+ /usr/lib/gcc/x86_64-linux-gnu/7/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/7/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper -plugin-opt=-fresolution=/tmp/ccS0UYIY.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lquadmath -plugin-opt=-pass-through=-lm -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_1cf45 /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/7/../../.. CMakeFiles/cmTC_1cf45.dir/CMakeFortranCompilerABI.F.o -lgfortran -lm -lgcc_s -lgcc -lquadmath -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/7/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crtn.o
+COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_1cf45' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
+make[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-GNU-7.3.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-GNU-7.3.0.output
new file mode 100644
index 0000000000..d84842b6f1
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-GNU-7.3.0.output
@@ -0,0 +1 @@
+/usr/lib/gcc/x86_64-linux-gnu/7/finclude;/usr/lib/gcc/x86_64-linux-gnu/7/include;/usr/local/include;/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed;/usr/include/x86_64-linux-gnu;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-PGI-18.10.1.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-PGI-18.10.1.input
new file mode 100644
index 0000000000..fe49bcdeeb
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-PGI-18.10.1.input
@@ -0,0 +1,47 @@
+CMAKE_LANG=Fortran
+CMAKE_Fortran_COMPILER_ABI=
+CMAKE_Fortran_COMPILER_AR=
+CMAKE_Fortran_COMPILER_ARCHITECTURE_ID=
+CMAKE_Fortran_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_Fortran_COMPILER_ID=PGI
+CMAKE_Fortran_COMPILER_LAUNCHER=
+CMAKE_Fortran_COMPILER_LOADED=1
+CMAKE_Fortran_COMPILER_RANLIB=
+CMAKE_Fortran_COMPILER_TARGET=
+CMAKE_Fortran_COMPILER_VERSION=18.10.1
+CMAKE_Fortran_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/make" "cmTC_1e8d2/fast"
+/usr/bin/make -f CMakeFiles/cmTC_1e8d2.dir/build.make CMakeFiles/cmTC_1e8d2.dir/build
+make[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building Fortran object CMakeFiles/cmTC_1e8d2.dir/CMakeFortranCompilerABI.F.o
+/mnt/pgi/linux86-64/2018/bin/pgfortran -v -c /usr/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F -o CMakeFiles/cmTC_1e8d2.dir/CMakeFortranCompilerABI.F.o
+Export PGI_CURR_CUDA_HOME=/mnt/pgi/linux86-64/2018/cuda/9.1
+Export PGI=/mnt/pgi
+
+/mnt/pgi/linux86-64/18.10/bin/pgf901 /usr/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F -opt 1 -nohpf -nostatic -x 19 0x400000 -quad -x 59 4 -x 15 2 -x 49 0x400004 -x 51 0x20 -x 57 0x4c -x 58 0x10000 -x 124 0x1000 -tp k8 -x 57 0xfb0000 -x 58 0x78031040 -x 47 0x08 -x 48 4608 -x 49 0x100 -x 120 0x200 -stdinc /mnt/pgi/linux86-64/18.10/include-gcc70:/mnt/pgi/linux86-64/18.10/include:/usr/lib/gcc/x86_64-linux-gnu/7/include:/usr/local/include:/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed:/usr/include/x86_64-linux-gnu:/usr/include -cmdline '+pgfortran /usr/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F -v -c -o CMakeFiles/cmTC_1e8d2.dir/CMakeFortranCompilerABI.F.o' -def unix -def __unix -def __unix__ -def linux -def __linux -def __linux__ -def __NO_MATH_INLINES -def __LP64__ -def __x86_64 -def __x86_64__ -def __LONG_MAX__=9223372036854775807L -def '__SIZE_TYPE__=unsigned long int' -def '__PTRDIFF_TYPE__=long int' -def __extension__= -def __amd_64__amd64__ -def __k8 -def __k8__ -def __SSE__ -def __MMX__ -def __SSE2__ -def __SSE3__ -preprocess -nofreeform -vect 48 -x 54 1 -x 70 0x40000000 -y 163 0xc0000000 -x 189 0x10 -modexport /tmp/pgfortranSoCeegQjDEd5.cmod -modindex /tmp/pgfortranmoCeK26CaVn7.cmdx -output /tmp/pgfortranSoCeeXSv8E7w.ilm
+ 0 inform, 0 warnings, 0 severes, 0 fatal for cmakefortrancompilerabi
+PGF90/x86-64 Linux 18.10-1: compilation successful
+
+/mnt/pgi/linux86-64/18.10/bin/pgf902 /tmp/pgfortranSoCeeXSv8E7w.ilm -fn /usr/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F -opt 1 -x 51 0x20 -x 119 0xa10000 -x 122 0x40 -x 123 0x1000 -x 127 4 -x 127 17 -x 19 0x400000 -x 28 0x40000 -x 120 0x10000000 -x 70 0x8000 -x 122 1 -x 125 0x20000 -quad -x 59 4 -tp k8 -x 120 0x1000 -x 124 0x1400 -y 15 2 -x 57 0x3b0000 -x 58 0x48000000 -x 49 0x100 -x 120 0x200 -astype 0 -x 68 0x20 -x 70 0x40000000 -x 164 0x800000 -x 124 1 -y 163 0xc0000000 -x 189 0x10 -y 189 0x4000000 -cmdline '+pgfortran /usr/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F -v -c -o CMakeFiles/cmTC_1e8d2.dir/CMakeFortranCompilerABI.F.o' -asm /tmp/pgfortranSoCeeRr681iB.s
+ 0 inform, 0 warnings, 0 severes, 0 fatal for cmakefortrancompilerabi
+PGF90/x86-64 Linux 18.10-1: compilation successful
+
+/usr/bin/as /tmp/pgfortranSoCeeRr681iB.s -o CMakeFiles/cmTC_1e8d2.dir/CMakeFortranCompilerABI.F.o
+
+/mnt/pgi/linux86-64/18.10/bin/pgappend -noerror CMakeFiles/cmTC_1e8d2.dir/CMakeFortranCompilerABI.F.o -name .IPDINFO /tmp/pgfortranSoCeegQjDEd5.cmod -name .IPEINFO /tmp/pgfortranmoCeK26CaVn7.cmdx
+Unlinking /tmp/pgfortranSoCeeXSv8E7w.ilm
+Unlinking /tmp/pgfortranmoCeK5sPGGfq.stb
+Unlinking /tmp/pgfortranSoCeegQjDEd5.cmod
+Unlinking /tmp/pgfortranmoCeK26CaVn7.cmdx
+Unlinking /tmp/pgfortranSoCeeRr681iB.s
+Unlinking /tmp/pgfortranmoCeKdFYP9Gu.ll
+Linking Fortran executable cmTC_1e8d2
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_1e8d2.dir/link.txt --verbose=1
+/mnt/pgi/linux86-64/2018/bin/pgfortran -v CMakeFiles/cmTC_1e8d2.dir/CMakeFortranCompilerABI.F.o -o cmTC_1e8d2
+Export PGI_CURR_CUDA_HOME=/mnt/pgi/linux86-64/2018/cuda/9.1
+Export PGI=/mnt/pgi
+
+/usr/bin/ld /usr/lib/x86_64-linux-gnu/crt1.o /usr/lib/x86_64-linux-gnu/crti.o /mnt/pgi/linux86-64/18.10/lib/trace_init.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbegin.o /mnt/pgi/linux86-64/18.10/lib/initmp.o /mnt/pgi/linux86-64/18.10/lib/f90main.o --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /mnt/pgi/linux86-64/18.10/lib/pgi.ld -L/mnt/pgi/linux86-64/18.10/lib -L/usr/lib64 -L/usr/lib/gcc/x86_64-linux-gnu/7 CMakeFiles/cmTC_1e8d2.dir/CMakeFortranCompilerABI.F.o -rpath /mnt/pgi/linux86-64/18.10/lib -rpath /usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib64 -o cmTC_1e8d2 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib64 -lpgf90rtl -lpgf90 -lpgf90_rpm1 -lpgf902 -lpgf90rtl -lpgftnrtl -lpgmp -lnuma -lpthread --start-group -lpgmath -lnspgc -lpgc --end-group -lrt -lpthread -lm -lgcc -lc -lgcc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/7/crtend.o /usr/lib/x86_64-linux-gnu/crtn.o
+make[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-PGI-18.10.1.output
new file mode 100644
index 0000000000..289c530a62
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-PGI-18.10.1.output
@@ -0,0 +1 @@
+/mnt/pgi/linux86-64/18.10/include-gcc70;/mnt/pgi/linux86-64/18.10/include;/usr/lib/gcc/x86_64-linux-gnu/7/include;/usr/local/include;/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed;/usr/include/x86_64-linux-gnu;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-XL-14.1.0.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-XL-14.1.0.input
new file mode 100644
index 0000000000..d80cedef71
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-XL-14.1.0.input
@@ -0,0 +1,50 @@
+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=XL
+CMAKE_Fortran_COMPILER_LAUNCHER=
+CMAKE_Fortran_COMPILER_LOADED=1
+CMAKE_Fortran_COMPILER_RANLIB=
+CMAKE_Fortran_COMPILER_TARGET=
+CMAKE_Fortran_COMPILER_VERSION=14.1.0
+CMAKE_Fortran_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_d05a9/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_d05a9.dir/build.make CMakeFiles/cmTC_d05a9.dir/build
+gmake[1]: Entering directory `/tmp/ii/CMakeFiles/CMakeTmp'
+Building Fortran object CMakeFiles/cmTC_d05a9.dir/CMakeFortranCompilerABI.F.o
+/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/bin/xlf -qthreaded -qhalt=e -V -c /soft/buildtools/cmake/3.5.2/share/cmake-3.5/Modules/CMakeFortranCompilerABI.F -o CMakeFiles/cmTC_d05a9.dir/CMakeFortranCompilerABI.F.o
+export XL_CONFIG=/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/etc/xlf.cfg.rhel6.9.gcc447:xlf
+export XLF_USR_CONFIG=/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/etc/V1R2M4.xlf.cfg.rhel6.9.gcc447
+export "XL_DIS=/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/exe/dis -o "CMakeFiles/cmTC_d05a9.dir/CMakeFortranCompilerABI.F.o" "CMakeFortranCompilerABI.o""
+/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/exe/cpp /soft/buildtools/cmake/3.5.2/share/cmake-3.5/Modules/CMakeFortranCompilerABI.F /tmp/F841970obBXFf -C -I/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include -I/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/include
+/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/exe/xlfentry /tmp/F841970obBXFf /tmp/F841970QXWvB4 /tmp/F841970QXWvB4F.lst xlfsmsg.cat xlfmsg.cat /soft/buildtools/cmake/3.5.2/share/cmake-3.5/Modules/CMakeFortranCompilerABI.F "OSVAR(rhel.6.9)" NOZEROSIZE SAVE "ALIAS(intptr)" "POSITION(appendold)" "XLF90(noautodealloc,nosignedzero,oldpad)" "XLF77(intarg,intxor,persistent,noleadzero,gedit77,noblankpad,oldboz,softeof)" "XLF2003(nopolymorphic,nobozlitargs,nostopexcept,novolatile,noautorealloc,oldnaninf)" "XLF2008(nocheckpresence)" 64 "GNU_VERSION(4.4.7)" "SAVEOPTFILE(/tmp/optf.41970mydp8V)" "SAVEVERSIONFILE(/tmp/version.41970sjsfYH)" THREADED "HALT(e)" "WSTREAMS(/tmp/F8419704oFzOth1,/tmp/F8419704oFzOtb1,/tmp/F8419704oFzOts1)" "DEFMSG(/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/msg/en_US)" -I/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include -I/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/include
+COMMAND LINE 1520-061 (W) The XLF77(PERSISTENT) option stores entities in static storage. This may affect the thread safety of your code.
+COMMAND LINE 1520-061 (W) The SAVE option stores entities in static storage. This may affect the thread safety of your code.
+** cmakefortrancompilerabi === End of Compilation 1 ===
+rm /tmp/F841970obBXFf
+export XL_FRONTEND=/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/exe/xlfentry
+export XL_ASTI=/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/exe/xlfhot
+export XL_BACKEND=/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/exe/xlfcode
+export XL_LINKER=/usr/bin/ld
+export XL_BOLT=/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/exe/bolt
+/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/exe/xlfhot /tmp/F8419704oFzOth1 /tmp/F8419704oFzOth2 /tmp/F8419704oFzOtb1 /tmp/F8419704oFzOtb2 /tmp/F8419704oFzOts1 /tmp/F8419704oFzOts2 /tmp/F841970QXWvB4 /tmp/F841970QXWvB4A.lst
+export XL_FRONTEND=/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/exe/xlfentry
+export XL_ASTI=/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/exe/xlfhot
+export XL_BACKEND=/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/exe/xlfcode
+export XL_LINKER=/usr/bin/ld
+export XL_BOLT=/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/exe/bolt
+/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/exe/xlfcode /tmp/F8419704oFzOth2 /tmp/F8419704oFzOtb2 CMakeFiles/cmTC_d05a9.dir/CMakeFortranCompilerABI.F.o /tmp/F841970QXWvB4B.lst /tmp/F8419704oFzOts2
+1501-510 Compilation successful for file CMakeFortranCompilerABI.F.
+rm /tmp/optf.41970mydp8V
+Linking Fortran executable cmTC_d05a9
+/soft/buildtools/cmake/3.5.2/bin/cmake -E cmake_link_script CMakeFiles/cmTC_d05a9.dir/link.txt --verbose=1
+/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/bin/xlf -V -qthreaded -qhalt=e CMakeFiles/cmTC_d05a9.dir/CMakeFortranCompilerABI.F.o -o cmTC_d05a9 -Wl,-export-dynamic
+export XL_CONFIG=/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/etc/xlf.cfg.rhel6.9.gcc447:xlf
+export XLF_USR_CONFIG=/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/etc/V1R2M4.xlf.cfg.rhel6.9.gcc447
+/usr/bin/ld --eh-frame-hdr -Qy -melf64ppc /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crt1.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crti.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/crtbegin.o -L/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/lib64 -L/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/lib64 -L/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/lib64 -R/soft/compilers/ibmcmp-oct2017/lib64/bg -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../.. CMakeFiles/cmTC_d05a9.dir/CMakeFortranCompilerABI.F.o -o cmTC_d05a9 -export-dynamic -dynamic-linker /lib64/ld64.so.1 -lxlf90 -lxlopt -lxlomp_ser -lxl -lxlfmath -lgcc_s -ldl -lrt -lpthread -lgcc -lm -lc -lgcc_s -lgcc /usr/lib/gcc/ppc64-redhat-linux/4.4.7/crtend.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crtn.o
+rm /tmp/optf.419839KEged
+gmake[1]: Leaving directory `/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-XL-14.1.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-XL-14.1.0.output
new file mode 100644
index 0000000000..39a28a46bc
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-XL-14.1.0.output
@@ -0,0 +1 @@
+/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include;/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-PGI-18.10.1.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-PGI-18.10.1.input
new file mode 100644
index 0000000000..5e2e49ab83
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-PGI-18.10.1.input
@@ -0,0 +1,36 @@
+CMAKE_LANG=C
+CMAKE_C_COMPILER_ABI=
+CMAKE_C_COMPILER_AR=
+CMAKE_C_COMPILER_ARCHITECTURE_ID=
+CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_C_COMPILER_ID=PGI
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=18.10.1
+CMAKE_C_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/make" "cmTC_a7f0d/fast"
+/usr/bin/make -f CMakeFiles/cmTC_a7f0d.dir/build.make CMakeFiles/cmTC_a7f0d.dir/build
+make[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building C object CMakeFiles/cmTC_a7f0d.dir/CMakeCCompilerABI.c.o
+/mnt/pgi/linux86-64/2018/bin/pgcc -Mnostdinc -v -o CMakeFiles/cmTC_a7f0d.dir/CMakeCCompilerABI.c.o -c /usr/share/cmake-3.10/Modules/CMakeCCompilerABI.c
+Export PGI_CURR_CUDA_HOME=/mnt/pgi/linux86-64/2018/cuda/9.1
+Export PGI=/mnt/pgi
+
+/mnt/pgi/linux86-64/18.10/bin/pgc /usr/share/cmake-3.10/Modules/CMakeCCompilerABI.c -opt 1 -x 119 0xa10000 -x 122 0x40 -x 123 0x1000 -x 127 4 -x 127 17 -x 19 0x400000 -x 28 0x40000 -x 120 0x10000000 -x 70 0x8000 -x 122 1 -x 125 0x20000 -quad -x 59 4 -tp k8 -x 120 0x1000 -astype 0 -nostdinc -def unix -def __unix -def __unix__ -def linux -def __linux -def __linux__ -def __NO_MATH_INLINES -def __LP64__ -def __x86_64 -def __x86_64__ -def __LONG_MAX__=9223372036854775807L -def '__SIZE_TYPE__=unsigned long int' -def '__PTRDIFF_TYPE__=long int' -def __extension__= -def __amd_64__amd64__ -def __k8 -def __k8__ -def __SSE__ -def __MMX__ -def __SSE2__ -def __SSE3__ -predicate '#machine(x86_64) #lint(off) #system(posix) #cpu(x86_64)' -cmdline '+pgcc /usr/share/cmake-3.10/Modules/CMakeCCompilerABI.c -Mnostdinc -v -o CMakeFiles/cmTC_a7f0d.dir/CMakeCCompilerABI.c.o -c' -outfile CMakeFiles/cmTC_a7f0d.dir/CMakeCCompilerABI.c.o -x 123 0x80000000 -x 123 4 -x 2 0x400 -x 119 0x20 -def __pgnu_vsn=70300 -x 120 0x200000 -x 70 0x40000000 -x 164 0x800000 -y 163 0xc0000000 -x 189 0x10 -y 189 0x4000000 -asm /tmp/pgccjRkfBrHQsITu.s
+PGC/x86-64 Linux 18.10-1: compilation successful
+
+/usr/bin/as /tmp/pgccjRkfBrHQsITu.s -o CMakeFiles/cmTC_a7f0d.dir/CMakeCCompilerABI.c.o
+Unlinking /tmp/pgccjRkfBrHQsITu.s
+Unlinking /tmp/pgccrRkfZClhdaSG.ll
+Linking C executable cmTC_a7f0d
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_a7f0d.dir/link.txt --verbose=1
+/mnt/pgi/linux86-64/2018/bin/pgcc -Mnostdinc -v CMakeFiles/cmTC_a7f0d.dir/CMakeCCompilerABI.c.o -o cmTC_a7f0d
+Export PGI_CURR_CUDA_HOME=/mnt/pgi/linux86-64/2018/cuda/9.1
+Export PGI=/mnt/pgi
+
+/usr/bin/ld /usr/lib/x86_64-linux-gnu/crt1.o /usr/lib/x86_64-linux-gnu/crti.o /mnt/pgi/linux86-64/18.10/lib/trace_init.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbegin.o /mnt/pgi/linux86-64/18.10/lib/initmp.o --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /mnt/pgi/linux86-64/18.10/lib/pgi.ld -L/mnt/pgi/linux86-64/18.10/lib -L/usr/lib64 -L/usr/lib/gcc/x86_64-linux-gnu/7 CMakeFiles/cmTC_a7f0d.dir/CMakeCCompilerABI.c.o -rpath /mnt/pgi/linux86-64/18.10/lib -rpath /usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib64 -o cmTC_a7f0d -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib64 -lpgmp -lnuma -lpthread --start-group -lpgmath -lnspgc -lpgc --end-group -lm -lgcc -lc -lgcc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/7/crtend.o /usr/lib/x86_64-linux-gnu/crtn.o
+make[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-PGI-18.10.1.output
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-PGI-18.10.1.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-XL-12.1.0.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-XL-12.1.0.input
new file mode 100644
index 0000000000..8b1e2860b9
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-XL-12.1.0.input
@@ -0,0 +1,42 @@
+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=XL
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=12.1.0
+CMAKE_C_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_b8c4a/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_b8c4a.dir/build.make CMakeFiles/cmTC_b8c4a.dir/build
+gmake[1]: Entering directory `/tmp/ii/CMakeFiles/CMakeTmp'
+Building C object CMakeFiles/cmTC_b8c4a.dir/CMakeCCompilerABI.c.o
+/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/bin/xlc -qnostdinc -V -o CMakeFiles/cmTC_b8c4a.dir/CMakeCCompilerABI.c.o -c /soft/buildtools/cmake/3.5.2/share/cmake-3.5/Modules/CMakeCCompilerABI.c
+export XL_CONFIG=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/etc/vac.cfg.rhel6.9.gcc447:xlc
+export XLC_USR_CONFIG=/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/etc/V1R2M4.vac.cfg.rhel6.9.gcc447
+export XL_ASMOBJFILES=/tmp/xlcASEFMkoN
+export "XL_DIS=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/dis -o "CMakeFiles/cmTC_b8c4a.dir/CMakeCCompilerABI.c.o" "CMakeCCompilerABI.o""
+/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/xlcentry -qosvar=rhel.6.9 -qlanglvl=extc99 -qcpluscmt -qkeyword=inline -qalias=ansi -qtls -D_CALL_SYSV -D__null=0 -D__NO_MATH_INLINES -qtls -q64 -qgnu_version=4.4.7 -qnostdinc -qasm_as=/usr/bin/as -qc_stdinc=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/include:/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/include -qgcc_c_stdinc=/usr/local/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/crt/include:/usr/include -qcomplexgccincl=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/include:/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/include:/usr/local/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/crt/include:/usr/include -qvac_include_path=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/include -oCMakeFiles/cmTC_b8c4a.dir/CMakeCCompilerABI.c.o /soft/buildtools/cmake/3.5.2/share/cmake-3.5/Modules/CMakeCCompilerABI.c /tmp/xlcW0cUFNRj /tmp/xlcW1YJsgzt /dev/null /tmp/xlcLI4MvwXF.lst /dev/null /tmp/xlcW2sIonhD
+export XL_BACKEND=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/xlCcode
+export XL_LINKER=/usr/bin/ld
+/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/xlCcode -qlanglvl=extc99 -qcpluscmt -qkeyword=inline -qalias=ansi -qtls -qtls -qnostdinc /tmp/xlcW0cUFNRj /tmp/xlcW1YJsgzt CMakeFiles/cmTC_b8c4a.dir/CMakeCCompilerABI.c.o /tmp/xlcLI4MvwXB.lst /tmp/xlcW2sIonhD
+rm /tmp/xlcASEFMkoN
+rm /tmp/xlcLI4MvwX
+rm /tmp/xlcW0cUFNRj
+rm /tmp/xlcW1YJsgzt
+rm /tmp/xlcW2sIonhD
+Linking C executable cmTC_b8c4a
+/soft/buildtools/cmake/3.5.2/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b8c4a.dir/link.txt --verbose=1
+/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/bin/xlc -qnostdinc -V CMakeFiles/cmTC_b8c4a.dir/CMakeCCompilerABI.c.o -o cmTC_b8c4a -Wl,-export-dynamic
+export XL_CONFIG=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/etc/vac.cfg.rhel6.9.gcc447:xlc
+export XLC_USR_CONFIG=/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/etc/V1R2M4.vac.cfg.rhel6.9.gcc447
+/usr/bin/ld --eh-frame-hdr -Qy -melf64ppc /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crt1.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crti.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/crtbegin.o -L/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/lib64 -L/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/lib64 -L/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/lib64 -L/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/lib64 -R/soft/compilers/ibmcmp-oct2017/lib64/bg -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../.. CMakeFiles/cmTC_b8c4a.dir/CMakeCCompilerABI.c.o -o cmTC_b8c4a -export-dynamic -dynamic-linker /lib64/ld64.so.1 -lxlopt -lxl -ldl -lgcc_s -lgcc -lm -lc -lgcc_s -lgcc /usr/lib/gcc/ppc64-redhat-linux/4.4.7/crtend.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crtn.o
+rm /tmp/xlcW03gDCly
+rm /tmp/xlcW1oa6XxW
+rm /tmp/xlcW2fQXnKk
+gmake[1]: Leaving directory `/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-XL-12.1.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-XL-12.1.0.output
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-XL-12.1.0.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-PGI-18.10.1.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-PGI-18.10.1.input
new file mode 100644
index 0000000000..dd2b55d918
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-PGI-18.10.1.input
@@ -0,0 +1,40 @@
+CMAKE_LANG=CXX
+CMAKE_CXX_COMPILER_ABI=
+CMAKE_CXX_COMPILER_AR=
+CMAKE_CXX_COMPILER_ARCHITECTURE_ID=
+CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CXX_COMPILER_ID=PGI
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=18.10.1
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/make" "cmTC_90855/fast"
+/usr/bin/make -f CMakeFiles/cmTC_90855.dir/build.make CMakeFiles/cmTC_90855.dir/build
+make[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building CXX object CMakeFiles/cmTC_90855.dir/CMakeCXXCompilerABI.cpp.o
+/mnt/pgi/linux86-64/2018/bin/pgc++ -Mnostdinc -v -o CMakeFiles/cmTC_90855.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake-3.10/Modules/CMakeCXXCompilerABI.cpp
+Export PGI_CURR_CUDA_HOME=/mnt/pgi/linux86-64/2018/cuda/9.1
+Export PGI=/mnt/pgi
+
+/mnt/pgi/linux86-64/18.10/bin/pggpp1 --llalign -Dunix -D__unix -D__unix__ -Dlinux -D__linux -D__linux__ -D__NO_MATH_INLINES -D__LP64__ -D__x86_64 -D__x86_64__ -D__LONG_MAX__=9223372036854775807L '-D__SIZE_TYPE__=unsigned long int' '-D__PTRDIFF_TYPE__=long int' -D__extension__= -D__amd_64__amd64__ -D__k8 -D__k8__ -D__SSE__ -D__MMX__ -D__SSE2__ -D__SSE3__ -D__PGI -D_GNU_SOURCE -D_PGCG_SOURCE -I- -I/mnt/pgi/linux86-64/18.10/include-gcc70 -I/mnt/pgi/linux86-64/18.10/include -I/usr/include/c++/7 -I/usr/include/x86_64-linux-gnu/c++/7 -I/usr/include/c++/7/backward -I/usr/lib/gcc/x86_64-linux-gnu/7/include -I/usr/local/include -I/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed -I/usr/include/x86_64-linux-gnu -I/usr/include --preinclude _cplus_preinclude.h --preinclude_macros _cplus_macros.h --gnu_version=70300 -D__pgnu_vsn=70300 -q -o /tmp/pgc++X3kftwl3x0Hl.il /usr/share/cmake-3.10/Modules/CMakeCXXCompilerABI.cpp
+
+/mnt/pgi/linux86-64/18.10/bin/pggpp2 /usr/share/cmake-3.10/Modules/CMakeCXXCompilerABI.cpp -opt 1 -x 119 0xa10000 -x 122 0x40 -x 123 0x1000 -x 127 4 -x 127 17 -x 19 0x400000 -x 28 0x40000 -x 120 0x10000000 -x 70 0x8000 -x 122 1 -x 125 0x20000 -quad -x 59 4 -tp k8 -x 120 0x1000 -astype 0 -fn /usr/share/cmake-3.10/Modules/CMakeCXXCompilerABI.cpp -il /tmp/pgc++X3kftwl3x0Hl.il -x 117 0x600 -x 123 0x80000000 -x 123 4 -x 119 0x20 -def __pgnu_vsn=70300 -x 120 0x200000 -x 70 0x40000000 -x 164 0x800000 -y 163 0xc0000000 -x 189 0x10 -y 189 0x4000000 -gnuvsn 70300 -x 69 0x200 -cmdline '+pgc++ /tmp/pgc++X3kftwl3x0Hl.il -Mnostdinc -v -o CMakeFiles/cmTC_90855.dir/CMakeCXXCompilerABI.cpp.o -c' -asm /tmp/pgc++53kfRignAQXZ.s
+PGCC/x86 Linux 18.10-1: compilation successful
+
+/usr/bin/as /tmp/pgc++53kfRignAQXZ.s -o CMakeFiles/cmTC_90855.dir/CMakeCXXCompilerABI.cpp.o
+Action(ReadTIFile(./CMakeCXXCompilerABI.ti))
+Unlinking /tmp/pgc++X3kftwl3x0Hl.il
+Unlinking /tmp/pgc++53kfRignAQXZ.s
+Unlinking /tmp/pgc++b3kfdox2AAgc.ll
+Linking CXX executable cmTC_90855
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_90855.dir/link.txt --verbose=1
+/mnt/pgi/linux86-64/2018/bin/pgc++ -Mnostdinc -v CMakeFiles/cmTC_90855.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_90855
+Export PGI_CURR_CUDA_HOME=/mnt/pgi/linux86-64/2018/cuda/9.1
+Export PGI=/mnt/pgi
+
+/usr/bin/ld /usr/lib/x86_64-linux-gnu/crt1.o /usr/lib/x86_64-linux-gnu/crti.o /mnt/pgi/linux86-64/18.10/lib/trace_init.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbegin.o /mnt/pgi/linux86-64/18.10/lib/initmp.o --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /mnt/pgi/linux86-64/18.10/lib/pgi.ld -L/mnt/pgi/linux86-64/18.10/lib -L/usr/lib64 -L/usr/lib/gcc/x86_64-linux-gnu/7 CMakeFiles/cmTC_90855.dir/CMakeCXXCompilerABI.cpp.o -rpath /mnt/pgi/linux86-64/18.10/lib -rpath /usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib64 -o cmTC_90855 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib64 -latomic -lpgatm -lstdc++ -lpgmp -lnuma -lpthread --start-group -lpgmath -lnspgc -lpgc --end-group -lm -lgcc -lc -lgcc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/7/crtend.o /usr/lib/x86_64-linux-gnu/crtn.o
+make[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-PGI-18.10.1.output
new file mode 100644
index 0000000000..8c9d24ae51
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-PGI-18.10.1.output
@@ -0,0 +1 @@
+/mnt/pgi/linux86-64/18.10/include-gcc70;/mnt/pgi/linux86-64/18.10/include;/usr/include/c++/7;/usr/include/x86_64-linux-gnu/c++/7;/usr/include/c++/7/backward;/usr/lib/gcc/x86_64-linux-gnu/7/include;/usr/local/include;/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed;/usr/include/x86_64-linux-gnu;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-XL-12.1.0.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-XL-12.1.0.input
new file mode 100644
index 0000000000..f6b5d91114
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-XL-12.1.0.input
@@ -0,0 +1,42 @@
+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=XL
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=12.1.0
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_98791/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_98791.dir/build.make CMakeFiles/cmTC_98791.dir/build
+gmake[1]: Entering directory `/tmp/ii/CMakeFiles/CMakeTmp'
+Building CXX object CMakeFiles/cmTC_98791.dir/CMakeCXXCompilerABI.cpp.o
+/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/bin/xlC -+ -qnostdinc -V -o CMakeFiles/cmTC_98791.dir/CMakeCXXCompilerABI.cpp.o -c /soft/buildtools/cmake/3.5.2/share/cmake-3.5/Modules/CMakeCXXCompilerABI.cpp
+export XL_CONFIG=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/etc/vac.cfg.rhel6.9.gcc447:xlC
+export XLC_USR_CONFIG=/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/etc/V1R2M4.vac.cfg.rhel6.9.gcc447
+export XL_ASMOBJFILES=/tmp/xlcAS82INiZ
+export "XL_DIS=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/dis -o "CMakeFiles/cmTC_98791.dir/CMakeCXXCompilerABI.cpp.o" "CMakeCXXCompilerABI.o""
+/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/exe/xlCentry -qosvar=rhel.6.9 -qalias=ansi -qtls -D_CALL_SYSV -D__null=0 -D__NO_MATH_INLINES -qtls -q64 -qgnu_version=4.4.7 -qnostdinc -qasm_as=/usr/bin/as -qcpp_stdinc=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/include:/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include:/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/include -qc_stdinc=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/include:/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/include -qgcc_cpp_stdinc=/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../include/c++/4.4.7:/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/ppc64-redhat-linux:/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/backward:/usr/local/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/crt/include:/usr/include -qgcc_c_stdinc=/usr/local/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/crt/include:/usr/include -qcomplexgccincl=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/include:/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/include:/usr/local/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/crt/include:/usr/include -oCMakeFiles/cmTC_98791.dir/CMakeCXXCompilerABI.cpp.o /soft/buildtools/cmake/3.5.2/share/cmake-3.5/Modules/CMakeCXXCompilerABI.cpp /tmp/xlcW0SEqGeR /tmp/xlcW1AfQ1jy /dev/null /tmp/xlcLmUAPcJF.lst /dev/null /tmp/xlcW2OCErpf
+export XL_BACKEND=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/xlCcode
+export XL_LINKER=/usr/bin/ld
+/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/xlCcode -qalias=ansi -qtls -qtls -qnostdinc /tmp/xlcW0SEqGeR /tmp/xlcW1AfQ1jy CMakeFiles/cmTC_98791.dir/CMakeCXXCompilerABI.cpp.o /tmp/xlcLmUAPcJB.lst /tmp/xlcW2OCErpf
+rm /tmp/xlcAS82INiZ
+rm /tmp/xlcLmUAPcJ
+rm /tmp/xlcW0SEqGeR
+rm /tmp/xlcW1AfQ1jy
+rm /tmp/xlcW2OCErpf
+Linking CXX executable cmTC_98791
+/soft/buildtools/cmake/3.5.2/bin/cmake -E cmake_link_script CMakeFiles/cmTC_98791.dir/link.txt --verbose=1
+/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/bin/xlC -qnostdinc -V CMakeFiles/cmTC_98791.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_98791 -Wl,-export-dynamic
+export XL_CONFIG=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/etc/vac.cfg.rhel6.9.gcc447:xlC
+export XLC_USR_CONFIG=/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/etc/V1R2M4.vac.cfg.rhel6.9.gcc447
+/usr/bin/ld --eh-frame-hdr -Qy -melf64ppc /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crt1.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crti.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/crtbegin.o -L/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/lib64 -L/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/lib64 -L/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/lib64 -L/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/lib64 -R/soft/compilers/ibmcmp-oct2017/lib64/bg -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../.. -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../.. CMakeFiles/cmTC_98791.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_98791 -export-dynamic -dynamic-linker /lib64/ld64.so.1 -lxlopt -lxl -libmc++ -lxlopt -lxl -lstdc++ -lm -ldl -lgcc_s -lgcc -lm -lc -lgcc_s -lgcc -ldl -lgcc_s -lgcc -lm -lc -lgcc_s -lgcc /usr/lib/gcc/ppc64-redhat-linux/4.4.7/crtend.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crtn.o
+rm /tmp/xlcW0DcBWi8
+rm /tmp/xlcW14NqGs6
+rm /tmp/xlcW2Z8nuC4
+gmake[1]: Leaving directory `/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-XL-12.1.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-XL-12.1.0.output
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-XL-12.1.0.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-Fortran-PGI-18.10.1.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-Fortran-PGI-18.10.1.input
new file mode 100644
index 0000000000..12727f048d
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-Fortran-PGI-18.10.1.input
@@ -0,0 +1,47 @@
+CMAKE_LANG=Fortran
+CMAKE_Fortran_COMPILER_ABI=
+CMAKE_Fortran_COMPILER_AR=
+CMAKE_Fortran_COMPILER_ARCHITECTURE_ID=
+CMAKE_Fortran_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_Fortran_COMPILER_ID=PGI
+CMAKE_Fortran_COMPILER_LAUNCHER=
+CMAKE_Fortran_COMPILER_LOADED=1
+CMAKE_Fortran_COMPILER_RANLIB=
+CMAKE_Fortran_COMPILER_TARGET=
+CMAKE_Fortran_COMPILER_VERSION=18.10.1
+CMAKE_Fortran_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/make" "cmTC_b7462/fast"
+/usr/bin/make -f CMakeFiles/cmTC_b7462.dir/build.make CMakeFiles/cmTC_b7462.dir/build
+make[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building Fortran object CMakeFiles/cmTC_b7462.dir/CMakeFortranCompilerABI.F.o
+/mnt/pgi/linux86-64/2018/bin/pgfortran -Mnostdinc -v -c /usr/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F -o CMakeFiles/cmTC_b7462.dir/CMakeFortranCompilerABI.F.o
+Export PGI_CURR_CUDA_HOME=/mnt/pgi/linux86-64/2018/cuda/9.1
+Export PGI=/mnt/pgi
+
+/mnt/pgi/linux86-64/18.10/bin/pgf901 /usr/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F -opt 1 -nohpf -nostatic -x 19 0x400000 -quad -x 59 4 -x 15 2 -x 49 0x400004 -x 51 0x20 -x 57 0x4c -x 58 0x10000 -x 124 0x1000 -tp k8 -x 57 0xfb0000 -x 58 0x78031040 -x 47 0x08 -x 48 4608 -x 49 0x100 -x 120 0x200 -nostdinc -cmdline '+pgfortran /usr/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F -Mnostdinc -v -c -o CMakeFiles/cmTC_b7462.dir/CMakeFortranCompilerABI.F.o' -def unix -def __unix -def __unix__ -def linux -def __linux -def __linux__ -def __NO_MATH_INLINES -def __LP64__ -def __x86_64 -def __x86_64__ -def __LONG_MAX__=9223372036854775807L -def '__SIZE_TYPE__=unsigned long int' -def '__PTRDIFF_TYPE__=long int' -def __extension__= -def __amd_64__amd64__ -def __k8 -def __k8__ -def __SSE__ -def __MMX__ -def __SSE2__ -def __SSE3__ -preprocess -nofreeform -vect 48 -x 54 1 -x 70 0x40000000 -y 163 0xc0000000 -x 189 0x10 -modexport /tmp/pgfortranoelfQQWHVV3l.cmod -modindex /tmp/pgfortran_elf6-1UcVhp.cmdx -output /tmp/pgfortranUelfk_cqURUw.ilm
+ 0 inform, 0 warnings, 0 severes, 0 fatal for cmakefortrancompilerabi
+PGF90/x86-64 Linux 18.10-1: compilation successful
+
+/mnt/pgi/linux86-64/18.10/bin/pgf902 /tmp/pgfortranUelfk_cqURUw.ilm -fn /usr/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F -opt 1 -x 51 0x20 -x 119 0xa10000 -x 122 0x40 -x 123 0x1000 -x 127 4 -x 127 17 -x 19 0x400000 -x 28 0x40000 -x 120 0x10000000 -x 70 0x8000 -x 122 1 -x 125 0x20000 -quad -x 59 4 -tp k8 -x 120 0x1000 -x 124 0x1400 -y 15 2 -x 57 0x3b0000 -x 58 0x48000000 -x 49 0x100 -x 120 0x200 -astype 0 -x 68 0x20 -x 70 0x40000000 -x 164 0x800000 -x 124 1 -y 163 0xc0000000 -x 189 0x10 -y 189 0x4000000 -cmdline '+pgfortran /usr/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F -Mnostdinc -v -c -o CMakeFiles/cmTC_b7462.dir/CMakeFortranCompilerABI.F.o' -asm /tmp/pgfortranUelfk-LC2Ixm.s
+ 0 inform, 0 warnings, 0 severes, 0 fatal for cmakefortrancompilerabi
+PGF90/x86-64 Linux 18.10-1: compilation successful
+
+/usr/bin/as /tmp/pgfortranUelfk-LC2Ixm.s -o CMakeFiles/cmTC_b7462.dir/CMakeFortranCompilerABI.F.o
+
+/mnt/pgi/linux86-64/18.10/bin/pgappend -noerror CMakeFiles/cmTC_b7462.dir/CMakeFortranCompilerABI.F.o -name .IPDINFO /tmp/pgfortranoelfQQWHVV3l.cmod -name .IPEINFO /tmp/pgfortran_elf6-1UcVhp.cmdx
+Unlinking /tmp/pgfortranUelfk_cqURUw.ilm
+Unlinking /tmp/pgfortranEelfAVAFcE2q.stb
+Unlinking /tmp/pgfortranoelfQQWHVV3l.cmod
+Unlinking /tmp/pgfortran_elf6-1UcVhp.cmdx
+Unlinking /tmp/pgfortranUelfk-LC2Ixm.s
+Unlinking /tmp/pgfortranEelfA4vWZ2Nt.ll
+Linking Fortran executable cmTC_b7462
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b7462.dir/link.txt --verbose=1
+/mnt/pgi/linux86-64/2018/bin/pgfortran -v -Mnostdinc CMakeFiles/cmTC_b7462.dir/CMakeFortranCompilerABI.F.o -o cmTC_b7462
+Export PGI_CURR_CUDA_HOME=/mnt/pgi/linux86-64/2018/cuda/9.1
+Export PGI=/mnt/pgi
+
+/usr/bin/ld /usr/lib/x86_64-linux-gnu/crt1.o /usr/lib/x86_64-linux-gnu/crti.o /mnt/pgi/linux86-64/18.10/lib/trace_init.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbegin.o /mnt/pgi/linux86-64/18.10/lib/initmp.o /mnt/pgi/linux86-64/18.10/lib/f90main.o --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /mnt/pgi/linux86-64/18.10/lib/pgi.ld -L/mnt/pgi/linux86-64/18.10/lib -L/usr/lib64 -L/usr/lib/gcc/x86_64-linux-gnu/7 CMakeFiles/cmTC_b7462.dir/CMakeFortranCompilerABI.F.o -rpath /mnt/pgi/linux86-64/18.10/lib -rpath /usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib64 -o cmTC_b7462 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib64 -lpgf90rtl -lpgf90 -lpgf90_rpm1 -lpgf902 -lpgf90rtl -lpgftnrtl -lpgmp -lnuma -lpthread --start-group -lpgmath -lnspgc -lpgc --end-group -lrt -lpthread -lm -lgcc -lc -lgcc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/7/crtend.o /usr/lib/x86_64-linux-gnu/crtn.o
+make[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-Fortran-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-Fortran-PGI-18.10.1.output
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-Fortran-PGI-18.10.1.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-C-XL-12.1.0.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-C-XL-12.1.0.input
new file mode 100644
index 0000000000..a552d70521
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-C-XL-12.1.0.input
@@ -0,0 +1,42 @@
+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=XL
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=12.1.0
+CMAKE_C_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_76ec2/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_76ec2.dir/build.make CMakeFiles/cmTC_76ec2.dir/build
+gmake[1]: Entering directory `/tmp/ii/CMakeFiles/CMakeTmp'
+Building C object CMakeFiles/cmTC_76ec2.dir/CMakeCCompilerABI.c.o
+/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/bin/xlc -qnostdinc -I/tmp/ii/test_c -V -o CMakeFiles/cmTC_76ec2.dir/CMakeCCompilerABI.c.o -c /soft/buildtools/cmake/3.5.2/share/cmake-3.5/Modules/CMakeCCompilerABI.c
+export XL_CONFIG=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/etc/vac.cfg.rhel6.9.gcc447:xlc
+export XLC_USR_CONFIG=/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/etc/V1R2M4.vac.cfg.rhel6.9.gcc447
+export XL_ASMOBJFILES=/tmp/xlcASknvctJ
+export "XL_DIS=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/dis -o "CMakeFiles/cmTC_76ec2.dir/CMakeCCompilerABI.c.o" "CMakeCCompilerABI.o""
+/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/xlcentry -qosvar=rhel.6.9 -qlanglvl=extc99 -qcpluscmt -qkeyword=inline -qalias=ansi -qtls -D_CALL_SYSV -D__null=0 -D__NO_MATH_INLINES -qtls -q64 -qgnu_version=4.4.7 -qnostdinc -I/tmp/ii/test_c -qasm_as=/usr/bin/as -qc_stdinc=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/include:/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/include -qgcc_c_stdinc=/usr/local/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/crt/include:/usr/include -qcomplexgccincl=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/include:/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/include:/usr/local/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/crt/include:/usr/include -qvac_include_path=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/include -oCMakeFiles/cmTC_76ec2.dir/CMakeCCompilerABI.c.o /soft/buildtools/cmake/3.5.2/share/cmake-3.5/Modules/CMakeCCompilerABI.c /tmp/xlcW0buijl3 /tmp/xlcW1Cx9kxW /dev/null /tmp/xlcLVbqvUBF.lst /dev/null /tmp/xlcW2hWVoJP
+export XL_BACKEND=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/xlCcode
+export XL_LINKER=/usr/bin/ld
+/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/xlCcode -qlanglvl=extc99 -qcpluscmt -qkeyword=inline -qalias=ansi -qtls -qtls -qnostdinc /tmp/xlcW0buijl3 /tmp/xlcW1Cx9kxW CMakeFiles/cmTC_76ec2.dir/CMakeCCompilerABI.c.o /tmp/xlcLVbqvUBB.lst /tmp/xlcW2hWVoJP
+rm /tmp/xlcASknvctJ
+rm /tmp/xlcLVbqvUB
+rm /tmp/xlcW0buijl3
+rm /tmp/xlcW1Cx9kxW
+rm /tmp/xlcW2hWVoJP
+Linking C executable cmTC_76ec2
+/soft/buildtools/cmake/3.5.2/bin/cmake -E cmake_link_script CMakeFiles/cmTC_76ec2.dir/link.txt --verbose=1
+/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/bin/xlc -qnostdinc -I/tmp/ii/test_c -V CMakeFiles/cmTC_76ec2.dir/CMakeCCompilerABI.c.o -o cmTC_76ec2 -Wl,-export-dynamic
+export XL_CONFIG=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/etc/vac.cfg.rhel6.9.gcc447:xlc
+export XLC_USR_CONFIG=/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/etc/V1R2M4.vac.cfg.rhel6.9.gcc447
+/usr/bin/ld --eh-frame-hdr -Qy -melf64ppc /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crt1.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crti.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/crtbegin.o -L/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/lib64 -L/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/lib64 -L/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/lib64 -L/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/lib64 -R/soft/compilers/ibmcmp-oct2017/lib64/bg -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../.. CMakeFiles/cmTC_76ec2.dir/CMakeCCompilerABI.c.o -o cmTC_76ec2 -export-dynamic -dynamic-linker /lib64/ld64.so.1 -lxlopt -lxl -ldl -lgcc_s -lgcc -lm -lc -lgcc_s -lgcc /usr/lib/gcc/ppc64-redhat-linux/4.4.7/crtend.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crtn.o
+rm /tmp/xlcW0ka8GHg
+rm /tmp/xlcW1k1R1fn
+rm /tmp/xlcW2s4HnOt
+gmake[1]: Leaving directory `/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-C-XL-12.1.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-C-XL-12.1.0.output
new file mode 100644
index 0000000000..38f0b37343
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-C-XL-12.1.0.output
@@ -0,0 +1 @@
+/tmp/ii/test_c
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-CXX-XL-12.1.0.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-CXX-XL-12.1.0.input
new file mode 100644
index 0000000000..4b20f2ee47
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-CXX-XL-12.1.0.input
@@ -0,0 +1,42 @@
+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=XL
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=12.1.0
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_026f6/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_026f6.dir/build.make CMakeFiles/cmTC_026f6.dir/build
+gmake[1]: Entering directory `/tmp/ii/CMakeFiles/CMakeTmp'
+Building CXX object CMakeFiles/cmTC_026f6.dir/CMakeCXXCompilerABI.cpp.o
+/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/bin/xlC -+ -qnostdinc -I/tmp/ii/test_c -I/tmp/ii/test_cxx -V -o CMakeFiles/cmTC_026f6.dir/CMakeCXXCompilerABI.cpp.o -c /soft/buildtools/cmake/3.5.2/share/cmake-3.5/Modules/CMakeCXXCompilerABI.cpp
+export XL_CONFIG=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/etc/vac.cfg.rhel6.9.gcc447:xlC
+export XLC_USR_CONFIG=/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/etc/V1R2M4.vac.cfg.rhel6.9.gcc447
+export XL_ASMOBJFILES=/tmp/xlcAS6jiX2k
+export "XL_DIS=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/dis -o "CMakeFiles/cmTC_026f6.dir/CMakeCXXCompilerABI.cpp.o" "CMakeCXXCompilerABI.o""
+/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/exe/xlCentry -qosvar=rhel.6.9 -qalias=ansi -qtls -D_CALL_SYSV -D__null=0 -D__NO_MATH_INLINES -qtls -q64 -qgnu_version=4.4.7 -qnostdinc -I/tmp/ii/test_c -I/tmp/ii/test_cxx -qasm_as=/usr/bin/as -qcpp_stdinc=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/include:/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include:/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/include -qc_stdinc=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/include:/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/include -qgcc_cpp_stdinc=/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../include/c++/4.4.7:/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/ppc64-redhat-linux:/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/backward:/usr/local/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/crt/include:/usr/include -qgcc_c_stdinc=/usr/local/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/crt/include:/usr/include -qcomplexgccincl=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/include:/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/include:/usr/local/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/crt/include:/usr/include -oCMakeFiles/cmTC_026f6.dir/CMakeCXXCompilerABI.cpp.o /soft/buildtools/cmake/3.5.2/share/cmake-3.5/Modules/CMakeCXXCompilerABI.cpp /tmp/xlcW00ICris /tmp/xlcW1eYwBrK /dev/null /tmp/xlcLG2pVwDF.lst /dev/null /tmp/xlcW2YVJhA2
+export XL_BACKEND=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/xlCcode
+export XL_LINKER=/usr/bin/ld
+/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/xlCcode -qalias=ansi -qtls -qtls -qnostdinc /tmp/xlcW00ICris /tmp/xlcW1eYwBrK CMakeFiles/cmTC_026f6.dir/CMakeCXXCompilerABI.cpp.o /tmp/xlcLG2pVwDB.lst /tmp/xlcW2YVJhA2
+rm /tmp/xlcAS6jiX2k
+rm /tmp/xlcLG2pVwD
+rm /tmp/xlcW00ICris
+rm /tmp/xlcW1eYwBrK
+rm /tmp/xlcW2YVJhA2
+Linking CXX executable cmTC_026f6
+/soft/buildtools/cmake/3.5.2/bin/cmake -E cmake_link_script CMakeFiles/cmTC_026f6.dir/link.txt --verbose=1
+/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/bin/xlC -qnostdinc -I/tmp/ii/test_c -I/tmp/ii/test_cxx -V CMakeFiles/cmTC_026f6.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_026f6 -Wl,-export-dynamic
+export XL_CONFIG=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/etc/vac.cfg.rhel6.9.gcc447:xlC
+export XLC_USR_CONFIG=/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/etc/V1R2M4.vac.cfg.rhel6.9.gcc447
+/usr/bin/ld --eh-frame-hdr -Qy -melf64ppc /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crt1.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crti.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/crtbegin.o -L/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/lib64 -L/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/lib64 -L/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/lib64 -L/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/lib64 -R/soft/compilers/ibmcmp-oct2017/lib64/bg -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../.. -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../.. CMakeFiles/cmTC_026f6.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_026f6 -export-dynamic -dynamic-linker /lib64/ld64.so.1 -lxlopt -lxl -libmc++ -lxlopt -lxl -lstdc++ -lm -ldl -lgcc_s -lgcc -lm -lc -lgcc_s -lgcc -ldl -lgcc_s -lgcc -lm -lc -lgcc_s -lgcc /usr/lib/gcc/ppc64-redhat-linux/4.4.7/crtend.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crtn.o
+rm /tmp/xlcW0rO54CG
+rm /tmp/xlcW1Q6xB5c
+rm /tmp/xlcW2TnvdyJ
+gmake[1]: Leaving directory `/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-CXX-XL-12.1.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-CXX-XL-12.1.0.output
new file mode 100644
index 0000000000..727afdbc04
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-CXX-XL-12.1.0.output
@@ -0,0 +1 @@
+/tmp/ii/test_c;/tmp/ii/test_cxx
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_pgf77-Fortran-PGI-18.10.1.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_pgf77-Fortran-PGI-18.10.1.input
new file mode 100644
index 0000000000..01abe8d509
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_pgf77-Fortran-PGI-18.10.1.input
@@ -0,0 +1,35 @@
+CMAKE_LANG=Fortran
+CMAKE_Fortran_COMPILER_ABI=
+CMAKE_Fortran_COMPILER_AR=
+CMAKE_Fortran_COMPILER_ARCHITECTURE_ID=
+CMAKE_Fortran_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_Fortran_COMPILER_ID=PGI
+CMAKE_Fortran_COMPILER_LAUNCHER=
+CMAKE_Fortran_COMPILER_LOADED=1
+CMAKE_Fortran_COMPILER_RANLIB=
+CMAKE_Fortran_COMPILER_TARGET=
+CMAKE_Fortran_COMPILER_VERSION=18.10.1
+CMAKE_Fortran_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/make" "cmTC_ea063/fast"
+/usr/bin/make -f CMakeFiles/cmTC_ea063.dir/build.make CMakeFiles/cmTC_ea063.dir/build
+make[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building Fortran object CMakeFiles/cmTC_ea063.dir/CMakeFortranCompilerABI.F.o
+/mnt/pgi/linux86-64/2018/bin/pgf77 -v -c /usr/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F -o CMakeFiles/cmTC_ea063.dir/CMakeFortranCompilerABI.F.o
+Export PGI=/mnt/pgi
+
+/mnt/pgi/linux86-64/18.10/bin/pgftnc /usr/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F -opt 1 -x 119 0xa10000 -x 122 0x40 -x 123 0x1000 -x 127 4 -x 127 17 -x 19 0x400000 -x 28 0x40000 -x 120 0x10000000 -x 70 0x8000 -x 122 1 -x 125 0x20000 -quad -x 59 4 -tp k8 -x 120 0x1000 -x 51 0x20 -x 124 0x1401 -astype 0 -stdinc /mnt/pgi/linux86-64/18.10/include-gcc70:/mnt/pgi/linux86-64/18.10/include:/usr/lib/gcc/x86_64-linux-gnu/7/include:/usr/local/include:/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed:/usr/include/x86_64-linux-gnu:/usr/include -def unix -def __unix -def __unix__ -def linux -def __linux -def __linux__ -def __NO_MATH_INLINES -def __LP64__ -def __x86_64 -def __x86_64__ -def __LONG_MAX__=9223372036854775807L -def '__SIZE_TYPE__=unsigned long int' -def '__PTRDIFF_TYPE__=long int' -def __extension__= -def __amd_64__amd64__ -def __k8 -def __k8__ -def __SSE__ -def __MMX__ -def __SSE2__ -def __SSE3__ -preprocess -cmdline '+pgf77 /usr/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F -v -c -o CMakeFiles/cmTC_ea063.dir/CMakeFortranCompilerABI.F.o' -x 70 0x40000000 -x 164 0x800000 -x 124 1 -asm /tmp/pgf77RxHebkuzkjES.s
+ 0 inform, 0 warnings, 0 severes, 0 fatal for cmakefortrancompilerabi
+PGFTN/x86-64 Linux 18.10-1: compilation successful
+
+/usr/bin/as /tmp/pgf77RxHebkuzkjES.s -o CMakeFiles/cmTC_ea063.dir/CMakeFortranCompilerABI.F.o
+Unlinking /tmp/pgf77RxHebkuzkjES.s
+Unlinking /tmp/pgf77dxHejAvLAzcs.ll
+Linking Fortran executable cmTC_ea063
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_ea063.dir/link.txt --verbose=1
+/mnt/pgi/linux86-64/2018/bin/pgf77 -v CMakeFiles/cmTC_ea063.dir/CMakeFortranCompilerABI.F.o -o cmTC_ea063
+Export PGI=/mnt/pgi
+
+/usr/bin/ld /usr/lib/x86_64-linux-gnu/crt1.o /usr/lib/x86_64-linux-gnu/crti.o /mnt/pgi/linux86-64/18.10/lib/trace_init.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbegin.o /mnt/pgi/linux86-64/18.10/lib/initmp.o /mnt/pgi/linux86-64/18.10/lib/pgfmain.o --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /mnt/pgi/linux86-64/18.10/lib/pgi.ld -L/mnt/pgi/linux86-64/18.10/lib -L/usr/lib64 -L/usr/lib/gcc/x86_64-linux-gnu/7 CMakeFiles/cmTC_ea063.dir/CMakeFortranCompilerABI.F.o -rpath /mnt/pgi/linux86-64/18.10/lib -rpath /usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib64 -o cmTC_ea063 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib64 -lpgftnrtl -lpgmp -lnuma -lpthread --start-group -lpgmath -lnspgc -lpgc --end-group -lrt -lpthread -lm -lgcc -lc -lgcc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/7/crtend.o /usr/lib/x86_64-linux-gnu/crtn.o
+make[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_pgf77-Fortran-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_pgf77-Fortran-PGI-18.10.1.output
new file mode 100644
index 0000000000..289c530a62
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_pgf77-Fortran-PGI-18.10.1.output
@@ -0,0 +1 @@
+/mnt/pgi/linux86-64/18.10/include-gcc70;/mnt/pgi/linux86-64/18.10/include;/usr/lib/gcc/x86_64-linux-gnu/7/include;/usr/local/include;/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed;/usr/include/x86_64-linux-gnu;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-C-GNU-4.8.5.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-C-GNU-4.8.5.input
new file mode 100644
index 0000000000..cd5845ae56
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-C-GNU-4.8.5.input
@@ -0,0 +1,58 @@
+CMAKE_LANG=C
+CMAKE_C_COMPILER_ABI=ELF
+CMAKE_C_COMPILER_AR=CMAKE_C_COMPILER_AR-NOTFOUND
+CMAKE_C_COMPILER_ARCHITECTURE_ID=
+CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_C_COMPILER_ID=GNU
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=CMAKE_C_COMPILER_RANLIB-NOTFOUND
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=4.8.5
+CMAKE_C_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/pkg/bin/gmake" "cmTC_b8d65/fast"
+/usr/pkg/bin/gmake -f CMakeFiles/cmTC_b8d65.dir/build.make CMakeFiles/cmTC_b8d65.dir/build
+gmake[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building C object CMakeFiles/cmTC_b8d65.dir/CMakeCCompilerABI.c.o
+/usr/bin/cc -nostdinc -v -o CMakeFiles/cmTC_b8d65.dir/CMakeCCompilerABI.c.o -c /usr/pkg/share/cmake-3.9/Modules/CMakeCCompilerABI.c
+Using built-in specs.
+COLLECT_GCC=/usr/bin/cc
+Target: i486--netbsdelf
+Configured with: /usr/7/src/tools/gcc/../../external/gpl3/gcc/dist/configure --target=i486--netbsdelf --enable-long-long --enable-threads --with-bugurl=http://www.NetBSD.org/Misc/send-pr.html --with-pkgversion='NetBSD nb2 20150115' --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-threads --with-arch=i486 --with-tune=nocona --enable-libstdcxx-time=rt --enable-lto --with-mpc-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/mpc/lib/libmpc --with-mpfr-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/mpfr/lib/libmpfr --with-gmp-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/gmp/lib/libgmp --with-mpc-include=/usr/7/src/external/lgpl3/mpc/dist/src --with-mpfr-include=/usr/7/src/external/lgpl3/mpfr/dist/src --with-gmp-include=/usr/7/src/external/lgpl3/gmp/lib/libgmp/arch/i386 --enable-tls --disable-multilib --disable-symvers --disable-libstdcxx-pch --build=x86_64-unknown-netbsd6.0. --host=i486--netbsdelf --with-sysroot=/var/obj/mknative/i386/usr/7/src/destdir.i386
+Thread model: posix
+gcc version 4.8.5 (nb2 20150115)
+COLLECT_GCC_OPTIONS='-nostdinc' '-v' '-o' 'CMakeFiles/cmTC_b8d65.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=nocona' '-march=i486'
+ /usr/libexec/cc1 -quiet -nostdinc -v /usr/pkg/share/cmake-3.9/Modules/CMakeCCompilerABI.c -quiet -dumpbase CMakeCCompilerABI.c -mtune=nocona -march=i486 -auxbase-strip CMakeFiles/cmTC_b8d65.dir/CMakeCCompilerABI.c.o -version -o /var/tmp//ccPEfYnQ.s
+GNU C (nb2 20150115) version 4.8.5 (i486--netbsdelf)
+ compiled by GNU C version 4.8.5, GMP version 5.1.3, MPFR version 3.1.2, MPC version 1.0.1
+GGC heuristics: --param ggc-min-expand=73 --param ggc-min-heapsize=81803
+#include "..." search starts here:
+#include <...> search starts here:
+End of search list.
+GNU C (nb2 20150115) version 4.8.5 (i486--netbsdelf)
+ compiled by GNU C version 4.8.5, GMP version 5.1.3, MPFR version 3.1.2, MPC version 1.0.1
+GGC heuristics: --param ggc-min-expand=73 --param ggc-min-heapsize=81803
+Compiler executable checksum: 468b91b49af5cfeb6bb696ad20c66c1c
+COLLECT_GCC_OPTIONS='-nostdinc' '-v' '-o' 'CMakeFiles/cmTC_b8d65.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=nocona' '-march=i486'
+ as -v -o CMakeFiles/cmTC_b8d65.dir/CMakeCCompilerABI.c.o /var/tmp//ccPEfYnQ.s
+GNU assembler version 2.23.2 (i486--netbsdelf) using BFD version (NetBSD Binutils nb1) 2.23.2
+COMPILER_PATH=/usr/libexec/
+LIBRARY_PATH=/usr/lib/
+COLLECT_GCC_OPTIONS='-nostdinc' '-v' '-o' 'CMakeFiles/cmTC_b8d65.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=nocona' '-march=i486'
+Linking C executable cmTC_b8d65
+/usr/pkg/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b8d65.dir/link.txt --verbose=1
+/usr/bin/cc -nostdinc -v CMakeFiles/cmTC_b8d65.dir/CMakeCCompilerABI.c.o -o cmTC_b8d65
+Using built-in specs.
+COLLECT_GCC=/usr/bin/cc
+COLLECT_LTO_WRAPPER=/usr/libexec/lto-wrapper
+Target: i486--netbsdelf
+Configured with: /usr/7/src/tools/gcc/../../external/gpl3/gcc/dist/configure --target=i486--netbsdelf --enable-long-long --enable-threads --with-bugurl=http://www.NetBSD.org/Misc/send-pr.html --with-pkgversion='NetBSD nb2 20150115' --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-threads --with-arch=i486 --with-tune=nocona --enable-libstdcxx-time=rt --enable-lto --with-mpc-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/mpc/lib/libmpc --with-mpfr-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/mpfr/lib/libmpfr --with-gmp-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/gmp/lib/libgmp --with-mpc-include=/usr/7/src/external/lgpl3/mpc/dist/src --with-mpfr-include=/usr/7/src/external/lgpl3/mpfr/dist/src --with-gmp-include=/usr/7/src/external/lgpl3/gmp/lib/libgmp/arch/i386 --enable-tls --disable-multilib --disable-symvers --disable-libstdcxx-pch --build=x86_64-unknown-netbsd6.0. --host=i486--netbsdelf --with-sysroot=/var/obj/mknative/i386/usr/7/src/destdir.i386
+Thread model: posix
+gcc version 4.8.5 (nb2 20150115)
+COMPILER_PATH=/usr/libexec/
+LIBRARY_PATH=/usr/lib/
+COLLECT_GCC_OPTIONS='-nostdinc' '-v' '-o' 'cmTC_b8d65' '-mtune=nocona' '-march=i486'
+ ld --eh-frame-hdr -dc -dp -e __start -dynamic-linker /usr/libexec/ld.elf_so -o cmTC_b8d65 /usr/lib/crt0.o /usr/lib/crti.o /usr/lib/crtbegin.o CMakeFiles/cmTC_b8d65.dir/CMakeCCompilerABI.c.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/crtend.o /usr/lib/crtn.o
+gmake[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-C-GNU-4.8.5.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-C-GNU-4.8.5.output
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-C-GNU-4.8.5.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-CXX-GNU-4.8.5.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-CXX-GNU-4.8.5.input
new file mode 100644
index 0000000000..b9a585cc16
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-CXX-GNU-4.8.5.input
@@ -0,0 +1,58 @@
+CMAKE_LANG=CXX
+CMAKE_CXX_COMPILER_ABI=ELF
+CMAKE_CXX_COMPILER_AR=CMAKE_CXX_COMPILER_AR-NOTFOUND
+CMAKE_CXX_COMPILER_ARCHITECTURE_ID=
+CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CXX_COMPILER_ID=GNU
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=CMAKE_CXX_COMPILER_RANLIB-NOTFOUND
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=4.8.5
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/pkg/bin/gmake" "cmTC_bbb1e/fast"
+/usr/pkg/bin/gmake -f CMakeFiles/cmTC_bbb1e.dir/build.make CMakeFiles/cmTC_bbb1e.dir/build
+gmake[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building CXX object CMakeFiles/cmTC_bbb1e.dir/CMakeCXXCompilerABI.cpp.o
+/usr/bin/c++ -nostdinc -v -o CMakeFiles/cmTC_bbb1e.dir/CMakeCXXCompilerABI.cpp.o -c /usr/pkg/share/cmake-3.9/Modules/CMakeCXXCompilerABI.cpp
+Using built-in specs.
+COLLECT_GCC=/usr/bin/c++
+Target: i486--netbsdelf
+Configured with: /usr/7/src/tools/gcc/../../external/gpl3/gcc/dist/configure --target=i486--netbsdelf --enable-long-long --enable-threads --with-bugurl=http://www.NetBSD.org/Misc/send-pr.html --with-pkgversion='NetBSD nb2 20150115' --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-threads --with-arch=i486 --with-tune=nocona --enable-libstdcxx-time=rt --enable-lto --with-mpc-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/mpc/lib/libmpc --with-mpfr-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/mpfr/lib/libmpfr --with-gmp-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/gmp/lib/libgmp --with-mpc-include=/usr/7/src/external/lgpl3/mpc/dist/src --with-mpfr-include=/usr/7/src/external/lgpl3/mpfr/dist/src --with-gmp-include=/usr/7/src/external/lgpl3/gmp/lib/libgmp/arch/i386 --enable-tls --disable-multilib --disable-symvers --disable-libstdcxx-pch --build=x86_64-unknown-netbsd6.0. --host=i486--netbsdelf --with-sysroot=/var/obj/mknative/i386/usr/7/src/destdir.i386
+Thread model: posix
+gcc version 4.8.5 (nb2 20150115)
+COLLECT_GCC_OPTIONS='-nostdinc' '-v' '-o' 'CMakeFiles/cmTC_bbb1e.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=nocona' '-march=i486'
+ /usr/libexec/cc1plus -quiet -nostdinc -v /usr/pkg/share/cmake-3.9/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpbase CMakeCXXCompilerABI.cpp -mtune=nocona -march=i486 -auxbase-strip CMakeFiles/cmTC_bbb1e.dir/CMakeCXXCompilerABI.cpp.o -version -o /var/tmp//cclVebp0.s
+GNU C++ (nb2 20150115) version 4.8.5 (i486--netbsdelf)
+ compiled by GNU C version 4.8.5, GMP version 5.1.3, MPFR version 3.1.2, MPC version 1.0.1
+GGC heuristics: --param ggc-min-expand=73 --param ggc-min-heapsize=81803
+#include "..." search starts here:
+#include <...> search starts here:
+End of search list.
+GNU C++ (nb2 20150115) version 4.8.5 (i486--netbsdelf)
+ compiled by GNU C version 4.8.5, GMP version 5.1.3, MPFR version 3.1.2, MPC version 1.0.1
+GGC heuristics: --param ggc-min-expand=73 --param ggc-min-heapsize=81803
+Compiler executable checksum: 961550adc452c84b614bf799df00d02b
+COLLECT_GCC_OPTIONS='-nostdinc' '-v' '-o' 'CMakeFiles/cmTC_bbb1e.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=nocona' '-march=i486'
+ as -v -o CMakeFiles/cmTC_bbb1e.dir/CMakeCXXCompilerABI.cpp.o /var/tmp//cclVebp0.s
+GNU assembler version 2.23.2 (i486--netbsdelf) using BFD version (NetBSD Binutils nb1) 2.23.2
+COMPILER_PATH=/usr/libexec/
+LIBRARY_PATH=/usr/lib/
+COLLECT_GCC_OPTIONS='-nostdinc' '-v' '-o' 'CMakeFiles/cmTC_bbb1e.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=nocona' '-march=i486'
+Linking CXX executable cmTC_bbb1e
+/usr/pkg/bin/cmake -E cmake_link_script CMakeFiles/cmTC_bbb1e.dir/link.txt --verbose=1
+/usr/bin/c++ -nostdinc -v CMakeFiles/cmTC_bbb1e.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_bbb1e
+Using built-in specs.
+COLLECT_GCC=/usr/bin/c++
+COLLECT_LTO_WRAPPER=/usr/libexec/lto-wrapper
+Target: i486--netbsdelf
+Configured with: /usr/7/src/tools/gcc/../../external/gpl3/gcc/dist/configure --target=i486--netbsdelf --enable-long-long --enable-threads --with-bugurl=http://www.NetBSD.org/Misc/send-pr.html --with-pkgversion='NetBSD nb2 20150115' --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-threads --with-arch=i486 --with-tune=nocona --enable-libstdcxx-time=rt --enable-lto --with-mpc-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/mpc/lib/libmpc --with-mpfr-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/mpfr/lib/libmpfr --with-gmp-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/gmp/lib/libgmp --with-mpc-include=/usr/7/src/external/lgpl3/mpc/dist/src --with-mpfr-include=/usr/7/src/external/lgpl3/mpfr/dist/src --with-gmp-include=/usr/7/src/external/lgpl3/gmp/lib/libgmp/arch/i386 --enable-tls --disable-multilib --disable-symvers --disable-libstdcxx-pch --build=x86_64-unknown-netbsd6.0. --host=i486--netbsdelf --with-sysroot=/var/obj/mknative/i386/usr/7/src/destdir.i386
+Thread model: posix
+gcc version 4.8.5 (nb2 20150115)
+COMPILER_PATH=/usr/libexec/
+LIBRARY_PATH=/usr/lib/
+COLLECT_GCC_OPTIONS='-nostdinc' '-v' '-o' 'cmTC_bbb1e' '-shared-libgcc' '-mtune=nocona' '-march=i486'
+ ld --eh-frame-hdr -dc -dp -e __start -dynamic-linker /usr/libexec/ld.elf_so -o cmTC_bbb1e /usr/lib/crt0.o /usr/lib/crti.o /usr/lib/crtbegin.o CMakeFiles/cmTC_bbb1e.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm --as-needed -lgcc_s --no-as-needed -lgcc -lc --as-needed -lgcc_s --no-as-needed -lgcc /usr/lib/crtend.o /usr/lib/crtn.o
+gmake[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-CXX-GNU-4.8.5.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-CXX-GNU-4.8.5.output
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-CXX-GNU-4.8.5.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-C-SunPro-5.13.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-C-SunPro-5.13.0.output
index e69de29bb2..27c452d269 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-C-SunPro-5.13.0.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-C-SunPro-5.13.0.output
@@ -0,0 +1 @@
+/opt/solarisstudio12.4/lib/compilers/include/cc;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-CXX-SunPro-5.13.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-CXX-SunPro-5.13.0.output
index e69de29bb2..be851c2acd 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-CXX-SunPro-5.13.0.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-CXX-SunPro-5.13.0.output
@@ -0,0 +1 @@
+/opt/solarisstudio12.4/lib/compilers/include/CC/Cstd;/opt/solarisstudio12.4/lib/compilers/include/CC;/opt/solarisstudio12.4/lib/compilers/include/cc;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-Fortran-SunPro-8.8.0.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-Fortran-SunPro-8.8.0.input
new file mode 100644
index 0000000000..4a2bedd879
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-Fortran-SunPro-8.8.0.input
@@ -0,0 +1,40 @@
+CMAKE_LANG=Fortran
+CMAKE_Fortran_COMPILER_ABI=
+CMAKE_Fortran_COMPILER_AR=
+CMAKE_Fortran_COMPILER_ARCHITECTURE_ID=
+CMAKE_Fortran_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_Fortran_COMPILER_ID=SunPro
+CMAKE_Fortran_COMPILER_LAUNCHER=
+CMAKE_Fortran_COMPILER_LOADED=1
+CMAKE_Fortran_COMPILER_RANLIB=
+CMAKE_Fortran_COMPILER_TARGET=
+CMAKE_Fortran_COMPILER_VERSION=8.8.0
+CMAKE_Fortran_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/opt/csw/bin/gmake" "cmTC_adcec/fast"
+/opt/csw/bin/gmake -f CMakeFiles/cmTC_adcec.dir/build.make CMakeFiles/cmTC_adcec.dir/build
+gmake[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building Fortran object CMakeFiles/cmTC_adcec.dir/CMakeFortranCompilerABI.F.o
+/opt/developerstudio12.6/bin/sunf95 -v -c /tmp/CMake/Modules/CMakeFortranCompilerABI.F -o CMakeFiles/cmTC_adcec.dir/CMakeFortranCompilerABI.F.o
+### f90: Note: NLSPATH = /opt/developerstudio12.6/bin/../lib/locale/%L/LC_MESSAGES/%N.cat:/opt/developerstudio12.6/bin/../../lib/locale/%L/LC_MESSAGES/%N.cat
+### command line files and options (expanded):
+### -v -c /tmp/CMake/Modules/CMakeFortranCompilerABI.F -o CMakeFiles/cmTC_adcec.dir/CMakeFortranCompilerABI.F.o
+/opt/developerstudio12.6/bin/fpp -undef -vax=bslash -Y/opt/developerstudio12.6/lib/compilers/include/f95 -D__SunOS_5_10 -D__SunOS_RELEASE=0x051000 -D__SUNPRO_F90=0x880 -D__SUNPRO_F95=0x880 -D__unix -D__SVR4__ -D__svr4__ -D__SVR4 -D__sun -D__sun__ -D__SunOS -D__sparcv8 -D__sparcv8plus -D__sparc -D__sparc__ -Dsun -Dunix -Dsparc -D__SUN_PREFETCH -I/opt/developerstudio12.6/lib/compilers/include/f95 /tmp/CMake/Modules/CMakeFortranCompilerABI.F /tmp/fpp.1548681160.26580.01.f
+/opt/developerstudio12.6/lib/compilers/bin/f90comp -E/tmp/CMake/Modules/CMakeFortranCompilerABI.F -m3 -ev -xall -xivdep=loop -H "/opt/developerstudio12.6/bin/f90 -v -c " -I/opt/developerstudio12.6/lib/compilers/include/f95 -p/opt/developerstudio12.6/lib/compilers/modules -m32 -y-m32 -xmemalign=8i -iorounding=processor-defined -xhasc=yes -xdebuginfo=%none -y-xdebuginfo=%none -y-xglobalize=no -xcache=generic -y-xcache=generic -y-xassume_control=optimize -xassume_control=optimize -y-xdbggen=dwarf+incl -keepmod=yes -y-ir -y/tmp/f90comp.1548681160.26580.02.ir /tmp/fpp.1548681160.26580.01.f
+/opt/developerstudio12.6/lib/compilers/bin/cg -Qy -fsimple=0 -xarch=sparcvis2 -m32 -xchip=generic -xcache=generic -comdat -ftrap=division,invalid,overflow -xdebuginfo=%none -xbuiltin=%none -xcode=abs32 -xannotate=yes -xmemalign=8i -xprefetch=auto,explicit -xprefetch_auto_type=no%indirect_array_access -xcheck=stkovf -xcheck=noreturn -xvector=no -oo CMakeFiles/cmTC_adcec.dir/CMakeFortranCompilerABI.F.o -ir /tmp/f90comp.1548681160.26580.02.ir
+rm /tmp/f90comp.1548681160.26580.02.ir
+rm /tmp/fpp.1548681160.26580.01.f
+Linking Fortran executable cmTC_adcec
+/tmp/CMake/bin/cmake -E cmake_link_script CMakeFiles/cmTC_adcec.dir/link.txt --verbose=1
+/opt/developerstudio12.6/bin/sunf95 -v CMakeFiles/cmTC_adcec.dir/CMakeFortranCompilerABI.F.o -o cmTC_adcec
+### f90: Note: NLSPATH = /opt/developerstudio12.6/bin/../lib/locale/%L/LC_MESSAGES/%N.cat:/opt/developerstudio12.6/bin/../../lib/locale/%L/LC_MESSAGES/%N.cat
+### command line files and options (expanded):
+### -v CMakeFiles/cmTC_adcec.dir/CMakeFortranCompilerABI.F.o -o cmTC_adcec
+### f90: Note: LD_LIBRARY_PATH = (null)
+### f90: Note: LD_RUN_PATH = (null)
+### f90: Note: LD_OPTIONS = (null)
+ln -s /opt/developerstudio12.6/lib/compilers /tmp/lib_link.1548681161.26655.01
+/usr/ccs/bin/ld -zld32=-S/tmp/lib_link.1548681161.26655.01/libldstab_ws.so -zld64=-S/tmp/lib_link.1548681161.26655.01/sparcv9/libldstab_ws.so -zld32=-S/tmp/lib_link.1548681161.26655.01/libld_annotate.so -zld64=-S/tmp/lib_link.1548681161.26655.01/sparcv9/libld_annotate.so /opt/developerstudio12.6/lib/compilers/crti.o /opt/developerstudio12.6/lib/compilers/crt1.o /opt/developerstudio12.6/lib/compilers/misalign.o /opt/developerstudio12.6/lib/compilers/values-xi.o CMakeFiles/cmTC_adcec.dir/CMakeFortranCompilerABI.F.o -o cmTC_adcec -Y "P,/opt/developerstudio12.6/lib/compilers/sparcvis2:/opt/developerstudio12.6/lib/compilers:/opt/developerstudio12.6/lib:/usr/ccs/lib:/lib:/usr/lib" -Qy -R/opt/developerstudio12.6/lib -t -lfsu -lsunmath -lmtsk -lm -lc /opt/developerstudio12.6/lib/compilers/crtn.o
+rm /tmp/lib_link.1548681161.26655.01
+gmake[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-Fortran-SunPro-8.8.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-Fortran-SunPro-8.8.0.output
new file mode 100644
index 0000000000..3c31e16c99
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-Fortran-SunPro-8.8.0.output
@@ -0,0 +1 @@
+/opt/developerstudio12.6/lib/compilers/include/f95
diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
index 7c1ed4ec06..df253a9138 100644
--- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
+++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
@@ -1,5 +1,6 @@
include(RunCMake)
+run_cmake(VsCSharpCompilerOpts)
run_cmake(ExplicitCMakeLists)
run_cmake(SourceGroupCMakeLists)
diff --git a/Tests/RunCMake/VS10Project/VsCSharpCompilerOpts-check.cmake b/Tests/RunCMake/VS10Project/VsCSharpCompilerOpts-check.cmake
new file mode 100644
index 0000000000..3e418c34b4
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsCSharpCompilerOpts-check.cmake
@@ -0,0 +1,64 @@
+#
+# Check C# VS project for required elements.
+#
+set(csProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.csproj")
+if(NOT EXISTS "${csProjectFile}")
+ set(RunCMake_TEST_FAILED "Project file ${csProjectFile} does not exist.")
+ return()
+endif()
+
+
+set(inDebug FALSE)
+set(inRelease FALSE)
+set(debugOK FALSE)
+set(releaseOK FALSE)
+
+
+file(STRINGS "${csProjectFile}" lines)
+foreach(line IN LISTS lines)
+ #message(STATUS ${line})
+ if(line MATCHES "^ *<PropertyGroup .*Debug\\|(Win32|x64).*")
+ set(inDebug TRUE)
+ elseif(line MATCHES "^ *<PropertyGroup .*Release\\|(Win32|x64).*")
+ set(inRelease TRUE)
+ elseif(line MATCHES "^ *</PropertyGroup> *$")
+ set(inRelease FALSE)
+ set(inDebug FALSE)
+ elseif(inDebug AND
+ (line MATCHES "^ *<NoWarn>.*505.*</NoWarn> *$") AND
+ (line MATCHES "^ *<NoWarn>.*707.*</NoWarn> *$") AND
+ (line MATCHES "^ *<NoWarn>.*808.*</NoWarn> *$") AND
+ (line MATCHES "^ *<NoWarn>.*909.*</NoWarn> *$")
+ )
+ set(debugOK TRUE)
+ elseif(inRelease AND
+ (NOT (line MATCHES "^ *<NoWarn>.*505.*</NoWarn> *$")) AND
+ (line MATCHES "^ *<NoWarn>.*707.*</NoWarn> *$") AND
+ (line MATCHES "^ *<NoWarn>.*808.*</NoWarn> *$") AND
+ (line MATCHES "^ *<NoWarn>.*909.*</NoWarn> *$")
+ )
+ set(releaseOK TRUE)
+ endif()
+endforeach()
+
+function(print_csprojfile)
+ file(STRINGS "${csProjectFile}" lines)
+ foreach(line IN LISTS lines)
+ message(STATUS ${line})
+ endforeach()
+endfunction()
+
+
+if(NOT debugOK)
+ message(STATUS "Failed to set Debug configuration warning config correctly.")
+ set(RunCMake_TEST_FAILED "Failed to set Debug configuration defines correctly.")
+ print_csprojfile()
+ return()
+endif()
+
+if(NOT releaseOK)
+ message(STATUS "Failed to set Release configuration warning config correctly.")
+ set(RunCMake_TEST_FAILED "Failed to set Release configuration defines correctly.")
+ print_csprojfile()
+ return()
+endif()
diff --git a/Tests/RunCMake/VS10Project/VsCSharpCompilerOpts.cmake b/Tests/RunCMake/VS10Project/VsCSharpCompilerOpts.cmake
new file mode 100644
index 0000000000..85af38be92
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsCSharpCompilerOpts.cmake
@@ -0,0 +1,14 @@
+enable_language(CSharp)
+
+add_library(foo SHARED
+ foo.cs)
+
+set_target_properties(foo PROPERTIES
+ LINKER_LANGUAGE CSharp)
+
+
+# Issue 18878
+target_compile_options(foo PRIVATE "/platform:anycpu" "/nowarn:707,808" "/nowarn:909" )
+
+# Debug only warning disable
+set(CMAKE_CSharp_FLAGS_DEBUG "${CMAKE_CSharp_FLAGS_DEBUG} /nowarn:505")
diff --git a/Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy-check.cmake b/Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy-check.cmake
index c66676f5ca..6ab3833bf3 100644
--- a/Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy-check.cmake
+++ b/Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy-check.cmake
@@ -13,6 +13,7 @@ endif()
set(FoundCEAdditionalFiles FALSE)
set(FoundRemoteDirectory FALSE)
+set(FoundToolsVersion4 FALSE)
file(STRINGS "${vcProjectFile}" lines)
foreach(line IN LISTS lines)
@@ -20,6 +21,8 @@ foreach(line IN LISTS lines)
set(FoundCEAdditionalFiles TRUE)
elseif(line MATCHES " *<RemoteDirectory>[A-Za-z0-9\\]+</RemoteDirectory> *$")
set(FoundRemoteDirectory TRUE)
+ elseif(line MATCHES " *<Project +.*ToolsVersion=\"4.0\".*> *$")
+ set(FoundToolsVersion4 TRUE)
endif()
endforeach()
@@ -32,3 +35,8 @@ if(NOT FoundRemoteDirectory)
set(RunCMake_TEST_FAILED "RemoteDirectory not found or not set correctly.")
return()
endif()
+
+if(NOT FoundToolsVersion4)
+ set(RunCMake_TEST_FAILED "Failed to find correct ToolsVersion=\"4.0\" .")
+ return()
+endif()
diff --git a/Tests/RunCMake/XcodeProject/DeploymentTarget.cmake b/Tests/RunCMake/XcodeProject/DeploymentTarget.cmake
index 6281352e70..288735e87b 100644
--- a/Tests/RunCMake/XcodeProject/DeploymentTarget.cmake
+++ b/Tests/RunCMake/XcodeProject/DeploymentTarget.cmake
@@ -3,28 +3,21 @@ project(DeploymentTarget C)
# using Xcode 7.1 SDK versions for deployment targets
-if(SDK MATCHES iphone)
- set(CMAKE_OSX_SYSROOT ${SDK})
- set(CMAKE_OSX_ARCHITECTURES "armv7;x86_64")
+if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
set(CMAKE_OSX_DEPLOYMENT_TARGET "9.1")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO")
-elseif(SDK MATCHES watch)
- set(CMAKE_OSX_SYSROOT ${SDK})
- set(CMAKE_OSX_ARCHITECTURES "armv7k;i386")
+elseif(CMAKE_SYSTEM_NAME STREQUAL "watchOS")
set(CMAKE_OSX_DEPLOYMENT_TARGET "2.0")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "YES")
-elseif(SDK MATCHES appletv)
- set(CMAKE_OSX_SYSROOT ${SDK})
+elseif(CMAKE_SYSTEM_NAME STREQUAL "tvOS")
set(CMAKE_OSX_DEPLOYMENT_TARGET "9.0")
- set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "YES")
else()
- set(CMAKE_OSX_SYSROOT ${SDK})
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11")
endif()
diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
index fb0400560a..4918f7ca48 100644
--- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
+++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
@@ -1,9 +1,5 @@
include(RunCMake)
-if(XCODE_VERSION VERSION_GREATER_EQUAL 9)
- set(IOS_DEPLOYMENT_TARGET "-DCMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET=10")
-endif()
-
run_cmake(ExplicitCMakeLists)
run_cmake(XcodeFileType)
@@ -25,14 +21,48 @@ run_cmake(PerConfigPerSourceOptions)
run_cmake(PerConfigPerSourceDefinitions)
run_cmake(PerConfigPerSourceIncludeDirs)
+function(XcodeSchemaGeneration)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeSchemaGeneration-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ set(RunCMake_TEST_OPTIONS "-DCMAKE_XCODE_GENERATE_SCHEME=ON")
+
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+
+ run_cmake(XcodeSchemaGeneration)
+ run_cmake_command(XcodeSchemaGeneration-build xcodebuild -scheme foo build)
+endfunction()
+
+if(NOT XCODE_VERSION VERSION_LESS 7)
+ XcodeSchemaGeneration()
+ run_cmake(XcodeSchemaProperty)
+endif()
+
+function(XcodeDependOnZeroCheck)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeDependOnZeroCheck-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+
+ run_cmake(XcodeDependOnZeroCheck)
+ run_cmake_command(XcodeDependOnZeroCheck-build ${CMAKE_COMMAND} --build . --target parentdirlib)
+ run_cmake_command(XcodeDependOnZeroCheck-build ${CMAKE_COMMAND} --build . --target subdirlib)
+endfunction()
+
+XcodeDependOnZeroCheck()
+
+# Isolate device tests from host architecture selection.
+unset(ENV{CMAKE_OSX_ARCHITECTURES})
+
# Use a single build tree for a few tests without cleaning.
if(NOT XCODE_VERSION VERSION_LESS 5)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeInstallIOS-build)
set(RunCMake_TEST_NO_CLEAN 1)
set(RunCMake_TEST_OPTIONS
- "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_BINARY_DIR}/ios_install"
- "${IOS_DEPLOYMENT_TARGET}")
+ "-DCMAKE_SYSTEM_NAME=iOS"
+ "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_BINARY_DIR}/ios_install")
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
@@ -47,7 +77,7 @@ if(NOT XCODE_VERSION VERSION_LESS 5)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeBundlesOSX-build)
set(RunCMake_TEST_NO_CLEAN 1)
set(RunCMake_TEST_OPTIONS
- "-DTEST_IOS=OFF"
+ "-DCMAKE_SYSTEM_NAME=Darwin"
"-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/_install")
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
@@ -64,9 +94,8 @@ if(NOT XCODE_VERSION VERSION_LESS 5)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeBundlesIOS-build)
set(RunCMake_TEST_NO_CLEAN 1)
set(RunCMake_TEST_OPTIONS
- "-DTEST_IOS=ON"
- "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/_install"
- "${IOS_DEPLOYMENT_TARGET}")
+ "-DCMAKE_SYSTEM_NAME=iOS"
+ "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/_install")
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
@@ -84,7 +113,7 @@ if(NOT XCODE_VERSION VERSION_LESS 7)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeBundlesWatchOS-build)
set(RunCMake_TEST_NO_CLEAN 1)
set(RunCMake_TEST_OPTIONS
- "-DTEST_WATCHOS=ON"
+ "-DCMAKE_SYSTEM_NAME=watchOS"
"-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/_install")
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
@@ -103,7 +132,7 @@ if(NOT XCODE_VERSION VERSION_LESS 7.1)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeBundlesTvOS-build)
set(RunCMake_TEST_NO_CLEAN 1)
set(RunCMake_TEST_OPTIONS
- "-DTEST_TVOS=ON"
+ "-DCMAKE_SYSTEM_NAME=tvOS"
"-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/_install")
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
@@ -129,9 +158,9 @@ if(NOT XCODE_VERSION VERSION_LESS 6)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeIOSInstallCombined-build)
set(RunCMake_TEST_NO_CLEAN 1)
set(RunCMake_TEST_OPTIONS
- "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/_install"
+ "-DCMAKE_SYSTEM_NAME=iOS"
"-DCMAKE_IOS_INSTALL_COMBINED=YES"
- "${IOS_DEPLOYMENT_TARGET}")
+ "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/_install")
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
@@ -148,9 +177,9 @@ if(NOT XCODE_VERSION VERSION_LESS 6)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeIOSInstallCombinedPrune-build)
set(RunCMake_TEST_NO_CLEAN 1)
set(RunCMake_TEST_OPTIONS
- "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/_install"
+ "-DCMAKE_SYSTEM_NAME=iOS"
"-DCMAKE_IOS_INSTALL_COMBINED=YES"
- "${IOS_DEPLOYMENT_TARGET}")
+ "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/_install")
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
@@ -167,9 +196,9 @@ if(NOT XCODE_VERSION VERSION_LESS 6)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeIOSInstallCombinedSingleArch-build)
set(RunCMake_TEST_NO_CLEAN 1)
set(RunCMake_TEST_OPTIONS
- "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/_install"
+ "-DCMAKE_SYSTEM_NAME=iOS"
"-DCMAKE_IOS_INSTALL_COMBINED=YES"
- "${IOS_DEPLOYMENT_TARGET}")
+ "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/_install")
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
@@ -205,28 +234,11 @@ if(NOT XCODE_VERSION VERSION_LESS 5)
unset(RunCMake_TEST_OPTIONS)
endif()
-function(XcodeSchemaGeneration)
- set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeSchemaGeneration-build)
- set(RunCMake_TEST_NO_CLEAN 1)
- set(RunCMake_TEST_OPTIONS "-DCMAKE_XCODE_GENERATE_SCHEME=ON")
-
- file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
- file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
-
- run_cmake(XcodeSchemaGeneration)
- run_cmake_command(XcodeSchemaGeneration-build xcodebuild -scheme foo build)
-endfunction()
-
-if(NOT XCODE_VERSION VERSION_LESS 7)
- XcodeSchemaGeneration()
- run_cmake(XcodeSchemaProperty)
-endif()
-
if(XCODE_VERSION VERSION_GREATER_EQUAL 8)
- function(deploymeny_target_test SDK)
+ function(deployment_target_test SystemName SDK)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/DeploymentTarget-${SDK}-build)
set(RunCMake_TEST_NO_CLEAN 1)
- set(RunCMake_TEST_OPTIONS "-DSDK=${SDK}")
+ set(RunCMake_TEST_OPTIONS "-DCMAKE_SYSTEM_NAME=${SystemName}" "-DCMAKE_OSX_SYSROOT=${SDK}")
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
@@ -235,21 +247,13 @@ if(XCODE_VERSION VERSION_GREATER_EQUAL 8)
run_cmake_command(DeploymentTarget-${SDK} ${CMAKE_COMMAND} --build .)
endfunction()
- foreach(SDK macosx iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator)
- deploymeny_target_test(${SDK})
- endforeach()
+ deployment_target_test(Darwin macosx)
+ deployment_target_test(iOS iphoneos)
+ deployment_target_test(iOS iphonesimulator)
+ deployment_target_test(tvOS appletvos)
+ deployment_target_test(tvOS appletvsimulator)
+ deployment_target_test(watchOS watchos)
+ deployment_target_test(watchOS watchsimulator)
endif()
-function(XcodeDependOnZeroCheck)
- set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeDependOnZeroCheck-build)
- set(RunCMake_TEST_NO_CLEAN 1)
-
- file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
- file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
-
- run_cmake(XcodeDependOnZeroCheck)
- run_cmake_command(XcodeDependOnZeroCheck-build ${CMAKE_COMMAND} --build . --target parentdirlib)
- run_cmake_command(XcodeDependOnZeroCheck-build ${CMAKE_COMMAND} --build . --target subdirlib)
-endfunction()
-
-XcodeDependOnZeroCheck()
+# Please add macOS-only tests above before the device-specific tests.
diff --git a/Tests/RunCMake/XcodeProject/XcodeBundles.cmake b/Tests/RunCMake/XcodeProject/XcodeBundles.cmake
index 5d19ee8187..ef772ea652 100644
--- a/Tests/RunCMake/XcodeProject/XcodeBundles.cmake
+++ b/Tests/RunCMake/XcodeProject/XcodeBundles.cmake
@@ -3,27 +3,12 @@
cmake_minimum_required(VERSION 3.3)
enable_language(C)
-# due to lack of toolchain file it might point to running macOS version
-unset(CMAKE_OSX_DEPLOYMENT_TARGET CACHE)
-
-if(TEST_IOS)
- set(CMAKE_OSX_SYSROOT iphoneos)
- set(CMAKE_OSX_ARCHITECTURES "armv7")
+if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO")
-endif(TEST_IOS)
-
-if(TEST_WATCHOS)
- set(CMAKE_OSX_SYSROOT watchos)
- set(CMAKE_OSX_ARCHITECTURES "armv7k")
- set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
- set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
- set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "YES")
endif()
-if(TEST_TVOS)
- set(CMAKE_OSX_SYSROOT appletvos)
- set(CMAKE_OSX_ARCHITECTURES "arm64")
+if(CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "watchOS")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "YES")
@@ -41,7 +26,7 @@ add_dependencies(AppBundleTest AppBundle)
# with custom extension
-if (NOT TEST_IOS AND NOT TEST_WATCHOS AND NOT TEST_TVOS)
+if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
add_executable(AppBundleExt MACOSX_BUNDLE main.m)
set_target_properties(AppBundleExt PROPERTIES BUNDLE_EXTENSION "foo")
install(TARGETS AppBundleExt BUNDLE DESTINATION FooExtension)
@@ -55,7 +40,7 @@ endif()
# Shared Framework (not supported for iOS on Xcode < 6)
-if(NOT TEST_IOS OR NOT XCODE_VERSION VERSION_LESS 6)
+if(NOT CMAKE_SYSTEM_NAME STREQUAL "iOS" OR NOT XCODE_VERSION VERSION_LESS 6)
add_library(SharedFramework SHARED main.c)
set_target_properties(SharedFramework PROPERTIES FRAMEWORK TRUE)
diff --git a/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombined.cmake b/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombined.cmake
index d7f3920211..7f31d9493c 100644
--- a/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombined.cmake
+++ b/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombined.cmake
@@ -2,10 +2,10 @@ cmake_minimum_required(VERSION 3.3)
project(IOSInstallCombined CXX)
-# due to lack of toolchain file it might point to running macOS version
-unset(CMAKE_OSX_DEPLOYMENT_TARGET CACHE)
+if(XCODE_VERSION VERSION_GREATER_EQUAL 9)
+ set(CMAKE_OSX_DEPLOYMENT_TARGET 10)
+endif()
-set(CMAKE_OSX_SYSROOT iphoneos)
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf")
set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO")
diff --git a/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedPrune.cmake b/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedPrune.cmake
index 28ab883d7e..ec11dbbd47 100644
--- a/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedPrune.cmake
+++ b/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedPrune.cmake
@@ -2,10 +2,10 @@ cmake_minimum_required(VERSION 3.3)
project(XcodeIOSInstallCombinedPrune CXX)
-# due to lack of toolchain file it might point to running macOS version
-unset(CMAKE_OSX_DEPLOYMENT_TARGET CACHE)
+if(XCODE_VERSION VERSION_GREATER_EQUAL 9)
+ set(CMAKE_OSX_DEPLOYMENT_TARGET 10)
+endif()
-set(CMAKE_OSX_SYSROOT iphoneos)
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf")
diff --git a/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedSingleArch.cmake b/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedSingleArch.cmake
index 5e7961a779..58e96b4f38 100644
--- a/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedSingleArch.cmake
+++ b/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedSingleArch.cmake
@@ -2,10 +2,10 @@ cmake_minimum_required(VERSION 3.3)
project(XcodeIOSInstallCombinedSingleArch CXX)
-# due to lack of toolchain file it might point to running macOS version
-unset(CMAKE_OSX_DEPLOYMENT_TARGET CACHE)
+if(XCODE_VERSION VERSION_GREATER_EQUAL 9)
+ set(CMAKE_OSX_DEPLOYMENT_TARGET 10)
+endif()
-set(CMAKE_OSX_SYSROOT iphoneos)
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf")
diff --git a/Tests/RunCMake/XcodeProject/XcodeInstallIOS.cmake b/Tests/RunCMake/XcodeProject/XcodeInstallIOS.cmake
index a797410695..ab31387cd0 100644
--- a/Tests/RunCMake/XcodeProject/XcodeInstallIOS.cmake
+++ b/Tests/RunCMake/XcodeProject/XcodeInstallIOS.cmake
@@ -2,11 +2,8 @@ cmake_minimum_required(VERSION 2.8.5)
project(XcodeInstallIOS)
-set(CMAKE_OSX_SYSROOT iphoneos)
set(XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO")
-set(CMAKE_OSX_ARCHITECTURES "armv7;i386")
-
add_library(foo STATIC foo.cpp)
install(TARGETS foo ARCHIVE DESTINATION lib)
diff --git a/Tests/RunCMake/get_filename_component/KnownComponents.cmake b/Tests/RunCMake/get_filename_component/KnownComponents.cmake
index ac77ac3dec..54b858f926 100644
--- a/Tests/RunCMake/get_filename_component/KnownComponents.cmake
+++ b/Tests/RunCMake/get_filename_component/KnownComponents.cmake
@@ -11,8 +11,10 @@ set(expect_DIRECTORY "/path/to")
set(expect_NAME "filename.ext.in")
set(expect_EXT ".ext.in")
set(expect_NAME_WE "filename")
+set(expect_LAST_EXT ".in")
+set(expect_NAME_WLE "filename.ext")
set(expect_PATH "/path/to")
-foreach(c DIRECTORY NAME EXT NAME_WE PATH)
+foreach(c DIRECTORY NAME EXT NAME_WE LAST_EXT NAME_WLE PATH)
get_filename_component(actual_${c} "${filename}" ${c})
check("${c}" "${actual_${c}}" "${expect_${c}}")
list(APPEND non_cache_vars actual_${c})
diff --git a/Tests/RunCMake/install/TARGETS-OPTIONAL-stderr.txt b/Tests/RunCMake/install/TARGETS-OPTIONAL-stderr.txt
deleted file mode 100644
index 86e3ec0760..0000000000
--- a/Tests/RunCMake/install/TARGETS-OPTIONAL-stderr.txt
+++ /dev/null
@@ -1 +0,0 @@
-^WARNING: Target "notall" has EXCLUDE_FROM_ALL set and will not be built by default but an install rule has been provided for it\. CMake does not define behavior for this case\.$
diff --git a/Tests/RunCMake/set/ExtraEnvValue-stderr.txt b/Tests/RunCMake/set/ExtraEnvValue-stderr.txt
new file mode 100644
index 0000000000..f61f9d287b
--- /dev/null
+++ b/Tests/RunCMake/set/ExtraEnvValue-stderr.txt
@@ -0,0 +1,6 @@
+CMake Warning \(dev\) at ExtraEnvValue.cmake:1 \(set\):
+ Only the first value argument is used when setting an environment variable.
+ Argument 'value_2' and later are unused.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/set/ExtraEnvValue.cmake b/Tests/RunCMake/set/ExtraEnvValue.cmake
new file mode 100644
index 0000000000..768a6eac2e
--- /dev/null
+++ b/Tests/RunCMake/set/ExtraEnvValue.cmake
@@ -0,0 +1 @@
+set (ENV{sample_key} value_1 value_2)
diff --git a/Tests/RunCMake/set/RunCMakeTest.cmake b/Tests/RunCMake/set/RunCMakeTest.cmake
index b8e8cf1f9c..b3bd0a4807 100644
--- a/Tests/RunCMake/set/RunCMakeTest.cmake
+++ b/Tests/RunCMake/set/RunCMakeTest.cmake
@@ -3,3 +3,5 @@ include(RunCMake)
run_cmake(ParentScope)
run_cmake(ParentPulling)
run_cmake(ParentPullingRecursive)
+run_cmake(UnknownCacheType)
+run_cmake(ExtraEnvValue)
diff --git a/Tests/RunCMake/set/UnknownCacheType-stderr.txt b/Tests/RunCMake/set/UnknownCacheType-stderr.txt
new file mode 100644
index 0000000000..6e1c8114a7
--- /dev/null
+++ b/Tests/RunCMake/set/UnknownCacheType-stderr.txt
@@ -0,0 +1,5 @@
+CMake Warning \(dev\) at UnknownCacheType.cmake:1 \(set\):
+ implicitly converting 'unknown_type_sample' to 'STRING' type.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/set/UnknownCacheType.cmake b/Tests/RunCMake/set/UnknownCacheType.cmake
new file mode 100644
index 0000000000..f2b5d051d2
--- /dev/null
+++ b/Tests/RunCMake/set/UnknownCacheType.cmake
@@ -0,0 +1 @@
+set (sample_key sample_value CACHE unknown_type_sample "sample doc")
diff --git a/Tests/SwiftOnly/CMakeLists.txt b/Tests/SwiftOnly/CMakeLists.txt
index cf4463ccf6..e5f858803e 100644
--- a/Tests/SwiftOnly/CMakeLists.txt
+++ b/Tests/SwiftOnly/CMakeLists.txt
@@ -1,7 +1,9 @@
cmake_minimum_required(VERSION 3.3)
project(SwiftOnly Swift)
-if(NOT XCODE_VERSION VERSION_LESS 8.0)
+if(NOT XCODE_VERSION VERSION_LESS 10.2)
+ set(CMAKE_Swift_LANGUAGE_VERSION 5.0)
+elseif(NOT XCODE_VERSION VERSION_LESS 8.0)
set(CMAKE_Swift_LANGUAGE_VERSION 3.0)
endif()
diff --git a/Tests/TryCompile/CMakeLists.txt b/Tests/TryCompile/CMakeLists.txt
index 184a7be5c8..54e96a2086 100644
--- a/Tests/TryCompile/CMakeLists.txt
+++ b/Tests/TryCompile/CMakeLists.txt
@@ -165,6 +165,35 @@ try_compile(TEST_INNER
OUTPUT_VARIABLE output)
TEST_ASSERT(TEST_INNER "try_compile project mode failed:\n${output}")
+try_compile(COMPILE_DEFINITIONS_LIST_EXPANDED
+ ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
+ ${TryCompile_SOURCE_DIR}/check_a_b.c
+ OUTPUT_VARIABLE output
+ COMPILE_DEFINITIONS "-DDEF_A;-DDEF_B"
+ )
+if(COMPILE_DEFINITIONS_LIST_EXPANDED)
+ message(STATUS "COMPILE_DEFINITIONS list expanded correctly")
+else()
+ string(REPLACE "\n" "\n " output " ${output}")
+ message(SEND_ERROR "COMPILE_DEFINITIONS list did not expand correctly\n${output}")
+endif()
+
+try_compile(SHOULD_FAIL_DUE_TO_BAD_SOURCE
+ ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
+ ${TryCompile_SOURCE_DIR}/pass.c
+ OUTPUT_VARIABLE output
+ COMPILE_DEFINITIONS "bad#source.c"
+ )
+if(SHOULD_FAIL_DUE_TO_BAD_SOURCE AND NOT CMAKE_GENERATOR MATCHES "Watcom WMake|NMake Makefiles")
+ string(REPLACE "\n" "\n " output " ${output}")
+ message(SEND_ERROR "try_compile with bad#source.c did not fail:\n${output}")
+elseif(NOT output MATCHES [[(bad#source\.c|bad\\)]])
+ string(REPLACE "\n" "\n " output " ${output}")
+ message(SEND_ERROR "try_compile with bad#source.c failed without mentioning bad source:\n${output}")
+else()
+ message(STATUS "try_compile with bad#source.c correctly failed")
+endif()
+
add_executable(TryCompile pass.c)
######################################
diff --git a/Tests/TryCompile/check_a_b.c b/Tests/TryCompile/check_a_b.c
new file mode 100644
index 0000000000..05fba0f828
--- /dev/null
+++ b/Tests/TryCompile/check_a_b.c
@@ -0,0 +1,10 @@
+#ifndef DEF_A
+# error DEF_A not defined
+#endif
+#ifndef DEF_B
+# error DEF_B not defined
+#endif
+int main()
+{
+ return 0;
+}
diff --git a/Tests/Tutorial/Complete/CMakeLists.txt b/Tests/Tutorial/Complete/CMakeLists.txt
new file mode 100644
index 0000000000..9658e65365
--- /dev/null
+++ b/Tests/Tutorial/Complete/CMakeLists.txt
@@ -0,0 +1,116 @@
+cmake_minimum_required(VERSION 3.3)
+project(Tutorial)
+
+# control where the static and shared libraries are built so that on windows
+# we don't need to tinker with the path to run the executable
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
+
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED True)
+
+option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
+
+# the version number.
+set(Tutorial_VERSION_MAJOR 1)
+set(Tutorial_VERSION_MINOR 0)
+
+if(APPLE)
+ set(CMAKE_INSTALL_RPATH "@executable_path/../lib")
+elseif(UNIX)
+ set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib")
+endif()
+
+# configure a header file to pass the version number only
+configure_file(
+ "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
+ "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ )
+
+# add the MathFunctions library
+add_subdirectory(MathFunctions)
+
+# add the executable
+add_executable(Tutorial tutorial.cxx)
+target_link_libraries(Tutorial MathFunctions)
+
+# add the binary tree to the search path for include files
+# so that we will find TutorialConfig.h
+target_include_directories(Tutorial PUBLIC
+ "${PROJECT_BINARY_DIR}"
+ )
+
+# add the install targets
+install(TARGETS Tutorial DESTINATION bin)
+install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ DESTINATION include
+ )
+
+# enable testing
+enable_testing()
+
+# does the application run
+add_test(NAME Runs COMMAND Tutorial 25)
+
+# does the usage message work?
+add_test(NAME Usage COMMAND Tutorial)
+set_tests_properties(Usage
+ PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number"
+ )
+
+# define a function to simplify adding tests
+function(do_test target arg result)
+ add_test(NAME Comp${arg} COMMAND ${target} ${arg})
+ set_tests_properties(Comp${arg}
+ PROPERTIES PASS_REGULAR_EXPRESSION ${result}
+ )
+endfunction(do_test)
+
+# do a bunch of result based tests
+do_test(Tutorial 4 "4 is 2")
+do_test(Tutorial 9 "9 is 3")
+do_test(Tutorial 5 "5 is 2.236")
+do_test(Tutorial 7 "7 is 2.645")
+do_test(Tutorial 25 "25 is 5")
+do_test(Tutorial -25 "-25 is [-nan|nan|0]")
+do_test(Tutorial 0.0001 "0.0001 is 0.01")
+
+include(InstallRequiredSystemLibraries)
+set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
+set(CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}")
+set(CPACK_PACKAGE_VERSION_MINOR "${Tutorial_VERSION_MINOR}")
+include(CPack)
+
+# install the configuration targets
+install(EXPORT MathFunctionsTargets
+ FILE MathFunctionsTargets.cmake
+ DESTINATION lib/cmake/MathFunctions
+)
+
+include(CMakePackageConfigHelpers)
+# generate the config file that is includes the exports
+configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
+ "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfig.cmake"
+ INSTALL_DESTINATION "lib/cmake/example"
+ NO_SET_AND_CHECK_MACRO
+ NO_CHECK_REQUIRED_COMPONENTS_MACRO
+ )
+# generate the version file for the config file
+write_basic_package_version_file(
+ "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfigVersion.cmake"
+ VERSION "${Tutorial_VERSION_MAJOR}.${Tutorial_VERSION_MINOR}"
+ COMPATIBILITY AnyNewerVersion
+)
+
+# install the configuration file
+install(FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfig.cmake
+ DESTINATION lib/cmake/MathFunctions
+ )
+
+# generate the export targets for the build tree
+# needs to be after the install(TARGETS ) command
+export(EXPORT MathFunctionsTargets
+ FILE "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsTargets.cmake"
+)
diff --git a/Tests/Tutorial/Complete/Config.cmake.in b/Tests/Tutorial/Complete/Config.cmake.in
new file mode 100644
index 0000000000..17cbabd99c
--- /dev/null
+++ b/Tests/Tutorial/Complete/Config.cmake.in
@@ -0,0 +1,4 @@
+
+@PACKAGE_INIT@
+
+include ( "${CMAKE_CURRENT_LIST_DIR}/MathFunctionsTargets.cmake" )
diff --git a/Tests/Tutorial/Step6/License.txt b/Tests/Tutorial/Complete/License.txt
index 673d724537..c62d00b9ea 100644
--- a/Tests/Tutorial/Step6/License.txt
+++ b/Tests/Tutorial/Complete/License.txt
@@ -1,2 +1,2 @@
This is the open source License.txt file introduced in
-CMake/Tests/Tutorial/Step6...
+CMake/Tutorial/Step7...
diff --git a/Tests/Tutorial/Complete/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Complete/MathFunctions/CMakeLists.txt
new file mode 100644
index 0000000000..161ad64492
--- /dev/null
+++ b/Tests/Tutorial/Complete/MathFunctions/CMakeLists.txt
@@ -0,0 +1,68 @@
+
+# add the library that runs
+add_library(MathFunctions MathFunctions.cxx)
+
+# state that anybody linking to us needs to include the current source dir
+# to find MathFunctions.h, while we don't.
+target_include_directories(MathFunctions
+ INTERFACE
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+ $<INSTALL_INTERFACE:include>
+ )
+
+# should we use our own math functions
+option(USE_MYMATH "Use tutorial provided math implementation" ON)
+if(USE_MYMATH)
+
+ # does this system provide the log and exp functions?
+ include(CheckSymbolExists)
+ set(CMAKE_REQUIRED_LIBRARIES "m")
+ check_symbol_exists(log "math.h" HAVE_LOG)
+ check_symbol_exists(exp "math.h" HAVE_EXP)
+
+ # first we add the executable that generates the table
+ add_executable(MakeTable MakeTable.cxx)
+
+ # add the command to generate the source code
+ add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ DEPENDS MakeTable
+ )
+
+ # library that just does sqrt
+ add_library(SqrtLibrary STATIC
+ mysqrt.cxx
+ ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ )
+
+ # state that we depend on our binary dir to find Table.h
+ target_include_directories(SqrtLibrary PRIVATE
+ ${CMAKE_CURRENT_BINARY_DIR}
+ )
+
+ set_target_properties(SqrtLibrary PROPERTIES
+ POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS}
+ )
+
+ target_compile_definitions(SqrtLibrary PRIVATE
+ "$<$<BOOL:${HAVE_LOG}>:HAVE_LOG>"
+ "$<$<BOOL:${HAVE_EXP}>:HAVE_EXP>"
+ )
+ target_link_libraries(MathFunctions PRIVATE SqrtLibrary)
+endif()
+
+target_compile_definitions(MathFunctions PRIVATE "$<$<BOOL:${USE_MYMATH}>:USE_MYMATH>")
+
+# define the symbol stating we are using the declspec(dllexport) when
+# building on windows
+target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH")
+
+# setup the version numbering
+set_property(TARGET MathFunctions PROPERTY VERSION "1.0.0")
+set_property(TARGET MathFunctions PROPERTY SOVERSION "1")
+
+install(TARGETS MathFunctions
+ DESTINATION lib
+ EXPORT MathFunctionsTargets)
+install(FILES MathFunctions.h DESTINATION include)
diff --git a/Tests/Tutorial/Complete/MathFunctions/MakeTable.cxx b/Tests/Tutorial/Complete/MathFunctions/MakeTable.cxx
new file mode 100644
index 0000000000..ee585568cb
--- /dev/null
+++ b/Tests/Tutorial/Complete/MathFunctions/MakeTable.cxx
@@ -0,0 +1,25 @@
+// A simple program that builds a sqrt table
+#include <cmath>
+#include <fstream>
+#include <iostream>
+
+int main(int argc, char* argv[])
+{
+ // make sure we have enough arguments
+ if (argc < 2) {
+ return 1;
+ }
+
+ std::ofstream fout(argv[1], std::ios_base::out);
+ const bool fileOpen = fout.is_open();
+ if (fileOpen) {
+ fout << "double sqrtTable[] = {" << std::endl;
+ for (int i = 0; i < 10; ++i) {
+ fout << sqrt(static_cast<double>(i)) << "," << std::endl;
+ }
+ // close the table with a zero
+ fout << "0};" << std::endl;
+ fout.close();
+ }
+ return fileOpen ? 0 : 1; // return 0 if wrote the file
+}
diff --git a/Tests/Tutorial/Complete/MathFunctions/MathFunctions.cxx b/Tests/Tutorial/Complete/MathFunctions/MathFunctions.cxx
new file mode 100644
index 0000000000..5351184be4
--- /dev/null
+++ b/Tests/Tutorial/Complete/MathFunctions/MathFunctions.cxx
@@ -0,0 +1,18 @@
+
+#include "MathFunctions.h"
+#include <cmath>
+
+#ifdef USE_MYMATH
+# include "mysqrt.h"
+#endif
+
+namespace mathfunctions {
+double sqrt(double x)
+{
+#ifdef USE_MYMATH
+ return detail::mysqrt(x);
+#else
+ return std::sqrt(x);
+#endif
+}
+}
diff --git a/Tests/Tutorial/Complete/MathFunctions/MathFunctions.h b/Tests/Tutorial/Complete/MathFunctions/MathFunctions.h
new file mode 100644
index 0000000000..3fb547b4a6
--- /dev/null
+++ b/Tests/Tutorial/Complete/MathFunctions/MathFunctions.h
@@ -0,0 +1,14 @@
+
+#if defined(_WIN32)
+# if defined(EXPORTING_MYMATH)
+# define DECLSPEC __declspec(dllexport)
+# else
+# define DECLSPEC __declspec(dllimport)
+# endif
+#else // non windows
+# define DECLSPEC
+#endif
+
+namespace mathfunctions {
+double DECLSPEC sqrt(double x);
+}
diff --git a/Tests/Tutorial/Complete/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Complete/MathFunctions/mysqrt.cxx
new file mode 100644
index 0000000000..96d94212db
--- /dev/null
+++ b/Tests/Tutorial/Complete/MathFunctions/mysqrt.cxx
@@ -0,0 +1,45 @@
+#include "MathFunctions.h"
+#include <iostream>
+
+// include the generated table
+#include "Table.h"
+
+#include <cmath>
+
+namespace mathfunctions {
+namespace detail {
+// a hack square root calculation using simple operations
+double mysqrt(double x)
+{
+ if (x <= 0) {
+ return 0;
+ }
+
+ // if we have both log and exp then use them
+#if defined(HAVE_LOG) && defined(HAVE_EXP)
+ double result = exp(log(x) * 0.5);
+ std::cout << "Computing sqrt of " << x << " to be " << result << " using log"
+ << std::endl;
+#else
+ // use the table to help find an initial value
+ double result = x;
+ if (x >= 1 && x < 10) {
+ result = sqrtTable[static_cast<int>(x)];
+ }
+
+ // if we have both log and exp then use them
+
+ // do ten iterations
+ for (int i = 0; i < 10; ++i) {
+ if (result <= 0) {
+ result = 0.1;
+ }
+ double delta = x - (result * result);
+ result = result + 0.5 * delta / result;
+ std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
+ }
+#endif
+ return result;
+}
+}
+}
diff --git a/Tests/Tutorial/Complete/MathFunctions/mysqrt.h b/Tests/Tutorial/Complete/MathFunctions/mysqrt.h
new file mode 100644
index 0000000000..e1c42ef0c2
--- /dev/null
+++ b/Tests/Tutorial/Complete/MathFunctions/mysqrt.h
@@ -0,0 +1,6 @@
+
+namespace mathfunctions {
+namespace detail {
+double mysqrt(double x);
+}
+}
diff --git a/Tests/Tutorial/Complete/TutorialConfig.h.in b/Tests/Tutorial/Complete/TutorialConfig.h.in
new file mode 100644
index 0000000000..8cd2fc9c63
--- /dev/null
+++ b/Tests/Tutorial/Complete/TutorialConfig.h.in
@@ -0,0 +1,3 @@
+// the configured version number
+#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
+#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
diff --git a/Tests/Tutorial/Complete/tutorial.cxx b/Tests/Tutorial/Complete/tutorial.cxx
new file mode 100644
index 0000000000..443d195554
--- /dev/null
+++ b/Tests/Tutorial/Complete/tutorial.cxx
@@ -0,0 +1,25 @@
+// A simple program that computes the square root of a number
+#include <iostream>
+#include <sstream>
+#include <string>
+
+#include "MathFunctions.h"
+#include "TutorialConfig.h"
+
+int main(int argc, char* argv[])
+{
+ if (argc < 2) {
+ std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
+ << Tutorial_VERSION_MAJOR << std::endl;
+ std::cout << "Usage: " << argv[0] << " number" << std::endl;
+ return 1;
+ }
+
+ double inputValue = std::stod(argv[1]);
+
+ const double outputValue = mathfunctions::sqrt(inputValue);
+
+ std::cout << "The square root of " << inputValue << " is " << outputValue
+ << std::endl;
+ return 0;
+}
diff --git a/Tests/Tutorial/Consumer/CMakeLists.txt b/Tests/Tutorial/Consumer/CMakeLists.txt
new file mode 100644
index 0000000000..4033b4da83
--- /dev/null
+++ b/Tests/Tutorial/Consumer/CMakeLists.txt
@@ -0,0 +1,51 @@
+cmake_minimum_required(VERSION 3.3)
+
+if(NOT DEFINED CMAKE_CXX_STANDARD)
+ set(CMAKE_CXX_STANDARD 11)
+ set(CMAKE_CXX_STANDARD_REQUIRED True)
+endif()
+
+
+function(find_external_dependency name)
+ set(${name}_ROOT "" CACHE PATH "Root directory to find ${name}")
+ mark_as_advanced(${name}_DIR)
+ find_package(${name} PATHS ${${name}_ROOT} REQUIRED)
+endfunction()
+
+
+project(Consumer)
+
+find_external_dependency(MathFunctions)
+
+add_library(consumer consumer.cxx)
+target_link_libraries(consumer PUBLIC MathFunctions)
+
+# install the consumer library
+install(TARGETS consumer DESTINATION bin EXPORT ConsumerTargets)
+
+# install the configuration targets
+install(EXPORT ConsumerTargets
+ FILE ConsumerTargets.cmake
+ DESTINATION lib/cmake/Consumer
+)
+
+include(CMakePackageConfigHelpers)
+# generate the config file that is includes the exports
+configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
+ "${CMAKE_CURRENT_BINARY_DIR}/ConsumerConfig.cmake"
+ INSTALL_DESTINATION "lib/cmake/example"
+ NO_SET_AND_CHECK_MACRO
+ NO_CHECK_REQUIRED_COMPONENTS_MACRO
+ )
+
+# install the configuration file
+install(FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/ConsumerConfig.cmake
+ DESTINATION lib/cmake/Consumer
+ )
+
+# generate the export targets for the build tree
+# needs to be after the install(TARGETS ) command
+export(EXPORT ConsumerTargets
+ FILE "${CMAKE_CURRENT_BINARY_DIR}/ConsumerTargets.cmake"
+)
diff --git a/Tests/Tutorial/Consumer/Config.cmake.in b/Tests/Tutorial/Consumer/Config.cmake.in
new file mode 100644
index 0000000000..0b3f1e4ef0
--- /dev/null
+++ b/Tests/Tutorial/Consumer/Config.cmake.in
@@ -0,0 +1,14 @@
+
+@PACKAGE_INIT@
+
+include(CMakeFindDependencyMacro)
+
+function(find_external_dependency name)
+ set(${name}_ROOT "" CACHE PATH "Root directory to find ${name}")
+ mark_as_advanced(${name}_DIR)
+ find_dependency(${name} PATHS ${${name}_ROOT} REQUIRED)
+endfunction()
+
+find_external_dependency(MathFunctions)
+
+include ( "${CMAKE_CURRENT_LIST_DIR}/ConsumerTargets.cmake" )
diff --git a/Tests/Tutorial/Consumer/consumer.cxx b/Tests/Tutorial/Consumer/consumer.cxx
new file mode 100644
index 0000000000..ae7877b5ab
--- /dev/null
+++ b/Tests/Tutorial/Consumer/consumer.cxx
@@ -0,0 +1,11 @@
+// A simple function that computes the square root of a number
+#include <iostream>
+#include <sstream>
+#include <string>
+
+#include "MathFunctions.h"
+
+double string_square_root(std::string const& value)
+{
+ return mathfunctions::sqrt(std::stod(value));
+}
diff --git a/Tests/Tutorial/Consumer/directions.txt b/Tests/Tutorial/Consumer/directions.txt
new file mode 100644
index 0000000000..6a70aab5ee
--- /dev/null
+++ b/Tests/Tutorial/Consumer/directions.txt
@@ -0,0 +1,6 @@
+# Import a CMake Project#
+
+This examples shows how a project can find other CMake packages that
+generated Config.cmake files.
+
+It also shows how to state a projects external dependencies when generating a Config.cmake.
diff --git a/Tests/Tutorial/MultiPackage/CMakeLists.txt b/Tests/Tutorial/MultiPackage/CMakeLists.txt
new file mode 100644
index 0000000000..067e807295
--- /dev/null
+++ b/Tests/Tutorial/MultiPackage/CMakeLists.txt
@@ -0,0 +1,109 @@
+cmake_minimum_required(VERSION 3.3)
+project(Tutorial)
+
+# control how we mark up Debug libraries compared to Release libraries
+set(CMAKE_DEBUG_POSTFIX "-d")
+
+# control where the static and shared libraries are built so that on windows
+# we don't need to tinker with the path to run the executable
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
+
+option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
+
+# the version number.
+set(Tutorial_VERSION_MAJOR 1)
+set(Tutorial_VERSION_MINOR 0)
+
+# configure a header file to pass the version number only
+configure_file(
+ "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
+ "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ )
+
+# add the MathFunctions library
+add_subdirectory(MathFunctions)
+
+# add the executable
+add_executable(Tutorial tutorial.cxx)
+target_link_libraries(Tutorial MathFunctions)
+
+# add the binary tree to the search path for include files
+# so that we will find TutorialConfig.h
+target_include_directories(Tutorial PUBLIC
+ "${PROJECT_BINARY_DIR}"
+ )
+
+# add the install targets
+install(TARGETS Tutorial DESTINATION bin)
+install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ DESTINATION include
+ )
+
+# enable testing
+enable_testing()
+
+# does the application run
+add_test(NAME Runs COMMAND Tutorial 25)
+
+# does the usage message work?
+add_test(NAME Usage COMMAND Tutorial)
+set_tests_properties(Usage
+ PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number"
+ )
+
+# define a function to simplify adding tests
+function(do_test target arg result)
+ add_test(NAME Comp${arg} COMMAND ${target} ${arg})
+ set_tests_properties(Comp${arg}
+ PROPERTIES PASS_REGULAR_EXPRESSION ${result}
+ )
+endfunction(do_test)
+
+# do a bunch of result based tests
+do_test(Tutorial 4 "4 is 2")
+do_test(Tutorial 9 "9 is 3")
+do_test(Tutorial 5 "5 is 2.236")
+do_test(Tutorial 7 "7 is 2.645")
+do_test(Tutorial 25 "25 is 5")
+do_test(Tutorial -25 "-25 is [-nan|nan|0]")
+do_test(Tutorial 0.0001 "0.0001 is 0.01")
+
+include(InstallRequiredSystemLibraries)
+set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
+set(CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}")
+set(CPACK_PACKAGE_VERSION_MINOR "${Tutorial_VERSION_MINOR}")
+include(CPack)
+
+# install the configuration targets
+install(EXPORT MathFunctionsTargets
+ FILE MathFunctionsTargets.cmake
+ DESTINATION lib/cmake/MathFunctions
+)
+
+include(CMakePackageConfigHelpers)
+# generate the config file that is includes the exports
+configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
+ "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfig.cmake"
+ INSTALL_DESTINATION "lib/cmake/example"
+ NO_SET_AND_CHECK_MACRO
+ NO_CHECK_REQUIRED_COMPONENTS_MACRO
+ )
+# generate the version file for the config file
+write_basic_package_version_file(
+ "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfigVersion.cmake"
+ VERSION "${Tutorial_VERSION_MAJOR}.${Tutorial_VERSION_MINOR}"
+ COMPATIBILITY AnyNewerVersion
+)
+
+# install the configuration file
+install(FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfig.cmake
+ DESTINATION lib/cmake/MathFunctions
+ )
+
+# generate the export targets for the build tree
+# needs to be after the install(TARGETS ) command
+export(EXPORT MathFunctionsTargets
+ FILE "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsTargets.cmake"
+)
diff --git a/Tests/Tutorial/MultiPackage/Config.cmake.in b/Tests/Tutorial/MultiPackage/Config.cmake.in
new file mode 100644
index 0000000000..17cbabd99c
--- /dev/null
+++ b/Tests/Tutorial/MultiPackage/Config.cmake.in
@@ -0,0 +1,4 @@
+
+@PACKAGE_INIT@
+
+include ( "${CMAKE_CURRENT_LIST_DIR}/MathFunctionsTargets.cmake" )
diff --git a/Tests/Tutorial/MultiPackage/License.txt b/Tests/Tutorial/MultiPackage/License.txt
new file mode 100644
index 0000000000..c62d00b9ea
--- /dev/null
+++ b/Tests/Tutorial/MultiPackage/License.txt
@@ -0,0 +1,2 @@
+This is the open source License.txt file introduced in
+CMake/Tutorial/Step7...
diff --git a/Tests/Tutorial/MultiPackage/MathFunctions/CMakeLists.txt b/Tests/Tutorial/MultiPackage/MathFunctions/CMakeLists.txt
new file mode 100644
index 0000000000..161ad64492
--- /dev/null
+++ b/Tests/Tutorial/MultiPackage/MathFunctions/CMakeLists.txt
@@ -0,0 +1,68 @@
+
+# add the library that runs
+add_library(MathFunctions MathFunctions.cxx)
+
+# state that anybody linking to us needs to include the current source dir
+# to find MathFunctions.h, while we don't.
+target_include_directories(MathFunctions
+ INTERFACE
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+ $<INSTALL_INTERFACE:include>
+ )
+
+# should we use our own math functions
+option(USE_MYMATH "Use tutorial provided math implementation" ON)
+if(USE_MYMATH)
+
+ # does this system provide the log and exp functions?
+ include(CheckSymbolExists)
+ set(CMAKE_REQUIRED_LIBRARIES "m")
+ check_symbol_exists(log "math.h" HAVE_LOG)
+ check_symbol_exists(exp "math.h" HAVE_EXP)
+
+ # first we add the executable that generates the table
+ add_executable(MakeTable MakeTable.cxx)
+
+ # add the command to generate the source code
+ add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ DEPENDS MakeTable
+ )
+
+ # library that just does sqrt
+ add_library(SqrtLibrary STATIC
+ mysqrt.cxx
+ ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ )
+
+ # state that we depend on our binary dir to find Table.h
+ target_include_directories(SqrtLibrary PRIVATE
+ ${CMAKE_CURRENT_BINARY_DIR}
+ )
+
+ set_target_properties(SqrtLibrary PROPERTIES
+ POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS}
+ )
+
+ target_compile_definitions(SqrtLibrary PRIVATE
+ "$<$<BOOL:${HAVE_LOG}>:HAVE_LOG>"
+ "$<$<BOOL:${HAVE_EXP}>:HAVE_EXP>"
+ )
+ target_link_libraries(MathFunctions PRIVATE SqrtLibrary)
+endif()
+
+target_compile_definitions(MathFunctions PRIVATE "$<$<BOOL:${USE_MYMATH}>:USE_MYMATH>")
+
+# define the symbol stating we are using the declspec(dllexport) when
+# building on windows
+target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH")
+
+# setup the version numbering
+set_property(TARGET MathFunctions PROPERTY VERSION "1.0.0")
+set_property(TARGET MathFunctions PROPERTY SOVERSION "1")
+
+install(TARGETS MathFunctions
+ DESTINATION lib
+ EXPORT MathFunctionsTargets)
+install(FILES MathFunctions.h DESTINATION include)
diff --git a/Tests/Tutorial/MultiPackage/MathFunctions/MakeTable.cxx b/Tests/Tutorial/MultiPackage/MathFunctions/MakeTable.cxx
new file mode 100644
index 0000000000..ee585568cb
--- /dev/null
+++ b/Tests/Tutorial/MultiPackage/MathFunctions/MakeTable.cxx
@@ -0,0 +1,25 @@
+// A simple program that builds a sqrt table
+#include <cmath>
+#include <fstream>
+#include <iostream>
+
+int main(int argc, char* argv[])
+{
+ // make sure we have enough arguments
+ if (argc < 2) {
+ return 1;
+ }
+
+ std::ofstream fout(argv[1], std::ios_base::out);
+ const bool fileOpen = fout.is_open();
+ if (fileOpen) {
+ fout << "double sqrtTable[] = {" << std::endl;
+ for (int i = 0; i < 10; ++i) {
+ fout << sqrt(static_cast<double>(i)) << "," << std::endl;
+ }
+ // close the table with a zero
+ fout << "0};" << std::endl;
+ fout.close();
+ }
+ return fileOpen ? 0 : 1; // return 0 if wrote the file
+}
diff --git a/Tests/Tutorial/MultiPackage/MathFunctions/MathFunctions.cxx b/Tests/Tutorial/MultiPackage/MathFunctions/MathFunctions.cxx
new file mode 100644
index 0000000000..5351184be4
--- /dev/null
+++ b/Tests/Tutorial/MultiPackage/MathFunctions/MathFunctions.cxx
@@ -0,0 +1,18 @@
+
+#include "MathFunctions.h"
+#include <cmath>
+
+#ifdef USE_MYMATH
+# include "mysqrt.h"
+#endif
+
+namespace mathfunctions {
+double sqrt(double x)
+{
+#ifdef USE_MYMATH
+ return detail::mysqrt(x);
+#else
+ return std::sqrt(x);
+#endif
+}
+}
diff --git a/Tests/Tutorial/MultiPackage/MathFunctions/MathFunctions.h b/Tests/Tutorial/MultiPackage/MathFunctions/MathFunctions.h
new file mode 100644
index 0000000000..3fb547b4a6
--- /dev/null
+++ b/Tests/Tutorial/MultiPackage/MathFunctions/MathFunctions.h
@@ -0,0 +1,14 @@
+
+#if defined(_WIN32)
+# if defined(EXPORTING_MYMATH)
+# define DECLSPEC __declspec(dllexport)
+# else
+# define DECLSPEC __declspec(dllimport)
+# endif
+#else // non windows
+# define DECLSPEC
+#endif
+
+namespace mathfunctions {
+double DECLSPEC sqrt(double x);
+}
diff --git a/Tests/Tutorial/MultiPackage/MathFunctions/mysqrt.cxx b/Tests/Tutorial/MultiPackage/MathFunctions/mysqrt.cxx
new file mode 100644
index 0000000000..96d94212db
--- /dev/null
+++ b/Tests/Tutorial/MultiPackage/MathFunctions/mysqrt.cxx
@@ -0,0 +1,45 @@
+#include "MathFunctions.h"
+#include <iostream>
+
+// include the generated table
+#include "Table.h"
+
+#include <cmath>
+
+namespace mathfunctions {
+namespace detail {
+// a hack square root calculation using simple operations
+double mysqrt(double x)
+{
+ if (x <= 0) {
+ return 0;
+ }
+
+ // if we have both log and exp then use them
+#if defined(HAVE_LOG) && defined(HAVE_EXP)
+ double result = exp(log(x) * 0.5);
+ std::cout << "Computing sqrt of " << x << " to be " << result << " using log"
+ << std::endl;
+#else
+ // use the table to help find an initial value
+ double result = x;
+ if (x >= 1 && x < 10) {
+ result = sqrtTable[static_cast<int>(x)];
+ }
+
+ // if we have both log and exp then use them
+
+ // do ten iterations
+ for (int i = 0; i < 10; ++i) {
+ if (result <= 0) {
+ result = 0.1;
+ }
+ double delta = x - (result * result);
+ result = result + 0.5 * delta / result;
+ std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
+ }
+#endif
+ return result;
+}
+}
+}
diff --git a/Tests/Tutorial/MultiPackage/MathFunctions/mysqrt.h b/Tests/Tutorial/MultiPackage/MathFunctions/mysqrt.h
new file mode 100644
index 0000000000..e1c42ef0c2
--- /dev/null
+++ b/Tests/Tutorial/MultiPackage/MathFunctions/mysqrt.h
@@ -0,0 +1,6 @@
+
+namespace mathfunctions {
+namespace detail {
+double mysqrt(double x);
+}
+}
diff --git a/Tests/Tutorial/MultiPackage/MultiCPackConfig.cmake b/Tests/Tutorial/MultiPackage/MultiCPackConfig.cmake
new file mode 100644
index 0000000000..403b633e11
--- /dev/null
+++ b/Tests/Tutorial/MultiPackage/MultiCPackConfig.cmake
@@ -0,0 +1,7 @@
+
+include("release/CPackConfig.cmake")
+
+set(CPACK_INSTALL_CMAKE_PROJECTS
+ "debug;Tutorial;ALL;/"
+ "release;Tutorial;ALL;/"
+ )
diff --git a/Tests/Tutorial/MultiPackage/TutorialConfig.h.in b/Tests/Tutorial/MultiPackage/TutorialConfig.h.in
new file mode 100644
index 0000000000..8cd2fc9c63
--- /dev/null
+++ b/Tests/Tutorial/MultiPackage/TutorialConfig.h.in
@@ -0,0 +1,3 @@
+// the configured version number
+#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
+#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
diff --git a/Tests/Tutorial/MultiPackage/directions.txt b/Tests/Tutorial/MultiPackage/directions.txt
new file mode 100644
index 0000000000..c3102bb10e
--- /dev/null
+++ b/Tests/Tutorial/MultiPackage/directions.txt
@@ -0,0 +1,34 @@
+# Packaging Debug and Release #
+
+By default CMake is model is that a build directory only contains a single
+configuration, be it Debug, Release, MinSizeRel, or RelWithDebInfo.
+
+But it is possible to setup CPack to bundle multiple build directories at the same
+time to build a package that contains multiple configurations of the same project.
+
+First we need to ahead and construct a directory called 'multi_config' this
+will contain all the builds that we want to package together.
+
+Second create a 'debug' and 'release' directory underneath 'multi_config'. At
+the end you should have a layout that looks like:
+
+─ multi_config
+ ├── debug
+ └── release
+
+Now we need to setup debug and release builds, which would roughly entail
+the following:
+
+ cd debug
+ cmake -DCMAKE_BUILD_TYPE=Debug ../../MultiPackage/
+ cmake --build .
+ cd ../release
+ cmake -DCMAKE_BUILD_TYPE=Release ../../MultiPackage/
+ cmake --build .
+ cd ..
+
+
+Now that both the debug and release builds are complete we can now use
+the custom MultiCPackConfig to package both builds into a single release.
+
+ cpack --config ../../MultiPackage/MultiCPackConfig.cmake
diff --git a/Tests/Tutorial/MultiPackage/tutorial.cxx b/Tests/Tutorial/MultiPackage/tutorial.cxx
new file mode 100644
index 0000000000..443d195554
--- /dev/null
+++ b/Tests/Tutorial/MultiPackage/tutorial.cxx
@@ -0,0 +1,25 @@
+// A simple program that computes the square root of a number
+#include <iostream>
+#include <sstream>
+#include <string>
+
+#include "MathFunctions.h"
+#include "TutorialConfig.h"
+
+int main(int argc, char* argv[])
+{
+ if (argc < 2) {
+ std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
+ << Tutorial_VERSION_MAJOR << std::endl;
+ std::cout << "Usage: " << argv[0] << " number" << std::endl;
+ return 1;
+ }
+
+ double inputValue = std::stod(argv[1]);
+
+ const double outputValue = mathfunctions::sqrt(inputValue);
+
+ std::cout << "The square root of " << inputValue << " is " << outputValue
+ << std::endl;
+ return 0;
+}
diff --git a/Tests/Tutorial/Readme.txt b/Tests/Tutorial/Readme.txt
new file mode 100644
index 0000000000..74eb01ae53
--- /dev/null
+++ b/Tests/Tutorial/Readme.txt
@@ -0,0 +1,16 @@
+
+Step 0: A Starting Point
+Step 1: Configure a File and C++11 Controls
+Step 2: Adding a Library
+Step 3: Usage Requirements for Library
+Step 4: Installing and Testing
+Step 5: System Introspection
+Step 6: Custom Command and Generated File
+Step 7: Building an Installer
+Step 8: CDash submission
+Step 9: Mixing Static and Shared
+Step 10: Generator Expressions
+Step 11: Adding Export Configuration
+Complete: End result of Step 11
+Consumer: Example of Import Packages
+MultiPackage: How to package Debug and Release versions
diff --git a/Tests/Tutorial/Step1/CMakeLists.txt b/Tests/Tutorial/Step1/CMakeLists.txt
index e461d3c8b3..141f0c27a0 100644
--- a/Tests/Tutorial/Step1/CMakeLists.txt
+++ b/Tests/Tutorial/Step1/CMakeLists.txt
@@ -1,20 +1,3 @@
-cmake_minimum_required (VERSION 2.6)
-project (Tutorial)
+project(Tutorial)
-# The version number.
-set (Tutorial_VERSION_MAJOR 1)
-set (Tutorial_VERSION_MINOR 0)
-
-# configure a header file to pass some of the CMake settings
-# to the source code
-configure_file (
- "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
- "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- )
-
-# add the binary tree to the search path for include files
-# so that we will find TutorialConfig.h
-include_directories("${PROJECT_BINARY_DIR}")
-
-# add the executable
add_executable(Tutorial tutorial.cxx)
diff --git a/Tests/Tutorial/Step1/directions.txt b/Tests/Tutorial/Step1/directions.txt
new file mode 100644
index 0000000000..827d7754d5
--- /dev/null
+++ b/Tests/Tutorial/Step1/directions.txt
@@ -0,0 +1,95 @@
+# Adding a Version Number and Configured Header File #
+
+The first feature we will add is to provide our executable and project with a
+version number. While we could do this exclusively in the source code, using
+CMakeLists provides more flexibility.
+
+To add a version number we modify the CMakeLists file as follows:
+
+ cmake_minimum_required(VERSION 3.3)
+ project(Tutorial)
+
+ # the version number.
+ set(Tutorial_VERSION_MAJOR 1)
+ set(Tutorial_VERSION_MINOR 0)
+
+ # configure a header file to pass some of the CMake settings
+ # to the source code
+ configure_file(
+ "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
+ "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ )
+
+ # add the executable
+ add_executable(Tutorial tutorial.cxx)
+
+ # add the binary tree to the search path for include files
+ # so that we will find TutorialConfig.h
+ target_include_directories(Tutorial PUBLIC
+ "${PROJECT_BINARY_DIR}"
+ )
+
+
+We then create a TutorialConfig.h.in file in the source tree with the
+following contents:
+
+ // the configured options and settings for Tutorial
+ #define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
+ #define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
+
+When CMake configures this header file the values for @Tutorial_VERSION_MAJOR@
+and @Tutorial_VERSION_MINOR@ will be replaced by the values from the CMakeLists
+file. Next we modify tutorial.cxx to include the configured header file and to
+make use of the version numbers. The resulting source code is listed below.
+
+ // A simple program that computes the square root of a number
+ #include <cmath>
+ #include <iostream>
+ #include <string>
+ #include <sstream>
+
+ #include "TutorialConfig.h"
+
+ int main (int argc, char *argv[])
+ {
+ if (argc < 2) {
+ std::cout << argv[0] << " Version "
+ << Tutorial_VERSION_MAJOR << "." << Tutorial_VERSION_MINOR
+ << std::endl;
+ std::cout << "Usage: " << argv[0] << " number" << std::endl;
+ return 1;
+ }
+
+ double inputValue = atof(argv[1]);
+
+ double outputValue = sqrt(inputValue);
+ std::cout << "The square root of "
+ << inputValue << " is " << outputValue << std::endl;
+ return 0;
+ }
+
+# Adding C++11 support #
+
+Let's add some C++11 features to our project. We will need to explicitly state
+in the CMake code that it should use the correct flags. The easiest way to
+enable C++11 support for CMake is by using the CMAKE_CXX_STANDARD
+and CMAKE_CXX_STANDARD_REQUIRED variables.
+
+First, replace `atof` with `std::stod` in tutorial.cxx.
+
+Then, add the CMAKE_CXX_STANDARD and CMAKE_CXX_STANDARD_REQUIRED variables to
+the CMakeLists file. The STANADARD value should be set to 11, and REQUIRED
+should be set to True.
+
+
+# Build and Test #
+
+Run cmake or cmake-gui to configure the project and then build it with your
+chosen build tool
+
+cd to the directory where Tutorial was built (likely the make directory or
+a Debug or Release build configuration subdirectory) and run these commands:
+
+ Tutorial 4294967296
+ Tutorial 10
+ Tutorial
diff --git a/Tests/Tutorial/Step1/tutorial.cxx b/Tests/Tutorial/Step1/tutorial.cxx
index 7a13376cbd..f8dd0c6c81 100644
--- a/Tests/Tutorial/Step1/tutorial.cxx
+++ b/Tests/Tutorial/Step1/tutorial.cxx
@@ -1,19 +1,20 @@
// A simple program that computes the square root of a number
-#include "TutorialConfig.h"
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
+#include <cmath>
+#include <cstdlib>
+#include <iostream>
+#include <string>
int main(int argc, char* argv[])
{
if (argc < 2) {
- fprintf(stdout, "%s Version %d.%d\n", argv[0], Tutorial_VERSION_MAJOR,
- Tutorial_VERSION_MINOR);
- fprintf(stdout, "Usage: %s number\n", argv[0]);
+ std::cout << "Usage: " << argv[0] << " number" << std::endl;
return 1;
}
+
double inputValue = atof(argv[1]);
+
double outputValue = sqrt(inputValue);
- fprintf(stdout, "The square root of %g is %g\n", inputValue, outputValue);
+ std::cout << "The square root of " << inputValue << " is " << outputValue
+ << std::endl;
return 0;
}
diff --git a/Tests/Tutorial/Step10/CMakeLists.txt b/Tests/Tutorial/Step10/CMakeLists.txt
new file mode 100644
index 0000000000..b1d46c4b9d
--- /dev/null
+++ b/Tests/Tutorial/Step10/CMakeLists.txt
@@ -0,0 +1,77 @@
+cmake_minimum_required(VERSION 3.3)
+project(Tutorial)
+
+# control where the static and shared libraries are built so that on windows
+# we don't need to tinker with the path to run the executable
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
+
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED True)
+
+option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
+
+# the version number.
+set(Tutorial_VERSION_MAJOR 1)
+set(Tutorial_VERSION_MINOR 0)
+
+# configure a header file to pass the version number only
+configure_file(
+ "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
+ "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ )
+
+# add the MathFunctions library
+add_subdirectory(MathFunctions)
+
+# add the executable
+add_executable(Tutorial tutorial.cxx)
+target_link_libraries(Tutorial MathFunctions)
+
+# add the binary tree to the search path for include files
+# so that we will find TutorialConfig.h
+target_include_directories(Tutorial PUBLIC
+ "${PROJECT_BINARY_DIR}"
+ )
+
+# add the install targets
+install(TARGETS Tutorial DESTINATION bin)
+install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ DESTINATION include
+ )
+
+# enable testing
+enable_testing()
+
+# does the application run
+add_test(NAME Runs COMMAND Tutorial 25)
+
+# does the usage message work?
+add_test(NAME Usage COMMAND Tutorial)
+set_tests_properties(Usage
+ PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number"
+ )
+
+# define a function to simplify adding tests
+function(do_test target arg result)
+ add_test(NAME Comp${arg} COMMAND ${target} ${arg})
+ set_tests_properties(Comp${arg}
+ PROPERTIES PASS_REGULAR_EXPRESSION ${result}
+ )
+endfunction(do_test)
+
+# do a bunch of result based tests
+do_test(Tutorial 4 "4 is 2")
+do_test(Tutorial 9 "9 is 3")
+do_test(Tutorial 5 "5 is 2.236")
+do_test(Tutorial 7 "7 is 2.645")
+do_test(Tutorial 25 "25 is 5")
+do_test(Tutorial -25 "-25 is [-nan|nan|0]")
+do_test(Tutorial 0.0001 "0.0001 is 0.01")
+
+include(InstallRequiredSystemLibraries)
+set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
+set(CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}")
+set(CPACK_PACKAGE_VERSION_MINOR "${Tutorial_VERSION_MINOR}")
+include(CPack)
diff --git a/Tests/Tutorial/Step10/License.txt b/Tests/Tutorial/Step10/License.txt
new file mode 100644
index 0000000000..c62d00b9ea
--- /dev/null
+++ b/Tests/Tutorial/Step10/License.txt
@@ -0,0 +1,2 @@
+This is the open source License.txt file introduced in
+CMake/Tutorial/Step7...
diff --git a/Tests/Tutorial/Step10/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Step10/MathFunctions/CMakeLists.txt
new file mode 100644
index 0000000000..7a23505723
--- /dev/null
+++ b/Tests/Tutorial/Step10/MathFunctions/CMakeLists.txt
@@ -0,0 +1,61 @@
+
+# add the library that runs
+add_library(MathFunctions MathFunctions.cxx)
+
+# state that anybody linking to us needs to include the current source dir
+# to find MathFunctions.h, while we don't.
+target_include_directories(MathFunctions
+ INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
+ )
+
+# should we use our own math functions
+option(USE_MYMATH "Use tutorial provided math implementation" ON)
+if(USE_MYMATH)
+
+ # does this system provide the log and exp functions?
+ include(CheckSymbolExists)
+ set(CMAKE_REQUIRED_LIBRARIES "m")
+ check_symbol_exists(log "math.h" HAVE_LOG)
+ check_symbol_exists(exp "math.h" HAVE_EXP)
+
+ # first we add the executable that generates the table
+ add_executable(MakeTable MakeTable.cxx)
+
+ # add the command to generate the source code
+ add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ DEPENDS MakeTable
+ )
+
+ # library that just does sqrt
+ add_library(SqrtLibrary STATIC
+ mysqrt.cxx
+ ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ )
+
+ # state that we depend on our binary dir to find Table.h
+ target_include_directories(SqrtLibrary PRIVATE
+ ${CMAKE_CURRENT_BINARY_DIR}
+ )
+
+ # state that SqrtLibrary need PIC when the default is shared libraries
+ set_target_properties(SqrtLibrary PROPERTIES
+ POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS}
+ )
+
+ target_compile_definitions(MathFunctions PRIVATE "USE_MYMATH")
+ if(HAVE_LOG AND HAVE_EXP)
+ target_compile_definitions(SqrtLibrary
+ PRIVATE "HAVE_LOG" "HAVE_EXP")
+ endif()
+
+ target_link_libraries(MathFunctions PRIVATE SqrtLibrary)
+endif()
+
+# define the symbol stating we are using the declspec(dllexport) when
+# building on windows
+target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH")
+
+install(TARGETS MathFunctions DESTINATION lib)
+install(FILES MathFunctions.h DESTINATION include)
diff --git a/Tests/Tutorial/Step10/MathFunctions/MakeTable.cxx b/Tests/Tutorial/Step10/MathFunctions/MakeTable.cxx
new file mode 100644
index 0000000000..ee585568cb
--- /dev/null
+++ b/Tests/Tutorial/Step10/MathFunctions/MakeTable.cxx
@@ -0,0 +1,25 @@
+// A simple program that builds a sqrt table
+#include <cmath>
+#include <fstream>
+#include <iostream>
+
+int main(int argc, char* argv[])
+{
+ // make sure we have enough arguments
+ if (argc < 2) {
+ return 1;
+ }
+
+ std::ofstream fout(argv[1], std::ios_base::out);
+ const bool fileOpen = fout.is_open();
+ if (fileOpen) {
+ fout << "double sqrtTable[] = {" << std::endl;
+ for (int i = 0; i < 10; ++i) {
+ fout << sqrt(static_cast<double>(i)) << "," << std::endl;
+ }
+ // close the table with a zero
+ fout << "0};" << std::endl;
+ fout.close();
+ }
+ return fileOpen ? 0 : 1; // return 0 if wrote the file
+}
diff --git a/Tests/Tutorial/Step10/MathFunctions/MathFunctions.cxx b/Tests/Tutorial/Step10/MathFunctions/MathFunctions.cxx
new file mode 100644
index 0000000000..5351184be4
--- /dev/null
+++ b/Tests/Tutorial/Step10/MathFunctions/MathFunctions.cxx
@@ -0,0 +1,18 @@
+
+#include "MathFunctions.h"
+#include <cmath>
+
+#ifdef USE_MYMATH
+# include "mysqrt.h"
+#endif
+
+namespace mathfunctions {
+double sqrt(double x)
+{
+#ifdef USE_MYMATH
+ return detail::mysqrt(x);
+#else
+ return std::sqrt(x);
+#endif
+}
+}
diff --git a/Tests/Tutorial/Step10/MathFunctions/MathFunctions.h b/Tests/Tutorial/Step10/MathFunctions/MathFunctions.h
new file mode 100644
index 0000000000..3fb547b4a6
--- /dev/null
+++ b/Tests/Tutorial/Step10/MathFunctions/MathFunctions.h
@@ -0,0 +1,14 @@
+
+#if defined(_WIN32)
+# if defined(EXPORTING_MYMATH)
+# define DECLSPEC __declspec(dllexport)
+# else
+# define DECLSPEC __declspec(dllimport)
+# endif
+#else // non windows
+# define DECLSPEC
+#endif
+
+namespace mathfunctions {
+double DECLSPEC sqrt(double x);
+}
diff --git a/Tests/Tutorial/Step10/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step10/MathFunctions/mysqrt.cxx
new file mode 100644
index 0000000000..96d94212db
--- /dev/null
+++ b/Tests/Tutorial/Step10/MathFunctions/mysqrt.cxx
@@ -0,0 +1,45 @@
+#include "MathFunctions.h"
+#include <iostream>
+
+// include the generated table
+#include "Table.h"
+
+#include <cmath>
+
+namespace mathfunctions {
+namespace detail {
+// a hack square root calculation using simple operations
+double mysqrt(double x)
+{
+ if (x <= 0) {
+ return 0;
+ }
+
+ // if we have both log and exp then use them
+#if defined(HAVE_LOG) && defined(HAVE_EXP)
+ double result = exp(log(x) * 0.5);
+ std::cout << "Computing sqrt of " << x << " to be " << result << " using log"
+ << std::endl;
+#else
+ // use the table to help find an initial value
+ double result = x;
+ if (x >= 1 && x < 10) {
+ result = sqrtTable[static_cast<int>(x)];
+ }
+
+ // if we have both log and exp then use them
+
+ // do ten iterations
+ for (int i = 0; i < 10; ++i) {
+ if (result <= 0) {
+ result = 0.1;
+ }
+ double delta = x - (result * result);
+ result = result + 0.5 * delta / result;
+ std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
+ }
+#endif
+ return result;
+}
+}
+}
diff --git a/Tests/Tutorial/Step10/MathFunctions/mysqrt.h b/Tests/Tutorial/Step10/MathFunctions/mysqrt.h
new file mode 100644
index 0000000000..e1c42ef0c2
--- /dev/null
+++ b/Tests/Tutorial/Step10/MathFunctions/mysqrt.h
@@ -0,0 +1,6 @@
+
+namespace mathfunctions {
+namespace detail {
+double mysqrt(double x);
+}
+}
diff --git a/Tests/Tutorial/Step10/TutorialConfig.h.in b/Tests/Tutorial/Step10/TutorialConfig.h.in
new file mode 100644
index 0000000000..8cd2fc9c63
--- /dev/null
+++ b/Tests/Tutorial/Step10/TutorialConfig.h.in
@@ -0,0 +1,3 @@
+// the configured version number
+#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
+#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
diff --git a/Tests/Tutorial/Step10/directions.txt b/Tests/Tutorial/Step10/directions.txt
new file mode 100644
index 0000000000..5317b5430a
--- /dev/null
+++ b/Tests/Tutorial/Step10/directions.txt
@@ -0,0 +1,38 @@
+# Adding Generator Expressions #
+
+Generator expressions are evaluated during build system generation to produce
+information specific to each build configuration.
+
+Generator expressions are allowed in the context of many target properties, such
+as LINK_LIBRARIES, INCLUDE_DIRECTORIES, COMPILE_DEFINITIONS and others. They may
+also be used when using commands to populate those properties, such as
+target_link_libraries(), target_include_directories(),
+target_compile_definitions() and others.
+
+Generator expressions may to used to enable conditional linking, conditional
+definitions used when compiling, and conditional include directories and more.
+The conditions may be based on the build configuration, target properties,
+platform information or any other queryable information.
+
+There are different types of generator expressions including Logical,
+Informational, and Output expressions.
+
+Logical expressions are used to create conditional output. The basic expressions
+are the 0 and 1 expressions. A "$<0:...>" results in the empty string, and
+"$<1:...>" results in the content of "...". They can also be nested.
+For example:
+
+ if(HAVE_LOG AND HAVE_EXP)
+ target_compile_definitions(SqrtLibrary
+ PRIVATE "HAVE_LOG" "HAVE_EXP")
+ endif()
+
+Can be rewritten with generator expressions:
+
+ target_compile_definitions(SqrtLibrary PRIVATE
+ "$<$<BOOL:${HAVE_LOG}>:HAVE_LOG>"
+ "$<$<BOOL:${HAVE_EXP}>:HAVE_EXP>"
+ )
+
+Note that "${HAVE_LOG}" is evaluated at CMake configure time while
+"$<$<BOOL:${HAVE_LOG}>:HAVE_LOG>" is evaluated at build system generation time.
diff --git a/Tests/Tutorial/Step10/tutorial.cxx b/Tests/Tutorial/Step10/tutorial.cxx
new file mode 100644
index 0000000000..443d195554
--- /dev/null
+++ b/Tests/Tutorial/Step10/tutorial.cxx
@@ -0,0 +1,25 @@
+// A simple program that computes the square root of a number
+#include <iostream>
+#include <sstream>
+#include <string>
+
+#include "MathFunctions.h"
+#include "TutorialConfig.h"
+
+int main(int argc, char* argv[])
+{
+ if (argc < 2) {
+ std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
+ << Tutorial_VERSION_MAJOR << std::endl;
+ std::cout << "Usage: " << argv[0] << " number" << std::endl;
+ return 1;
+ }
+
+ double inputValue = std::stod(argv[1]);
+
+ const double outputValue = mathfunctions::sqrt(inputValue);
+
+ std::cout << "The square root of " << inputValue << " is " << outputValue
+ << std::endl;
+ return 0;
+}
diff --git a/Tests/Tutorial/Step11/CMakeLists.txt b/Tests/Tutorial/Step11/CMakeLists.txt
new file mode 100644
index 0000000000..b1d46c4b9d
--- /dev/null
+++ b/Tests/Tutorial/Step11/CMakeLists.txt
@@ -0,0 +1,77 @@
+cmake_minimum_required(VERSION 3.3)
+project(Tutorial)
+
+# control where the static and shared libraries are built so that on windows
+# we don't need to tinker with the path to run the executable
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
+
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED True)
+
+option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
+
+# the version number.
+set(Tutorial_VERSION_MAJOR 1)
+set(Tutorial_VERSION_MINOR 0)
+
+# configure a header file to pass the version number only
+configure_file(
+ "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
+ "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ )
+
+# add the MathFunctions library
+add_subdirectory(MathFunctions)
+
+# add the executable
+add_executable(Tutorial tutorial.cxx)
+target_link_libraries(Tutorial MathFunctions)
+
+# add the binary tree to the search path for include files
+# so that we will find TutorialConfig.h
+target_include_directories(Tutorial PUBLIC
+ "${PROJECT_BINARY_DIR}"
+ )
+
+# add the install targets
+install(TARGETS Tutorial DESTINATION bin)
+install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ DESTINATION include
+ )
+
+# enable testing
+enable_testing()
+
+# does the application run
+add_test(NAME Runs COMMAND Tutorial 25)
+
+# does the usage message work?
+add_test(NAME Usage COMMAND Tutorial)
+set_tests_properties(Usage
+ PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number"
+ )
+
+# define a function to simplify adding tests
+function(do_test target arg result)
+ add_test(NAME Comp${arg} COMMAND ${target} ${arg})
+ set_tests_properties(Comp${arg}
+ PROPERTIES PASS_REGULAR_EXPRESSION ${result}
+ )
+endfunction(do_test)
+
+# do a bunch of result based tests
+do_test(Tutorial 4 "4 is 2")
+do_test(Tutorial 9 "9 is 3")
+do_test(Tutorial 5 "5 is 2.236")
+do_test(Tutorial 7 "7 is 2.645")
+do_test(Tutorial 25 "25 is 5")
+do_test(Tutorial -25 "-25 is [-nan|nan|0]")
+do_test(Tutorial 0.0001 "0.0001 is 0.01")
+
+include(InstallRequiredSystemLibraries)
+set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
+set(CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}")
+set(CPACK_PACKAGE_VERSION_MINOR "${Tutorial_VERSION_MINOR}")
+include(CPack)
diff --git a/Tests/Tutorial/Step11/License.txt b/Tests/Tutorial/Step11/License.txt
new file mode 100644
index 0000000000..c62d00b9ea
--- /dev/null
+++ b/Tests/Tutorial/Step11/License.txt
@@ -0,0 +1,2 @@
+This is the open source License.txt file introduced in
+CMake/Tutorial/Step7...
diff --git a/Tests/Tutorial/Step11/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Step11/MathFunctions/CMakeLists.txt
new file mode 100644
index 0000000000..760d6a57ce
--- /dev/null
+++ b/Tests/Tutorial/Step11/MathFunctions/CMakeLists.txt
@@ -0,0 +1,60 @@
+
+# add the library that runs
+add_library(MathFunctions MathFunctions.cxx)
+
+# state that anybody linking to us needs to include the current source dir
+# to find MathFunctions.h, while we don't.
+target_include_directories(MathFunctions
+ INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
+ )
+
+# should we use our own math functions
+option(USE_MYMATH "Use tutorial provided math implementation" ON)
+if(USE_MYMATH)
+
+ # does this system provide the log and exp functions?
+ include(CheckSymbolExists)
+ set(CMAKE_REQUIRED_LIBRARIES "m")
+ check_symbol_exists(log "math.h" HAVE_LOG)
+ check_symbol_exists(exp "math.h" HAVE_EXP)
+
+ # first we add the executable that generates the table
+ add_executable(MakeTable MakeTable.cxx)
+
+ # add the command to generate the source code
+ add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ DEPENDS MakeTable
+ )
+
+ # library that just does sqrt
+ add_library(SqrtLibrary STATIC
+ mysqrt.cxx
+ ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ )
+
+ # state that we depend on our binary dir to find Table.h
+ target_include_directories(SqrtLibrary PRIVATE
+ ${CMAKE_CURRENT_BINARY_DIR}
+ )
+
+ set_target_properties(SqrtLibrary PROPERTIES
+ POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS}
+ )
+
+ target_compile_definitions(SqrtLibrary PRIVATE
+ "$<$<BOOL:${HAVE_LOG}>:HAVE_LOG>"
+ "$<$<BOOL:${HAVE_EXP}>:HAVE_EXP>"
+ )
+ target_link_libraries(MathFunctions PRIVATE SqrtLibrary)
+endif()
+
+target_compile_definitions(MathFunctions PRIVATE "$<$<BOOL:${USE_MYMATH}>:USE_MYMATH>")
+
+# define the symbol stating we are using the declspec(dllexport) when
+#building on windows
+target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH")
+
+install(TARGETS MathFunctions DESTINATION lib)
+install(FILES MathFunctions.h DESTINATION include)
diff --git a/Tests/Tutorial/Step11/MathFunctions/MakeTable.cxx b/Tests/Tutorial/Step11/MathFunctions/MakeTable.cxx
new file mode 100644
index 0000000000..ee585568cb
--- /dev/null
+++ b/Tests/Tutorial/Step11/MathFunctions/MakeTable.cxx
@@ -0,0 +1,25 @@
+// A simple program that builds a sqrt table
+#include <cmath>
+#include <fstream>
+#include <iostream>
+
+int main(int argc, char* argv[])
+{
+ // make sure we have enough arguments
+ if (argc < 2) {
+ return 1;
+ }
+
+ std::ofstream fout(argv[1], std::ios_base::out);
+ const bool fileOpen = fout.is_open();
+ if (fileOpen) {
+ fout << "double sqrtTable[] = {" << std::endl;
+ for (int i = 0; i < 10; ++i) {
+ fout << sqrt(static_cast<double>(i)) << "," << std::endl;
+ }
+ // close the table with a zero
+ fout << "0};" << std::endl;
+ fout.close();
+ }
+ return fileOpen ? 0 : 1; // return 0 if wrote the file
+}
diff --git a/Tests/Tutorial/Step11/MathFunctions/MathFunctions.cxx b/Tests/Tutorial/Step11/MathFunctions/MathFunctions.cxx
new file mode 100644
index 0000000000..5351184be4
--- /dev/null
+++ b/Tests/Tutorial/Step11/MathFunctions/MathFunctions.cxx
@@ -0,0 +1,18 @@
+
+#include "MathFunctions.h"
+#include <cmath>
+
+#ifdef USE_MYMATH
+# include "mysqrt.h"
+#endif
+
+namespace mathfunctions {
+double sqrt(double x)
+{
+#ifdef USE_MYMATH
+ return detail::mysqrt(x);
+#else
+ return std::sqrt(x);
+#endif
+}
+}
diff --git a/Tests/Tutorial/Step11/MathFunctions/MathFunctions.h b/Tests/Tutorial/Step11/MathFunctions/MathFunctions.h
new file mode 100644
index 0000000000..3fb547b4a6
--- /dev/null
+++ b/Tests/Tutorial/Step11/MathFunctions/MathFunctions.h
@@ -0,0 +1,14 @@
+
+#if defined(_WIN32)
+# if defined(EXPORTING_MYMATH)
+# define DECLSPEC __declspec(dllexport)
+# else
+# define DECLSPEC __declspec(dllimport)
+# endif
+#else // non windows
+# define DECLSPEC
+#endif
+
+namespace mathfunctions {
+double DECLSPEC sqrt(double x);
+}
diff --git a/Tests/Tutorial/Step11/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step11/MathFunctions/mysqrt.cxx
new file mode 100644
index 0000000000..96d94212db
--- /dev/null
+++ b/Tests/Tutorial/Step11/MathFunctions/mysqrt.cxx
@@ -0,0 +1,45 @@
+#include "MathFunctions.h"
+#include <iostream>
+
+// include the generated table
+#include "Table.h"
+
+#include <cmath>
+
+namespace mathfunctions {
+namespace detail {
+// a hack square root calculation using simple operations
+double mysqrt(double x)
+{
+ if (x <= 0) {
+ return 0;
+ }
+
+ // if we have both log and exp then use them
+#if defined(HAVE_LOG) && defined(HAVE_EXP)
+ double result = exp(log(x) * 0.5);
+ std::cout << "Computing sqrt of " << x << " to be " << result << " using log"
+ << std::endl;
+#else
+ // use the table to help find an initial value
+ double result = x;
+ if (x >= 1 && x < 10) {
+ result = sqrtTable[static_cast<int>(x)];
+ }
+
+ // if we have both log and exp then use them
+
+ // do ten iterations
+ for (int i = 0; i < 10; ++i) {
+ if (result <= 0) {
+ result = 0.1;
+ }
+ double delta = x - (result * result);
+ result = result + 0.5 * delta / result;
+ std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
+ }
+#endif
+ return result;
+}
+}
+}
diff --git a/Tests/Tutorial/Step11/MathFunctions/mysqrt.h b/Tests/Tutorial/Step11/MathFunctions/mysqrt.h
new file mode 100644
index 0000000000..e1c42ef0c2
--- /dev/null
+++ b/Tests/Tutorial/Step11/MathFunctions/mysqrt.h
@@ -0,0 +1,6 @@
+
+namespace mathfunctions {
+namespace detail {
+double mysqrt(double x);
+}
+}
diff --git a/Tests/Tutorial/Step11/TutorialConfig.h.in b/Tests/Tutorial/Step11/TutorialConfig.h.in
new file mode 100644
index 0000000000..8cd2fc9c63
--- /dev/null
+++ b/Tests/Tutorial/Step11/TutorialConfig.h.in
@@ -0,0 +1,3 @@
+// the configured version number
+#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
+#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
diff --git a/Tests/Tutorial/Step11/directions.txt b/Tests/Tutorial/Step11/directions.txt
new file mode 100644
index 0000000000..ebb5defff7
--- /dev/null
+++ b/Tests/Tutorial/Step11/directions.txt
@@ -0,0 +1,104 @@
+# Adding Export Configuration #
+
+During Step 4 of the tutorial we added the ability for CMake to install the
+library and headers of the project. During Step 7 we added the ability
+to package up this information so it could be distributed to other people.
+
+The next step is to add the necessary information so that other CMake projects
+can use our project, be it from a build directory, a local install or when
+packaged.
+
+The first step is to update our install(TARGETS) commands to not only specify
+a DESTINATION but also an EXPORT. The EXPORT keyword generates and installs a
+CMake file containing code to import all targets listed in the install command
+from the installation tree. So let's go ahead and explicitly EXPORT the
+MathFunctions library by updating the install command in
+MathFunctions/CMakeLists.txt to look like:
+
+ install(TARGETS MathFunctions DESTINATION lib EXPORT MathFunctionsTargets)
+
+Now that we have MathFunctions being exported, we also need to explicitly install
+the generated MathFunctionsTargets.cmake file. This is done by adding
+the following to the bottom of the top-level CMakeLists.txt:
+
+ # install the configuration targets
+ install(EXPORT MathFunctionsTargets
+ FILE MathFunctionsTargets.cmake
+ DESTINATION lib/cmake/MathFunctions
+ )
+
+At this point you should try and run CMake. If everything is setup properly
+you will see that CMake will generate an error that looks like:
+
+ Target "MathFunctions" INTERFACE_INCLUDE_DIRECTORIES property contains
+ path:
+
+ "/Users/robert/Documents/CMakeClass/Tutorial/Step11/MathFunctions"
+
+ which is prefixed in the source directory.
+
+What CMake is trying to say is that during generating the export information
+it will export a path that is intrinsically tied to the current machine and
+will not be valid on other machines. The solution to this is to update the
+MathFunctions target_include_directories to understand that it needs different
+INTERFACE locations when being used from within the build directory and from an
+install / package. This means converting the target_include_directories
+call for MathFunctions to look like:
+
+ target_include_directories(MathFunctions
+ INTERFACE
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+ $<INSTALL_INTERFACE:include>
+ )
+
+Once this has been updated, we can re-run CMake and see verify that it doesn't
+warn anymore.
+
+At this point, we have CMake properly packaging the target information that is
+required but we will still need to generate a MathFunctionsConfig.cmake, so
+that the CMake find_package command can find our project. So let's go ahead and
+add a new file to the top-level of the project called Config.cmake.in with the
+following contents:
+
+ @PACKAGE_INIT@
+
+ include ( "${CMAKE_CURRENT_LIST_DIR}/MathFunctionsTargets.cmake" )
+
+Then, to properly configure and install that file, add the following to the
+bottom of the top-level CMakeLists:
+
+ include(CMakePackageConfigHelpers)
+ # generate the config file that is includes the exports
+ configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
+ "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfig.cmake"
+ INSTALL_DESTINATION "lib/cmake/example"
+ NO_SET_AND_CHECK_MACRO
+ NO_CHECK_REQUIRED_COMPONENTS_MACRO
+ )
+ # generate the version file for the config file
+ write_basic_package_version_file(
+ "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfigVersion.cmake"
+ VERSION "${Tutorial_VERSION_MAJOR}.${Tutorial_VERSION_MINOR}"
+ COMPATIBILITY AnyNewerVersion
+ )
+
+ # install the configuration file
+ install(FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfig.cmake
+ DESTINATION lib/cmake/MathFunctions
+ )
+
+At this point, we have generated a relocatable CMake Configuration for our project
+that can be used after the project has been installed or packaged. If we want
+our project to also be used from a build directory we only have to add
+the following to the bottom of the top level CMakeLists:
+
+ # generate the export targets for the build tree
+ # needs to be after the install(TARGETS ) command
+ export(EXPORT MathFunctionsTargets
+ FILE "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsTargets.cmake"
+ )
+
+With this export call we now generate a Targets.cmake, allowing the configured
+MathFunctionsConfig.cmake in the build directory to be used by other projects,
+without needing it to be installed.
diff --git a/Tests/Tutorial/Step11/tutorial.cxx b/Tests/Tutorial/Step11/tutorial.cxx
new file mode 100644
index 0000000000..3768855269
--- /dev/null
+++ b/Tests/Tutorial/Step11/tutorial.cxx
@@ -0,0 +1,25 @@
+// A simple program that computes the square root of a number
+#include <cmath>
+#include <iostream>
+#include <string>
+
+#include "MathFunctions.h"
+#include "TutorialConfig.h"
+
+int main(int argc, char* argv[])
+{
+ if (argc < 2) {
+ std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
+ << Tutorial_VERSION_MAJOR << std::endl;
+ std::cout << "Usage: " << argv[0] << " number" << std::endl;
+ return 1;
+ }
+
+ double inputValue = std::stod(argv[1]);
+
+ const double outputValue = mathfunctions::sqrt(inputValue);
+
+ std::cout << "The square root of " << inputValue << " is " << outputValue
+ << std::endl;
+ return 0;
+}
diff --git a/Tests/Tutorial/Step2/CMakeLists.txt b/Tests/Tutorial/Step2/CMakeLists.txt
index cf1d30ee29..48afaa327f 100644
--- a/Tests/Tutorial/Step2/CMakeLists.txt
+++ b/Tests/Tutorial/Step2/CMakeLists.txt
@@ -1,31 +1,25 @@
-cmake_minimum_required (VERSION 2.6)
-project (Tutorial)
+cmake_minimum_required(VERSION 3.3)
+project(Tutorial)
-# The version number.
-set (Tutorial_VERSION_MAJOR 1)
-set (Tutorial_VERSION_MINOR 0)
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED True)
-# should we use our own math functions
-option(USE_MYMATH "Use tutorial provided math implementation" ON)
+# the version number.
+set(Tutorial_VERSION_MAJOR 1)
+set(Tutorial_VERSION_MINOR 0)
# configure a header file to pass some of the CMake settings
# to the source code
-configure_file (
+configure_file(
"${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
"${PROJECT_BINARY_DIR}/TutorialConfig.h"
)
+# add the executable
+add_executable(Tutorial tutorial.cxx)
+
# add the binary tree to the search path for include files
# so that we will find TutorialConfig.h
-include_directories ("${PROJECT_BINARY_DIR}")
-
-# add the MathFunctions library?
-if (USE_MYMATH)
- include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions")
- add_subdirectory (MathFunctions)
- set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions)
-endif ()
-
-# add the executable
-add_executable (Tutorial tutorial.cxx)
-target_link_libraries (Tutorial ${EXTRA_LIBS})
+target_include_directories(Tutorial PUBLIC
+ "${PROJECT_BINARY_DIR}"
+ )
diff --git a/Tests/Tutorial/Step2/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step2/MathFunctions/mysqrt.cxx
index 2710f92205..7d9379e43e 100644
--- a/Tests/Tutorial/Step2/MathFunctions/mysqrt.cxx
+++ b/Tests/Tutorial/Step2/MathFunctions/mysqrt.cxx
@@ -1,5 +1,5 @@
#include "MathFunctions.h"
-#include <stdio.h>
+#include <iostream>
// a hack square root calculation using simple operations
double mysqrt(double x)
@@ -8,19 +8,16 @@ double mysqrt(double x)
return 0;
}
- double result;
- double delta;
- result = x;
+ double result = x;
// do ten iterations
- int i;
- for (i = 0; i < 10; ++i) {
+ for (int i = 0; i < 10; ++i) {
if (result <= 0) {
result = 0.1;
}
- delta = x - (result * result);
+ double delta = x - (result * result);
result = result + 0.5 * delta / result;
- fprintf(stdout, "Computing sqrt of %g to be %g\n", x, result);
+ std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
}
return result;
}
diff --git a/Tests/Tutorial/Step2/TutorialConfig.h.in b/Tests/Tutorial/Step2/TutorialConfig.h.in
index 25a06020ac..5395a06710 100644
--- a/Tests/Tutorial/Step2/TutorialConfig.h.in
+++ b/Tests/Tutorial/Step2/TutorialConfig.h.in
@@ -1,5 +1,4 @@
// the configured options and settings for Tutorial
#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
-#cmakedefine USE_MYMATH
diff --git a/Tests/Tutorial/Step2/directions.txt b/Tests/Tutorial/Step2/directions.txt
new file mode 100644
index 0000000000..bb6662c7e6
--- /dev/null
+++ b/Tests/Tutorial/Step2/directions.txt
@@ -0,0 +1,102 @@
+# Adding a Library #
+
+Now we will add a library to our project. This library will contain our own
+implementation for computing the square root of a number. The executable can
+then use this library instead of the standard square root function provided by
+the compiler.
+
+For this tutorial we will put the library into a subdirectory
+called MathFunctions. It will have the following one line CMakeLists file:
+
+ add_library(MathFunctions mysqrt.cxx)
+
+The source file mysqrt.cxx has one function called mysqrt that provides similar
+functionality to the compiler’s sqrt function. To make use of the new library
+we add an add_subdirectory call in the top-level CMakeLists file so that the
+library will get built. We add the new library to the executable, and add the
+MathFunctions as an include directory so that mqsqrt.h header file can be
+found. The last few lines of the top-level CMakeLists file now look like:
+
+
+ add_subdirectory(MathFunctions)
+
+ #add the executable
+ add_executable(Tutorial tutorial.cxx)
+
+ target_link_libraries(Tutorial ${EXTRA_LIBS})
+
+
+Now let us make the MathFunctions library optional. While for the tutorial
+there really isn’t any need to do so, but with larger projects this is a common
+occurrence. The first step is to add an option to the top-level CMakeLists file.
+
+ option (USE_MYMATH
+ "Use tutorial provided math implementation" ON)
+
+This will show up in CMake GUI and ccmake with a default value of ON that can
+be changed by the user. This setting will be stored so that the user does not
+need to set the value each time they run CMake on this build directory.
+
+The next change is to make building and linking the MathFunctions library
+conditional. To do this we change the top-level CMakeLists file to look like
+the following:
+
+ cmake_minimum_required(VERSION 3.3)
+ project(Tutorial)
+
+ set(CMAKE_CXX_STANDARD 11)
+ set(CMAKE_CXX_STANDARD_REQUIRED True)
+
+ # the version number.
+ set(Tutorial_VERSION_MAJOR 1)
+ set(Tutorial_VERSION_MINOR 0)
+
+ # configure a header file to pass some of the CMake settings
+ # to the source code
+ configure_file(
+ "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
+ "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ )
+
+ # should we use our own math functions
+ option(USE_MYMATH "Use tutorial provided math implementation" ON)
+
+ # add the MathFunctions library?
+ if(USE_MYMATH)
+ add_subdirectory(MathFunctions)
+ list(APPEND EXTRA_LIBS MathFunctions)
+ list(APPEND EXTRA_INCLUDES "${PROJECT_SOURCE_DIR}/MathFunctions")
+ endif(USE_MYMATH)
+
+ # add the executable
+ add_executable(Tutorial tutorial.cxx)
+
+ target_link_libraries(Tutorial ${EXTRA_LIBS})
+
+ # add the binary tree to the search path for include files
+ # so that we will find TutorialConfig.h
+ target_include_directories(Tutorial PUBLIC
+ "${PROJECT_BINARY_DIR}"
+ ${EXTRA_INCLUDES}
+ )
+
+Note the use of the variables EXTRA_LIBS, and EXTRA_INCLUDES to collect
+up any optional libraries to later be linked into the executable. This is a
+classic approach when dealing with many optional components, we will cover the
+modern approach in the next step. For now the corresponding changes to the
+source code are fairly straightforward and leave us with:
+
+ #ifdef USE_MYMATH
+ double outputValue = mysqrt(inputValue);
+ #else
+ double outputValue = sqrt(inputValue);
+ #endif
+
+Since the source code now requires USE_MYMATH we can add it to the
+TutorialConfig.h.in. Simply add the following line:
+ #cmakedefine USE_MYMATH
+
+Run cmake or cmake-gui to configure the project and then build it with your
+chosen build tool and then run the built Tutorial executable.
+
+Which function gives better results, Step1’s sqrt or Step2’s mysqrt?
diff --git a/Tests/Tutorial/Step2/tutorial.cxx b/Tests/Tutorial/Step2/tutorial.cxx
index 37f6ac4567..75b7d67b04 100644
--- a/Tests/Tutorial/Step2/tutorial.cxx
+++ b/Tests/Tutorial/Step2/tutorial.cxx
@@ -1,33 +1,23 @@
// A simple program that computes the square root of a number
-#include "TutorialConfig.h"
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
+#include <cmath>
+#include <iostream>
+#include <string>
-#ifdef USE_MYMATH
-# include "MathFunctions.h"
-#endif
+#include "TutorialConfig.h"
int main(int argc, char* argv[])
{
if (argc < 2) {
- fprintf(stdout, "%s Version %d.%d\n", argv[0], Tutorial_VERSION_MAJOR,
- Tutorial_VERSION_MINOR);
- fprintf(stdout, "Usage: %s number\n", argv[0]);
+ std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
+ << Tutorial_VERSION_MAJOR << std::endl;
+ std::cout << "Usage: " << argv[0] << " number" << std::endl;
return 1;
}
- double inputValue = atof(argv[1]);
- double outputValue = 0;
-
- if (inputValue >= 0) {
-#ifdef USE_MYMATH
- outputValue = mysqrt(inputValue);
-#else
- outputValue = sqrt(inputValue);
-#endif
- }
+ double inputValue = std::stod(argv[1]);
- fprintf(stdout, "The square root of %g is %g\n", inputValue, outputValue);
+ double outputValue = sqrt(inputValue);
+ std::cout << "The square root of " << inputValue << " is " << outputValue
+ << std::endl;
return 0;
}
diff --git a/Tests/Tutorial/Step3/CMakeLists.txt b/Tests/Tutorial/Step3/CMakeLists.txt
index 762302bc57..f904ea7486 100644
--- a/Tests/Tutorial/Step3/CMakeLists.txt
+++ b/Tests/Tutorial/Step3/CMakeLists.txt
@@ -1,68 +1,38 @@
-cmake_minimum_required (VERSION 2.6)
-project (Tutorial)
+cmake_minimum_required(VERSION 3.3)
+project(Tutorial)
-# The version number.
-set (Tutorial_VERSION_MAJOR 1)
-set (Tutorial_VERSION_MINOR 0)
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED True)
# should we use our own math functions
option(USE_MYMATH "Use tutorial provided math implementation" ON)
+# the version number.
+set(Tutorial_VERSION_MAJOR 1)
+set(Tutorial_VERSION_MINOR 0)
+
# configure a header file to pass some of the CMake settings
# to the source code
-configure_file (
+configure_file(
"${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
"${PROJECT_BINARY_DIR}/TutorialConfig.h"
)
-# add the binary tree to the search path for include files
-# so that we will find TutorialConfig.h
-include_directories ("${PROJECT_BINARY_DIR}")
-
# add the MathFunctions library?
-if (USE_MYMATH)
- include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions")
- add_subdirectory (MathFunctions)
- set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions)
-endif ()
+if(USE_MYMATH)
+ add_subdirectory(MathFunctions)
+ list(APPEND EXTRA_LIBS MathFunctions)
+ list(APPEND EXTRA_INCLUDES "${PROJECT_SOURCE_DIR}/MathFunctions")
+endif(USE_MYMATH)
# add the executable
-add_executable (Tutorial tutorial.cxx)
-target_link_libraries (Tutorial ${EXTRA_LIBS})
-
-# add the install targets
-install (TARGETS Tutorial DESTINATION bin)
-install (FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- DESTINATION include)
-
-
-# enable testing
-enable_testing ()
-
-# does the application run
-add_test (TutorialRuns Tutorial 25)
+add_executable(Tutorial tutorial.cxx)
-# does it sqrt of 25
-add_test (TutorialComp25 Tutorial 25)
-set_tests_properties (TutorialComp25
- PROPERTIES PASS_REGULAR_EXPRESSION "25 is 5"
- )
-
-# does it handle negative numbers
-add_test (TutorialNegative Tutorial -25)
-set_tests_properties (TutorialNegative
- PROPERTIES PASS_REGULAR_EXPRESSION "-25 is 0"
- )
-
-# does it handle small numbers
-add_test (TutorialSmall Tutorial 0.0001)
-set_tests_properties (TutorialSmall
- PROPERTIES PASS_REGULAR_EXPRESSION "0.0001 is 0.01"
- )
+target_link_libraries(Tutorial ${EXTRA_LIBS})
-# does the usage message work?
-add_test (TutorialUsage Tutorial)
-set_tests_properties (TutorialUsage
- PROPERTIES
- PASS_REGULAR_EXPRESSION "Usage:.*number"
- )
+# add the binary tree to the search path for include files
+# so that we will find TutorialConfig.h
+target_include_directories(Tutorial PUBLIC
+ "${PROJECT_BINARY_DIR}"
+ ${EXTRA_INCLUDES}
+ )
diff --git a/Tests/Tutorial/Step3/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Step3/MathFunctions/CMakeLists.txt
index f386036c3a..8b443a6599 100644
--- a/Tests/Tutorial/Step3/MathFunctions/CMakeLists.txt
+++ b/Tests/Tutorial/Step3/MathFunctions/CMakeLists.txt
@@ -1,4 +1 @@
add_library(MathFunctions mysqrt.cxx)
-
-install (TARGETS MathFunctions DESTINATION bin)
-install (FILES MathFunctions.h DESTINATION include)
diff --git a/Tests/Tutorial/Step3/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step3/MathFunctions/mysqrt.cxx
index 2710f92205..7d9379e43e 100644
--- a/Tests/Tutorial/Step3/MathFunctions/mysqrt.cxx
+++ b/Tests/Tutorial/Step3/MathFunctions/mysqrt.cxx
@@ -1,5 +1,5 @@
#include "MathFunctions.h"
-#include <stdio.h>
+#include <iostream>
// a hack square root calculation using simple operations
double mysqrt(double x)
@@ -8,19 +8,16 @@ double mysqrt(double x)
return 0;
}
- double result;
- double delta;
- result = x;
+ double result = x;
// do ten iterations
- int i;
- for (i = 0; i < 10; ++i) {
+ for (int i = 0; i < 10; ++i) {
if (result <= 0) {
result = 0.1;
}
- delta = x - (result * result);
+ double delta = x - (result * result);
result = result + 0.5 * delta / result;
- fprintf(stdout, "Computing sqrt of %g to be %g\n", x, result);
+ std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
}
return result;
}
diff --git a/Tests/Tutorial/Step3/directions.txt b/Tests/Tutorial/Step3/directions.txt
new file mode 100644
index 0000000000..54d0318063
--- /dev/null
+++ b/Tests/Tutorial/Step3/directions.txt
@@ -0,0 +1,26 @@
+# Adding Usage Requirements for Library #
+
+Usage requirements allow for far better control over a library / executable's
+link and include line. While also giving more control over the transitive
+property of targets inside CMake. The primary commands that leverage usage
+requirements are:
+
+ - target_compile_definitions
+ - target_compile_options
+ - target_include_directories
+ - target_link_libraries
+
+First up is MathFunctions. We first state that anybody linking to MathFunctions
+needs to include the current source directory, while MathFunctions itself
+doesn't. So this can become an INTERFACE usage requirement.
+
+Remember INTERFACE means things that consumers require but the producer doesn't.
+
+ target_include_directories(MathFunctions
+ INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
+
+Now that we've specified usage requirements for MathFunctions we can safely remove
+our uses of the EXTRA_INCLUDES variable.
+
+Run cmake or cmake-gui to configure the project and then build it with your
+chosen build tool.
diff --git a/Tests/Tutorial/Step3/tutorial.cxx b/Tests/Tutorial/Step3/tutorial.cxx
index 37f6ac4567..1d5742d2d1 100644
--- a/Tests/Tutorial/Step3/tutorial.cxx
+++ b/Tests/Tutorial/Step3/tutorial.cxx
@@ -1,8 +1,9 @@
// A simple program that computes the square root of a number
+#include <cmath>
+#include <iostream>
+#include <string>
+
#include "TutorialConfig.h"
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
#ifdef USE_MYMATH
# include "MathFunctions.h"
@@ -11,23 +12,21 @@
int main(int argc, char* argv[])
{
if (argc < 2) {
- fprintf(stdout, "%s Version %d.%d\n", argv[0], Tutorial_VERSION_MAJOR,
- Tutorial_VERSION_MINOR);
- fprintf(stdout, "Usage: %s number\n", argv[0]);
+ std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
+ << Tutorial_VERSION_MAJOR << std::endl;
+ std::cout << "Usage: " << argv[0] << " number" << std::endl;
return 1;
}
- double inputValue = atof(argv[1]);
- double outputValue = 0;
+ double inputValue = std::stod(argv[1]);
- if (inputValue >= 0) {
#ifdef USE_MYMATH
- outputValue = mysqrt(inputValue);
+ double outputValue = mysqrt(inputValue);
#else
- outputValue = sqrt(inputValue);
+ double outputValue = sqrt(inputValue);
#endif
- }
- fprintf(stdout, "The square root of %g is %g\n", inputValue, outputValue);
+ std::cout << "The square root of " << inputValue << " is " << outputValue
+ << std::endl;
return 0;
}
diff --git a/Tests/Tutorial/Step4/CMakeLists.txt b/Tests/Tutorial/Step4/CMakeLists.txt
index 6994aa1ceb..34eab55581 100644
--- a/Tests/Tutorial/Step4/CMakeLists.txt
+++ b/Tests/Tutorial/Step4/CMakeLists.txt
@@ -1,68 +1,36 @@
-cmake_minimum_required (VERSION 2.6)
-project (Tutorial)
+cmake_minimum_required(VERSION 3.3)
+project(Tutorial)
-# The version number.
-set (Tutorial_VERSION_MAJOR 1)
-set (Tutorial_VERSION_MINOR 0)
-
-# does this system provide the log and exp functions?
-include (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake)
-check_function_exists (log HAVE_LOG)
-check_function_exists (exp HAVE_EXP)
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED True)
# should we use our own math functions
option(USE_MYMATH "Use tutorial provided math implementation" ON)
+# the version number.
+set(Tutorial_VERSION_MAJOR 1)
+set(Tutorial_VERSION_MINOR 0)
+
# configure a header file to pass some of the CMake settings
# to the source code
-configure_file (
+configure_file(
"${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
"${PROJECT_BINARY_DIR}/TutorialConfig.h"
)
-# add the binary tree to the search path for include files
-# so that we will find TutorialConfig.h
-include_directories ("${PROJECT_BINARY_DIR}")
-
# add the MathFunctions library?
-if (USE_MYMATH)
- include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions")
- add_subdirectory (MathFunctions)
- set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions)
-endif ()
+if(USE_MYMATH)
+ add_subdirectory(MathFunctions)
+ list(APPEND EXTRA_LIBS MathFunctions)
+endif(USE_MYMATH)
# add the executable
-add_executable (Tutorial tutorial.cxx)
-target_link_libraries (Tutorial ${EXTRA_LIBS})
-
-# add the install targets
-install (TARGETS Tutorial DESTINATION bin)
-install (FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- DESTINATION include)
-
-# enable testing
-enable_testing ()
+add_executable(Tutorial tutorial.cxx)
-# does the application run
-add_test (TutorialRuns Tutorial 25)
-
-# does the usage message work?
-add_test (TutorialUsage Tutorial)
-set_tests_properties (TutorialUsage
- PROPERTIES
- PASS_REGULAR_EXPRESSION "Usage:.*number"
- )
-
-#define a macro to simplify adding tests
-macro (do_test arg result)
- add_test (TutorialComp${arg} Tutorial ${arg})
- set_tests_properties (TutorialComp${arg}
- PROPERTIES PASS_REGULAR_EXPRESSION ${result}
- )
-endmacro ()
-
-# do a bunch of result based tests
-do_test (25 "25 is 5")
-do_test (-25 "-25 is 0")
-do_test (0.0001 "0.0001 is 0.01")
+target_link_libraries(Tutorial PUBLIC ${EXTRA_LIBS})
+# add the binary tree to the search path for include files
+# so that we will find TutorialConfig.h
+target_include_directories(Tutorial PUBLIC
+ "${PROJECT_BINARY_DIR}"
+ )
diff --git a/Tests/Tutorial/Step4/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Step4/MathFunctions/CMakeLists.txt
index f386036c3a..0515852a0c 100644
--- a/Tests/Tutorial/Step4/MathFunctions/CMakeLists.txt
+++ b/Tests/Tutorial/Step4/MathFunctions/CMakeLists.txt
@@ -1,4 +1,7 @@
add_library(MathFunctions mysqrt.cxx)
-install (TARGETS MathFunctions DESTINATION bin)
-install (FILES MathFunctions.h DESTINATION include)
+# state that anybody linking to us needs to include the current source dir
+# to find MathFunctions.h, while we don't.
+target_include_directories(MathFunctions
+ INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
+ )
diff --git a/Tests/Tutorial/Step4/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step4/MathFunctions/mysqrt.cxx
index 6ca264f765..7d9379e43e 100644
--- a/Tests/Tutorial/Step4/MathFunctions/mysqrt.cxx
+++ b/Tests/Tutorial/Step4/MathFunctions/mysqrt.cxx
@@ -1,8 +1,5 @@
#include "MathFunctions.h"
-#include "TutorialConfig.h"
-#include <stdio.h>
-
-#include <math.h>
+#include <iostream>
// a hack square root calculation using simple operations
double mysqrt(double x)
@@ -11,26 +8,16 @@ double mysqrt(double x)
return 0;
}
- double result;
-
-// if we have both log and exp then use them
-#if defined(HAVE_LOG) && defined(HAVE_EXP)
- result = exp(log(x) * 0.5);
- fprintf(stdout, "Computing sqrt of %g to be %g using log\n", x, result);
-#else
- double delta;
- result = x;
+ double result = x;
// do ten iterations
- int i;
- for (i = 0; i < 10; ++i) {
+ for (int i = 0; i < 10; ++i) {
if (result <= 0) {
result = 0.1;
}
- delta = x - (result * result);
+ double delta = x - (result * result);
result = result + 0.5 * delta / result;
- fprintf(stdout, "Computing sqrt of %g to be %g\n", x, result);
+ std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
}
-#endif
return result;
}
diff --git a/Tests/Tutorial/Step4/TutorialConfig.h.in b/Tests/Tutorial/Step4/TutorialConfig.h.in
index a0912656a6..25a06020ac 100644
--- a/Tests/Tutorial/Step4/TutorialConfig.h.in
+++ b/Tests/Tutorial/Step4/TutorialConfig.h.in
@@ -3,7 +3,3 @@
#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
#cmakedefine USE_MYMATH
-// does the platform provide exp and log functions?
-#cmakedefine HAVE_LOG
-#cmakedefine HAVE_EXP
-
diff --git a/Tests/Tutorial/Step4/directions.txt b/Tests/Tutorial/Step4/directions.txt
new file mode 100644
index 0000000000..91e4043da2
--- /dev/null
+++ b/Tests/Tutorial/Step4/directions.txt
@@ -0,0 +1,72 @@
+# Installing and Testing #
+
+Now we can start adding testing support and install rules to our project.
+
+The install rules are fairly simple; for MathFunctions we install the library
+and header file, for the application we install the executable and configured
+header.
+
+So to MathFunctions/CMakeLists.txt we add:
+
+ install (TARGETS MathFunctions DESTINATION bin)
+ install (FILES MathFunctions.h DESTINATION include)
+
+And the to top-level CMakeLists.txt we add:
+
+ install(TARGETS Tutorial DESTINATION bin)
+ install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ DESTINATION include
+ )
+
+That is all that is needed to create a basic local install of the tutorial.
+
+Run cmake or cmake-gui to configure the project and then build it with your
+chosen build tool. Then build the “install” target by typing 'make install'
+from the command line or build the INSTALL target from an IDE. This will
+install the appropriate header files, libraries, and executables.
+
+Verify that the installed Tutorial runs. Note: The CMake variable
+CMAKE_INSTALL_PREFIX is used to determine the root of where the files will
+be installed.
+
+Next let's test our application. Adding testing is an easy process. At the
+end of the top-level CMakeLists file we can add a number of basic tests to
+verify that the application is working correctly.
+
+ # enable testing
+ enable_testing()
+
+ # does the application run
+ add_test(NAME Runs COMMAND Tutorial 25)
+
+ # does the usage message work?
+ add_test(NAME Usage COMMAND Tutorial)
+ set_tests_properties(Usage
+ PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number"
+ )
+
+ # define a function to simplify adding tests
+ function(do_test target arg result)
+ add_test(NAME Comp${arg} COMMAND ${target} ${arg})
+ set_tests_properties(Comp${arg}
+ PROPERTIES PASS_REGULAR_EXPRESSION ${result}
+ )
+ endfunction(do_test)
+
+ # do a bunch of result based tests
+ do_test(Tutorial 25 "25 is 5")
+ do_test(Tutorial -25 "-25 is [-nan|nan|0]")
+ do_test(Tutorial 0.0001 "0.0001 is 0.01")
+
+The first test simply verifies that the application runs, does not segfault or
+otherwise crash, and has a zero return value. This is the basic form of a CTest
+test.
+
+The Usage test uses a regular expression to verify that the usage message
+is printed when an incorrect number of arguments are provided.
+
+Lastly, we have a function called do_test that simplifies running the
+application and verifying that the computed square root is correct for given
+input.
+
+To run tests, cd to the binary directory and run “ctest -N” and “ctest -VV”.
diff --git a/Tests/Tutorial/Step4/tutorial.cxx b/Tests/Tutorial/Step4/tutorial.cxx
index 37f6ac4567..1d5742d2d1 100644
--- a/Tests/Tutorial/Step4/tutorial.cxx
+++ b/Tests/Tutorial/Step4/tutorial.cxx
@@ -1,8 +1,9 @@
// A simple program that computes the square root of a number
+#include <cmath>
+#include <iostream>
+#include <string>
+
#include "TutorialConfig.h"
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
#ifdef USE_MYMATH
# include "MathFunctions.h"
@@ -11,23 +12,21 @@
int main(int argc, char* argv[])
{
if (argc < 2) {
- fprintf(stdout, "%s Version %d.%d\n", argv[0], Tutorial_VERSION_MAJOR,
- Tutorial_VERSION_MINOR);
- fprintf(stdout, "Usage: %s number\n", argv[0]);
+ std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
+ << Tutorial_VERSION_MAJOR << std::endl;
+ std::cout << "Usage: " << argv[0] << " number" << std::endl;
return 1;
}
- double inputValue = atof(argv[1]);
- double outputValue = 0;
+ double inputValue = std::stod(argv[1]);
- if (inputValue >= 0) {
#ifdef USE_MYMATH
- outputValue = mysqrt(inputValue);
+ double outputValue = mysqrt(inputValue);
#else
- outputValue = sqrt(inputValue);
+ double outputValue = sqrt(inputValue);
#endif
- }
- fprintf(stdout, "The square root of %g is %g\n", inputValue, outputValue);
+ std::cout << "The square root of " << inputValue << " is " << outputValue
+ << std::endl;
return 0;
}
diff --git a/Tests/Tutorial/Step5/CMakeLists.txt b/Tests/Tutorial/Step5/CMakeLists.txt
index e40b676b49..63e5410564 100644
--- a/Tests/Tutorial/Step5/CMakeLists.txt
+++ b/Tests/Tutorial/Step5/CMakeLists.txt
@@ -1,72 +1,70 @@
-cmake_minimum_required (VERSION 2.6)
-project (Tutorial)
+cmake_minimum_required(VERSION 3.3)
+project(Tutorial)
-# The version number.
-set (Tutorial_VERSION_MAJOR 1)
-set (Tutorial_VERSION_MINOR 0)
-
-# does this system provide the log and exp functions?
-include (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake)
-check_function_exists (log HAVE_LOG)
-check_function_exists (exp HAVE_EXP)
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED True)
# should we use our own math functions
option(USE_MYMATH "Use tutorial provided math implementation" ON)
+# the version number.
+set(Tutorial_VERSION_MAJOR 1)
+set(Tutorial_VERSION_MINOR 0)
+
# configure a header file to pass some of the CMake settings
# to the source code
-configure_file (
+configure_file(
"${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
"${PROJECT_BINARY_DIR}/TutorialConfig.h"
)
-# add the binary tree to the search path for include files
-# so that we will find TutorialConfig.h
-include_directories ("${PROJECT_BINARY_DIR}")
-
# add the MathFunctions library?
-if (USE_MYMATH)
- include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions")
- add_subdirectory (MathFunctions)
- set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions)
-endif ()
+if(USE_MYMATH)
+ add_subdirectory(MathFunctions)
+ list(APPEND EXTRA_LIBS MathFunctions)
+endif()
# add the executable
-add_executable (Tutorial tutorial.cxx)
-target_link_libraries (Tutorial ${EXTRA_LIBS})
+add_executable(Tutorial tutorial.cxx)
+target_link_libraries(Tutorial PUBLIC ${EXTRA_LIBS})
+
+# add the binary tree to the search path for include files
+# so that we will find TutorialConfig.h
+target_include_directories(Tutorial PUBLIC
+ "${PROJECT_BINARY_DIR}"
+ )
# add the install targets
-install (TARGETS Tutorial DESTINATION bin)
-install (FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- DESTINATION include)
+install(TARGETS Tutorial DESTINATION bin)
+install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ DESTINATION include
+ )
# enable testing
-enable_testing ()
+enable_testing()
# does the application run
-add_test (TutorialRuns Tutorial 25)
+add_test(NAME Runs COMMAND Tutorial 25)
# does the usage message work?
-add_test (TutorialUsage Tutorial)
-set_tests_properties (TutorialUsage
- PROPERTIES
- PASS_REGULAR_EXPRESSION "Usage:.*number"
+add_test(NAME Usage COMMAND Tutorial)
+set_tests_properties(Usage
+ PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number"
)
-#define a macro to simplify adding tests
-macro (do_test arg result)
- add_test (TutorialComp${arg} Tutorial ${arg})
- set_tests_properties (TutorialComp${arg}
+# define a function to simplify adding tests
+function(do_test target arg result)
+ add_test(NAME Comp${arg} COMMAND ${target} ${arg})
+ set_tests_properties(Comp${arg}
PROPERTIES PASS_REGULAR_EXPRESSION ${result}
)
-endmacro ()
+endfunction(do_test)
# do a bunch of result based tests
-do_test (4 "4 is 2")
-do_test (9 "9 is 3")
-do_test (5 "5 is 2.236")
-do_test (7 "7 is 2.645")
-do_test (25 "25 is 5")
-do_test (-25 "-25 is 0")
-do_test (0.0001 "0.0001 is 0.01")
-
+do_test(Tutorial 4 "4 is 2")
+do_test(Tutorial 9 "9 is 3")
+do_test(Tutorial 5 "5 is 2.236")
+do_test(Tutorial 7 "7 is 2.645")
+do_test(Tutorial 25 "25 is 5")
+do_test(Tutorial -25 "-25 is [-nan|nan|0]")
+do_test(Tutorial 0.0001 "0.0001 is 0.01")
diff --git a/Tests/Tutorial/Step5/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Step5/MathFunctions/CMakeLists.txt
index 453a46332e..11cf4127b5 100644
--- a/Tests/Tutorial/Step5/MathFunctions/CMakeLists.txt
+++ b/Tests/Tutorial/Step5/MathFunctions/CMakeLists.txt
@@ -1,17 +1,10 @@
-# first we add the executable that generates the table
-# add the binary tree directory to the search path for include files
-include_directories( ${CMAKE_CURRENT_BINARY_DIR} )
+add_library(MathFunctions mysqrt.cxx)
-add_executable(MakeTable MakeTable.cxx )
-# add the command to generate the source code
-add_custom_command (
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- DEPENDS MakeTable
- )
+# state that anybody linking to us needs to include the current source dir
+# to find MathFunctions.h, while we don't.
+target_include_directories(MathFunctions
+ INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
+ )
-# add the main library
-add_library(MathFunctions mysqrt.cxx ${CMAKE_CURRENT_BINARY_DIR}/Table.h )
-
-install (TARGETS MathFunctions DESTINATION bin)
-install (FILES MathFunctions.h DESTINATION include)
+install(TARGETS MathFunctions DESTINATION lib)
+install(FILES MathFunctions.h DESTINATION include)
diff --git a/Tests/Tutorial/Step5/MathFunctions/MakeTable.cxx b/Tests/Tutorial/Step5/MathFunctions/MakeTable.cxx
index cebd50fcc1..ee585568cb 100644
--- a/Tests/Tutorial/Step5/MathFunctions/MakeTable.cxx
+++ b/Tests/Tutorial/Step5/MathFunctions/MakeTable.cxx
@@ -1,32 +1,25 @@
// A simple program that builds a sqrt table
-#include <math.h>
-#include <stdio.h>
+#include <cmath>
+#include <fstream>
+#include <iostream>
int main(int argc, char* argv[])
{
- int i;
- double result;
-
// make sure we have enough arguments
if (argc < 2) {
return 1;
}
- // open the output file
- FILE* fout = fopen(argv[1], "w");
- if (!fout) {
- return 1;
+ std::ofstream fout(argv[1], std::ios_base::out);
+ const bool fileOpen = fout.is_open();
+ if (fileOpen) {
+ fout << "double sqrtTable[] = {" << std::endl;
+ for (int i = 0; i < 10; ++i) {
+ fout << sqrt(static_cast<double>(i)) << "," << std::endl;
+ }
+ // close the table with a zero
+ fout << "0};" << std::endl;
+ fout.close();
}
-
- // create a source file with a table of square roots
- fprintf(fout, "double sqrtTable[] = {\n");
- for (i = 0; i < 10; ++i) {
- result = sqrt(static_cast<double>(i));
- fprintf(fout, "%g,\n", result);
- }
-
- // close the table with a zero
- fprintf(fout, "0};\n");
- fclose(fout);
- return 0;
+ return fileOpen ? 0 : 1; // return 0 if wrote the file
}
diff --git a/Tests/Tutorial/Step5/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step5/MathFunctions/mysqrt.cxx
index 458ed63a15..7d9379e43e 100644
--- a/Tests/Tutorial/Step5/MathFunctions/mysqrt.cxx
+++ b/Tests/Tutorial/Step5/MathFunctions/mysqrt.cxx
@@ -1,11 +1,5 @@
#include "MathFunctions.h"
-#include "TutorialConfig.h"
-#include <stdio.h>
-
-// include the generated table
-#include "Table.h"
-
-#include <math.h>
+#include <iostream>
// a hack square root calculation using simple operations
double mysqrt(double x)
@@ -14,27 +8,16 @@ double mysqrt(double x)
return 0;
}
- double result;
-
- // if we have both log and exp then use them
- double delta;
-
- // use the table to help find an initial value
- result = x;
- if (x >= 1 && x < 10) {
- result = sqrtTable[static_cast<int>(x)];
- }
+ double result = x;
// do ten iterations
- int i;
- for (i = 0; i < 10; ++i) {
+ for (int i = 0; i < 10; ++i) {
if (result <= 0) {
result = 0.1;
}
- delta = x - (result * result);
+ double delta = x - (result * result);
result = result + 0.5 * delta / result;
- fprintf(stdout, "Computing sqrt of %g to be %g\n", x, result);
+ std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
}
-
return result;
}
diff --git a/Tests/Tutorial/Step5/TutorialConfig.h.in b/Tests/Tutorial/Step5/TutorialConfig.h.in
index a0912656a6..25a06020ac 100644
--- a/Tests/Tutorial/Step5/TutorialConfig.h.in
+++ b/Tests/Tutorial/Step5/TutorialConfig.h.in
@@ -3,7 +3,3 @@
#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
#cmakedefine USE_MYMATH
-// does the platform provide exp and log functions?
-#cmakedefine HAVE_LOG
-#cmakedefine HAVE_EXP
-
diff --git a/Tests/Tutorial/Step5/directions.txt b/Tests/Tutorial/Step5/directions.txt
new file mode 100644
index 0000000000..e6f51975cd
--- /dev/null
+++ b/Tests/Tutorial/Step5/directions.txt
@@ -0,0 +1,69 @@
+# Adding System Introspection #
+
+Let us consider adding some code to our project that depends on features the
+target platform may not have. For this example, we will add some code that
+depends on whether or not the target platform has the log and exp functions. Of
+course almost every platform has these functions but for this tutorial assume
+that they are not common.
+
+If the platform has log and exp then we will use them to compute the square
+root in the mysqrt function. We first test for the availability of these
+functions using the CheckSymbolExists.cmake macro in the top-level CMakeLists
+file as follows:
+
+ # does this system provide the log and exp functions?
+ include(CheckSymbolExists)
+ set(CMAKE_REQUIRED_LIBRARIES "m")
+ check_symbol_exists(log "math.h" HAVE_LOG)
+ check_symbol_exists(exp "math.h" HAVE_EXP)
+
+Now let's add these defines to TutorialConfig.h.in so that we can use them
+from mysqrt.cxx:
+
+ // does the platform provide exp and log functions?
+ #cmakedefine HAVE_LOG
+ #cmakedefine HAVE_EXP
+
+Modify mysqrt.cxx to include math.h. Next, in the mysqrt function we can
+provide an alternate implementation based on log and exp if they are available
+on the system using the following code:
+
+ // if we have both log and exp then use them
+ #if defined(HAVE_LOG) && defined (HAVE_EXP)
+ double result = exp(log(x)*0.5);
+ std::cout << "Computing sqrt of " << x << " to be " << result << " using log" << std::endl;
+ #else
+ ...
+
+Run cmake or cmake-gui to configure the project and then build it with your
+chosen build tool.
+
+You will notice that even though HAVE_LOG and HAVE_EXP are both defined mysqrt
+isn't using them. We should realize quickly that we have forgotten to include
+TutorialConfig.h in mysqrt.cxx. We will also need to update
+MathFunctions/CMakeLists.txt with where it is located.
+
+So let's go ahead and update MathFunctions/CMakeLists.txt to look like:
+
+ add_library(MathFunctions mysqrt.cxx)
+
+ target_include_directories(MathFunctions
+ INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
+ PRIVATE ${Tutorial_BINARY_DIR}
+ )
+
+ install(TARGETS MathFunctions DESTINATION lib)
+ install(FILES MathFunctions.h DESTINATION include)
+
+Now all we need to do is include TutorialConfig.h in mysqrt.cxx
+
+At this point you should go ahead and build the project again.
+
+Run the built Tutorial executable. Which function gives better results now,
+Step1’s sqrt or Step5’s mysqrt?
+
+Exercise: Why is it important that we configure TutorialConfig.h.in after the
+checks for HAVE_LOG and HAVE_EXP? What would happen if we inverted the two?
+
+Exercise: Is there a better place for us to save the HAVE_LOG and HAVE_EXP
+values other than in TutorialConfig.h?
diff --git a/Tests/Tutorial/Step5/tutorial.cxx b/Tests/Tutorial/Step5/tutorial.cxx
index 37f6ac4567..1d5742d2d1 100644
--- a/Tests/Tutorial/Step5/tutorial.cxx
+++ b/Tests/Tutorial/Step5/tutorial.cxx
@@ -1,8 +1,9 @@
// A simple program that computes the square root of a number
+#include <cmath>
+#include <iostream>
+#include <string>
+
#include "TutorialConfig.h"
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
#ifdef USE_MYMATH
# include "MathFunctions.h"
@@ -11,23 +12,21 @@
int main(int argc, char* argv[])
{
if (argc < 2) {
- fprintf(stdout, "%s Version %d.%d\n", argv[0], Tutorial_VERSION_MAJOR,
- Tutorial_VERSION_MINOR);
- fprintf(stdout, "Usage: %s number\n", argv[0]);
+ std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
+ << Tutorial_VERSION_MAJOR << std::endl;
+ std::cout << "Usage: " << argv[0] << " number" << std::endl;
return 1;
}
- double inputValue = atof(argv[1]);
- double outputValue = 0;
+ double inputValue = std::stod(argv[1]);
- if (inputValue >= 0) {
#ifdef USE_MYMATH
- outputValue = mysqrt(inputValue);
+ double outputValue = mysqrt(inputValue);
#else
- outputValue = sqrt(inputValue);
+ double outputValue = sqrt(inputValue);
#endif
- }
- fprintf(stdout, "The square root of %g is %g\n", inputValue, outputValue);
+ std::cout << "The square root of " << inputValue << " is " << outputValue
+ << std::endl;
return 0;
}
diff --git a/Tests/Tutorial/Step6/CMakeLists.txt b/Tests/Tutorial/Step6/CMakeLists.txt
index 0fb7cac5f7..503a312905 100644
--- a/Tests/Tutorial/Step6/CMakeLists.txt
+++ b/Tests/Tutorial/Step6/CMakeLists.txt
@@ -1,78 +1,76 @@
-cmake_minimum_required (VERSION 2.6)
-project (Tutorial)
+cmake_minimum_required(VERSION 3.3)
+project(Tutorial)
-# The version number.
-set (Tutorial_VERSION_MAJOR 1)
-set (Tutorial_VERSION_MINOR 0)
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED True)
+
+# the version number.
+set(Tutorial_VERSION_MAJOR 1)
+set(Tutorial_VERSION_MINOR 0)
# does this system provide the log and exp functions?
-include (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake)
-check_function_exists (log HAVE_LOG)
-check_function_exists (exp HAVE_EXP)
+include(CheckSymbolExists)
+set(CMAKE_REQUIRED_LIBRARIES "m")
+check_symbol_exists(log "math.h" HAVE_LOG)
+check_symbol_exists(exp "math.h" HAVE_EXP)
# should we use our own math functions
option(USE_MYMATH "Use tutorial provided math implementation" ON)
# configure a header file to pass some of the CMake settings
# to the source code
-configure_file (
+configure_file(
"${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
"${PROJECT_BINARY_DIR}/TutorialConfig.h"
)
-# add the binary tree to the search path for include files
-# so that we will find TutorialConfig.h
-include_directories ("${PROJECT_BINARY_DIR}")
-
# add the MathFunctions library?
-if (USE_MYMATH)
- include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions")
- add_subdirectory (MathFunctions)
- set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions)
-endif ()
+if(USE_MYMATH)
+ add_subdirectory(MathFunctions)
+ list(APPEND EXTRA_LIBS MathFunctions)
+endif()
# add the executable
-add_executable (Tutorial tutorial.cxx)
-target_link_libraries (Tutorial ${EXTRA_LIBS})
+add_executable(Tutorial tutorial.cxx)
+target_link_libraries(Tutorial PUBLIC ${EXTRA_LIBS})
+
+# add the binary tree to the search path for include files
+# so that we will find TutorialConfig.h
+target_include_directories(Tutorial PUBLIC
+ "${PROJECT_BINARY_DIR}"
+ )
# add the install targets
-install (TARGETS Tutorial DESTINATION bin)
-install (FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- DESTINATION include)
+install(TARGETS Tutorial DESTINATION bin)
+install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ DESTINATION include
+ )
# enable testing
-enable_testing ()
+enable_testing()
# does the application run
-add_test (TutorialRuns Tutorial 25)
+add_test(NAME Runs COMMAND Tutorial 25)
# does the usage message work?
-add_test (TutorialUsage Tutorial)
-set_tests_properties (TutorialUsage
- PROPERTIES
- PASS_REGULAR_EXPRESSION "Usage:.*number"
+add_test(NAME Usage COMMAND Tutorial)
+set_tests_properties(Usage
+ PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number"
)
-#define a macro to simplify adding tests
-macro (do_test arg result)
- add_test (TutorialComp${arg} Tutorial ${arg})
- set_tests_properties (TutorialComp${arg}
+# define a function to simplify adding tests
+function(do_test target arg result)
+ add_test(NAME Comp${arg} COMMAND ${target} ${arg})
+ set_tests_properties(Comp${arg}
PROPERTIES PASS_REGULAR_EXPRESSION ${result}
)
-endmacro ()
+endfunction(do_test)
# do a bunch of result based tests
-do_test (4 "4 is 2")
-do_test (9 "9 is 3")
-do_test (5 "5 is 2.236")
-do_test (7 "7 is 2.645")
-do_test (25 "25 is 5")
-do_test (-25 "-25 is 0")
-do_test (0.0001 "0.0001 is 0.01")
-
-# build a CPack driven installer package
-include (InstallRequiredSystemLibraries)
-set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
-set (CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}")
-set (CPACK_PACKAGE_VERSION_MINOR "${Tutorial_VERSION_MINOR}")
-include (CPack)
+do_test(Tutorial 4 "4 is 2")
+do_test(Tutorial 9 "9 is 3")
+do_test(Tutorial 5 "5 is 2.236")
+do_test(Tutorial 7 "7 is 2.645")
+do_test(Tutorial 25 "25 is 5")
+do_test(Tutorial -25 "-25 is [-nan|nan|0]")
+do_test(Tutorial 0.0001 "0.0001 is 0.01")
diff --git a/Tests/Tutorial/Step6/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Step6/MathFunctions/CMakeLists.txt
index 70a35f662e..2946075f1f 100644
--- a/Tests/Tutorial/Step6/MathFunctions/CMakeLists.txt
+++ b/Tests/Tutorial/Step6/MathFunctions/CMakeLists.txt
@@ -1,24 +1,14 @@
-# first we add the executable that generates the table
-add_executable(MakeTable MakeTable.cxx)
-
-# add the command to generate the source code
-add_custom_command (
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- DEPENDS MakeTable
- COMMAND MakeTable
- ARGS ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- )
-
-set_source_files_properties (
- mysqrt.cxx PROPERTIES
- OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- )
+add_library(MathFunctions mysqrt.cxx)
-# add the binary tree directory to the search path for include files
-include_directories( ${CMAKE_CURRENT_BINARY_DIR} )
+# state that anybody linking to us needs to include the current source dir
+# to find MathFunctions.h, while we don't.
+# state that we depend on Tutorial_BINARY_DIR but consumers don't, as the
+# TutorialConfig.h include is an implementation detail
-# add the main library
-add_library(MathFunctions mysqrt.cxx)
+target_include_directories(MathFunctions
+ INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
+ PRIVATE ${Tutorial_BINARY_DIR}
+ )
-install (TARGETS MathFunctions DESTINATION bin)
-install (FILES MathFunctions.h DESTINATION include)
+install(TARGETS MathFunctions DESTINATION lib)
+install(FILES MathFunctions.h DESTINATION include)
diff --git a/Tests/Tutorial/Step6/MathFunctions/MakeTable.cxx b/Tests/Tutorial/Step6/MathFunctions/MakeTable.cxx
index cebd50fcc1..ee585568cb 100644
--- a/Tests/Tutorial/Step6/MathFunctions/MakeTable.cxx
+++ b/Tests/Tutorial/Step6/MathFunctions/MakeTable.cxx
@@ -1,32 +1,25 @@
// A simple program that builds a sqrt table
-#include <math.h>
-#include <stdio.h>
+#include <cmath>
+#include <fstream>
+#include <iostream>
int main(int argc, char* argv[])
{
- int i;
- double result;
-
// make sure we have enough arguments
if (argc < 2) {
return 1;
}
- // open the output file
- FILE* fout = fopen(argv[1], "w");
- if (!fout) {
- return 1;
+ std::ofstream fout(argv[1], std::ios_base::out);
+ const bool fileOpen = fout.is_open();
+ if (fileOpen) {
+ fout << "double sqrtTable[] = {" << std::endl;
+ for (int i = 0; i < 10; ++i) {
+ fout << sqrt(static_cast<double>(i)) << "," << std::endl;
+ }
+ // close the table with a zero
+ fout << "0};" << std::endl;
+ fout.close();
}
-
- // create a source file with a table of square roots
- fprintf(fout, "double sqrtTable[] = {\n");
- for (i = 0; i < 10; ++i) {
- result = sqrt(static_cast<double>(i));
- fprintf(fout, "%g,\n", result);
- }
-
- // close the table with a zero
- fprintf(fout, "0};\n");
- fclose(fout);
- return 0;
+ return fileOpen ? 0 : 1; // return 0 if wrote the file
}
diff --git a/Tests/Tutorial/Step6/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step6/MathFunctions/mysqrt.cxx
index 458ed63a15..b9ad20a848 100644
--- a/Tests/Tutorial/Step6/MathFunctions/mysqrt.cxx
+++ b/Tests/Tutorial/Step6/MathFunctions/mysqrt.cxx
@@ -1,11 +1,8 @@
#include "MathFunctions.h"
#include "TutorialConfig.h"
-#include <stdio.h>
+#include <iostream>
-// include the generated table
-#include "Table.h"
-
-#include <math.h>
+#include <cmath>
// a hack square root calculation using simple operations
double mysqrt(double x)
@@ -14,27 +11,23 @@ double mysqrt(double x)
return 0;
}
- double result;
-
// if we have both log and exp then use them
- double delta;
-
- // use the table to help find an initial value
- result = x;
- if (x >= 1 && x < 10) {
- result = sqrtTable[static_cast<int>(x)];
- }
+#if defined(HAVE_LOG) && defined(HAVE_EXP)
+ double result = exp(log(x) * 0.5);
+ std::cout << "Computing sqrt of " << x << " to be " << result << " using log"
+ << std::endl;
+#else
+ double result = x;
// do ten iterations
- int i;
- for (i = 0; i < 10; ++i) {
+ for (int i = 0; i < 10; ++i) {
if (result <= 0) {
result = 0.1;
}
- delta = x - (result * result);
+ double delta = x - (result * result);
result = result + 0.5 * delta / result;
- fprintf(stdout, "Computing sqrt of %g to be %g\n", x, result);
+ std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
}
-
+#endif
return result;
}
diff --git a/Tests/Tutorial/Step6/directions.txt b/Tests/Tutorial/Step6/directions.txt
new file mode 100644
index 0000000000..42b9f06df8
--- /dev/null
+++ b/Tests/Tutorial/Step6/directions.txt
@@ -0,0 +1,104 @@
+# Adding a Custom Command and Generated File #
+
+In this section we will show how you can add a generated source file into the
+build process of an application. For this example, we will create a table of
+precomputed square roots as part of the build process, and then compile that
+table into our application.
+
+To accomplish this, we first need a program that will generate the table. In the
+MathFunctions subdirectory a new source file named MakeTable.cxx will do just that.
+
+ // A simple program that builds a sqrt table
+ #include <iostream>
+ #include <fstream>
+ #include <cmath>
+
+ int main (int argc, char *argv[])
+ {
+ // make sure we have enough arguments
+ if (argc < 2) {
+ return 1;
+ }
+
+ std::ofstream fout(argv[1],std::ios_base::out);
+ const bool fileOpen = fout.is_open();
+ if(fileOpen) {
+ fout << "double sqrtTable[] = {" << std::endl;
+ for (int i = 0; i < 10; ++i) {
+ fout << sqrt(static_cast<double>(i)) << "," << std::endl;
+ }
+ // close the table with a zero
+ fout << "0};" << std::endl;
+ fout.close();
+ }
+ return fileOpen ? 0 : 1; // return 0 if wrote the file
+ }
+
+Note that the table is produced as valid C++ code and that the output filename
+is passed in as an argument.
+
+The next step is to add the appropriate commands to MathFunctions’ CMakeLists
+file to build the MakeTable executable and then run it as part of the build
+process. A few commands are needed to accomplish this, as shown below:
+
+ # first we add the executable that generates the table
+ add_executable(MakeTable MakeTable.cxx)
+
+ # add the command to generate the source code
+ add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ DEPENDS MakeTable
+ )
+
+ # add the main library
+ add_library(MathFunctions
+ mysqrt.cxx
+ ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ )
+
+ target_include_directories(MathFunctions
+ INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
+ PUBLIC ${Tutorial_BINARY_DIR}
+ # add the binary tree directory to the search path for include files
+ ${CMAKE_CURRENT_BINARY_DIR}
+ )
+
+ install(TARGETS MathFunctions DESTINATION lib)
+ install(FILES MathFunctions.h DESTINATION include)
+
+First, the executable for MakeTable is added as any other executable would be
+added. Then we add a custom command that specifies how to produce Table.h by
+running MakeTable. Next we have to let CMake know that mysqrt.cxx depends on
+the generated file Table.h. This is done by adding the generated Table.h to the
+list of sources for the library MathFunctions. We also have to add the current
+binary directory to the list of include directories so that Table.h can be
+found and included by mysqrt.cxx.
+
+Now let's use the generated table. First, modify mysqrt.cxx to include Table.h.
+Next, we can rewrite the mysqrt function to use the table:
+
+ if (x <= 0) {
+ return 0;
+ }
+
+ // use the table to help find an initial value
+ double result = x;
+ if (x >= 1 && x < 10) {
+ result = sqrtTable[static_cast<int>(x)];
+ }
+
+ // do ten iterations
+ for (int i = 0; i < 10; ++i) {
+ if (result <= 0) {
+ result = 0.1;
+ }
+ double delta = x - (result*result);
+ result = result + 0.5*delta/result;
+ std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
+ }
+
+Run cmake or cmake-gui to configure the project and then build it with your
+chosen build tool. When this project is built it will first build the MakeTable
+executable. It will then run MakeTable to produce Table.h. Finally, it will
+compile mysqrt.cxx which includes Table.h to produce the MathFunctions library.
diff --git a/Tests/Tutorial/Step6/tutorial.cxx b/Tests/Tutorial/Step6/tutorial.cxx
index 37f6ac4567..1d5742d2d1 100644
--- a/Tests/Tutorial/Step6/tutorial.cxx
+++ b/Tests/Tutorial/Step6/tutorial.cxx
@@ -1,8 +1,9 @@
// A simple program that computes the square root of a number
+#include <cmath>
+#include <iostream>
+#include <string>
+
#include "TutorialConfig.h"
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
#ifdef USE_MYMATH
# include "MathFunctions.h"
@@ -11,23 +12,21 @@
int main(int argc, char* argv[])
{
if (argc < 2) {
- fprintf(stdout, "%s Version %d.%d\n", argv[0], Tutorial_VERSION_MAJOR,
- Tutorial_VERSION_MINOR);
- fprintf(stdout, "Usage: %s number\n", argv[0]);
+ std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
+ << Tutorial_VERSION_MAJOR << std::endl;
+ std::cout << "Usage: " << argv[0] << " number" << std::endl;
return 1;
}
- double inputValue = atof(argv[1]);
- double outputValue = 0;
+ double inputValue = std::stod(argv[1]);
- if (inputValue >= 0) {
#ifdef USE_MYMATH
- outputValue = mysqrt(inputValue);
+ double outputValue = mysqrt(inputValue);
#else
- outputValue = sqrt(inputValue);
+ double outputValue = sqrt(inputValue);
#endif
- }
- fprintf(stdout, "The square root of %g is %g\n", inputValue, outputValue);
+ std::cout << "The square root of " << inputValue << " is " << outputValue
+ << std::endl;
return 0;
}
diff --git a/Tests/Tutorial/Step7/CMakeLists.txt b/Tests/Tutorial/Step7/CMakeLists.txt
index d9a92fbef0..f2d3839b70 100644
--- a/Tests/Tutorial/Step7/CMakeLists.txt
+++ b/Tests/Tutorial/Step7/CMakeLists.txt
@@ -1,82 +1,76 @@
-cmake_minimum_required (VERSION 2.6)
-project (Tutorial)
+cmake_minimum_required(VERSION 3.3)
+project(Tutorial)
-# The version number.
-set (Tutorial_VERSION_MAJOR 1)
-set (Tutorial_VERSION_MINOR 0)
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED True)
+
+# the version number.
+set(Tutorial_VERSION_MAJOR 1)
+set(Tutorial_VERSION_MINOR 0)
# does this system provide the log and exp functions?
-include (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake)
-check_function_exists (log HAVE_LOG)
-check_function_exists (exp HAVE_EXP)
+include(CheckSymbolExists)
+set(CMAKE_REQUIRED_LIBRARIES "m")
+check_symbol_exists(log "math.h" HAVE_LOG)
+check_symbol_exists(exp "math.h" HAVE_EXP)
# should we use our own math functions
option(USE_MYMATH "Use tutorial provided math implementation" ON)
# configure a header file to pass some of the CMake settings
# to the source code
-configure_file (
+configure_file(
"${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
"${PROJECT_BINARY_DIR}/TutorialConfig.h"
)
-# add the binary tree to the search path for include files
-# so that we will find TutorialConfig.h
-include_directories ("${PROJECT_BINARY_DIR}")
-
# add the MathFunctions library?
-if (USE_MYMATH)
- include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions")
- add_subdirectory (MathFunctions)
- set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions)
-endif ()
+if(USE_MYMATH)
+ add_subdirectory(MathFunctions)
+ list(APPEND EXTRA_LIBS MathFunctions)
+endif(USE_MYMATH)
# add the executable
-add_executable (Tutorial tutorial.cxx)
-target_link_libraries (Tutorial ${EXTRA_LIBS})
+add_executable(Tutorial tutorial.cxx)
+target_link_libraries(Tutorial PUBLIC ${EXTRA_LIBS})
+
+# add the binary tree to the search path for include files
+# so that we will find TutorialConfig.h
+target_include_directories(Tutorial PUBLIC
+ "${PROJECT_BINARY_DIR}"
+ )
# add the install targets
-install (TARGETS Tutorial DESTINATION bin)
-install (FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- DESTINATION include)
+install(TARGETS Tutorial DESTINATION bin)
+install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ DESTINATION include
+ )
# enable testing
-enable_testing ()
+enable_testing()
# does the application run
-add_test (TutorialRuns Tutorial 25)
+add_test(NAME Runs COMMAND Tutorial 25)
# does the usage message work?
-add_test (TutorialUsage Tutorial)
-set_tests_properties (TutorialUsage
- PROPERTIES
- PASS_REGULAR_EXPRESSION "Usage:.*number"
+add_test(NAME Usage COMMAND Tutorial)
+set_tests_properties(Usage
+ PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number"
)
-#define a macro to simplify adding tests
-macro (do_test arg result)
- add_test (TutorialComp${arg} Tutorial ${arg})
- set_tests_properties (TutorialComp${arg}
+# define a function to simplify adding tests
+function(do_test target arg result)
+ add_test(NAME Comp${arg} COMMAND ${target} ${arg})
+ set_tests_properties(Comp${arg}
PROPERTIES PASS_REGULAR_EXPRESSION ${result}
)
-endmacro ()
+endfunction(do_test)
# do a bunch of result based tests
-do_test (4 "4 is 2")
-do_test (9 "9 is 3")
-do_test (5 "5 is 2.236")
-do_test (7 "7 is 2.645")
-do_test (25 "25 is 5")
-do_test (-25 "-25 is 0")
-do_test (0.0001 "0.0001 is 0.01")
-
-# build a CPack driven installer package
-include (InstallRequiredSystemLibraries)
-set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
-set (CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}")
-set (CPACK_PACKAGE_VERSION_MINOR "${Tutorial_VERSION_MINOR}")
-set (CPACK_PACKAGE_CONTACT "foo@bar.org")
-include (CPack)
-
-# enable dashboard scripting
-include (CTest)
+do_test(Tutorial 4 "4 is 2")
+do_test(Tutorial 9 "9 is 3")
+do_test(Tutorial 5 "5 is 2.236")
+do_test(Tutorial 7 "7 is 2.645")
+do_test(Tutorial 25 "25 is 5")
+do_test(Tutorial -25 "-25 is [-nan|nan|0]")
+do_test(Tutorial 0.0001 "0.0001 is 0.01")
diff --git a/Tests/Tutorial/Step7/License.txt b/Tests/Tutorial/Step7/License.txt
index 673d724537..c62d00b9ea 100644
--- a/Tests/Tutorial/Step7/License.txt
+++ b/Tests/Tutorial/Step7/License.txt
@@ -1,2 +1,2 @@
This is the open source License.txt file introduced in
-CMake/Tests/Tutorial/Step6...
+CMake/Tutorial/Step7...
diff --git a/Tests/Tutorial/Step7/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Step7/MathFunctions/CMakeLists.txt
index 70a35f662e..dc3eb9822a 100644
--- a/Tests/Tutorial/Step7/MathFunctions/CMakeLists.txt
+++ b/Tests/Tutorial/Step7/MathFunctions/CMakeLists.txt
@@ -2,23 +2,28 @@
add_executable(MakeTable MakeTable.cxx)
# add the command to generate the source code
-add_custom_command (
+add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
DEPENDS MakeTable
- COMMAND MakeTable
- ARGS ${CMAKE_CURRENT_BINARY_DIR}/Table.h
)
-set_source_files_properties (
- mysqrt.cxx PROPERTIES
- OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- )
-
-# add the binary tree directory to the search path for include files
-include_directories( ${CMAKE_CURRENT_BINARY_DIR} )
-
# add the main library
-add_library(MathFunctions mysqrt.cxx)
+add_library(MathFunctions
+ mysqrt.cxx
+ ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ )
+
+# state that anybody linking to us needs to include the current source dir
+# to find MathFunctions.h, while we don't.
+# state that we depend on Tutorial_BINARY_DIR but consumers don't, as the
+# TutorialConfig.h include is an implementation detail
+# state that we depend on our binary dir to find Table.h
+target_include_directories(MathFunctions
+ INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
+ PRIVATE ${Tutorial_BINARY_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}
+ )
-install (TARGETS MathFunctions DESTINATION bin)
-install (FILES MathFunctions.h DESTINATION include)
+install(TARGETS MathFunctions DESTINATION lib)
+install(FILES MathFunctions.h DESTINATION include)
diff --git a/Tests/Tutorial/Step7/MathFunctions/MakeTable.cxx b/Tests/Tutorial/Step7/MathFunctions/MakeTable.cxx
index cebd50fcc1..ee585568cb 100644
--- a/Tests/Tutorial/Step7/MathFunctions/MakeTable.cxx
+++ b/Tests/Tutorial/Step7/MathFunctions/MakeTable.cxx
@@ -1,32 +1,25 @@
// A simple program that builds a sqrt table
-#include <math.h>
-#include <stdio.h>
+#include <cmath>
+#include <fstream>
+#include <iostream>
int main(int argc, char* argv[])
{
- int i;
- double result;
-
// make sure we have enough arguments
if (argc < 2) {
return 1;
}
- // open the output file
- FILE* fout = fopen(argv[1], "w");
- if (!fout) {
- return 1;
+ std::ofstream fout(argv[1], std::ios_base::out);
+ const bool fileOpen = fout.is_open();
+ if (fileOpen) {
+ fout << "double sqrtTable[] = {" << std::endl;
+ for (int i = 0; i < 10; ++i) {
+ fout << sqrt(static_cast<double>(i)) << "," << std::endl;
+ }
+ // close the table with a zero
+ fout << "0};" << std::endl;
+ fout.close();
}
-
- // create a source file with a table of square roots
- fprintf(fout, "double sqrtTable[] = {\n");
- for (i = 0; i < 10; ++i) {
- result = sqrt(static_cast<double>(i));
- fprintf(fout, "%g,\n", result);
- }
-
- // close the table with a zero
- fprintf(fout, "0};\n");
- fclose(fout);
- return 0;
+ return fileOpen ? 0 : 1; // return 0 if wrote the file
}
diff --git a/Tests/Tutorial/Step7/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step7/MathFunctions/mysqrt.cxx
index 458ed63a15..5272f56f22 100644
--- a/Tests/Tutorial/Step7/MathFunctions/mysqrt.cxx
+++ b/Tests/Tutorial/Step7/MathFunctions/mysqrt.cxx
@@ -1,11 +1,11 @@
#include "MathFunctions.h"
#include "TutorialConfig.h"
-#include <stdio.h>
+#include <iostream>
// include the generated table
#include "Table.h"
-#include <math.h>
+#include <cmath>
// a hack square root calculation using simple operations
double mysqrt(double x)
@@ -14,26 +14,20 @@ double mysqrt(double x)
return 0;
}
- double result;
-
- // if we have both log and exp then use them
- double delta;
-
// use the table to help find an initial value
- result = x;
+ double result = x;
if (x >= 1 && x < 10) {
result = sqrtTable[static_cast<int>(x)];
}
// do ten iterations
- int i;
- for (i = 0; i < 10; ++i) {
+ for (int i = 0; i < 10; ++i) {
if (result <= 0) {
result = 0.1;
}
- delta = x - (result * result);
+ double delta = x - (result * result);
result = result + 0.5 * delta / result;
- fprintf(stdout, "Computing sqrt of %g to be %g\n", x, result);
+ std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
}
return result;
diff --git a/Tests/Tutorial/Step7/directions.txt b/Tests/Tutorial/Step7/directions.txt
new file mode 100644
index 0000000000..7d7c2eacde
--- /dev/null
+++ b/Tests/Tutorial/Step7/directions.txt
@@ -0,0 +1,40 @@
+# Building an Installer #
+
+Next suppose that we want to distribute our project to other people so that they
+can use it. We want to provide both binary and source distributions on a variety
+of platforms. This is a little different from the install we did previously in
+the Installing and Testing section (Step 4), where we were installing the
+binaries that we had built from the source code. In this example we will be
+building installation packages that support binary installations and package
+management features. To accomplish this we will use CPack to create platform
+specific installers. Specifically we need to add a few lines to the bottom of
+our top-level CMakeLists.txt file.
+
+ include(InstallRequiredSystemLibraries)
+ set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
+ set(CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}")
+ set(CPACK_PACKAGE_VERSION_MINOR "${Tutorial_VERSION_MINOR}")
+ include(CPack)
+
+That is all there is to it. We start by including InstallRequiredSystemLibraries.
+This module will include any runtime libraries that are needed by the project
+for the current platform. Next we set some CPack variables to where we have
+stored the license and version information for this project. The version
+information makes use of the variables we set earlier in this tutorial. Finally
+we include the CPack module which will use these variables and some other
+properties of the system you are on to setup an installer.
+
+The next step is to build the project in the usual manner and then run CPack
+on it. To build a binary distribution you would run:
+
+ cpack
+
+To create a source distribution you would type:
+
+ cpack -C CPackSourceConfig.cmake
+
+Alternatively, run “make package” or right click the Package target and
+“Build Project” from an IDE.
+
+Run the installer executable found in the binary directory. Then run the
+installed executable and verify that it works.
diff --git a/Tests/Tutorial/Step7/tutorial.cxx b/Tests/Tutorial/Step7/tutorial.cxx
index 37f6ac4567..1d5742d2d1 100644
--- a/Tests/Tutorial/Step7/tutorial.cxx
+++ b/Tests/Tutorial/Step7/tutorial.cxx
@@ -1,8 +1,9 @@
// A simple program that computes the square root of a number
+#include <cmath>
+#include <iostream>
+#include <string>
+
#include "TutorialConfig.h"
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
#ifdef USE_MYMATH
# include "MathFunctions.h"
@@ -11,23 +12,21 @@
int main(int argc, char* argv[])
{
if (argc < 2) {
- fprintf(stdout, "%s Version %d.%d\n", argv[0], Tutorial_VERSION_MAJOR,
- Tutorial_VERSION_MINOR);
- fprintf(stdout, "Usage: %s number\n", argv[0]);
+ std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
+ << Tutorial_VERSION_MAJOR << std::endl;
+ std::cout << "Usage: " << argv[0] << " number" << std::endl;
return 1;
}
- double inputValue = atof(argv[1]);
- double outputValue = 0;
+ double inputValue = std::stod(argv[1]);
- if (inputValue >= 0) {
#ifdef USE_MYMATH
- outputValue = mysqrt(inputValue);
+ double outputValue = mysqrt(inputValue);
#else
- outputValue = sqrt(inputValue);
+ double outputValue = sqrt(inputValue);
#endif
- }
- fprintf(stdout, "The square root of %g is %g\n", inputValue, outputValue);
+ std::cout << "The square root of " << inputValue << " is " << outputValue
+ << std::endl;
return 0;
}
diff --git a/Tests/Tutorial/Step8/CMakeLists.txt b/Tests/Tutorial/Step8/CMakeLists.txt
new file mode 100644
index 0000000000..c66bf96e34
--- /dev/null
+++ b/Tests/Tutorial/Step8/CMakeLists.txt
@@ -0,0 +1,82 @@
+cmake_minimum_required(VERSION 3.3)
+project(Tutorial)
+
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED True)
+
+# the version number.
+set(Tutorial_VERSION_MAJOR 1)
+set(Tutorial_VERSION_MINOR 0)
+
+# does this system provide the log and exp functions?
+include(CheckSymbolExists)
+set(CMAKE_REQUIRED_LIBRARIES "m")
+check_symbol_exists(log "math.h" HAVE_LOG)
+check_symbol_exists(exp "math.h" HAVE_EXP)
+
+# should we use our own math functions
+option(USE_MYMATH "Use tutorial provided math implementation" ON)
+
+# configure a header file to pass some of the CMake settings
+# to the source code
+configure_file(
+ "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
+ "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ )
+
+# add the MathFunctions library?
+if(USE_MYMATH)
+ add_subdirectory(MathFunctions)
+ list(APPEND EXTRA_LIBS MathFunctions)
+endif(USE_MYMATH)
+
+# add the executable
+add_executable(Tutorial tutorial.cxx)
+target_link_libraries(Tutorial PUBLIC ${EXTRA_LIBS})
+
+# add the binary tree to the search path for include files
+# so that we will find TutorialConfig.h
+target_include_directories(Tutorial PUBLIC
+ "${PROJECT_BINARY_DIR}"
+ )
+
+# add the install targets
+install(TARGETS Tutorial DESTINATION bin)
+install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ DESTINATION include
+ )
+
+# enable testing
+enable_testing()
+
+# does the application run
+add_test(NAME Runs COMMAND Tutorial 25)
+
+# does the usage message work?
+add_test(NAME Usage COMMAND Tutorial)
+set_tests_properties(Usage
+ PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number"
+ )
+
+# define a function to simplify adding tests
+function(do_test target arg result)
+add_test(NAME Comp${arg} COMMAND ${target} ${arg})
+ set_tests_properties(Comp${arg}
+ PROPERTIES PASS_REGULAR_EXPRESSION ${result}
+ )
+endfunction(do_test)
+
+# do a bunch of result based tests
+do_test(Tutorial 4 "4 is 2")
+do_test(Tutorial 9 "9 is 3")
+do_test(Tutorial 5 "5 is 2.236")
+do_test(Tutorial 7 "7 is 2.645")
+do_test(Tutorial 25 "25 is 5")
+do_test(Tutorial -25 "-25 is [-nan|nan|0]")
+do_test(Tutorial 0.0001 "0.0001 is 0.01")
+
+include(InstallRequiredSystemLibraries)
+set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
+set(CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}")
+set(CPACK_PACKAGE_VERSION_MINOR "${Tutorial_VERSION_MINOR}")
+include(CPack)
diff --git a/Tests/Tutorial/Step8/License.txt b/Tests/Tutorial/Step8/License.txt
new file mode 100644
index 0000000000..c62d00b9ea
--- /dev/null
+++ b/Tests/Tutorial/Step8/License.txt
@@ -0,0 +1,2 @@
+This is the open source License.txt file introduced in
+CMake/Tutorial/Step7...
diff --git a/Tests/Tutorial/Step8/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Step8/MathFunctions/CMakeLists.txt
new file mode 100644
index 0000000000..dc3eb9822a
--- /dev/null
+++ b/Tests/Tutorial/Step8/MathFunctions/CMakeLists.txt
@@ -0,0 +1,29 @@
+# first we add the executable that generates the table
+add_executable(MakeTable MakeTable.cxx)
+
+# add the command to generate the source code
+add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ DEPENDS MakeTable
+ )
+
+# add the main library
+add_library(MathFunctions
+ mysqrt.cxx
+ ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ )
+
+# state that anybody linking to us needs to include the current source dir
+# to find MathFunctions.h, while we don't.
+# state that we depend on Tutorial_BINARY_DIR but consumers don't, as the
+# TutorialConfig.h include is an implementation detail
+# state that we depend on our binary dir to find Table.h
+target_include_directories(MathFunctions
+ INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
+ PRIVATE ${Tutorial_BINARY_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}
+ )
+
+install(TARGETS MathFunctions DESTINATION lib)
+install(FILES MathFunctions.h DESTINATION include)
diff --git a/Tests/Tutorial/Step8/MathFunctions/MakeTable.cxx b/Tests/Tutorial/Step8/MathFunctions/MakeTable.cxx
new file mode 100644
index 0000000000..ee585568cb
--- /dev/null
+++ b/Tests/Tutorial/Step8/MathFunctions/MakeTable.cxx
@@ -0,0 +1,25 @@
+// A simple program that builds a sqrt table
+#include <cmath>
+#include <fstream>
+#include <iostream>
+
+int main(int argc, char* argv[])
+{
+ // make sure we have enough arguments
+ if (argc < 2) {
+ return 1;
+ }
+
+ std::ofstream fout(argv[1], std::ios_base::out);
+ const bool fileOpen = fout.is_open();
+ if (fileOpen) {
+ fout << "double sqrtTable[] = {" << std::endl;
+ for (int i = 0; i < 10; ++i) {
+ fout << sqrt(static_cast<double>(i)) << "," << std::endl;
+ }
+ // close the table with a zero
+ fout << "0};" << std::endl;
+ fout.close();
+ }
+ return fileOpen ? 0 : 1; // return 0 if wrote the file
+}
diff --git a/Tests/Tutorial/Step8/MathFunctions/MathFunctions.h b/Tests/Tutorial/Step8/MathFunctions/MathFunctions.h
new file mode 100644
index 0000000000..cd36bccffd
--- /dev/null
+++ b/Tests/Tutorial/Step8/MathFunctions/MathFunctions.h
@@ -0,0 +1 @@
+double mysqrt(double x);
diff --git a/Tests/Tutorial/Step8/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step8/MathFunctions/mysqrt.cxx
new file mode 100644
index 0000000000..5b862fbd57
--- /dev/null
+++ b/Tests/Tutorial/Step8/MathFunctions/mysqrt.cxx
@@ -0,0 +1,42 @@
+#include "MathFunctions.h"
+#include "TutorialConfig.h"
+#include <iostream>
+
+// include the generated table
+#include "Table.h"
+
+#include <cmath>
+
+// a hack square root calculation using simple operations
+double mysqrt(double x)
+{
+ if (x <= 0) {
+ return 0;
+ }
+
+ // if we have both log and exp then use them
+#if defined(HAVE_LOG) && defined(HAVE_EXP)
+ double result = exp(log(x) * 0.5);
+ std::cout << "Computing sqrt of " << x << " to be " << result << " using log"
+ << std::endl;
+#else
+ // use the table to help find an initial value
+ double result = x;
+ if (x >= 1 && x < 10) {
+ result = sqrtTable[static_cast<int>(x)];
+ }
+
+ // if we have both log and exp then use them
+
+ // do ten iterations
+ for (int i = 0; i < 10; ++i) {
+ if (result <= 0) {
+ result = 0.1;
+ }
+ double delta = x - (result * result);
+ result = result + 0.5 * delta / result;
+ std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
+ }
+#endif
+ return result;
+}
diff --git a/Tests/Tutorial/Step8/TutorialConfig.h.in b/Tests/Tutorial/Step8/TutorialConfig.h.in
new file mode 100644
index 0000000000..e97ce24ea9
--- /dev/null
+++ b/Tests/Tutorial/Step8/TutorialConfig.h.in
@@ -0,0 +1,8 @@
+// the configured options and settings for Tutorial
+#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
+#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
+#cmakedefine USE_MYMATH
+
+// does the platform provide exp and log functions?
+#cmakedefine HAVE_LOG
+#cmakedefine HAVE_EXP
diff --git a/Tests/Tutorial/Step8/directions.txt b/Tests/Tutorial/Step8/directions.txt
new file mode 100644
index 0000000000..588d9c6799
--- /dev/null
+++ b/Tests/Tutorial/Step8/directions.txt
@@ -0,0 +1,38 @@
+# Adding Support for a Dashboard #
+
+Adding support for submitting our test results to a dashboard is very easy. We
+already defined a number of tests for our project in the earlier steps of this
+tutorial. We just have to run those tests and submit them to a dashboard. To
+include support for dashboards we include the CTest module in our top-level
+CMakeLists.txt.
+
+Replace:
+ # enable testing
+ enable_testing()
+
+With:
+ # enable dashboard scripting
+ include(CTest)
+
+The CTest module will automatically call enable_testing(), so
+we can remove it from our CMake files.
+
+We will also need to create a CTestConfig.cmake file where we can specify the
+name of the project and where to submit the dashboard.
+
+ set(CTEST_PROJECT_NAME "CMakeTutorial")
+ set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
+
+ set(CTEST_DROP_METHOD "http")
+ set(CTEST_DROP_SITE "my.cdash.org/")
+ set(CTEST_DROP_LOCATION "/submit.php?project=CMakeTutorial")
+ set(CTEST_DROP_SITE_CDASH TRUE)
+
+CTest will read in this file when it runs. To create a simple dashboard you can
+run cmake or cmake-gui to configure the project, but do not build it yet.
+Instead, change directory to the binary tree, and then run:
+ 'ctest [-VV] –D Experimental'. On Windows, build the EXPERIMENTAL target.
+
+Ctest will build and test the project and submit results to the Kitware public
+dashboard. The results of your dashboard will be uploaded to Kitware's public
+dashboard here: https://my.cdash.org/index.php?project=CMakeTutorial.
diff --git a/Tests/Tutorial/Step8/tutorial.cxx b/Tests/Tutorial/Step8/tutorial.cxx
new file mode 100644
index 0000000000..1d5742d2d1
--- /dev/null
+++ b/Tests/Tutorial/Step8/tutorial.cxx
@@ -0,0 +1,32 @@
+// A simple program that computes the square root of a number
+#include <cmath>
+#include <iostream>
+#include <string>
+
+#include "TutorialConfig.h"
+
+#ifdef USE_MYMATH
+# include "MathFunctions.h"
+#endif
+
+int main(int argc, char* argv[])
+{
+ if (argc < 2) {
+ std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
+ << Tutorial_VERSION_MAJOR << std::endl;
+ std::cout << "Usage: " << argv[0] << " number" << std::endl;
+ return 1;
+ }
+
+ double inputValue = std::stod(argv[1]);
+
+#ifdef USE_MYMATH
+ double outputValue = mysqrt(inputValue);
+#else
+ double outputValue = sqrt(inputValue);
+#endif
+
+ std::cout << "The square root of " << inputValue << " is " << outputValue
+ << std::endl;
+ return 0;
+}
diff --git a/Tests/Tutorial/Step9/CMakeLists.txt b/Tests/Tutorial/Step9/CMakeLists.txt
new file mode 100644
index 0000000000..309d513ff8
--- /dev/null
+++ b/Tests/Tutorial/Step9/CMakeLists.txt
@@ -0,0 +1,81 @@
+cmake_minimum_required(VERSION 3.3)
+project(Tutorial)
+
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED True)
+
+# the version number.
+set(Tutorial_VERSION_MAJOR 1)
+set(Tutorial_VERSION_MINOR 0)
+
+# does this system provide the log and exp functions?
+include(CheckSymbolExists)
+set(CMAKE_REQUIRED_LIBRARIES "m")
+check_symbol_exists(log "math.h" HAVE_LOG)
+check_symbol_exists(exp "math.h" HAVE_EXP)
+
+# should we use our own math functions
+option(USE_MYMATH "Use tutorial provided math implementation" ON)
+
+# configure a header file to pass the version number only
+configure_file(
+ "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
+ "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ )
+
+# add the MathFunctions library?
+if(USE_MYMATH)
+ add_subdirectory(MathFunctions)
+ list(APPEND EXTRA_LIBS MathFunctions)
+endif()
+
+# add the executable
+add_executable(Tutorial tutorial.cxx)
+target_link_libraries(Tutorial PUBLIC ${EXTRA_LIBS})
+
+# add the binary tree to the search path for include files
+# so that we will find TutorialConfig.h
+target_include_directories(Tutorial PUBLIC
+ "${PROJECT_BINARY_DIR}"
+ )
+
+# add the install targets
+install(TARGETS Tutorial DESTINATION bin)
+install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ DESTINATION include
+ )
+
+# enable testing
+include(CTest)
+
+# does the application run
+add_test(NAME Runs COMMAND Tutorial 25)
+
+# does the usage message work?
+add_test(NAME Usage COMMAND Tutorial)
+set_tests_properties(Usage
+ PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number"
+ )
+
+# define a function to simplify adding tests
+function(do_test target arg result)
+ add_test(NAME Comp${arg} COMMAND ${target} ${arg})
+ set_tests_properties(Comp${arg}
+ PROPERTIES PASS_REGULAR_EXPRESSION ${result}
+ )
+endfunction(do_test)
+
+# do a bunch of result based tests
+do_test(Tutorial 4 "4 is 2")
+do_test(Tutorial 9 "9 is 3")
+do_test(Tutorial 5 "5 is 2.236")
+do_test(Tutorial 7 "7 is 2.645")
+do_test(Tutorial 25 "25 is 5")
+do_test(Tutorial -25 "-25 is [-nan|nan|0]")
+do_test(Tutorial 0.0001 "0.0001 is 0.01")
+
+include(InstallRequiredSystemLibraries)
+set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
+set(CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}")
+set(CPACK_PACKAGE_VERSION_MINOR "${Tutorial_VERSION_MINOR}")
+include(CPack)
diff --git a/Tests/Tutorial/Step9/CTestConfig.cmake b/Tests/Tutorial/Step9/CTestConfig.cmake
new file mode 100644
index 0000000000..7a927ac947
--- /dev/null
+++ b/Tests/Tutorial/Step9/CTestConfig.cmake
@@ -0,0 +1,15 @@
+## This file should be placed in the root directory of your project.
+## Then modify the CMakeLists.txt file in the root directory of your
+## project to incorporate the testing dashboard.
+##
+## # The following are required to submit to the CDash dashboard:
+## ENABLE_TESTING()
+## INCLUDE(CTest)
+
+set(CTEST_PROJECT_NAME "CMakeTutorial")
+set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
+
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "my.cdash.org")
+set(CTEST_DROP_LOCATION "/submit.php?project=CMakeTutorial")
+set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/Tutorial/Step9/License.txt b/Tests/Tutorial/Step9/License.txt
new file mode 100644
index 0000000000..c62d00b9ea
--- /dev/null
+++ b/Tests/Tutorial/Step9/License.txt
@@ -0,0 +1,2 @@
+This is the open source License.txt file introduced in
+CMake/Tutorial/Step7...
diff --git a/Tests/Tutorial/Step9/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Step9/MathFunctions/CMakeLists.txt
new file mode 100644
index 0000000000..e651a57487
--- /dev/null
+++ b/Tests/Tutorial/Step9/MathFunctions/CMakeLists.txt
@@ -0,0 +1,35 @@
+# first we add the executable that generates the table
+add_executable(MakeTable MakeTable.cxx)
+
+# add the command to generate the source code
+add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ DEPENDS MakeTable
+ )
+
+# add the main library
+add_library(MathFunctions
+ mysqrt.cxx
+ ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ )
+
+# state that anybody linking to us needs to include the current source dir
+# to find MathFunctions.h, while we don't.
+# state that we depend on our binary dir to find Table.h
+target_include_directories(MathFunctions
+ INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
+ PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
+ )
+
+# use compile definitions to state if we have enabled USE_MYMATH
+# and that anything that links to use will get this define
+target_compile_definitions(MathFunctions INTERFACE "USE_MYMATH")
+
+if(HAVE_LOG AND HAVE_EXP)
+ target_compile_definitions(MathFunctions
+ PRIVATE "HAVE_LOG" "HAVE_EXP")
+endif()
+
+install(TARGETS MathFunctions DESTINATION lib)
+install(FILES MathFunctions.h DESTINATION include)
diff --git a/Tests/Tutorial/Step9/MathFunctions/MakeTable.cxx b/Tests/Tutorial/Step9/MathFunctions/MakeTable.cxx
new file mode 100644
index 0000000000..ee585568cb
--- /dev/null
+++ b/Tests/Tutorial/Step9/MathFunctions/MakeTable.cxx
@@ -0,0 +1,25 @@
+// A simple program that builds a sqrt table
+#include <cmath>
+#include <fstream>
+#include <iostream>
+
+int main(int argc, char* argv[])
+{
+ // make sure we have enough arguments
+ if (argc < 2) {
+ return 1;
+ }
+
+ std::ofstream fout(argv[1], std::ios_base::out);
+ const bool fileOpen = fout.is_open();
+ if (fileOpen) {
+ fout << "double sqrtTable[] = {" << std::endl;
+ for (int i = 0; i < 10; ++i) {
+ fout << sqrt(static_cast<double>(i)) << "," << std::endl;
+ }
+ // close the table with a zero
+ fout << "0};" << std::endl;
+ fout.close();
+ }
+ return fileOpen ? 0 : 1; // return 0 if wrote the file
+}
diff --git a/Tests/Tutorial/Step9/MathFunctions/MathFunctions.cxx b/Tests/Tutorial/Step9/MathFunctions/MathFunctions.cxx
new file mode 100644
index 0000000000..5351184be4
--- /dev/null
+++ b/Tests/Tutorial/Step9/MathFunctions/MathFunctions.cxx
@@ -0,0 +1,18 @@
+
+#include "MathFunctions.h"
+#include <cmath>
+
+#ifdef USE_MYMATH
+# include "mysqrt.h"
+#endif
+
+namespace mathfunctions {
+double sqrt(double x)
+{
+#ifdef USE_MYMATH
+ return detail::mysqrt(x);
+#else
+ return std::sqrt(x);
+#endif
+}
+}
diff --git a/Tests/Tutorial/Step9/MathFunctions/MathFunctions.h b/Tests/Tutorial/Step9/MathFunctions/MathFunctions.h
new file mode 100644
index 0000000000..cd36bccffd
--- /dev/null
+++ b/Tests/Tutorial/Step9/MathFunctions/MathFunctions.h
@@ -0,0 +1 @@
+double mysqrt(double x);
diff --git a/Tests/Tutorial/Step9/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step9/MathFunctions/mysqrt.cxx
new file mode 100644
index 0000000000..8b82141512
--- /dev/null
+++ b/Tests/Tutorial/Step9/MathFunctions/mysqrt.cxx
@@ -0,0 +1,41 @@
+#include "MathFunctions.h"
+#include <iostream>
+
+// include the generated table
+#include "Table.h"
+
+#include <cmath>
+
+// a hack square root calculation using simple operations
+double mysqrt(double x)
+{
+ if (x <= 0) {
+ return 0;
+ }
+
+ // if we have both log and exp then use them
+#if defined(HAVE_LOG) && defined(HAVE_EXP)
+ double result = exp(log(x) * 0.5);
+ std::cout << "Computing sqrt of " << x << " to be " << result << " using log"
+ << std::endl;
+#else
+ // use the table to help find an initial value
+ double result = x;
+ if (x >= 1 && x < 10) {
+ result = sqrtTable[static_cast<int>(x)];
+ }
+
+ // if we have both log and exp then use them
+
+ // do ten iterations
+ for (int i = 0; i < 10; ++i) {
+ if (result <= 0) {
+ result = 0.1;
+ }
+ double delta = x - (result * result);
+ result = result + 0.5 * delta / result;
+ std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
+ }
+#endif
+ return result;
+}
diff --git a/Tests/Tutorial/Step9/MathFunctions/mysqrt.h b/Tests/Tutorial/Step9/MathFunctions/mysqrt.h
new file mode 100644
index 0000000000..e1c42ef0c2
--- /dev/null
+++ b/Tests/Tutorial/Step9/MathFunctions/mysqrt.h
@@ -0,0 +1,6 @@
+
+namespace mathfunctions {
+namespace detail {
+double mysqrt(double x);
+}
+}
diff --git a/Tests/Tutorial/Step9/TutorialConfig.h.in b/Tests/Tutorial/Step9/TutorialConfig.h.in
new file mode 100644
index 0000000000..8cd2fc9c63
--- /dev/null
+++ b/Tests/Tutorial/Step9/TutorialConfig.h.in
@@ -0,0 +1,3 @@
+// the configured version number
+#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
+#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
diff --git a/Tests/Tutorial/Step9/directions.txt b/Tests/Tutorial/Step9/directions.txt
new file mode 100644
index 0000000000..8771637d2a
--- /dev/null
+++ b/Tests/Tutorial/Step9/directions.txt
@@ -0,0 +1,166 @@
+# Mixing Static and Shared #
+
+In this section we will show how by using the BUILD_SHARED_LIBS variable we can
+control the default behavior of add_library, and allow control over how
+libraries without an explicit type ( STATIC/SHARED/MODULE/OBJECT ) are built.
+
+To accomplish this we need to add BUILD_SHARED_LIBS to the top level
+CMakeLists.txt. We use the option command as it allows users to optionally
+select if the value should be On or Off.
+
+Next we are going to refactor MathFunctions to become a real library that
+encapsulates using mysqrt or sqrt, instead of requiring the calling code
+to do this logic. This will also mean that USE_MYMATH will not control building
+MathFuctions, but instead will control the behavior of this library.
+
+The first step is to update the starting section of the top level CMakeLists.txt
+to look like:
+
+ cmake_minimum_required(VERSION 3.3)
+ project(Tutorial)
+
+ # control where the static and shared libraries are built so that on windows
+ # we don't need to tinker with the path to run the executable
+ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
+ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
+
+ set(CMAKE_CXX_STANDARD 11)
+ set(CMAKE_CXX_STANDARD_REQUIRED True)
+
+ option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
+
+ # the version number.
+ set(Tutorial_VERSION_MAJOR 1)
+ set(Tutorial_VERSION_MINOR 0)
+
+ # configure a header file to pass the version number only
+ configure_file(
+ "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
+ "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ )
+
+ # add the MathFunctions library
+ add_subdirectory(MathFunctions)
+
+ # add the executable
+ add_executable(Tutorial tutorial.cxx)
+ target_link_libraries(Tutorial PUBLIC MathFunctions)
+
+Now that we have made MathFunctions always be used, we will need to update
+the logic of that library. So, in MathFunctions/CMakeLists.txt we need to
+create a SqrtLibrary that will conditionally be built when USE_MYMATH is
+enabled. Now, since this is a tutorial, we are going to explicitly require
+that SqrtLibrary is built statically.
+
+The end result is that MathFunctions/CMakeLists.txt should look like:
+
+ # add the library that runs
+ add_library(MathFunctions MathFunctions.cxx)
+
+ # state that anybody linking to us needs to include the current source dir
+ # to find MathFunctions.h, while we don't.
+ target_include_directories(MathFunctions
+ INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
+ )
+
+ # should we use our own math functions
+ option(USE_MYMATH "Use tutorial provided math implementation" ON)
+ if(USE_MYMATH)
+
+ # does this system provide the log and exp functions?
+ include(CheckSymbolExists)
+ set(CMAKE_REQUIRED_LIBRARIES "m")
+ check_symbol_exists(log "math.h" HAVE_LOG)
+ check_symbol_exists(exp "math.h" HAVE_EXP)
+
+ # first we add the executable that generates the table
+ add_executable(MakeTable MakeTable.cxx)
+
+ # add the command to generate the source code
+ add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ DEPENDS MakeTable
+ )
+
+ # library that just does sqrt
+ add_library(SqrtLibrary STATIC
+ mysqrt.cxx
+ ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ )
+
+ # state that we depend on our binary dir to find Table.h
+ target_include_directories(SqrtLibrary PRIVATE
+ ${CMAKE_CURRENT_BINARY_DIR}
+ )
+
+ target_compile_definitions(MathFunctions PRIVATE "USE_MYMATH")
+ if(HAVE_LOG AND HAVE_EXP)
+ target_compile_definitions(SqrtLibrary
+ PRIVATE "HAVE_LOG" "HAVE_EXP")
+ endif()
+
+ target_link_libraries(MathFunctions PRIVATE SqrtLibrary)
+ endif()
+
+ # define the symbol stating we are using the declspec(dllexport) when
+ # building on windows
+ target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH")
+
+ install(TARGETS MathFunctions DESTINATION lib)
+ install(FILES MathFunctions.h DESTINATION include)
+
+Next, update MathFunctions/mysqrt.cxx to use the mathfunctions and detail namespaces:
+
+ #include <iostream>
+ #include "MathFunctions.h"
+
+ // include the generated table
+ #include "Table.h"
+
+ #include <cmath>
+
+ namespace mathfunctions {
+ namespace detail {
+ // a hack square root calculation using simple operations
+ double mysqrt(double x)
+ {
+ ...
+
+ return result;
+ }
+ }
+ }
+
+We also need to make some changes in tutorial.cxx, so that it no longer uses USE_MYMATH:
+1. Always include MathFunctions.h
+2. Always use mathfunctions::sqrt
+
+Finally, update MathFunctions/MathFunctions.h to use dll export defines:
+
+ #if defined(_WIN32)
+ #if defined(EXPORTING_MYMATH)
+ #define DECLSPEC __declspec(dllexport)
+ #else
+ #define DECLSPEC __declspec(dllimport)
+ #endif
+ #else //non windows
+ #define DECLSPEC
+ #endif
+
+ namespace mathfunctions
+ {
+ double DECLSPEC sqrt(double x);
+ }
+
+At this point, if you build everything, you will notice that linking fails
+as we are combining a static library without position enabled code with a
+library that has position enabled code. This solution to this is to explicitly
+set the POSITION_INDEPENDENT_CODE target property of SqrtLibrary to be True no
+matter the build type.
+
+Exercise: We modified MathFunctions.h to use dll export defines. Using CMake
+documentation can you find a helper module to simplify this?
+
+Exercise: Determine what command is enabling PIC for SqrtLibrary.
+What happens if we remove said command?
diff --git a/Tests/Tutorial/Step9/tutorial.cxx b/Tests/Tutorial/Step9/tutorial.cxx
new file mode 100644
index 0000000000..73e67a9c02
--- /dev/null
+++ b/Tests/Tutorial/Step9/tutorial.cxx
@@ -0,0 +1,33 @@
+// A simple program that computes the square root of a number
+#include <cmath>
+#include <iostream>
+#include <sstream>
+#include <string>
+
+#include "TutorialConfig.h"
+
+#ifdef USE_MYMATH
+# include "MathFunctions.h"
+#endif
+
+int main(int argc, char* argv[])
+{
+ if (argc < 2) {
+ std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
+ << Tutorial_VERSION_MAJOR << std::endl;
+ std::cout << "Usage: " << argv[0] << " number" << std::endl;
+ return 1;
+ }
+
+ double inputValue = std::stod(argv[1]);
+
+#ifdef USE_MYMATH
+ double outputValue = mysqrt(inputValue);
+#else
+ double outputValue = sqrt(inputValue);
+#endif
+
+ std::cout << "The square root of " << inputValue << " is " << outputValue
+ << std::endl;
+ return 0;
+}
diff --git a/Tests/VSWinStorePhone/CMakeLists.txt b/Tests/VSWinStorePhone/CMakeLists.txt
index acda117353..efc77601d2 100644
--- a/Tests/VSWinStorePhone/CMakeLists.txt
+++ b/Tests/VSWinStorePhone/CMakeLists.txt
@@ -8,6 +8,8 @@ elseif(MSVC_VERSION GREATER 1600)
set(COMPILER_VERSION "11")
endif()
+add_subdirectory(WinRT)
+
set (APP_MANIFEST_NAME Package.appxmanifest)
if("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsPhone")
set(PLATFORM WP)
@@ -139,11 +141,14 @@ if("${SHORT_VERSION}" STREQUAL "10.0")
message(STATUS "Targeting Windows 10. Setting Extensions to version ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
set_property(TARGET ${EXE_NAME} PROPERTY VS_DESKTOP_EXTENSIONS_VERSION "${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
set_property(TARGET ${EXE_NAME} PROPERTY VS_MOBILE_EXTENSIONS_VERSION "${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
- set_property(TARGET ${EXE_NAME} PROPERTY VS_IOT_EXTENSIONS_VERSION "${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
+
+ # The last IOT reference is on 10.0.17134.0, so only add it if supported
+ if("${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}" VERSION_LESS "10.0.17135.0")
+ set_property(TARGET ${EXE_NAME} PROPERTY VS_IOT_EXTENSIONS_VERSION "${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
+ endif()
# Add a reference to an SDK
set_property(TARGET ${EXE_NAME} PROPERTY VS_SDK_REFERENCES "Microsoft.UniversalCRT.Debug, Version=${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
endif()
-
-target_link_libraries(${EXE_NAME} d3d11)
+target_link_libraries(${EXE_NAME} d3d11 JusticeLeagueWinRT)
diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Assets/ApplicationIcon.png b/Tests/VSWinStorePhone/Direct3DApp1/Assets/ApplicationIcon.png
index 7d95d4e081..c715e1bc73 100644
--- a/Tests/VSWinStorePhone/Direct3DApp1/Assets/ApplicationIcon.png
+++ b/Tests/VSWinStorePhone/Direct3DApp1/Assets/ApplicationIcon.png
Binary files differ
diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Assets/Logo.png b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Logo.png
index e26771cb33..65f91ac0f9 100644
--- a/Tests/VSWinStorePhone/Direct3DApp1/Assets/Logo.png
+++ b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Logo.png
Binary files differ
diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Assets/SmallLogo.png b/Tests/VSWinStorePhone/Direct3DApp1/Assets/SmallLogo.png
index 1eb0d9d528..460c0222d4 100644
--- a/Tests/VSWinStorePhone/Direct3DApp1/Assets/SmallLogo.png
+++ b/Tests/VSWinStorePhone/Direct3DApp1/Assets/SmallLogo.png
Binary files differ
diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Assets/SmallLogo44x44.png b/Tests/VSWinStorePhone/Direct3DApp1/Assets/SmallLogo44x44.png
index 28810b7c0e..c2374581a8 100644
--- a/Tests/VSWinStorePhone/Direct3DApp1/Assets/SmallLogo44x44.png
+++ b/Tests/VSWinStorePhone/Direct3DApp1/Assets/SmallLogo44x44.png
Binary files differ
diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Assets/SplashScreen.png b/Tests/VSWinStorePhone/Direct3DApp1/Assets/SplashScreen.png
index c951e031bd..8342565809 100644
--- a/Tests/VSWinStorePhone/Direct3DApp1/Assets/SplashScreen.png
+++ b/Tests/VSWinStorePhone/Direct3DApp1/Assets/SplashScreen.png
Binary files differ
diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Assets/StoreLogo.png b/Tests/VSWinStorePhone/Direct3DApp1/Assets/StoreLogo.png
index dcb672712c..508c8a809a 100644
--- a/Tests/VSWinStorePhone/Direct3DApp1/Assets/StoreLogo.png
+++ b/Tests/VSWinStorePhone/Direct3DApp1/Assets/StoreLogo.png
Binary files differ
diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileLarge.png b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileLarge.png
index e0c59ac014..fcdbaf4ac6 100644
--- a/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileLarge.png
+++ b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileLarge.png
Binary files differ
diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileMedium.png b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileMedium.png
index e93b89d600..06425c4b1f 100644
--- a/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileMedium.png
+++ b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileMedium.png
Binary files differ
diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileSmall.png b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileSmall.png
index 550b1b5e8d..4cef0eb301 100644
--- a/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileSmall.png
+++ b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileSmall.png
Binary files differ
diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/IconicTileMediumLarge.png b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/IconicTileMediumLarge.png
index 686e6b53f0..253503f045 100644
--- a/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/IconicTileMediumLarge.png
+++ b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/IconicTileMediumLarge.png
Binary files differ
diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/IconicTileSmall.png b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/IconicTileSmall.png
index d4b5ede1b5..2ef050fb32 100644
--- a/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/IconicTileSmall.png
+++ b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/IconicTileSmall.png
Binary files differ
diff --git a/Tests/VSWinStorePhone/Direct3DApp1/CubeRenderer.cpp b/Tests/VSWinStorePhone/Direct3DApp1/CubeRenderer.cpp
index 1c969cd2fc..3ba35fa436 100644
--- a/Tests/VSWinStorePhone/Direct3DApp1/CubeRenderer.cpp
+++ b/Tests/VSWinStorePhone/Direct3DApp1/CubeRenderer.cpp
@@ -6,11 +6,15 @@ using namespace DirectX;
using namespace Microsoft::WRL;
using namespace Windows::Foundation;
using namespace Windows::UI::Core;
+using namespace JusticeLeagueWinRT;
CubeRenderer::CubeRenderer()
: m_loadingComplete(false)
, m_indexCount(0)
{
+ // Create a new WinRT object to validate that we can link properly
+ Batman ^ hero = ref new Batman();
+ hero->savePeople();
}
void CubeRenderer::CreateDeviceResources()
diff --git a/Tests/VSWinStorePhone/WinRT/Batman.cpp b/Tests/VSWinStorePhone/WinRT/Batman.cpp
new file mode 100644
index 0000000000..e092258982
--- /dev/null
+++ b/Tests/VSWinStorePhone/WinRT/Batman.cpp
@@ -0,0 +1,14 @@
+#include "Batman.h"
+
+using namespace JusticeLeagueWinRT;
+using namespace Platform;
+
+Batman::Batman()
+{
+}
+
+void Batman::savePeople()
+{
+ int i = 0;
+ i++;
+}
diff --git a/Tests/VSWinStorePhone/WinRT/Batman.h b/Tests/VSWinStorePhone/WinRT/Batman.h
new file mode 100644
index 0000000000..e2dcabc46e
--- /dev/null
+++ b/Tests/VSWinStorePhone/WinRT/Batman.h
@@ -0,0 +1,12 @@
+#pragma once
+
+namespace JusticeLeagueWinRT {
+public
+ref class Batman sealed
+{
+public:
+ Batman();
+
+ void savePeople();
+};
+}
diff --git a/Tests/VSWinStorePhone/WinRT/CMakeLists.txt b/Tests/VSWinStorePhone/WinRT/CMakeLists.txt
new file mode 100644
index 0000000000..bb93333606
--- /dev/null
+++ b/Tests/VSWinStorePhone/WinRT/CMakeLists.txt
@@ -0,0 +1,13 @@
+project(JusticeLeagueWinRT CXX)
+
+# create project
+add_library(JusticeLeagueWinRT SHARED
+ "${CMAKE_CURRENT_SOURCE_DIR}/Batman.cpp"
+ "${CMAKE_CURRENT_SOURCE_DIR}/Batman.h"
+)
+
+set_target_properties(JusticeLeagueWinRT PROPERTIES
+ VS_WINRT_COMPONENT TRUE
+ VS_GLOBAL_ROOTNAMESPACE "JusticeLeagueWinRT"
+ OUTPUT_NAME "JusticeLeagueWinRT"
+)
diff --git a/Tests/VSXaml/Assets/Logo.scale-100.png b/Tests/VSXaml/Assets/Logo.scale-100.png
index e26771cb33..65f91ac0f9 100644
--- a/Tests/VSXaml/Assets/Logo.scale-100.png
+++ b/Tests/VSXaml/Assets/Logo.scale-100.png
Binary files differ
diff --git a/Tests/VSXaml/Assets/SmallLogo.scale-100.png b/Tests/VSXaml/Assets/SmallLogo.scale-100.png
index 1eb0d9d528..460c0222d4 100644
--- a/Tests/VSXaml/Assets/SmallLogo.scale-100.png
+++ b/Tests/VSXaml/Assets/SmallLogo.scale-100.png
Binary files differ
diff --git a/Tests/VSXaml/Assets/SplashScreen.scale-100.png b/Tests/VSXaml/Assets/SplashScreen.scale-100.png
index c951e031bd..8342565809 100644
--- a/Tests/VSXaml/Assets/SplashScreen.scale-100.png
+++ b/Tests/VSXaml/Assets/SplashScreen.scale-100.png
Binary files differ
diff --git a/Tests/VSXaml/Assets/StoreLogo.scale-100.png b/Tests/VSXaml/Assets/StoreLogo.scale-100.png
index dcb672712c..508c8a809a 100644
--- a/Tests/VSXaml/Assets/StoreLogo.scale-100.png
+++ b/Tests/VSXaml/Assets/StoreLogo.scale-100.png
Binary files differ
diff --git a/Utilities/Release/upload_release.cmake b/Utilities/Release/upload_release.cmake
index bbc74379dc..3613ae7a7f 100644
--- a/Utilities/Release/upload_release.cmake
+++ b/Utilities/Release/upload_release.cmake
@@ -1,6 +1,6 @@
set(CTEST_RUN_CURRENT_SCRIPT 0)
if(NOT VERSION)
- set(VERSION 3.13)
+ set(VERSION 3.14)
endif()
if(NOT DEFINED PROJECT_PREFIX)
set(PROJECT_PREFIX cmake-${VERSION})
diff --git a/Utilities/Sphinx/cmake.py b/Utilities/Sphinx/cmake.py
index 882cdc1b73..d903dbe39b 100644
--- a/Utilities/Sphinx/cmake.py
+++ b/Utilities/Sphinx/cmake.py
@@ -21,6 +21,8 @@ from pygments.lexer import bygroups
# - Unix paths are recognized by '/'; support for Windows paths may be added if needed
# - (\\.) allows for \-escapes (used in manual/cmake-language.7)
# - $<..$<..$>..> nested occurence in cmake-buildsystem
+# - Nested variable evaluations are only supported in a limited capacity. Only
+# one level of nesting is supported and at most one nested variable can be present.
CMakeLexer.tokens["root"] = [
(r'\b(\w+)([ \t]*)(\()', bygroups(Name.Function, Text, Name.Function), '#push'), # fctn(
@@ -34,7 +36,8 @@ CMakeLexer.tokens["root"] = [
(r'[<>]=', Punctuation), # used in FindPkgConfig.cmake
(r'\$<', Operator, '#push'), # $<...>
(r'<[^<|]+?>(\w*\.\.\.)?', Name.Variable), # <expr>
- (r'(\$\w*\{)(.+?)(\})', bygroups(Operator, Name.Tag, Operator)), # ${..} $ENV{..}
+ (r'(\$\w*\{)([^\}\$]*)?(?:(\$\w*\{)([^\}]+?)(\}))?([^\}]*?)(\})', # ${..} $ENV{..}, possibly nested
+ bygroups(Operator, Name.Tag, Operator, Name.Tag, Operator, Name.Tag, Operator)),
(r'([A-Z]+\{)(.+?)(\})', bygroups(Operator, Name.Tag, Operator)), # DATA{ ...}
(r'[a-z]+(@|(://))((\\.)|[\w.+-:/\\])+', Name.Attribute), # URL, git@, ...
(r'/\w[\w\.\+-/\\]*', Name.Attribute), # absolute path
diff --git a/Utilities/Sphinx/static/cmake-logo-16.png b/Utilities/Sphinx/static/cmake-logo-16.png
index 9c95b75f39..db9458dc18 100644
--- a/Utilities/Sphinx/static/cmake-logo-16.png
+++ b/Utilities/Sphinx/static/cmake-logo-16.png
Binary files differ
diff --git a/bootstrap b/bootstrap
index f185ea8ac9..26c5212501 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1317,7 +1317,6 @@ cmake_report cmConfigure.h${_tmp} "#define CMAKE_BIN_DIR \"/bootstrap-not-insall
cmake_report cmConfigure.h${_tmp} "#define CMAKE_DATA_DIR \"/bootstrap-not-insalled\""
cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP"
cmake_report cmConfigure.h${_tmp} "#define CM_FALLTHROUGH"
-cmake_report cmConfigure.h${_tmp} "#define CM_DISABLE_COPY(Class)"
# Regenerate configured headers
for h in Configure VersionConfig; do